Delay kapt dependencies resolution from configuration phase

Store kapt configurations instead of classpath files in the tasks
Delay wrapping kapt subplugin options to task execution (when the
classpath can be safely resovled)

Issue #KT-18821 Fixed
This commit is contained in:
Sergey Igushkin
2018-01-12 17:34:46 +03:00
parent 8ac95b54a2
commit e8cd8b566e
5 changed files with 81 additions and 31 deletions
@@ -324,4 +324,17 @@ open class Kapt3IT : Kapt3BaseIT() {
assertContains("Additional warning message from AP")
}
}
@Test
fun testKaptConfigurationLazyResolution() = with(Project("simple", GRADLE_VERSION, directoryPrefix = "kapt2")) {
setupWorkingDir()
File(projectDir, "build.gradle").appendText(
"\ndependencies { kapt project.files { throw new GradleException(\"Resolved!\") } }"
)
// Check that the kapt configuration does not get resolved during the project evaluation:
build("tasks") {
assertSuccessful()
assertNotContains("Resolved!")
}
}
}