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:
parent
234172a1a7
commit
4a43d17288
4 changed files with 28 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue