diff --git a/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/Kotlin2JsCompilerTask.kt b/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/Kotlin2JsCompilerTask.kt index e06db037c71..5fd5df9d8b4 100644 --- a/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/Kotlin2JsCompilerTask.kt +++ b/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/Kotlin2JsCompilerTask.kt @@ -37,7 +37,7 @@ public class Kotlin2JsCompilerTask : Task() { public var library: Path? = null public var outputPrefix: File? = null public var outputPostfix: File? = null - public var sourcemap: Boolean = false + public var sourceMap: Boolean = false /** * {@link K2JsArgumentConstants.CALL} (default) if need generate a main function call (main function will be auto detected) @@ -84,7 +84,7 @@ public class Kotlin2JsCompilerTask : Task() { arguments.outputPostfix = outputPostfix?.canonicalPath arguments.main = main - arguments.sourcemap = sourcemap + arguments.sourceMap = sourceMap log("Compiling ${arguments.freeArgs} => [${arguments.outputFile}]"); diff --git a/build.xml b/build.xml index 6149fd3a870..b7661ecab62 100644 --- a/build.xml +++ b/build.xml @@ -579,7 +579,7 @@ - + diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java index b4f44dcf3d1..2a27693489e 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java @@ -23,20 +23,17 @@ import org.jetbrains.annotations.Nullable; import static org.jetbrains.jet.cli.common.arguments.K2JsArgumentConstants.CALL; import static org.jetbrains.jet.cli.common.arguments.K2JsArgumentConstants.NO_CALL; -/** - * NOTE: for now K2JSCompiler supports only minimal amount of parameters required to launch it from the plugin. - */ public class K2JSCompilerArguments extends CommonCompilerArguments { @Argument(value = "output", description = "Output file path") @ValueDescription("") public String outputFile; - @Argument(value = "libraryFiles", description = "Path to zipped library sources or kotlin files separated by commas") + @Argument(value = "library-files", description = "Path to zipped library sources or kotlin files separated by commas") @ValueDescription("") public String[] libraryFiles; - @Argument(value = "sourcemap", description = "Generate SourceMap") - public boolean sourcemap; + @Argument(value = "source-map", description = "Generate source map") + public boolean sourceMap; @Argument(value = "target", description = "Generate JS files for specific ECMA version (only ECMA 5 is supported)") @ValueDescription("") @@ -47,11 +44,11 @@ public class K2JSCompilerArguments extends CommonCompilerArguments { @ValueDescription("{" + CALL + "," + NO_CALL + "}") public String main; - @Argument(value = "outputPrefix", description = "Path to file which will be added to the beginning of output file") + @Argument(value = "output-prefix", description = "Path to file which will be added to the beginning of output file") @ValueDescription("") public String outputPrefix; - @Argument(value = "outputPostfix", description = "Path to file which will be added to the end of output file") + @Argument(value = "output-postfix", description = "Path to file which will be added to the end of output file") @ValueDescription("") public String outputPostfix; diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java index 0869147f316..b23e86aaf3d 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java @@ -19,10 +19,6 @@ package org.jetbrains.jet.cli.common.arguments; import com.sampullara.cli.Argument; import org.jetbrains.annotations.NotNull; -/** - * Command line arguments for K2JVMCompiler - */ -@SuppressWarnings("UnusedDeclaration") public class K2JVMCompilerArguments extends CommonCompilerArguments { @Argument(value = "d", description = "Destination for generated class files") @ValueDescription("") @@ -36,16 +32,16 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments { @ValueDescription("") public String annotations; - @Argument(value = "includeRuntime", description = "Include Kotlin runtime in to resulting .jar") + @Argument(value = "include-runtime", description = "Include Kotlin runtime in to resulting .jar") public boolean includeRuntime; - @Argument(value = "noJdk", description = "Don't include Java runtime into classpath") + @Argument(value = "no-jdk", description = "Don't include Java runtime into classpath") public boolean noJdk; - @Argument(value = "noStdlib", description = "Don't include Kotlin runtime into classpath") + @Argument(value = "no-stdlib", description = "Don't include Kotlin runtime into classpath") public boolean noStdlib; - @Argument(value = "noJdkAnnotations", description = "Don't include JDK external annotations into classpath") + @Argument(value = "no-jdk-annotations", description = "Don't include JDK external annotations into classpath") public boolean noJdkAnnotations; @Argument(value = "module", description = "Path to the module file to compile") @@ -55,7 +51,7 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments { @Argument(value = "script", description = "Evaluate the script file") public boolean script; - @Argument(value = "kotlinHome", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery") + @Argument(value = "kotlin-home", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery") @ValueDescription("") public String kotlinHome; 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 a6d0143126c..504e06865db 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompiler.java @@ -191,11 +191,11 @@ public class K2JSCompiler extends CLICompiler { EcmaVersion ecmaVersion = EcmaVersion.defaultVersion(); String moduleId = FileUtil.getNameWithoutExtension(new File(arguments.outputFile)); if (arguments.libraryFiles != null) { - return new LibrarySourcesConfig(project, moduleId, Arrays.asList(arguments.libraryFiles), ecmaVersion, arguments.sourcemap); + return new LibrarySourcesConfig(project, moduleId, Arrays.asList(arguments.libraryFiles), ecmaVersion, arguments.sourceMap); } else { // lets discover the JS library definitions on the classpath - return new ClassPathLibraryDefintionsConfig(project, moduleId, ecmaVersion, arguments.sourcemap); + return new ClassPathLibraryDefintionsConfig(project, moduleId, ecmaVersion, arguments.sourceMap); } } diff --git a/compiler/integration-tests/src/org/jetbrains/kotlin/CompilerSmokeTest.java b/compiler/integration-tests/src/org/jetbrains/kotlin/CompilerSmokeTest.java index 8f8f351cf6d..4d69af38f34 100644 --- a/compiler/integration-tests/src/org/jetbrains/kotlin/CompilerSmokeTest.java +++ b/compiler/integration-tests/src/org/jetbrains/kotlin/CompilerSmokeTest.java @@ -56,7 +56,7 @@ public class CompilerSmokeTest extends KotlinIntegrationTestBase { public void helloApp() throws Exception { String jar = tmpdir.getTmpDir().getAbsolutePath() + File.separator + "hello.jar"; - assertEquals("compilation failed", 0, runCompiler("hello.compile", "-includeRuntime", "hello.kt", "-d", jar)); + assertEquals("compilation failed", 0, runCompiler("hello.compile", "-include-runtime", "hello.kt", "-d", jar)); runJava("hello.run", "-cp", jar, "Hello.HelloPackage"); } @@ -64,7 +64,7 @@ public class CompilerSmokeTest extends KotlinIntegrationTestBase { public void helloAppFQMain() throws Exception { String jar = tmpdir.getTmpDir().getAbsolutePath() + File.separator + "hello.jar"; - assertEquals("compilation failed", 0, runCompiler("hello.compile", "-includeRuntime", "hello.kt", "-d", jar)); + assertEquals("compilation failed", 0, runCompiler("hello.compile", "-include-runtime", "hello.kt", "-d", jar)); runJava("hello.run", "-cp", jar, "Hello.HelloPackage"); } @@ -72,7 +72,7 @@ public class CompilerSmokeTest extends KotlinIntegrationTestBase { public void helloAppVarargMain() throws Exception { String jar = tmpdir.getTmpDir().getAbsolutePath() + File.separator + "hello.jar"; - assertEquals("compilation failed", 0, runCompiler("hello.compile", "-includeRuntime", "hello.kt", "-d", jar)); + assertEquals("compilation failed", 0, runCompiler("hello.compile", "-include-runtime", "hello.kt", "-d", jar)); runJava("hello.run", "-cp", jar, "Hello.HelloPackage"); } diff --git a/compiler/testData/cli/js/jsHelp.out b/compiler/testData/cli/js/jsHelp.out index 5af695b917c..c160669be38 100644 --- a/compiler/testData/cli/js/jsHelp.out +++ b/compiler/testData/cli/js/jsHelp.out @@ -1,12 +1,12 @@ Usage: kotlinc-js where possible options include: -output Output file path - -libraryFiles Path to zipped library sources or kotlin files separated by commas - -sourcemap Generate SourceMap + -library-files Path to zipped library sources or kotlin files separated by commas + -source-map Generate source map -target Generate JS files for specific ECMA version (only ECMA 5 is supported) -main {call,noCall} Whether a main function should be called; default 'call' (main function will be auto detected) - -outputPrefix Path to file which will be added to the beginning of output file - -outputPostfix Path to file which will be added to the end of output file + -output-prefix Path to file which will be added to the beginning of output file + -output-postfix Path to file which will be added to the end of output file -tags Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose Enable verbose logging output -version Display compiler version diff --git a/compiler/testData/cli/js/outputPostfixFileNotFound.args b/compiler/testData/cli/js/outputPostfixFileNotFound.args index 2ac3c1e3b42..cab465cb577 100644 --- a/compiler/testData/cli/js/outputPostfixFileNotFound.args +++ b/compiler/testData/cli/js/outputPostfixFileNotFound.args @@ -1,5 +1,5 @@ $TESTDATA_DIR$/simple2js.kt -output $TEMP_DIR$/out.js --outputPostfix +-output-postfix not/existing/path diff --git a/compiler/testData/cli/js/outputPrefixFileNotFound.args b/compiler/testData/cli/js/outputPrefixFileNotFound.args index dab81c7e94f..4e7e0c86d01 100644 --- a/compiler/testData/cli/js/outputPrefixFileNotFound.args +++ b/compiler/testData/cli/js/outputPrefixFileNotFound.args @@ -1,5 +1,5 @@ $TESTDATA_DIR$/simple2js.kt -output $TEMP_DIR$/out.js --outputPrefix +-output-prefix not/existing/path diff --git a/compiler/testData/cli/jvm/help.out b/compiler/testData/cli/jvm/help.out index 3ef5ae13c10..c4492e71b4a 100644 --- a/compiler/testData/cli/jvm/help.out +++ b/compiler/testData/cli/jvm/help.out @@ -3,13 +3,13 @@ where possible options include: -d Destination for generated class files -classpath Paths where to find user class files -annotations Paths to external annotations - -includeRuntime Include Kotlin runtime in to resulting .jar - -noJdk Don't include Java runtime into classpath - -noStdlib Don't include Kotlin runtime into classpath - -noJdkAnnotations Don't include JDK external annotations into classpath + -include-runtime Include Kotlin runtime in to resulting .jar + -no-jdk Don't include Java runtime into classpath + -no-stdlib Don't include Kotlin runtime into classpath + -no-jdk-annotations Don't include JDK external annotations into classpath -module Path to the module file to compile -script Evaluate the script file - -kotlinHome Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery + -kotlin-home Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery -tags Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose Enable verbose logging output -version Display compiler version diff --git a/compiler/testData/cli/jvm/wrongArgument.args b/compiler/testData/cli/jvm/wrongArgument.args index e327439d84d..76003b8c286 100644 --- a/compiler/testData/cli/jvm/wrongArgument.args +++ b/compiler/testData/cli/jvm/wrongArgument.args @@ -1 +1 @@ --wrongArgument +-wrong-argument diff --git a/compiler/testData/cli/jvm/wrongArgument.out b/compiler/testData/cli/jvm/wrongArgument.out index dc538750f39..fd67ab44bae 100644 --- a/compiler/testData/cli/jvm/wrongArgument.out +++ b/compiler/testData/cli/jvm/wrongArgument.out @@ -1,16 +1,16 @@ -Invalid argument: -wrongArgument +Invalid argument: -wrong-argument Usage: kotlinc-jvm where possible options include: -d Destination for generated class files -classpath Paths where to find user class files -annotations Paths to external annotations - -includeRuntime Include Kotlin runtime in to resulting .jar - -noJdk Don't include Java runtime into classpath - -noStdlib Don't include Kotlin runtime into classpath - -noJdkAnnotations Don't include JDK external annotations into classpath + -include-runtime Include Kotlin runtime in to resulting .jar + -no-jdk Don't include Java runtime into classpath + -no-stdlib Don't include Kotlin runtime into classpath + -no-jdk-annotations Don't include JDK external annotations into classpath -module Path to the module file to compile -script Evaluate the script file - -kotlinHome Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery + -kotlin-home Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery -tags Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose Enable verbose logging output -version Display compiler version diff --git a/compiler/tests/org/jetbrains/jet/codegen/forTestCompile/ForTestCompileRuntime.java b/compiler/tests/org/jetbrains/jet/codegen/forTestCompile/ForTestCompileRuntime.java index 9cf40b5a16d..b1a2cd30c1e 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/forTestCompile/ForTestCompileRuntime.java +++ b/compiler/tests/org/jetbrains/jet/codegen/forTestCompile/ForTestCompileRuntime.java @@ -89,8 +89,8 @@ public class ForTestCompileRuntime { ) { List args = KotlinPackage.arrayListOf( "-d", destDir.getPath(), - "-noStdlib", - "-noJdkAnnotations", + "-no-stdlib", + "-no-jdk-annotations", "-suppress", "warnings", "-annotations", JetTestUtils.getJdkAnnotationsJar().getAbsolutePath(), "-classpath", classPath diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileEnvironmentTest.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileEnvironmentTest.java index ee2e3171c11..bfc2d686705 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileEnvironmentTest.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileEnvironmentTest.java @@ -36,7 +36,6 @@ import java.util.jar.JarEntry; import java.util.jar.JarInputStream; public class CompileEnvironmentTest extends TestCase { - public void testSmokeWithCompilerJar() throws IOException { File tempDir = FileUtil.createTempDirectory("compilerTest", "compilerTest"); @@ -48,9 +47,9 @@ public class CompileEnvironmentTest extends TestCase { System.out, "-module", JetTestCaseBuilder.getTestDataPathBase() + "/compiler/smoke/Smoke.ktm", "-d", resultJar.getAbsolutePath(), - "-noStdlib", + "-no-stdlib", "-classpath", stdlib.getAbsolutePath(), - "-noJdkAnnotations", + "-no-jdk-annotations", "-annotations", jdkAnnotations.getAbsolutePath() ); Assert.assertEquals("compilation completed with non-zero code", ExitCode.OK, rv); @@ -85,15 +84,16 @@ public class CompileEnvironmentTest extends TestCase { System.out, JetTestCaseBuilder.getTestDataPathBase() + "/compiler/smoke/Smoke.kt", "-d", out.getAbsolutePath(), - "-noStdlib", + "-no-stdlib", "-classpath", stdlib.getAbsolutePath(), - "-noJdkAnnotations", + "-no-jdk-annotations", "-annotations", jdkAnnotations.getAbsolutePath() ); Assert.assertEquals(ExitCode.OK, exitCode); assertEquals(1, out.listFiles().length); assertEquals(2, out.listFiles()[0].listFiles().length); - } finally { + } + finally { FileUtil.delete(tempDir); } } diff --git a/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/KotlinCompilerRunner.java b/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/KotlinCompilerRunner.java index aaffb8bf770..8bc2b859116 100644 --- a/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/KotlinCompilerRunner.java +++ b/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/KotlinCompilerRunner.java @@ -105,7 +105,7 @@ public class KotlinCompilerRunner { ) { try { messageCollector.report(CompilerMessageSeverity.INFO, - "Using kotlinHome=" + environment.getKotlinPaths().getHomePath(), + "Using kotlin-home = " + environment.getKotlinPaths().getHomePath(), CompilerMessageLocation.NO_LOCATION); Object rc = CompilerRunnerUtil.invokeExecMethod(compilerClassName, arguments, environment, diff --git a/idea/src/org/jetbrains/jet/plugin/compiler/configuration/KotlinCompilerConfigurableTab.java b/idea/src/org/jetbrains/jet/plugin/compiler/configuration/KotlinCompilerConfigurableTab.java index 88452e7d178..77864d6b5a3 100644 --- a/idea/src/org/jetbrains/jet/plugin/compiler/configuration/KotlinCompilerConfigurableTab.java +++ b/idea/src/org/jetbrains/jet/plugin/compiler/configuration/KotlinCompilerConfigurableTab.java @@ -90,7 +90,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co public boolean isModified() { return ComparingUtils.isModified(generateNoWarningsCheckBox, isGenerateNoWarnings()) || ComparingUtils.isModified(additionalArgsOptionsField, compilerSettings.getAdditionalArguments()) || - ComparingUtils.isModified(generateSourceMapsCheckBox, k2jsCompilerArguments.sourcemap) || + ComparingUtils.isModified(generateSourceMapsCheckBox, k2jsCompilerArguments.sourceMap) || isModified(outputPrefixFile, k2jsCompilerArguments.outputPrefix) || isModified(outputPostfixFile, k2jsCompilerArguments.outputPostfix); } @@ -99,7 +99,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co public void apply() throws ConfigurationException { setGenerateNoWarnings(generateNoWarningsCheckBox.isSelected()); compilerSettings.setAdditionalArguments(additionalArgsOptionsField.getText()); - k2jsCompilerArguments.sourcemap = generateSourceMapsCheckBox.isSelected(); + k2jsCompilerArguments.sourceMap = generateSourceMapsCheckBox.isSelected(); k2jsCompilerArguments.outputPrefix = StringUtil.nullize(outputPrefixFile.getText(), true); k2jsCompilerArguments.outputPostfix = StringUtil.nullize(outputPostfixFile.getText(), true); } @@ -108,7 +108,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co public void reset() { generateNoWarningsCheckBox.setSelected(isGenerateNoWarnings()); additionalArgsOptionsField.setText(compilerSettings.getAdditionalArguments()); - generateSourceMapsCheckBox.setSelected(k2jsCompilerArguments.sourcemap); + generateSourceMapsCheckBox.setSelected(k2jsCompilerArguments.sourceMap); outputPrefixFile.setText(k2jsCompilerArguments.outputPrefix); outputPostfixFile.setText(k2jsCompilerArguments.outputPostfix); } diff --git a/js/js.tests/test/org/jetbrains/k2js/test/SourcemapTest.java b/js/js.tests/test/org/jetbrains/k2js/test/SourceMapTest.java similarity index 94% rename from js/js.tests/test/org/jetbrains/k2js/test/SourcemapTest.java rename to js/js.tests/test/org/jetbrains/k2js/test/SourceMapTest.java index 79b53aaecaf..38d7b36774a 100644 --- a/js/js.tests/test/org/jetbrains/k2js/test/SourcemapTest.java +++ b/js/js.tests/test/org/jetbrains/k2js/test/SourceMapTest.java @@ -32,13 +32,12 @@ import static org.jetbrains.k2js.test.utils.TranslationUtils.createJetFileList; import static org.jetbrains.k2js.test.utils.TranslationUtils.getConfig; @SuppressWarnings("JUnitTestCaseWithNoTests") -public final class SourcemapTest extends SingleFileTranslationTest { - +public final class SourceMapTest extends SingleFileTranslationTest { @NotNull private final String filename; @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors") - public SourcemapTest(@NotNull String filename) { + public SourceMapTest(@NotNull String filename) { super("sourcemap/"); this.filename = filename; } @@ -74,7 +73,7 @@ public final class SourcemapTest extends SingleFileTranslationTest { @NotNull @Override public Test createTest(@NotNull String filename) { - SourcemapTest examplesTest = new SourcemapTest(filename); + SourceMapTest examplesTest = new SourceMapTest(filename); examplesTest.setName(filename); return examplesTest; } diff --git a/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt b/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt index f03c61f11e2..010bc09a893 100644 --- a/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt +++ b/libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocCompiler.kt @@ -34,7 +34,7 @@ class KDocCompiler() : K2JVMCompiler() { } protected override fun usage(target: PrintStream, extraHelp: Boolean) { - target.println("Usage: KDocCompiler -docOutput -d [|] [-stdlib ] [|-module ] [-includeRuntime]"); + target.println("Usage: KDocCompiler -docOutput -d [|] [-stdlib ] [|-module ] [-include-runtime]"); } }