diff --git a/plug-in-development/index.html b/plug-in-development/index.html index 851afdf..cfa9a4e 100644 --- a/plug-in-development/index.html +++ b/plug-in-development/index.html @@ -94,7 +94,7 @@
All plug-in actors are interfaces that extend IPluginActor
. Plug-ins extend IPlugin
,
- interceptors extend IInterceptor
and contributors extend IContributor
. When Kobalt parses your
+ interceptors extend
and contributors extend IInterceptor
. When Kobalt parses your
IContributor
kobalt-plugin.xml
, it instantiates all the classes found in the <plugin-actors>
tag
and then introspects them to find out which IPluginActor
interfaces that class implements.
@@ -130,52 +130,54 @@
IBuildDirectoryInterceptor
IInterceptor
IBuildDirectoryInterceptor
IInterceptor
IClasspathContributor
IContributor
IClasspathContributor
+
IContributor
"compile"
task.
IClasspathInterceptor
IInterceptor
IClasspathInterceptor
+
IInterceptor
ICompilerContributor
IContributor
ICompilerContributor
IContributor
ICompilerInterceptor
IInterceptor
ICompilerInterceptor
IInterceptor
dependencies{}
, dependenciesTest{}
, ...) before Kobalt sees them.
IDocContributor
IContributor
IDocContributor
IContributor
IInitContributor
IContributor
IInitContributor
IContributor
--init
command line parameter, which generates a default build file
based on the files found in the current directory. Any plug-in that wants to be part of this process need
to implement this interface. In this case, both the Java and Kotlin plug-ins define such a contributor
@@ -183,15 +185,15 @@
IProjectContributor
IContributor
IProjectContributor
IContributor
IRepoContributor
IContributor
IRepoContributor
IContributor
ANDROID_HOME
environment variable has been
@@ -200,22 +202,24 @@
ISourceDirectoryInterceptor
IInterceptor
+ ISourceDirectoriesInterceptor
IInterceptor
IRunnerContributor
IContributor
IRunnerContributor
IContributor
"run"
task gets invoked should implement that interface.
ITestRunnerContributor
IContributor
+ ITestRunnerContributor
IContributor
"test"
task gets invoked should implement that interface.
Several plug-ins might want to contribute to a specific task where only one participant only should be allowed, such as running tests or generating documentation. Even the simple task of compiling should probably only - ever be performed by no more than one plug-in. Therefore, when comes the time to compile a project, + ever be performed by no more than one plug-in for a given project. Therefore, when comes the time to + compile a project, Kobalt needs to find which plug-in is the most suitable for that task and pick it. In order to do that, plug-ins that contribute to tasks that can only be performed by one candidate need to declare their affinity to that task for a given project. @@ -266,14 +271,15 @@ class JavaBuildGenerator: IInitContributor {
interface IAffinity { -/** - * @return an integer indicating the affinity of your actor for the given project. The actor that returns - * the highest affinity gets selected. - */ -fun affinity(project: Project, context: KobaltContext) : Int+ /** + * @return an integer indicating the affinity of your actor for the given project. + * The actor that returns the highest affinity gets selected. + */ + fun affinity(project: Project, context: KobaltContext) : Int +}
For example, the JavaPlugin implements the ICompilerContributor
interface and then overrides
- the affinity
method to make sure it gets run for Java projects but ignored for others:
+ the affinity()
method to make sure it gets run for Java projects but ignored for others:
override fun affinity(project: Project, context: KobaltContext) =