diff --git a/libraries/tools/kotlin-gradle-plugin-core/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt b/libraries/tools/kotlin-gradle-plugin-core/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt index fa693ba1040..e48089d83c2 100644 --- a/libraries/tools/kotlin-gradle-plugin-core/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt +++ b/libraries/tools/kotlin-gradle-plugin-core/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt @@ -63,7 +63,9 @@ abstract class AbstractKotlinCompile() : AbstractCo } abstract protected fun populateTargetSpecificArgs(args: T) - var experimentalIncremental: Boolean = false + // indicates that task should compile kotlin incrementally if possible + // it's not possible when IncrementalTaskInputs#isIncremental returns false (i.e first build) + var incremental: Boolean = false var kotlinOptions: T = createBlankArgs() var kotlinDestinationDir: File? = destinationDir var compilerCalled: Boolean = false @@ -226,7 +228,7 @@ open class KotlinCompile() : AbstractKotlinCompile() { fun projectRelativePath(f: File) = f.toRelativeString(project.projectDir) - if (experimentalIncremental) { + if (incremental) { // TODO: consider other ways to pass incremental flag to compiler/builder System.setProperty("kotlin.incremental.compilation", "true") // TODO: experimental should be removed as soon as it becomes standard @@ -300,7 +302,7 @@ open class KotlinCompile() : AbstractKotlinCompile() { } fun calculateSourcesToCompile(): Pair, Boolean> { - if (!experimentalIncremental + if (!incremental || !isIncrementalRequested // TODO: more precise will be not to rebuild unconditionally on classpath changes, but retrieve lookup info and try to find out which sources are affected by cp changes || isClassPathChanged() @@ -351,7 +353,7 @@ open class KotlinCompile() : AbstractKotlinCompile() { } } - if (!experimentalIncremental) { + if (!incremental) { anyClassesCompiled = true processCompilerExitCode(compileNotIncremental(sources, outputDir, args)) return diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt index a8f091358d5..f69c0fc8a1f 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt @@ -10,7 +10,7 @@ fun mapKotlinTaskProperties(project: Project, task: AbstractCompile) { } private val propertyMappings = listOf( - KotlinPropertyMapping("kotlin.incremental", "experimentalIncremental", String::toBoolean) + KotlinPropertyMapping("kotlin.incremental", "incremental", String::toBoolean) ) private class KotlinPropertyMapping(