diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/BuildCacheIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/BuildCacheIT.kt index b28c5eb66f4..f6c4faa2b8f 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/BuildCacheIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/BuildCacheIT.kt @@ -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 diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/CompilerArgumentsGradleInput.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/CompilerArgumentsGradleInput.kt index 44e23cd08ba..ddc21840908 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/CompilerArgumentsGradleInput.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/CompilerArgumentsGradleInput.kt @@ -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>( - 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