Change how kotlinc and tools display their version

- Display the Kotlin version in kotlin-gradle-plugin. This is needed
  because if "-version" is specified in compiler arguments, the "info"
  level of the message printed by the compiler in CLICompiler prevents
  it from being displayed by default (unless "--debug" is passed to
  Gradle).
- Display the version of JRE the compiler is running on. This will be
  helpful to diagnose Java 9 related issues in the future.
- In CLI, also display the executable name (kotlinc-jvm or kotlinc-js)
This commit is contained in:
Alexander Udalov
2017-04-06 18:29:48 +03:00
parent bb01ca038a
commit fcf44af294
26 changed files with 63 additions and 67 deletions
@@ -362,12 +362,6 @@ public class CliTestGenerated extends AbstractCliTest {
doJvmTest(fileName);
}
@TestMetadata("version.args")
public void testVersion() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/version.args");
doJvmTest(fileName);
}
@TestMetadata("warningJdkWithNoJdk.args")
public void testWarningJdkWithNoJdk() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/warningJdkWithNoJdk.args");
@@ -515,12 +509,6 @@ public class CliTestGenerated extends AbstractCliTest {
doJsTest(fileName);
}
@TestMetadata("version.args")
public void testVersion() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/js/version.args");
doJsTest(fileName);
}
@TestMetadata("withFolderAsLib.args")
public void testWithFolderAsLib() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/js/withFolderAsLib.args");
@@ -85,5 +85,8 @@ public class CompilerSmokeTest extends CompilerSmokeTestBase {
assertEquals("compilation failed", 0, runCompiler("inlineOnly.compile", "-include-runtime", "inlineOnly.kt", "-d", jar));
run("inlineOnly.run", "-cp", jar, "InlineOnly.InlineOnlyKt");
}
}
public void testPrintVersion() throws Exception {
runCompiler("test.compile", "-version");
}
}