From bd6dfb494f93b930cb81598517615bb3567d982a Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Tue, 5 Jul 2016 23:24:43 -0800 Subject: [PATCH] Restore the Kotlin compiler's ability to compile directories. --- .../main/kotlin/com/beust/kobalt/api/ICompilerContributor.kt | 3 ++- src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinPlugin.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ICompilerContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ICompilerContributor.kt index 4883bf32..b4788370 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ICompilerContributor.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ICompilerContributor.kt @@ -51,7 +51,8 @@ interface ICompiler { class CompilerDescription(override val name: String, override val sourceDirectory: String, override val sourceSuffixes: List, val compiler: ICompiler, - override val priority: Int = ICompilerDescription.DEFAULT_PRIORITY) : ICompilerDescription { + override val priority: Int = ICompilerDescription.DEFAULT_PRIORITY, + override val canCompileDirectories: Boolean = false) : ICompilerDescription { override fun compile(project: Project, context: KobaltContext, info: CompilerActionInfo): TaskResult { val result = if (info.sourceFiles.size > 0) { diff --git a/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinPlugin.kt b/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinPlugin.kt index fd62e272..e40bceed 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinPlugin.kt @@ -111,7 +111,7 @@ class KotlinPlugin @Inject constructor(val executors: KobaltExecutors, val depen /** The Kotlin compiler should run before the Java one, hence priority - 5 */ val compiler = CompilerDescription(PLUGIN_NAME, "kotlin", SOURCE_SUFFIXES, KotlinCompiler(), - ICompilerDescription.DEFAULT_PRIORITY - 5) + ICompilerDescription.DEFAULT_PRIORITY - 5, canCompileDirectories = true) override fun compilersFor(project: Project, context: KobaltContext) = arrayListOf(compiler)