Fix explicitApiMode could be overwritten by freeCompilerArgs

Now tasks has a separate task input for 'explicitApiMode' which is
passed to Kotlin compiler via arg, rather than free compiler args.

^KT-57653 Fixed
This commit is contained in:
Yahor Berdnikau
2023-05-04 22:38:04 +02:00
committed by Space Team
parent d3043b6f1c
commit 2ea65bd658
15 changed files with 198 additions and 53 deletions
@@ -34,7 +34,10 @@ interface KotlinTopLevelExtensionConfig {
/**
* Different modes that can be used to set the level of issue reporting for [KotlinTopLevelExtensionConfig.explicitApi] option.
*/
enum class ExplicitApiMode(val cliOption: String) {
enum class ExplicitApiMode(
@Deprecated("Should not be exposed in api", level = DeprecationLevel.ERROR)
val cliOption: String
) {
/** Report issues as errors. */
Strict("strict"),
@@ -44,5 +47,7 @@ enum class ExplicitApiMode(val cliOption: String) {
/** Disable issues reporting. */
Disabled("disable");
@Deprecated("Should not be exposed in api", level = DeprecationLevel.ERROR)
@Suppress("DEPRECATION_ERROR")
fun toCompilerArg() = "-Xexplicit-api=$cliOption"
}