From cbcee10618bf1cad4d7c08ae8e2f9457ca712f69 Mon Sep 17 00:00:00 2001 From: pTalanov Date: Fri, 1 Jun 2012 15:19:47 +0400 Subject: [PATCH] K2JSCompiler and K2JSTranslator fixes (mostly codestyle) --- .../jetbrains/jet/cli/js/K2JSCompiler.java | 22 ++++++++++++------- .../jetbrains/k2js/facade/K2JSTranslator.java | 12 +++------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompiler.java index 1218a626cbe..7e46e586e3a 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompiler.java @@ -89,13 +89,7 @@ public class K2JSCompiler extends CLICompiler fileNames = Iterables.transform(environmentForJS.getSourceFiles(), new Function() { - @Override - public String apply(@Nullable JetFile file) { - return file.getName(); - } - }); - System.out.println("Compiling source files: " + Joiner.on(", ").join(fileNames)); + reportCompiledSourcesList(messageCollector, environmentForJS); } String outputFile = arguments.outputFile; @@ -109,6 +103,19 @@ public class K2JSCompiler extends CLICompiler fileNames = Iterables.transform(environmentForJS.getSourceFiles(), new Function() { + @Override + public String apply(@Nullable JetFile file) { + assert file != null; + return file.getName(); + } + }); + messageCollector.report(CompilerMessageSeverity.LOGGING, "Compiling source files: " + Joiner.on(", ").join(fileNames), + CompilerMessageLocation.NO_LOCATION); + } + @NotNull private static ExitCode translateAndGenerateOutputFile(@NotNull MainCallParameters mainCall, @NotNull PrintingMessageCollector messageCollector, @@ -121,7 +128,6 @@ public class K2JSCompiler extends CLICompiler files, + public static void translateWithMainCallParametersAndSaveToFile(@NotNull MainCallParameters mainCall, + @NotNull List files, @NotNull String outputPath, - @NotNull Config config) throws Exception { - translateWithMainCallParametersAndSaveToFile(MainCallParameters.mainWithoutArguments(), files, outputPath, config); - } - - public static void translateWithMainCallParametersAndSaveToFile(MainCallParameters mainCall, - List files, - String outputPath, - Config config) throws TranslationException, IOException { + @NotNull Config config) throws TranslationException, IOException { K2JSTranslator translator = new K2JSTranslator(config); String programCode = translator.generateProgramCode(files, mainCall) + "\n"; writeCodeToFile(outputPath, programCode);