Reorder method parameters
This commit is contained in:
@@ -88,11 +88,12 @@ public class CompilerRunnerUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object invokeExecMethod(CompilerEnvironment environment,
|
public static Object invokeExecMethod(
|
||||||
PrintStream out,
|
String className, String[] arguments, CompilerEnvironment environment,
|
||||||
MessageCollector messageCollector, String[] arguments, String name) throws Exception {
|
MessageCollector messageCollector, PrintStream out
|
||||||
|
) throws Exception {
|
||||||
URLClassLoader loader = getOrCreateClassLoader(environment.getKotlinPaths(), messageCollector);
|
URLClassLoader loader = getOrCreateClassLoader(environment.getKotlinPaths(), messageCollector);
|
||||||
Class<?> kompiler = Class.forName(name, true, loader);
|
Class<?> kompiler = Class.forName(className, true, loader);
|
||||||
Method exec = kompiler.getMethod("exec", PrintStream.class, String[].class);
|
Method exec = kompiler.getMethod("exec", PrintStream.class, String[].class);
|
||||||
return exec.invoke(kompiler.newInstance(), out, arguments);
|
return exec.invoke(kompiler.newInstance(), out, arguments);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class KotlinCompilerRunner {
|
|||||||
messageCollector.report(CompilerMessageSeverity.INFO,
|
messageCollector.report(CompilerMessageSeverity.INFO,
|
||||||
"Invoking in-process compiler " + compilerClassName + " with arguments " + Arrays.asList(arguments),
|
"Invoking in-process compiler " + compilerClassName + " with arguments " + Arrays.asList(arguments),
|
||||||
CompilerMessageLocation.NO_LOCATION);
|
CompilerMessageLocation.NO_LOCATION);
|
||||||
Object rc = CompilerRunnerUtil.invokeExecMethod(environment, out, messageCollector, arguments, compilerClassName);
|
Object rc = CompilerRunnerUtil.invokeExecMethod(compilerClassName, arguments, environment, messageCollector, out);
|
||||||
// exec() returns a K2JVMCompiler.ExitCode object, that class is not accessible here,
|
// exec() returns a K2JVMCompiler.ExitCode object, that class is not accessible here,
|
||||||
// so we take it's contents through reflection
|
// so we take it's contents through reflection
|
||||||
return CompilerRunnerUtil.getReturnCodeFromObject(rc);
|
return CompilerRunnerUtil.getReturnCodeFromObject(rc);
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public final class K2JSCompiler implements TranslatingCompiler {
|
|||||||
File outDir = environment.getOutput();
|
File outDir = environment.getOutput();
|
||||||
File outFile = new File(outDir, module.getName() + ".js");
|
File outFile = new File(outDir, module.getName() + ".js");
|
||||||
String[] commandLineArgs = constructArguments(module, outFile);
|
String[] commandLineArgs = constructArguments(module, outFile);
|
||||||
Object rc = invokeExecMethod(environment, out, messageCollector, commandLineArgs, "org.jetbrains.jet.cli.js.K2JSCompiler");
|
Object rc = invokeExecMethod("org.jetbrains.jet.cli.js.K2JSCompiler", commandLineArgs, environment, messageCollector, out);
|
||||||
|
|
||||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||||
VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByIoFile(outDir);
|
VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByIoFile(outDir);
|
||||||
|
|||||||
Reference in New Issue
Block a user