Add the compiler classpath of the KotlinCompile task as KaptTask's input
KaptTask was not declaring the compiler classpath (which it takes from compileKotlin task for calling the compiler) as input. This commit fixes that and adds a test that checks compiler classpath input checks for the kapt tasks. Issue #KT-23879 Fixed
This commit is contained in:
+9
-2
@@ -72,7 +72,14 @@ class UpToDateIT : BaseGradleIT() {
|
||||
override fun initProject(project: Project) = with(project) {
|
||||
buildGradle.appendText("\nprintln 'compiler_cp=' + compileKotlin.getComputedCompilerClasspath\$kotlin_gradle_plugin()")
|
||||
build("clean") { originalCompilerCp = "compiler_cp=\\[(.*)]".toRegex().find(output)!!.groupValues[1].split(", ") }
|
||||
buildGradle.appendText("\ncompileKotlin.compilerClasspath = files($originalPaths).toList()")
|
||||
buildGradle.appendText("""${'\n'}
|
||||
// Add Kapt to the project to test its input checks as well:
|
||||
apply plugin: 'kotlin-kapt'
|
||||
compileKotlin.compilerClasspath = files($originalPaths).toList()
|
||||
afterEvaluate {
|
||||
kaptGenerateStubsKotlin.compilerClasspath = files($originalPaths).toList()
|
||||
}
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
override fun mutateProject(project: Project) = with(project) {
|
||||
@@ -88,7 +95,7 @@ class UpToDateIT : BaseGradleIT() {
|
||||
}
|
||||
|
||||
override fun checkAfterRebuild(compiledProject: CompiledProject) = with(compiledProject) {
|
||||
assertTasksExecuted(listOf(":compileKotlin"))
|
||||
assertTasksExecuted(listOf(":compileKotlin", ":kaptGenerateStubsKotlin", ":kaptKotlin"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user