[Gradle] Remove warning about experimental IC backup optimizations
This commit is part of the optimizations stabilization ^KT-62758 In Progress
This commit is contained in:
committed by
Space Team
parent
093f51c89a
commit
f0c643a887
-5
@@ -47,7 +47,6 @@ import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLI
|
||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_RUN_COMPILER_VIA_BUILD_TOOLS_API
|
||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_STDLIB_DEFAULT_DEPENDENCY
|
||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_STDLIB_JDK_VARIANTS_VERSION_ALIGNMENT
|
||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_SUPPRESS_EXPERIMENTAL_IC_OPTIMIZATIONS_WARNING
|
||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.MPP_13X_FLAGS_SET_BY_PLUGIN
|
||||
import org.jetbrains.kotlin.gradle.plugin.diagnostics.KotlinToolingDiagnostics
|
||||
import org.jetbrains.kotlin.gradle.plugin.diagnostics.reportDiagnosticOncePerBuild
|
||||
@@ -465,9 +464,6 @@ internal class PropertiesProvider private constructor(private val project: Proje
|
||||
val keepIncrementalCompilationCachesInMemory: Boolean
|
||||
get() = booleanProperty(KOTLIN_COMPILER_KEEP_INCREMENTAL_COMPILATION_CACHES_IN_MEMORY) ?: false
|
||||
|
||||
val suppressExperimentalICOptimizationsWarning: Boolean
|
||||
get() = booleanProperty(KOTLIN_SUPPRESS_EXPERIMENTAL_IC_OPTIMIZATIONS_WARNING) ?: false
|
||||
|
||||
val createDefaultMultiplatformPublications: Boolean
|
||||
get() = booleanProperty(KOTLIN_CREATE_DEFAULT_MULTIPLATFORM_PUBLICATIONS) ?: true
|
||||
|
||||
@@ -640,7 +636,6 @@ internal class PropertiesProvider private constructor(private val project: Proje
|
||||
val KOTLIN_COMPILER_USE_PRECISE_COMPILATION_RESULTS_BACKUP = property("kotlin.compiler.preciseCompilationResultsBackup")
|
||||
val KOTLIN_COMPILER_KEEP_INCREMENTAL_COMPILATION_CACHES_IN_MEMORY =
|
||||
property("kotlin.compiler.keepIncrementalCompilationCachesInMemory")
|
||||
val KOTLIN_SUPPRESS_EXPERIMENTAL_IC_OPTIMIZATIONS_WARNING = property("kotlin.compiler.suppressExperimentalICOptimizationsWarning")
|
||||
val KOTLIN_RUN_COMPILER_VIA_BUILD_TOOLS_API = property("kotlin.compiler.runViaBuildToolsApi")
|
||||
val KOTLIN_MPP_ALLOW_LEGACY_DEPENDENCIES = property("kotlin.mpp.allow.legacy.dependencies")
|
||||
val KOTLIN_PUBLISH_JVM_ENVIRONMENT_ATTRIBUTE = property("kotlin.publishJvmEnvironmentAttribute")
|
||||
|
||||
-26
@@ -31,7 +31,6 @@ import org.jetbrains.kotlin.gradle.internal.UsesClassLoadersCachingBuildService
|
||||
import org.jetbrains.kotlin.gradle.internal.tasks.allOutputFiles
|
||||
import org.jetbrains.kotlin.gradle.logging.GradleKotlinLogger
|
||||
import org.jetbrains.kotlin.gradle.logging.kotlinDebug
|
||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_SUPPRESS_EXPERIMENTAL_IC_OPTIMIZATIONS_WARNING
|
||||
import org.jetbrains.kotlin.gradle.plugin.UsesBuildFinishedListenerService
|
||||
import org.jetbrains.kotlin.gradle.plugin.UsesVariantImplementationFactories
|
||||
import org.jetbrains.kotlin.gradle.plugin.diagnostics.UsesKotlinToolingDiagnostics
|
||||
@@ -219,37 +218,12 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments> @Inject constr
|
||||
@get:Internal
|
||||
internal abstract val keepIncrementalCompilationCachesInMemory: Property<Boolean>
|
||||
|
||||
@get:Internal
|
||||
internal abstract val suppressExperimentalIcOptimizationsWarning: Property<Boolean>
|
||||
|
||||
/** Task outputs that we don't want to include in [TaskOutputsBackup] (see [TaskOutputsBackup.outputsToRestore] for more info). */
|
||||
@get:Internal
|
||||
internal abstract val taskOutputsBackupExcludes: SetProperty<File>
|
||||
|
||||
private fun notifyUserAboutExperimentalICOptimizations() {
|
||||
if (suppressExperimentalIcOptimizationsWarning.get()) {
|
||||
return
|
||||
}
|
||||
if (!preciseCompilationResultsBackup.get() && !keepIncrementalCompilationCachesInMemory.get()) {
|
||||
return
|
||||
}
|
||||
val key = "experimental-ic-optimizations"
|
||||
buildFinishedListenerService.get().onCloseOnceByKey(key) {
|
||||
Logging.getLogger(key).warn(
|
||||
"""
|
||||
|
||||
The build has experimental Kotlin incremental compilation optimizations enabled.
|
||||
If you notice incorrect compilation results after enabling it, please file a bug report at https://kotl.in/issue/experimental-ic-optimizations
|
||||
|
||||
You can suppress this warning by adding `${KOTLIN_SUPPRESS_EXPERIMENTAL_IC_OPTIMIZATIONS_WARNING}=true` to the gradle.properties
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
fun execute(inputChanges: InputChanges) {
|
||||
notifyUserAboutExperimentalICOptimizations()
|
||||
val buildMetrics = metrics.get()
|
||||
buildMetrics.addTimeMetric(GradleBuildPerformanceMetric.START_TASK_ACTION_EXECUTION)
|
||||
buildMetrics.measure(GradleBuildTime.OUT_OF_WORKER_TASK_ACTION) {
|
||||
|
||||
-3
@@ -80,9 +80,6 @@ internal abstract class AbstractKotlinCompileConfig<TASK : AbstractKotlinCompile
|
||||
task.taskOutputsBackupExcludes.addAll(task.keepIncrementalCompilationCachesInMemory.map {
|
||||
if (it) listOf(task.taskBuildCacheableOutputDirectory.get().asFile) else emptyList()
|
||||
})
|
||||
task.suppressExperimentalIcOptimizationsWarning
|
||||
.convention(propertiesProvider.suppressExperimentalICOptimizationsWarning)
|
||||
.finalizeValueOnRead()
|
||||
task.buildFinishedListenerService.value(buildFinishedListenerService).disallowChanges()
|
||||
task.buildIdService.value(buildIdService).disallowChanges()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user