From 120fb56f8df7d5adc90b675144c25e73797ce574 Mon Sep 17 00:00:00 2001 From: "nataliya.valtman" Date: Fri, 27 May 2022 17:27:40 +0300 Subject: [PATCH] KT-52549: ignore reportPerf property --- .../jetbrains/kotlin/gradle/BuildCacheIT.kt | 22 +++++++++++++++++++ .../internal/CompilerArgumentsGradleInput.kt | 5 +++++ 2 files changed, 27 insertions(+) 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 846c4f1d492..2d06e4b3e3d 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 @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.gradle import org.gradle.api.logging.LogLevel import org.gradle.util.GradleVersion +import org.jetbrains.kotlin.gradle.report.BuildReportType import org.jetbrains.kotlin.gradle.testbase.* import org.junit.jupiter.api.DisplayName import kotlin.io.path.ExperimentalPathApi @@ -122,6 +123,27 @@ class BuildCacheIT : KGPBaseTest() { } } + @DisplayName("Enabled statistic should not break build cache") + @GradleTest + fun testCacheWithStatistic(gradleVersion: GradleVersion) { + project("simpleProject", gradleVersion) { + enableLocalBuildCache(localBuildCacheDir) + + build( + ":assemble" + ) { + assertTasksPackedToCache(":compileKotlin") + } + + build( + "clean", ":assemble", + buildOptions = defaultBuildOptions.copy(buildReport = listOf(BuildReportType.FILE)) + ) { + assertTasksFromCache(":compileKotlin") + } + } + } + //doesn't work for build history files approach @DisplayName("Restore from build cache should not break incremental compilation") @GradleTest diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/internal/CompilerArgumentsGradleInput.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/internal/CompilerArgumentsGradleInput.kt index ddc21840908..73e266d07eb 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/internal/CompilerArgumentsGradleInput.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/internal/CompilerArgumentsGradleInput.kt @@ -53,6 +53,11 @@ internal object CompilerArgumentsGradleInput { K2JSCompilerArguments::verbose, K2JVMCompilerArguments::verbose, + CommonCompilerArguments::reportPerf, + K2MetadataCompilerArguments::reportPerf, + K2JSCompilerArguments::reportPerf, + K2JVMCompilerArguments::reportPerf, + K2JVMCompilerArguments::destination, // handled by destinationDir K2JVMCompilerArguments::classpath, // handled by classpath of the Gradle tasks K2JVMCompilerArguments::friendPaths, // is part of the classpath