Warn when running the compiler under Java 6 or 7
(cherry picked from commit 5537800) (cherry picked from commit 5614874)
This commit is contained in:
@@ -155,6 +155,7 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
|
||||
}
|
||||
|
||||
reportUnknownExtraFlags(messageCollector, arguments);
|
||||
reportUnsupportedJavaVersion(messageCollector, arguments);
|
||||
|
||||
GroupingMessageCollector groupingCollector = new GroupingMessageCollector(messageCollector);
|
||||
|
||||
@@ -350,6 +351,16 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user