From 406714a1f4def3c903e2e47b2e419ccdc5d76b88 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 7 Apr 2017 18:11:48 +0200 Subject: [PATCH] Remove warning for running the compiler under Java 6/7 Now the compiler won't even start, so no need to check this manually. --- .../common/arguments/CommonCompilerArguments.java | 3 --- .../org/jetbrains/kotlin/cli/common/CLICompiler.java | 12 ------------ compiler/testData/cli/js/jsExtraHelp.out | 1 - compiler/testData/cli/jvm/extraHelp.out | 1 - .../integration/KotlinIntegrationTestBase.java | 3 --- .../org/jetbrains/kotlin/cli/AbstractCliTest.java | 1 - .../kotlin/integration/CompilerSmokeTestBase.java | 1 - .../AbstractMultiPlatformIntegrationTest.kt | 2 +- .../kotlin-maven-plugin/src/it/simple/verify.groovy | 2 -- 9 files changed, 1 insertion(+), 25 deletions(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.java index 6b3d3a8bf86..188ef22b440 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.java @@ -79,9 +79,6 @@ public abstract class CommonCompilerArguments implements Serializable { @Argument(value = "Xno-check-impl", description = "Do not check presence of 'impl' modifier in multi-platform projects") public boolean noCheckImpl; - @Argument(value = "Xskip-java-check", description = "Do not warn when running the compiler under Java 6 or 7") - public boolean noJavaVersionWarning; - @Argument(value = "Xcoroutines=warn") public boolean coroutinesWarn; diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java b/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java index f3798403a46..f6c24fce839 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java @@ -18,7 +18,6 @@ package org.jetbrains.kotlin.cli.common; import com.intellij.openapi.Disposable; import com.intellij.openapi.util.Disposer; -import com.intellij.openapi.util.SystemInfo; import kotlin.collections.ArraysKt; import org.fusesource.jansi.AnsiConsole; import org.jetbrains.annotations.NotNull; @@ -142,7 +141,6 @@ public abstract class CLICompiler { } reportUnknownExtraFlags(messageCollector, arguments); - reportUnsupportedJavaVersion(messageCollector, arguments); GroupingMessageCollector groupingCollector = new GroupingMessageCollector(messageCollector); @@ -337,16 +335,6 @@ public abstract class CLICompiler { } } - private void reportUnsupportedJavaVersion(MessageCollector collector, A arguments) { - if (!SystemInfo.isJavaVersionAtLeast("1.8") && !arguments.noJavaVersionWarning) { - collector.report( - CompilerMessageSeverity.STRONG_WARNING, - "Running the Kotlin compiler under Java 6 or 7 is unsupported and will no longer be possible in a future update.", - CompilerMessageLocation.NO_LOCATION - ); - } - } - @NotNull protected abstract ExitCode doExecute( @NotNull A arguments, diff --git a/compiler/testData/cli/js/jsExtraHelp.out b/compiler/testData/cli/js/jsExtraHelp.out index 88b73eace14..15f95f8b8a3 100644 --- a/compiler/testData/cli/js/jsExtraHelp.out +++ b/compiler/testData/cli/js/jsExtraHelp.out @@ -8,7 +8,6 @@ where advanced options include: -Xplugin Load plugins from the given classpath -Xmulti-platform Enable experimental language support for multi-platform projects -Xno-check-impl Do not check presence of 'impl' modifier in multi-platform projects - -Xskip-java-check Do not warn when running the compiler under Java 6 or 7 -Xcoroutines={enable|warn|error} Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier Advanced options are non-standard and may be changed or removed without any notice. diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index c2458c6caae..357633c4bfe 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -20,7 +20,6 @@ where advanced options include: -Xplugin Load plugins from the given classpath -Xmulti-platform Enable experimental language support for multi-platform projects -Xno-check-impl Do not check presence of 'impl' modifier in multi-platform projects - -Xskip-java-check Do not warn when running the compiler under Java 6 or 7 -Xcoroutines={enable|warn|error} Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier Advanced options are non-standard and may be changed or removed without any notice. diff --git a/compiler/tests-common/org/jetbrains/kotlin/integration/KotlinIntegrationTestBase.java b/compiler/tests-common/org/jetbrains/kotlin/integration/KotlinIntegrationTestBase.java index 1c43a2d0552..6a2a7b03f81 100644 --- a/compiler/tests-common/org/jetbrains/kotlin/integration/KotlinIntegrationTestBase.java +++ b/compiler/tests-common/org/jetbrains/kotlin/integration/KotlinIntegrationTestBase.java @@ -82,9 +82,6 @@ public abstract class KotlinIntegrationTestBase extends TestCaseWithTmpdir { content = normalizePath(content, getKotlinProjectHome(), "[KotlinProjectHome]"); content = content.replaceAll(Pattern.quote(KotlinCompilerVersion.VERSION), "[KotlinVersion]"); content = StringUtil.convertLineSeparators(content); - content = Pattern.compile("^.+running the Kotlin compiler under Java 6 or 7 is unsupported and will no longer be possible in a future update\\.\n", Pattern.MULTILINE) - .matcher(content) - .replaceAll(""); return content; } diff --git a/compiler/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java b/compiler/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java index 509709f8692..66e9ad56fe8 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java +++ b/compiler/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java @@ -74,7 +74,6 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir { .replace("expected version is " + JvmMetadataVersion.INSTANCE, "expected version is $ABI_VERSION$") .replace("expected version is " + JsMetadataVersion.INSTANCE, "expected version is $ABI_VERSION$") .replace("\\", "/") - .replaceAll("^.+running the Kotlin compiler under Java 6 or 7 is unsupported and will no longer be possible in a future update\\.\n", "") .replace(KotlinCompilerVersion.VERSION, "$VERSION$"); return normalizedOutputWithoutExitCode + exitCode; diff --git a/compiler/tests/org/jetbrains/kotlin/integration/CompilerSmokeTestBase.java b/compiler/tests/org/jetbrains/kotlin/integration/CompilerSmokeTestBase.java index 098d54ca9ef..628a6ffa7b8 100644 --- a/compiler/tests/org/jetbrains/kotlin/integration/CompilerSmokeTestBase.java +++ b/compiler/tests/org/jetbrains/kotlin/integration/CompilerSmokeTestBase.java @@ -43,7 +43,6 @@ public abstract class CompilerSmokeTestBase extends KotlinIntegrationTestBase { javaArgs.add("org.jetbrains.kotlin.cli.jvm.K2JVMCompiler"); Collections.addAll(javaArgs, arguments); - javaArgs.add("-Xskip-java-check"); return run(logName, ArrayUtil.toStringArray(javaArgs)); } diff --git a/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt b/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt index 9c30997551a..93bc83c0bed 100644 --- a/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt @@ -84,7 +84,7 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() { private fun CLICompiler<*>.compile(sources: List, vararg additionalArguments: String): String = buildString { val (output, exitCode) = AbstractCliTest.executeCompilerGrabOutput( this@compile, - sources.map(File::getAbsolutePath) + listOf("-Xmulti-platform", "-Xskip-java-check") + additionalArguments + sources.map(File::getAbsolutePath) + listOf("-Xmulti-platform") + additionalArguments ) appendln("Exit code: $exitCode") appendln("Output:") diff --git a/libraries/tools/kotlin-maven-plugin/src/it/simple/verify.groovy b/libraries/tools/kotlin-maven-plugin/src/it/simple/verify.groovy index 3ce87fb96d0..9de730c891a 100644 --- a/libraries/tools/kotlin-maven-plugin/src/it/simple/verify.groovy +++ b/libraries/tools/kotlin-maven-plugin/src/it/simple/verify.groovy @@ -34,8 +34,6 @@ State state = new File(basedir, "build.log").readLines().collect { it.replaceAll replace("\\", "/"). replaceAll(/[0-9]+\s*ms/, "LLL ms"). trim(). - // TODO: Remove after build is launched only under java 8 - replaceAll(/\[WARNING] Running the Kotlin compiler under Java 6 or 7 is unsupported and will no longer be possible in a future update./, ""). replaceAll(/^\[[A-Z]+\]$/, ""). replaceAll(/version [0-9a-z-+\.]+/, "version @snapshot@")