From 70db910767301e6437aeefb07056bce5fb240a9f Mon Sep 17 00:00:00 2001 From: Andrey Uskov Date: Fri, 16 Dec 2022 13:49:55 +0300 Subject: [PATCH] Report new IC usage in FUS #KT-55000 Fixed --- .../org/jetbrains/kotlin/gradle/plugin/PropertiesProvider.kt | 5 ++++- .../org/jetbrains/kotlin/statistics/metrics/StringMetrics.kt | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/PropertiesProvider.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/PropertiesProvider.kt index ef38d5c84a6..c3ef26187e2 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/PropertiesProvider.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/PropertiesProvider.kt @@ -156,19 +156,22 @@ internal class PropertiesProvider private constructor(private val project: Proje val useClasspathSnapshot: Boolean get() { + val reporter = KotlinBuildStatsService.getInstance() // The feature should be controlled by a Gradle property. // Currently, we also allow it to be controlled by a system property to make it easier to test the feature during development. // TODO: Remove the system property later. val gradleProperty = booleanProperty(CompilerSystemProperties.COMPILE_INCREMENTAL_WITH_ARTIFACT_TRANSFORM.property) if (gradleProperty != null) { + reporter?.report(StringMetrics.USE_CLASSPATH_SNAPSHOT, gradleProperty.toString()) return gradleProperty } val systemProperty = CompilerSystemProperties.COMPILE_INCREMENTAL_WITH_ARTIFACT_TRANSFORM.value?.toBooleanLenient() if (systemProperty != null) { + reporter?.report(StringMetrics.USE_CLASSPATH_SNAPSHOT, systemProperty.toString()) return systemProperty } - // Default value + reporter?.report(StringMetrics.USE_CLASSPATH_SNAPSHOT, "default-true") return true } diff --git a/libraries/tools/kotlin-gradle-statistics/src/common/kotlin/org/jetbrains/kotlin/statistics/metrics/StringMetrics.kt b/libraries/tools/kotlin-gradle-statistics/src/common/kotlin/org/jetbrains/kotlin/statistics/metrics/StringMetrics.kt index 16d4ec3648c..c5ebf7df005 100644 --- a/libraries/tools/kotlin-gradle-statistics/src/common/kotlin/org/jetbrains/kotlin/statistics/metrics/StringMetrics.kt +++ b/libraries/tools/kotlin-gradle-statistics/src/common/kotlin/org/jetbrains/kotlin/statistics/metrics/StringMetrics.kt @@ -105,6 +105,7 @@ enum class StringMetrics(val type: StringOverridePolicy, val anonymization: Stri // Features KOTLIN_LANGUAGE_VERSION(OVERRIDE, ComponentVersionAnonymizer()), KOTLIN_API_VERSION(OVERRIDE, ComponentVersionAnonymizer()), + USE_CLASSPATH_SNAPSHOT(CONCAT, AllowedListAnonymizer(listOf("true", "false", "default-true"))), JS_GENERATE_EXECUTABLE_DEFAULT(CONCAT, AllowedListAnonymizer(listOf("true", "false"))), JS_TARGET_MODE(CONCAT, AllowedListAnonymizer(listOf("both", "browser", "nodejs", "none"))), JS_OUTPUT_GRANULARITY(OVERRIDE, RegexControlled("(whole_program|per_module|per_file)", false)),