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

Fix lateinit bug.

Fix #110.
This commit is contained in:
Cedric Beust 2016-02-02 16:57:31 -08:00
parent 9e53359790
commit 385a5005a1
2 changed files with 11 additions and 6 deletions

View file

@ -33,11 +33,11 @@ class JavaPlugin @Inject constructor(
override val name = PLUGIN_NAME
override fun accept(project: Project) = project is JavaProject
override fun accept(project: Project) = project.sourceDirectories.any { it.contains("java") }
// IDocContributor
override fun affinity(project: Project, context: KobaltContext) =
if (project.sourceDirectories.any { it.contains("java") }) 1 else 0
if (accept(project)) 1 else 0
override fun generateDoc(project: Project, context: KobaltContext, info: CompilerActionInfo) : TaskResult {
val result =

View file

@ -33,9 +33,17 @@ class KotlinPlugin @Inject constructor(
const val PLUGIN_NAME = "Kotlin"
}
override fun apply(project: Project, context: KobaltContext) {
super.apply(project, context)
}
override val name = PLUGIN_NAME
override fun accept(project: Project) = project is KotlinProject
override fun accept(project: Project) = project.sourceDirectories.any { it.contains("kotlin") }
// IDocContributor
override fun affinity(project: Project, context: KobaltContext) =
if (project.sourceDirectories.any { it.contains("kotlin") }) 2 else 0
override fun generateDoc(project: Project, context: KobaltContext, info: CompilerActionInfo) : TaskResult {
return TaskResult()
@ -127,9 +135,6 @@ class KotlinPlugin @Inject constructor(
override val sourceSuffixes = listOf("kt")
override fun affinity(project: Project, context: KobaltContext) =
if (project.sourceDirectories.any { it.contains("kotlin") }) 2 else 0
override fun compile(project: Project, context: KobaltContext, info: CompilerActionInfo) : TaskResult {
val result =
if (info.sourceFiles.size > 0) {