Mark obsolete Gradle JVM options as Deprecated with Error

Options `includeRuntime`, `noStdlib` and `noReflect` were affected
#Fixed KT-44361
This commit is contained in:
Yaroslav Chernyshev
2021-02-09 12:02:34 +03:00
parent 6eaf0a95ca
commit 17fc10a8af
4 changed files with 47 additions and 2 deletions
@@ -0,0 +1,13 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.cli.common.arguments
@Retention(AnnotationRetention.RUNTIME)
annotation class DeprecatedOption(
val message: String = "This option has no effect and will be removed in a future release.",
val removeAfter: String,
val level: DeprecationLevel
)
@@ -25,6 +25,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
description = "List of directories and JAR/ZIP archives to search for user class files")
var classpath: String? by NullableStringFreezableVar(null)
@DeprecatedOption(removeAfter = "1.5", level = DeprecationLevel.ERROR)
@GradleOption(DefaultValues.BooleanFalseDefault::class)
@Argument(value = "-include-runtime", description = "Include Kotlin runtime into the resulting JAR")
var includeRuntime: Boolean by FreezableVar(false)
@@ -41,10 +42,12 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
@Argument(value = "-no-jdk", description = "Don't automatically include the Java runtime into the classpath")
var noJdk: Boolean by FreezableVar(false)
@DeprecatedOption(removeAfter = "1.5", level = DeprecationLevel.ERROR)
@GradleOption(DefaultValues.BooleanTrueDefault::class)
@Argument(value = "-no-stdlib", description = "Don't automatically include the Kotlin/JVM stdlib and Kotlin reflection into the classpath")
var noStdlib: Boolean by FreezableVar(false)
@DeprecatedOption(removeAfter = "1.5", level = DeprecationLevel.ERROR)
@GradleOption(DefaultValues.BooleanTrueDefault::class)
@Argument(value = "-no-reflect", description = "Don't automatically include Kotlin reflection into the classpath")
var noReflect: Boolean by FreezableVar(false)