-mode idea

#KT-1893 Fixed
This commit is contained in:
Stepan Koltsov
2012-05-04 23:57:13 +04:00
parent 78a4ebe236
commit dd332bc08c
6 changed files with 20 additions and 5 deletions
@@ -45,6 +45,11 @@ public class CompilerDependencies {
this.jdkHeadersJar = jdkHeadersJar;
this.runtimeJar = runtimeJar;
if (compilerSpecialMode.includeJdk()) {
if (jdkJar == null) {
throw new IllegalArgumentException("jdk must be included for mode " + compilerSpecialMode);
}
}
if (compilerSpecialMode.includeJdkHeaders()) {
if (jdkHeadersJar == null) {
throw new IllegalArgumentException("jdkHeaders must be included for mode " + compilerSpecialMode);
@@ -101,7 +106,7 @@ public class CompilerDependencies {
public static CompilerDependencies compilerDependenciesForProduction(@NotNull CompilerSpecialMode compilerSpecialMode) {
return new CompilerDependencies(
compilerSpecialMode,
findRtJar(),
compilerSpecialMode.includeJdk() ? findRtJar() : null,
compilerSpecialMode.includeJdkHeaders() ? PathUtil.getAltHeadersPath() : null,
compilerSpecialMode.includeKotlinRuntime() ? PathUtil.getDefaultRuntimePath() : null);
}
@@ -24,17 +24,22 @@ public enum CompilerSpecialMode {
BUILTINS,
JDK_HEADERS,
STDLIB,
IDEA,
JS,
;
public boolean includeJdkHeaders() {
return this == REGULAR || this == STDLIB;
return this == REGULAR || this == STDLIB || this == IDEA;
}
public boolean includeKotlinRuntime() {
return this == REGULAR;
}
public boolean includeJdk() {
return this != IDEA;
}
public boolean isStubs() {
return this == BUILTINS || this == JDK_HEADERS;
}