Fix 'verbose' argument was not excluded from task inputs.

^KT-48134 Fixed
This commit is contained in:
Yahor Berdnikau
2021-09-16 16:05:00 +02:00
committed by Space
parent ee728b6902
commit ac164c2bff
2 changed files with 26 additions and 1 deletions
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.gradle
import org.gradle.api.logging.LogLevel
import org.gradle.util.GradleVersion
import org.jetbrains.kotlin.gradle.testbase.*
import org.junit.jupiter.api.DisplayName
@@ -152,6 +153,25 @@ class BuildCacheIT : KGPBaseTest() {
checkKaptCachingIncrementalBuild(firstProject, secondProject)
}
@DisplayName("Debug log level should not break build cache")
@GradleTest
fun testDebugLogLevelCaching(gradleVersion: GradleVersion) {
project("simpleProject", gradleVersion) {
enableLocalBuildCache(localBuildCacheDir)
build(
":assemble",
buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.DEBUG)
) {
assertTasksPackedToCache(":compileKotlin")
}
build("clean", ":assemble") {
assertTasksFromCache(":compileKotlin")
}
}
}
private fun checkKotlinCompileCachingIncrementalBuild(
firstProject: TestProject,
secondProject: TestProject
@@ -46,7 +46,12 @@ internal object CompilerArgumentsGradleInput {
// We ignore some file properties e.g. to instead include their values into the Gradle file property checks,
// which, unlike String checks, run with specified path sensitivity;
private val ignoredProperties = setOf<KProperty<*>>(
CommonCompilerArguments::verbose, // debug should not lead to rebuild
// debug should not lead to rebuild (should include all subclasses where this property is)
CommonToolArguments::verbose,
CommonCompilerArguments::verbose,
K2MetadataCompilerArguments::verbose,
K2JSCompilerArguments::verbose,
K2JVMCompilerArguments::verbose,
K2JVMCompilerArguments::destination, // handled by destinationDir
K2JVMCompilerArguments::classpath, // handled by classpath of the Gradle tasks