[Gradle, JS] IR by default and report warnings for using legacy compiler
- just legacy - report warning about deprecation - both - report warning about deprecation of legacy - no compiler explicitly chosen - error about explicit setting compiler warn from cli legacy compiler nowarn flag - kotlin.js.compiler.nowarn KT-42326 KT-53074
This commit is contained in:
+6
@@ -265,6 +265,12 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
@Argument(value = "-Xwasm-enable-asserts", description = "Turn on asserts")
|
||||
var wasmEnableAsserts: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xlegacy-deprecated-no-warn",
|
||||
description = "Disable warnings of deprecation of legacy compiler"
|
||||
)
|
||||
var legacyDeprecatedNoWarn: Boolean by FreezableVar(false)
|
||||
|
||||
override fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap<AnalysisFlag<*>, Any> {
|
||||
return super.configureAnalysisFlags(collector, languageVersion).also {
|
||||
it[allowFullyQualifiedNameInKClass] = wasm && wasmKClassFqn //Only enabled WASM BE supports this flag
|
||||
|
||||
@@ -186,6 +186,10 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
if (!arguments.getLegacyDeprecatedNoWarn()) {
|
||||
messageCollector.report(STRONG_WARNING, "Legacy compiler is deprecated. Please migrate onto IR.", null);
|
||||
}
|
||||
|
||||
if (arguments.getFreeArgs().isEmpty() && (!incrementalCompilationIsEnabledForJs(arguments))) {
|
||||
if (arguments.getVersion()) {
|
||||
return OK;
|
||||
|
||||
Reference in New Issue
Block a user