Better method names.
This commit is contained in:
@@ -69,7 +69,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments, K2JSCompile
|
|||||||
return ExitCode.INTERNAL_ERROR;
|
return ExitCode.INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
JetCoreEnvironment environmentForJS = JetCoreEnvironment.getCoreEnvironmentForJS(rootDisposable);
|
JetCoreEnvironment environmentForJS = JetCoreEnvironment.createCoreEnvironmentForJS(rootDisposable);
|
||||||
|
|
||||||
if (arguments.srcdir != null) {
|
if (arguments.srcdir != null) {
|
||||||
environmentForJS.addSources(arguments.srcdir);
|
environmentForJS.addSources(arguments.srcdir);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments, K2JVMComp
|
|||||||
return ExitCode.OK;
|
return ExitCode.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
JetCoreEnvironment environment = JetCoreEnvironment.getCoreEnvironmentForJVM(rootDisposable, dependencies);
|
JetCoreEnvironment environment = JetCoreEnvironment.createCoreEnvironmentForJVM(rootDisposable, dependencies);
|
||||||
K2JVMCompileEnvironmentConfiguration configuration = new K2JVMCompileEnvironmentConfiguration(environment, messageCollector, arguments.script);
|
K2JVMCompileEnvironmentConfiguration configuration = new K2JVMCompileEnvironmentConfiguration(environment, messageCollector, arguments.script);
|
||||||
|
|
||||||
messageCollector.report(CompilerMessageSeverity.LOGGING, "Configuring the compilation environment",
|
messageCollector.report(CompilerMessageSeverity.LOGGING, "Configuring the compilation environment",
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class CompileEnvironmentUtil {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
CompilerDependencies dependencies = CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.REGULAR);
|
CompilerDependencies dependencies = CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.REGULAR);
|
||||||
JetCoreEnvironment scriptEnvironment = JetCoreEnvironment.getCoreEnvironmentForJVM(disposable, dependencies);
|
JetCoreEnvironment scriptEnvironment = JetCoreEnvironment.createCoreEnvironmentForJVM(disposable, dependencies);
|
||||||
scriptEnvironment.addSources(moduleScriptFile);
|
scriptEnvironment.addSources(moduleScriptFile);
|
||||||
|
|
||||||
GenerationState generationState = KotlinToJVMBytecodeCompiler
|
GenerationState generationState = KotlinToJVMBytecodeCompiler
|
||||||
|
|||||||
@@ -51,12 +51,12 @@ public class JetCoreEnvironment extends JavaCoreEnvironment {
|
|||||||
private final List<JetFile> sourceFiles = new ArrayList<JetFile>();
|
private final List<JetFile> sourceFiles = new ArrayList<JetFile>();
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static JetCoreEnvironment getCoreEnvironmentForJS(Disposable disposable) {
|
public static JetCoreEnvironment createCoreEnvironmentForJS(Disposable disposable) {
|
||||||
return new JetCoreEnvironment(disposable, CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.JS));
|
return new JetCoreEnvironment(disposable, CompilerDependencies.compilerDependenciesForProduction(CompilerSpecialMode.JS));
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static JetCoreEnvironment getCoreEnvironmentForJVM(Disposable disposable, @NotNull CompilerDependencies dependencies) {
|
public static JetCoreEnvironment createCoreEnvironmentForJVM(Disposable disposable, @NotNull CompilerDependencies dependencies) {
|
||||||
return new JetCoreEnvironment(disposable, dependencies);
|
return new JetCoreEnvironment(disposable, dependencies);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -153,7 +153,7 @@ public class ResolveDescriptorsFromExternalLibraries {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CompilerDependencies compilerDependencies = CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.STDLIB, false);
|
CompilerDependencies compilerDependencies = CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.STDLIB, false);
|
||||||
jetCoreEnvironment = JetCoreEnvironment.getCoreEnvironmentForJVM(junk, compilerDependencies);
|
jetCoreEnvironment = JetCoreEnvironment.createCoreEnvironmentForJVM(junk, compilerDependencies);
|
||||||
if (!compilerDependencies.getJdkJar().equals(jar)) {
|
if (!compilerDependencies.getJdkJar().equals(jar)) {
|
||||||
throw new RuntimeException("rt.jar mismatch: " + jar + ", " + compilerDependencies.getJdkJar());
|
throw new RuntimeException("rt.jar mismatch: " + jar + ", " + compilerDependencies.getJdkJar());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ public abstract class TestWithEnvironment extends UsefulTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void createEnvironmentWithMockJdkAndIdeaAnnotations() {
|
protected void createEnvironmentWithMockJdkAndIdeaAnnotations() {
|
||||||
myEnvironment = JetCoreEnvironment.getCoreEnvironmentForJVM(getTestRootDisposable(),
|
myEnvironment = JetCoreEnvironment.createCoreEnvironmentForJVM(getTestRootDisposable(),
|
||||||
CompileCompilerDependenciesTest.compilerDependenciesForTests(
|
CompileCompilerDependenciesTest.compilerDependenciesForTests(
|
||||||
CompilerSpecialMode.JS,
|
CompilerSpecialMode.JS,
|
||||||
true));
|
true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user