mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Source directories now coming from ISourceDirectoryContributor.
This commit is contained in:
parent
89b7b774fe
commit
29a68fde19
1 changed files with 9 additions and 6 deletions
|
@ -26,7 +26,7 @@ abstract class JvmCompilerPlugin @Inject constructor(
|
|||
open val executors: KobaltExecutors,
|
||||
open val jvmCompiler: JvmCompiler,
|
||||
val taskContributor : TaskContributor = TaskContributor())
|
||||
: BasePlugin(), IProjectContributor, ITaskContributor by taskContributor {
|
||||
: BasePlugin(), ISourceDirectoryContributor, IProjectContributor, ITaskContributor by taskContributor {
|
||||
|
||||
companion object {
|
||||
@ExportedProjectProperty(doc = "Projects this project depends on", type = "List<ProjectDescription>")
|
||||
|
@ -154,6 +154,10 @@ abstract class JvmCompilerPlugin @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a CompilerActionInfo (all the information that a compiler needs to know) for the given parameters.
|
||||
* Runs all the contributors and interceptors relevant to that task.
|
||||
*/
|
||||
protected fun createCompilerActionInfo(project: Project, context: KobaltContext, generatedSourceDir: File?,
|
||||
isTest: Boolean) : CompilerActionInfo {
|
||||
copyResources(project, JvmCompilerPlugin.SOURCE_SET_MAIN)
|
||||
|
@ -174,11 +178,6 @@ abstract class JvmCompilerPlugin @Inject constructor(
|
|||
initialSourceDirectories.add(it)
|
||||
}
|
||||
|
||||
// Source directories from the project and variants
|
||||
if (! isTest) {
|
||||
initialSourceDirectories.addAll(context.variant.sourceDirectories(project))
|
||||
}
|
||||
|
||||
// Source directories from the contributors
|
||||
initialSourceDirectories.addAll(
|
||||
if (isTest) {
|
||||
|
@ -208,5 +207,9 @@ abstract class JvmCompilerPlugin @Inject constructor(
|
|||
})
|
||||
return result
|
||||
}
|
||||
|
||||
// ISourceDirectoryContributor
|
||||
override fun sourceDirectoriesFor(project: Project, context: KobaltContext)
|
||||
= if (accept(project)) context.variant.sourceDirectories(project) else listOf()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue