Unify build cache debug approach.

^KT-45745 In Progress
This commit is contained in:
Yahor Berdnikau
2021-10-06 13:39:56 +02:00
parent 862d46f58b
commit e30b11fc05
3 changed files with 3 additions and 11 deletions
@@ -189,7 +189,7 @@ class BuildCacheIT : KGPBaseTest() {
// Change the return type of foo() from Int to String in foo.kt, and check that fooUsage.kt is recompiled as well:
val fooKtSourceFile = secondProject.projectPath.resolve("src/main/kotlin/foo.kt")
fooKtSourceFile.modify { it.replace("Int = 1", "String = \"abc\"") }
secondProject.build("assemble", forceOutput = true) {
secondProject.build("assemble") {
assertIncrementalCompilation(modifiedFiles = setOf(fooKtSourceFile))
}
@@ -116,7 +116,7 @@ class KotlinJavaToolchainTest : KGPBaseTest() {
enableLocalBuildCache(buildCache)
useToolchainExtension(11)
build("assemble", forceOutput = true, enableBuildCacheDebug = true)
build("assemble")
}
project(
@@ -129,7 +129,7 @@ class KotlinJavaToolchainTest : KGPBaseTest() {
enableLocalBuildCache(buildCache)
useToolchainExtension(11)
build("assemble", enableBuildCacheDebug = true) {
build("assemble") {
assertTasksFromCache(":compileKotlin")
}
}
@@ -146,7 +146,6 @@ class KotlinJavaToolchainTest : KGPBaseTest() {
buildOptions = defaultBuildOptions.copy(buildCacheEnabled = true)
) {
enableLocalBuildCache(buildCache)
enableBuildCacheDebug()
if (shouldUseToolchain(gradleVersion)) {
useToolchainExtension(11)
} else {
@@ -166,7 +165,6 @@ class KotlinJavaToolchainTest : KGPBaseTest() {
buildOptions = defaultBuildOptions.copy(buildCacheEnabled = true)
) {
enableLocalBuildCache(buildCache)
enableBuildCacheDebug()
build("assemble") {
assertTasksExecuted(":compileKotlin")
}
@@ -151,12 +151,6 @@ fun TestProject.enableLocalBuildCache(
)
}
fun TestProject.enableBuildCacheDebug() {
gradleProperties.append(
"org.gradle.caching.debug=true"
)
}
class TestProject(
val gradleRunner: GradleRunner,
val projectName: String,