remove nop code
This commit is contained in:
@@ -131,28 +131,6 @@ public class CompileEnvironmentUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ensureRuntime(JetCoreEnvironment environment, CompilerDependencies compilerDependencies) {
|
|
||||||
if (compilerDependencies.getCompilerSpecialMode() == CompilerSpecialMode.REGULAR) {
|
|
||||||
ensureJdkRuntime(environment);
|
|
||||||
ensureKotlinRuntime(environment);
|
|
||||||
}
|
|
||||||
else if (compilerDependencies.getCompilerSpecialMode() == CompilerSpecialMode.JDK_HEADERS) {
|
|
||||||
ensureJdkRuntime(environment);
|
|
||||||
}
|
|
||||||
else if (compilerDependencies.getCompilerSpecialMode() == CompilerSpecialMode.STDLIB) {
|
|
||||||
ensureJdkRuntime(environment);
|
|
||||||
}
|
|
||||||
else if (compilerDependencies.getCompilerSpecialMode() == CompilerSpecialMode.BUILTINS) {
|
|
||||||
// nop
|
|
||||||
}
|
|
||||||
else if (compilerDependencies.getCompilerSpecialMode() == CompilerSpecialMode.IDEA) {
|
|
||||||
// nop
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new IllegalStateException("unknown mode: " + compilerDependencies.getCompilerSpecialMode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Module> loadModuleScript(String moduleScriptFile, MessageCollector messageCollector) {
|
public static List<Module> loadModuleScript(String moduleScriptFile, MessageCollector messageCollector) {
|
||||||
Disposable disposable = new Disposable() {
|
Disposable disposable = new Disposable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -162,7 +140,6 @@ public class CompileEnvironmentUtil {
|
|||||||
};
|
};
|
||||||
CompilerDependencies dependencies = CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.REGULAR);
|
CompilerDependencies dependencies = CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.REGULAR);
|
||||||
JetCoreEnvironment scriptEnvironment = JetCoreEnvironment.getCoreEnvironmentForJVM(disposable, dependencies);
|
JetCoreEnvironment scriptEnvironment = JetCoreEnvironment.getCoreEnvironmentForJVM(disposable, dependencies);
|
||||||
ensureRuntime(scriptEnvironment, dependencies);
|
|
||||||
scriptEnvironment.addSources(moduleScriptFile);
|
scriptEnvironment.addSources(moduleScriptFile);
|
||||||
|
|
||||||
GenerationState generationState = KotlinToJVMBytecodeCompiler
|
GenerationState generationState = KotlinToJVMBytecodeCompiler
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ public class KotlinToJVMBytecodeCompiler {
|
|||||||
configuration.getEnvironment().addToClasspath(new File(classpathRoot));
|
configuration.getEnvironment().addToClasspath(new File(classpathRoot));
|
||||||
}
|
}
|
||||||
|
|
||||||
CompileEnvironmentUtil.ensureRuntime(configuration.getEnvironment(), configuration.getEnvironment().getCompilerDependencies());
|
|
||||||
|
|
||||||
GenerationState generationState = analyzeAndGenerate(configuration);
|
GenerationState generationState = analyzeAndGenerate(configuration);
|
||||||
if (generationState == null) {
|
if (generationState == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -130,8 +128,6 @@ public class KotlinToJVMBytecodeCompiler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CompileEnvironmentUtil.ensureRuntime(configuration.getEnvironment(), configuration.getEnvironment().getCompilerDependencies());
|
|
||||||
|
|
||||||
GenerationState generationState = analyzeAndGenerate(configuration);
|
GenerationState generationState = analyzeAndGenerate(configuration);
|
||||||
if (generationState == null) {
|
if (generationState == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user