Fix bugs causing early task evaluation (#1812)
* Fix bugs causing early task evaluation Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com> * Fix merge mistakes Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com> * Fix another call forcing tasks evaluation Add a test for lazy tasks
This commit is contained in:
committed by
Sergey Igushkin
parent
b7d0d20739
commit
524ae9df7d
+27
@@ -861,4 +861,31 @@ class KotlinGradleIT : BaseGradleIT() {
|
||||
expectedKotlinDirs.forEach { assertTrue(it in reportedSrcDirs, "$it should be included into the Java source sets") }
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testNoTaskConfigurationForcing() {
|
||||
val gradleVersionRequirement = GradleVersionRequired.AtLeast("4.9")
|
||||
val projects = listOf(
|
||||
Project("simpleProject", gradleVersionRequirement),
|
||||
Project("kotlin2JsNoOutputFileProject", gradleVersionRequirement),
|
||||
Project("sample-app", gradleVersionRequirement, "new-mpp-lib-and-app")
|
||||
)
|
||||
|
||||
projects.forEach {
|
||||
it.apply {
|
||||
setupWorkingDir()
|
||||
|
||||
val taskConfigureFlag = "Configured the task!"
|
||||
|
||||
gradleBuildScript().appendText("\n" + """
|
||||
tasks.register("myTask") { println '$taskConfigureFlag' }
|
||||
""".trimIndent())
|
||||
|
||||
build("help") {
|
||||
assertSuccessful()
|
||||
assertNotContains(taskConfigureFlag)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user