From 5cbcbe4a9cc0c1ccd67e34764c5171c86269934b Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 25 Aug 2017 17:11:34 +0300 Subject: [PATCH] Support -Werror CLI argument to treat warnings as errors The option is named "warningsAsErrors" in the Gradle plugin #KT-10563 Fixed --- .../builtins/BuiltInsSerializer.kt | 3 ++- .../common/arguments/CommonToolArguments.kt | 4 ++++ .../messages/CompilerMessageSeverity.java | 7 ++++-- .../messages/GroupingMessageCollector.java | 21 +++++++++++++--- .../kotlin/cli/common/CLICompiler.java | 2 +- .../jetbrains/kotlin/cli/common/CLITool.kt | 2 +- .../ReplTerminalDiagnosticMessageHolder.kt | 3 ++- compiler/testData/cli/js-dce/dceHelp.out | 1 + compiler/testData/cli/js/jsHelp.out | 1 + compiler/testData/cli/jvm/help.out | 1 + compiler/testData/cli/jvm/werror.args | 4 ++++ compiler/testData/cli/jvm/werror.kt | 4 ++++ compiler/testData/cli/jvm/werror.out | 5 ++++ .../cli/jvm/werrorWithExplicitError.args | 4 ++++ .../cli/jvm/werrorWithExplicitError.kt | 5 ++++ .../cli/jvm/werrorWithExplicitError.out | 4 ++++ .../testData/cli/jvm/werrorWithNoWarn.args | 5 ++++ compiler/testData/cli/jvm/werrorWithNoWarn.kt | 4 ++++ .../testData/cli/jvm/werrorWithNoWarn.out | 5 ++++ .../cli/jvm/werrorWithStrongWarning.args | 6 +++++ .../cli/jvm/werrorWithStrongWarning.kt | 4 ++++ .../cli/jvm/werrorWithStrongWarning.out | 3 +++ .../kotlin/cli/CliTestGenerated.java | 24 +++++++++++++++++++ .../kotlin/gradle/dsl/KotlinCommonOptions.kt | 6 +++++ .../kotlin/gradle/dsl/KotlinJsOptionsBase.kt | 7 ++++++ .../kotlin/gradle/dsl/KotlinJvmOptionsBase.kt | 7 ++++++ 26 files changed, 133 insertions(+), 9 deletions(-) create mode 100644 compiler/testData/cli/jvm/werror.args create mode 100644 compiler/testData/cli/jvm/werror.kt create mode 100644 compiler/testData/cli/jvm/werror.out create mode 100644 compiler/testData/cli/jvm/werrorWithExplicitError.args create mode 100644 compiler/testData/cli/jvm/werrorWithExplicitError.kt create mode 100644 compiler/testData/cli/jvm/werrorWithExplicitError.out create mode 100644 compiler/testData/cli/jvm/werrorWithNoWarn.args create mode 100644 compiler/testData/cli/jvm/werrorWithNoWarn.kt create mode 100644 compiler/testData/cli/jvm/werrorWithNoWarn.out create mode 100644 compiler/testData/cli/jvm/werrorWithStrongWarning.args create mode 100644 compiler/testData/cli/jvm/werrorWithStrongWarning.kt create mode 100644 compiler/testData/cli/jvm/werrorWithStrongWarning.out diff --git a/compiler/builtins-serializer/src/org/jetbrains/kotlin/serialization/builtins/BuiltInsSerializer.kt b/compiler/builtins-serializer/src/org/jetbrains/kotlin/serialization/builtins/BuiltInsSerializer.kt index 218075e83b9..f33a16e1763 100644 --- a/compiler/builtins-serializer/src/org/jetbrains/kotlin/serialization/builtins/BuiltInsSerializer.kt +++ b/compiler/builtins-serializer/src/org/jetbrains/kotlin/serialization/builtins/BuiltInsSerializer.kt @@ -74,7 +74,8 @@ class BuiltInsSerializer(dependOnOldBuiltIns: Boolean) : MetadataSerializer(depe } private fun createMessageCollector() = object : GroupingMessageCollector( - PrintingMessageCollector(System.err, MessageRenderer.PLAIN_RELATIVE_PATHS, /* verbose = */ false) + PrintingMessageCollector(System.err, MessageRenderer.PLAIN_RELATIVE_PATHS, false), + false ) { override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageLocation?) { // Only report diagnostics without a particular location because there's plenty of errors in built-in sources diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonToolArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonToolArguments.kt index b32e0ea4b9f..fc3f2ea9536 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonToolArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonToolArguments.kt @@ -44,4 +44,8 @@ abstract class CommonToolArguments : Freezable(), Serializable { @GradleOption(DefaultValues.BooleanFalseDefault::class) @Argument(value = "-nowarn", description = "Generate no warnings") var suppressWarnings: Boolean by FreezableVar(false) + + @GradleOption(DefaultValues.BooleanFalseDefault::class) + @Argument(value = "-Werror", description = "Report an error if there are any warnings") + var warningsAsErrors: Boolean by FreezableVar(false) } diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/messages/CompilerMessageSeverity.java b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/messages/CompilerMessageSeverity.java index 6221b65e8c4..a35e3f69d23 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/messages/CompilerMessageSeverity.java +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/messages/CompilerMessageSeverity.java @@ -35,11 +35,14 @@ public enum CompilerMessageSeverity { */ OUTPUT; - public static final EnumSet ERRORS = EnumSet.of(ERROR, EXCEPTION); public static final EnumSet VERBOSE = EnumSet.of(LOGGING); public boolean isError() { - return ERRORS.contains(this); + return this == EXCEPTION || this == ERROR; + } + + public boolean isWarning() { + return this == STRONG_WARNING || this == WARNING; } @NotNull diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/messages/GroupingMessageCollector.java b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/messages/GroupingMessageCollector.java index 930808945da..cd9689a8ee0 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/messages/GroupingMessageCollector.java +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/messages/GroupingMessageCollector.java @@ -24,16 +24,19 @@ import org.jetbrains.annotations.Nullable; import java.util.Comparator; import java.util.List; +import java.util.Map; import java.util.Objects; public class GroupingMessageCollector implements MessageCollector { private final MessageCollector delegate; + private final boolean treatWarningsAsErrors; // Note that the key in this map can be null private final Multimap groupedMessages = LinkedHashMultimap.create(); - public GroupingMessageCollector(@NotNull MessageCollector delegate) { + public GroupingMessageCollector(@NotNull MessageCollector delegate, boolean treatWarningsAsErrors) { this.delegate = delegate; + this.treatWarningsAsErrors = treatWarningsAsErrors; } @Override @@ -57,17 +60,29 @@ public class GroupingMessageCollector implements MessageCollector { @Override public boolean hasErrors() { + return hasExplicitErrors() || (treatWarningsAsErrors && hasWarnings()); + } + + private boolean hasExplicitErrors() { return groupedMessages.entries().stream().anyMatch(entry -> entry.getValue().severity.isError()); } + private boolean hasWarnings() { + return groupedMessages.entries().stream().anyMatch(entry -> entry.getValue().severity.isWarning()); + } + public void flush() { - boolean hasErrors = hasErrors(); + boolean hasExplicitErrors = hasExplicitErrors(); + + if (treatWarningsAsErrors && !hasExplicitErrors && hasWarnings()) { + report(CompilerMessageSeverity.ERROR, "warnings found and -Werror specified", null); + } List sortedKeys = CollectionsKt.sortedWith(groupedMessages.keySet(), Comparator.nullsFirst(CompilerMessageLocationComparator.INSTANCE)); for (CompilerMessageLocation location : sortedKeys) { for (Message message : groupedMessages.get(location)) { - if (!hasErrors || message.severity.isError() || message.severity == CompilerMessageSeverity.STRONG_WARNING) { + if (!hasExplicitErrors || message.severity.isError() || message.severity == CompilerMessageSeverity.STRONG_WARNING) { delegate.report(message.severity, message.message, message.location); } } 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 f6afab2fbc8..f0053b55755 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java @@ -69,7 +69,7 @@ public abstract class CLICompiler extends CLI @NotNull @Override public ExitCode execImpl(@NotNull MessageCollector messageCollector, @NotNull Services services, @NotNull A arguments) { - GroupingMessageCollector groupingCollector = new GroupingMessageCollector(messageCollector); + GroupingMessageCollector groupingCollector = new GroupingMessageCollector(messageCollector, arguments.getWarningsAsErrors()); CompilerConfiguration configuration = new CompilerConfiguration(); configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, groupingCollector); diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLITool.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLITool.kt index d307775d9f9..bd2a581d173 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLITool.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLITool.kt @@ -81,7 +81,7 @@ abstract class CLITool { fun exec(messageCollector: MessageCollector, services: Services, arguments: A): ExitCode { printVersionIfNeeded(messageCollector, arguments) - val fixedMessageCollector = if (arguments.suppressWarnings) { + val fixedMessageCollector = if (arguments.suppressWarnings && !arguments.warningsAsErrors) { FilteringMessageCollector(messageCollector, Predicate.isEqual(CompilerMessageSeverity.WARNING)) } else { diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/messages/ReplTerminalDiagnosticMessageHolder.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/messages/ReplTerminalDiagnosticMessageHolder.kt index ef72098dd2d..7552516419d 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/messages/ReplTerminalDiagnosticMessageHolder.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/messages/ReplTerminalDiagnosticMessageHolder.kt @@ -28,7 +28,8 @@ class ReplTerminalDiagnosticMessageHolder : MessageCollectorBasedReporter, Diagn private val outputStream = ByteArrayOutputStream() override val messageCollector: GroupingMessageCollector = GroupingMessageCollector( - PrintingMessageCollector(PrintStream(outputStream), MessageRenderer.WITHOUT_PATHS, false) + PrintingMessageCollector(PrintStream(outputStream), MessageRenderer.WITHOUT_PATHS, false), + false ) override val renderedDiagnostics: String diff --git a/compiler/testData/cli/js-dce/dceHelp.out b/compiler/testData/cli/js-dce/dceHelp.out index c31e8e7ca2c..ec622412995 100644 --- a/compiler/testData/cli/js-dce/dceHelp.out +++ b/compiler/testData/cli/js-dce/dceHelp.out @@ -8,4 +8,5 @@ where possible options include: -nowarn Generate no warnings -verbose Enable verbose logging output -version Display compiler version + -Werror Report an error if there are any warnings OK diff --git a/compiler/testData/cli/js/jsHelp.out b/compiler/testData/cli/js/jsHelp.out index f76e57906fe..61d7f3bf457 100644 --- a/compiler/testData/cli/js/jsHelp.out +++ b/compiler/testData/cli/js/jsHelp.out @@ -25,4 +25,5 @@ where possible options include: -nowarn Generate no warnings -verbose Enable verbose logging output -version Display compiler version + -Werror Report an error if there are any warnings OK diff --git a/compiler/testData/cli/jvm/help.out b/compiler/testData/cli/jvm/help.out index 655702b591b..97a45be04d5 100644 --- a/compiler/testData/cli/jvm/help.out +++ b/compiler/testData/cli/jvm/help.out @@ -23,4 +23,5 @@ where possible options include: -nowarn Generate no warnings -verbose Enable verbose logging output -version Display compiler version + -Werror Report an error if there are any warnings OK diff --git a/compiler/testData/cli/jvm/werror.args b/compiler/testData/cli/jvm/werror.args new file mode 100644 index 00000000000..52c71c79b17 --- /dev/null +++ b/compiler/testData/cli/jvm/werror.args @@ -0,0 +1,4 @@ +$TESTDATA_DIR$/werror.kt +-d +$TEMP_DIR$ +-Werror diff --git a/compiler/testData/cli/jvm/werror.kt b/compiler/testData/cli/jvm/werror.kt new file mode 100644 index 00000000000..0baba9dabb1 --- /dev/null +++ b/compiler/testData/cli/jvm/werror.kt @@ -0,0 +1,4 @@ +fun foo(s: String, t: String?) { + s!! + t?.toString() +} diff --git a/compiler/testData/cli/jvm/werror.out b/compiler/testData/cli/jvm/werror.out new file mode 100644 index 00000000000..9f5f8640bf4 --- /dev/null +++ b/compiler/testData/cli/jvm/werror.out @@ -0,0 +1,5 @@ +error: warnings found and -Werror specified +compiler/testData/cli/jvm/werror.kt:2:6: warning: unnecessary non-null assertion (!!) on a non-null receiver of type String + s!! + ^ +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/werrorWithExplicitError.args b/compiler/testData/cli/jvm/werrorWithExplicitError.args new file mode 100644 index 00000000000..b462ded472b --- /dev/null +++ b/compiler/testData/cli/jvm/werrorWithExplicitError.args @@ -0,0 +1,4 @@ +$TESTDATA_DIR$/werrorWithExplicitError.kt +-d +$TEMP_DIR$ +-Werror diff --git a/compiler/testData/cli/jvm/werrorWithExplicitError.kt b/compiler/testData/cli/jvm/werrorWithExplicitError.kt new file mode 100644 index 00000000000..d5093edc3a4 --- /dev/null +++ b/compiler/testData/cli/jvm/werrorWithExplicitError.kt @@ -0,0 +1,5 @@ +fun foo(s: String, t: String?) { + s!! + t?.toString() + t.length +} diff --git a/compiler/testData/cli/jvm/werrorWithExplicitError.out b/compiler/testData/cli/jvm/werrorWithExplicitError.out new file mode 100644 index 00000000000..f6697cb02ef --- /dev/null +++ b/compiler/testData/cli/jvm/werrorWithExplicitError.out @@ -0,0 +1,4 @@ +compiler/testData/cli/jvm/werrorWithExplicitError.kt:4:6: error: only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String? + t.length + ^ +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/werrorWithNoWarn.args b/compiler/testData/cli/jvm/werrorWithNoWarn.args new file mode 100644 index 00000000000..470522b9102 --- /dev/null +++ b/compiler/testData/cli/jvm/werrorWithNoWarn.args @@ -0,0 +1,5 @@ +$TESTDATA_DIR$/werrorWithNoWarn.kt +-d +$TEMP_DIR$ +-Werror +-nowarn diff --git a/compiler/testData/cli/jvm/werrorWithNoWarn.kt b/compiler/testData/cli/jvm/werrorWithNoWarn.kt new file mode 100644 index 00000000000..0baba9dabb1 --- /dev/null +++ b/compiler/testData/cli/jvm/werrorWithNoWarn.kt @@ -0,0 +1,4 @@ +fun foo(s: String, t: String?) { + s!! + t?.toString() +} diff --git a/compiler/testData/cli/jvm/werrorWithNoWarn.out b/compiler/testData/cli/jvm/werrorWithNoWarn.out new file mode 100644 index 00000000000..6f4af1f1ec7 --- /dev/null +++ b/compiler/testData/cli/jvm/werrorWithNoWarn.out @@ -0,0 +1,5 @@ +error: warnings found and -Werror specified +compiler/testData/cli/jvm/werrorWithNoWarn.kt:2:6: warning: unnecessary non-null assertion (!!) on a non-null receiver of type String + s!! + ^ +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/werrorWithStrongWarning.args b/compiler/testData/cli/jvm/werrorWithStrongWarning.args new file mode 100644 index 00000000000..19e9c488012 --- /dev/null +++ b/compiler/testData/cli/jvm/werrorWithStrongWarning.args @@ -0,0 +1,6 @@ +$TESTDATA_DIR$/werrorWithStrongWarning.kt +-d +$TEMP_DIR$ +-Werror +-cp +non-existing-path.jar diff --git a/compiler/testData/cli/jvm/werrorWithStrongWarning.kt b/compiler/testData/cli/jvm/werrorWithStrongWarning.kt new file mode 100644 index 00000000000..0baba9dabb1 --- /dev/null +++ b/compiler/testData/cli/jvm/werrorWithStrongWarning.kt @@ -0,0 +1,4 @@ +fun foo(s: String, t: String?) { + s!! + t?.toString() +} diff --git a/compiler/testData/cli/jvm/werrorWithStrongWarning.out b/compiler/testData/cli/jvm/werrorWithStrongWarning.out new file mode 100644 index 00000000000..02ec28c5d8f --- /dev/null +++ b/compiler/testData/cli/jvm/werrorWithStrongWarning.out @@ -0,0 +1,3 @@ +warning: classpath entry points to a non-existent location: non-existing-path.jar +error: warnings found and -Werror specified +COMPILATION_ERROR diff --git a/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java index d9800ce5f9e..6f4b94d8e28 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -476,6 +476,30 @@ public class CliTestGenerated extends AbstractCliTest { doJvmTest(fileName); } + @TestMetadata("werror.args") + public void testWerror() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/werror.args"); + doJvmTest(fileName); + } + + @TestMetadata("werrorWithExplicitError.args") + public void testWerrorWithExplicitError() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/werrorWithExplicitError.args"); + doJvmTest(fileName); + } + + @TestMetadata("werrorWithNoWarn.args") + public void testWerrorWithNoWarn() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/werrorWithNoWarn.args"); + doJvmTest(fileName); + } + + @TestMetadata("werrorWithStrongWarning.args") + public void testWerrorWithStrongWarning() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/werrorWithStrongWarning.args"); + doJvmTest(fileName); + } + @TestMetadata("wrongAbiVersion.args") public void testWrongAbiVersion() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/wrongAbiVersion.args"); diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt index 1c597d47e1e..b3b3b1f585b 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt @@ -17,4 +17,10 @@ interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToo * Default value: null */ var languageVersion: kotlin.String? + + /** + * Report an error if there are any warnings + * Default value: false + */ + var warningsAsErrors: kotlin.Boolean } diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJsOptionsBase.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJsOptionsBase.kt index 164b75024b1..e197f1cb471 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJsOptionsBase.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJsOptionsBase.kt @@ -24,6 +24,11 @@ internal abstract class KotlinJsOptionsBase : org.jetbrains.kotlin.gradle.dsl.Ko get() = languageVersionField ?: null set(value) { languageVersionField = value } + private var warningsAsErrorsField: kotlin.Boolean? = null + override var warningsAsErrors: kotlin.Boolean + get() = warningsAsErrorsField ?: false + set(value) { warningsAsErrorsField = value } + private var friendModulesDisabledField: kotlin.Boolean? = null override var friendModulesDisabled: kotlin.Boolean get() = friendModulesDisabledField ?: false @@ -84,6 +89,7 @@ internal abstract class KotlinJsOptionsBase : org.jetbrains.kotlin.gradle.dsl.Ko verboseField?.let { args.verbose = it } apiVersionField?.let { args.apiVersion = it } languageVersionField?.let { args.languageVersion = it } + warningsAsErrorsField?.let { args.warningsAsErrors = it } friendModulesDisabledField?.let { args.friendModulesDisabled = it } mainField?.let { args.main = it } metaInfoField?.let { args.metaInfo = it } @@ -103,6 +109,7 @@ internal fun org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments.fil verbose = false apiVersion = null languageVersion = null + warningsAsErrors = false friendModulesDisabled = false main = "call" metaInfo = true diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptionsBase.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptionsBase.kt index 2d2c2143abd..5915ff71f3f 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptionsBase.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptionsBase.kt @@ -24,6 +24,11 @@ internal abstract class KotlinJvmOptionsBase : org.jetbrains.kotlin.gradle.dsl.K get() = languageVersionField ?: null set(value) { languageVersionField = value } + private var warningsAsErrorsField: kotlin.Boolean? = null + override var warningsAsErrors: kotlin.Boolean + get() = warningsAsErrorsField ?: false + set(value) { warningsAsErrorsField = value } + private var includeRuntimeField: kotlin.Boolean? = null override var includeRuntime: kotlin.Boolean get() = includeRuntimeField ?: false @@ -64,6 +69,7 @@ internal abstract class KotlinJvmOptionsBase : org.jetbrains.kotlin.gradle.dsl.K verboseField?.let { args.verbose = it } apiVersionField?.let { args.apiVersion = it } languageVersionField?.let { args.languageVersion = it } + warningsAsErrorsField?.let { args.warningsAsErrors = it } includeRuntimeField?.let { args.includeRuntime = it } javaParametersField?.let { args.javaParameters = it } jdkHomeField?.let { args.jdkHome = it } @@ -79,6 +85,7 @@ internal fun org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments.fi verbose = false apiVersion = null languageVersion = null + warningsAsErrors = false includeRuntime = false javaParameters = false jdkHome = null