1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Shut down actors.

This commit is contained in:
Cedric Beust 2016-04-23 05:15:07 -08:00
parent 234172a1a7
commit 4a43d17288
4 changed files with 28 additions and 1 deletions

View file

@ -1,6 +1,11 @@
package com.beust.kobalt.api
interface IPluginActor
interface IPluginActor {
/**
* Clean up any state that your actor might have saved so it can be run again.
*/
fun shutdownActors() {}
}
interface IContributor : IPluginActor

View file

@ -226,8 +226,13 @@ open class JvmCompilerPlugin @Inject constructor(
val allProjects = arrayListOf<ProjectDescription>()
// IProjectContributor
override fun projects() = allProjects
override fun shutdownActors() {
allProjects.clear()
}
fun addDependentProjects(project: Project, dependents: List<Project>) {
project.projectExtra.dependsOn.addAll(dependents)
with(ProjectDescription(project, dependents)) {

View file

@ -168,6 +168,22 @@ class PluginInfo(val xml: KobaltPluginXml, val classLoader: ClassLoader?) {
}
}
fun shutdown() {
listOf(projectContributors, classpathContributors, initContributors,
repoContributors, compilerFlagContributors, compilerInterceptors,
sourceDirectoriesInterceptors, buildDirectoryInterceptors,
runnerContributors, testRunnerContributors, classpathInterceptors,
compilerContributors, docContributors, sourceDirContributors,
testSourceDirContributors, buildConfigFieldContributors,
taskContributors, assemblyContributors,
incrementalAssemblyContributors
).forEach {
it.forEach {
it.shutdownActors()
}
}
}
/**
* Populate pluginInfo with what was found in the plug-in's kobalt-plugin.xml
*/