Explicit Api mode: prototype with check for missing explicit visibility
Add cli flag with 3-state switch
This commit is contained in:
@@ -38,6 +38,10 @@ class AnalysisFlag<out T> internal constructor(
|
||||
operator fun provideDelegate(instance: Any?, property: KProperty<*>) = Delegate(property.name, JvmDefaultMode.DISABLE)
|
||||
}
|
||||
|
||||
object ApiModeDisabledByDefault {
|
||||
operator fun provideDelegate(instance: Any?, property: KProperty<*>) = Delegate(property.name, ApiMode.DISABLED)
|
||||
}
|
||||
|
||||
object ListOfStrings {
|
||||
operator fun provideDelegate(instance: Any?, property: KProperty<*>) = Delegate(property.name, emptyList<String>())
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010-2019 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.config
|
||||
|
||||
enum class ApiMode(val state: String) {
|
||||
DISABLED("disable"),
|
||||
ENABLED("enable"),
|
||||
MIGRATION("migration");
|
||||
|
||||
companion object {
|
||||
fun fromString(string: String): ApiMode? = values().find { it.state == string }
|
||||
|
||||
fun availableValues() = values().joinToString(prefix = "{", postfix = "}") { it.state }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user