Rename
This commit is contained in:
@@ -106,7 +106,7 @@ public class JetCompiler implements TranslatingCompiler {
|
|||||||
|
|
||||||
MessageCollector messageCollector = new MessageCollectorAdapter(compileContext);
|
MessageCollector messageCollector = new MessageCollectorAdapter(compileContext);
|
||||||
|
|
||||||
CompilerEnvironment environment = CompilerUtils.getEnvironmentFor(compileContext, module, tests);
|
CompilerEnvironment environment = TranslatingCompilerUtils.getEnvironmentFor(compileContext, module, tests);
|
||||||
if (!environment.success()) {
|
if (!environment.success()) {
|
||||||
environment.reportErrorsTo(messageCollector);
|
environment.reportErrorsTo(messageCollector);
|
||||||
return;
|
return;
|
||||||
@@ -129,7 +129,7 @@ public class JetCompiler implements TranslatingCompiler {
|
|||||||
};
|
};
|
||||||
runCompiler(messageCollector, environment, scriptFile, collector);
|
runCompiler(messageCollector, environment, scriptFile, collector);
|
||||||
|
|
||||||
CompilerUtils.reportOutputs(outputSink, outputDir, collector);
|
TranslatingCompilerUtils.reportOutputs(outputSink, outputDir, collector);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void runCompiler(
|
private static void runCompiler(
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public final class K2JSCompiler implements TranslatingCompiler {
|
|||||||
|
|
||||||
MessageCollector messageCollector = new MessageCollectorAdapter(context);
|
MessageCollector messageCollector = new MessageCollectorAdapter(context);
|
||||||
|
|
||||||
CompilerEnvironment environment = CompilerUtils.getEnvironmentFor(context, module, /*tests = */ false);
|
CompilerEnvironment environment = TranslatingCompilerUtils.getEnvironmentFor(context, module, /*tests = */ false);
|
||||||
if (!environment.success()) {
|
if (!environment.success()) {
|
||||||
environment.reportErrorsTo(messageCollector);
|
environment.reportErrorsTo(messageCollector);
|
||||||
return;
|
return;
|
||||||
@@ -100,7 +100,7 @@ public final class K2JSCompiler implements TranslatingCompiler {
|
|||||||
return execInProcess(messageCollector, environment, stream, module);
|
return execInProcess(messageCollector, environment, stream, module);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
CompilerUtils.reportOutputs(sink, environment.getOutput(), collector);
|
TranslatingCompilerUtils.reportOutputs(sink, environment.getOutput(), collector);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
+4
-7
@@ -34,22 +34,19 @@ import java.io.File;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
public final class TranslatingCompilerUtils {
|
||||||
* @author Pavel Talanov
|
private TranslatingCompilerUtils() {
|
||||||
*/
|
|
||||||
public final class CompilerUtils {
|
|
||||||
private CompilerUtils() {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static CompilerEnvironment getEnvironmentFor(@NotNull CompileContext compileContext, @NotNull Module module, boolean tests) {
|
public static CompilerEnvironment getEnvironmentFor(@NotNull CompileContext compileContext, @NotNull Module module, boolean tests) {
|
||||||
VirtualFile mainOutput = compileContext.getModuleOutputDirectory(module);
|
VirtualFile mainOutput = compileContext.getModuleOutputDirectory(module);
|
||||||
VirtualFile outputDirectoryForTests = compileContext.getModuleOutputDirectoryForTests(module);
|
VirtualFile outputDirectoryForTests = compileContext.getModuleOutputDirectoryForTests(module);
|
||||||
return CompilerEnvironment.getEnvironmentFor(tests, toIoFile(mainOutput), toIoFile(outputDirectoryForTests));
|
return CompilerEnvironment.getEnvironmentFor(tests, toNullableIoFile(mainOutput), toNullableIoFile(outputDirectoryForTests));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static File toIoFile(@Nullable VirtualFile file) {
|
public static File toNullableIoFile(@Nullable VirtualFile file) {
|
||||||
if (file == null) return null;
|
if (file == null) return null;
|
||||||
return new File(file.getPath());
|
return new File(file.getPath());
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user