Don't use global state for keeping incremental compilation state
Previously IC state was stored in System properties. As result parallel compilation might cause incorrect state of IC, what led to corruption of kotlin_module files. Now IC state is stored via CompilerArguments and CompilerConfiguration #KT-46038 Fixed
This commit is contained in:
@@ -25,23 +25,26 @@ public class IncrementalCompilation {
|
||||
public static final String INCREMENTAL_COMPILATION_JS_PROPERTY = "kotlin.incremental.compilation.js";
|
||||
|
||||
public static boolean isEnabledForJvm() {
|
||||
return "true".equals(System.getProperty(INCREMENTAL_COMPILATION_JVM_PROPERTY));
|
||||
return Boolean.valueOf(System.getProperty(INCREMENTAL_COMPILATION_JVM_PROPERTY));
|
||||
}
|
||||
|
||||
public static boolean isEnabledForJs() {
|
||||
return "true".equals(System.getProperty(INCREMENTAL_COMPILATION_JS_PROPERTY));
|
||||
return Boolean.valueOf(System.getProperty(INCREMENTAL_COMPILATION_JS_PROPERTY));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@TestOnly
|
||||
public static void setIsEnabledForJvm(boolean value) {
|
||||
System.setProperty(INCREMENTAL_COMPILATION_JVM_PROPERTY, String.valueOf(value));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@TestOnly
|
||||
public static void setIsEnabledForJs(boolean value) {
|
||||
System.setProperty(INCREMENTAL_COMPILATION_JS_PROPERTY, String.valueOf(value));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void toJvmArgs(List<String> jvmArgs) {
|
||||
if (isEnabledForJvm()) addJvmSystemFlag(jvmArgs, INCREMENTAL_COMPILATION_JVM_PROPERTY);
|
||||
if (isEnabledForJs()) addJvmSystemFlag(jvmArgs, INCREMENTAL_COMPILATION_JS_PROPERTY);
|
||||
|
||||
Reference in New Issue
Block a user