From 1e4ac7714a2adb8b70ffa162e35d6527ff4090e8 Mon Sep 17 00:00:00 2001 From: Alexander Likhachev Date: Fri, 12 Feb 2021 14:06:50 +0300 Subject: [PATCH] [Gradle] Read system properties at configuration time using Gradle providers The change is a step to fully support Gradle configuration cache. Relates to #KT-43605 Relates to #KT-44611 (cherry picked from commit 3537c699b572a96c7aa614f8d00de716a9edc87a) Original commit: de62c4cde79d606fb3b3a9f63f12f2c387066890 --- .../kotlin/compilerRunner/JpsKotlinCompilerRunner.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt index e2d6d835f94..0668e492e67 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt @@ -19,8 +19,8 @@ package org.jetbrains.kotlin.compilerRunner import com.intellij.util.xmlb.XmlSerializerUtil import org.jetbrains.annotations.TestOnly import org.jetbrains.jps.api.GlobalOptions +import org.jetbrains.kotlin.cli.common.CompilerSystemProperties import org.jetbrains.kotlin.cli.common.ExitCode -import org.jetbrains.kotlin.cli.common.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY import org.jetbrains.kotlin.cli.common.arguments.* import org.jetbrains.kotlin.cli.common.messages.MessageCollectorUtil import org.jetbrains.kotlin.config.CompilerSettings @@ -295,7 +295,7 @@ class JpsKotlinCompilerRunner { // unfortunately it cannot be currently set by default globally, because it breaks many tests // since there is no reliable way so far to detect running under tests, switching it on only for parallel builds if (System.getProperty(GlobalOptions.COMPILE_PARALLEL_OPTION, "false").toBoolean()) - System.setProperty(KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY, "true") + CompilerSystemProperties.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY.value = "true" val rc = environment.withProgressReporter { progress -> progress.compilationStarted()