jps, daemon: pass incremental compilation flag from jps process to daemon

This commit is contained in:
Sergey Rostov
2018-06-07 11:03:26 +03:00
parent ce96c1b9a8
commit e831964871
2 changed files with 16 additions and 1 deletions
@@ -18,6 +18,8 @@ package org.jetbrains.kotlin.config;
import org.jetbrains.annotations.TestOnly;
import java.util.List;
public class IncrementalCompilation {
private static final String INCREMENTAL_COMPILATION_PROPERTY = "kotlin.incremental.compilation";
private static final String INCREMENTAL_COMPILATION_JS_PROPERTY = "kotlin.incremental.compilation.js";
@@ -39,4 +41,13 @@ public class IncrementalCompilation {
public static void setIsEnabledForJs(boolean value) {
System.setProperty(INCREMENTAL_COMPILATION_JS_PROPERTY, String.valueOf(value));
}
public static void toJvmArgs(List<String> jvmArgs) {
if (isEnabled()) addJvmSystemFlag(jvmArgs, INCREMENTAL_COMPILATION_PROPERTY);
if (isEnabledForJs()) addJvmSystemFlag(jvmArgs, INCREMENTAL_COMPILATION_JS_PROPERTY);
}
private static void addJvmSystemFlag(List<String> jvmArgs, String name) {
jvmArgs.add("-D" + name + "=true");
}
}