Move JVM-specific analysis flags to 'config.jvm'
This commit is contained in:
committed by
Alexander Udalov
parent
7bb77e5672
commit
db9347cb56
@@ -5,15 +5,18 @@
|
||||
|
||||
package org.jetbrains.kotlin.config
|
||||
|
||||
import org.jetbrains.kotlin.utils.Jsr305State
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
object JvmAnalysisFlags {
|
||||
@JvmStatic
|
||||
val strictMetadataVersionSemantics by AnalysisFlag.Delegates.Boolean
|
||||
|
||||
@JvmStatic
|
||||
val jsr305 by AnalysisFlag.Delegates.Jsr305StateWarnByDefault
|
||||
val jsr305 by Delegates.Jsr305StateWarnByDefault
|
||||
|
||||
@JvmStatic
|
||||
val jvmDefaultMode by AnalysisFlag.Delegates.JvmDefaultModeDisabledByDefault
|
||||
val jvmDefaultMode by Delegates.JvmDefaultModeDisabledByDefault
|
||||
|
||||
@JvmStatic
|
||||
val inheritMultifileParts by AnalysisFlag.Delegates.Boolean
|
||||
@@ -26,4 +29,16 @@ object JvmAnalysisFlags {
|
||||
|
||||
@JvmStatic
|
||||
val irCheckLocalNames by AnalysisFlag.Delegates.Boolean
|
||||
|
||||
private object Delegates {
|
||||
object Jsr305StateWarnByDefault {
|
||||
operator fun provideDelegate(instance: Any?, property: KProperty<*>): AnalysisFlag.Delegate<Jsr305State> =
|
||||
AnalysisFlag.Delegate(property.name, Jsr305State.DEFAULT)
|
||||
}
|
||||
|
||||
object JvmDefaultModeDisabledByDefault {
|
||||
operator fun provideDelegate(instance: Any?, property: KProperty<*>): AnalysisFlag.Delegate<JvmDefaultMode> =
|
||||
AnalysisFlag.Delegate(property.name, JvmDefaultMode.DISABLE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,4 +23,4 @@ enum class JvmDefaultMode(val description: String) {
|
||||
@JvmStatic
|
||||
fun fromStringOrNull(string: String?) = values().find { it.description == string }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.config
|
||||
|
||||
import org.jetbrains.kotlin.utils.Jsr305State
|
||||
import kotlin.properties.ReadOnlyProperty
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
@@ -30,14 +29,6 @@ class AnalysisFlag<out T> internal constructor(
|
||||
operator fun provideDelegate(instance: Any?, property: KProperty<*>) = Delegate(property.name, false)
|
||||
}
|
||||
|
||||
object Jsr305StateWarnByDefault {
|
||||
operator fun provideDelegate(instance: Any?, property: KProperty<*>) = Delegate(property.name, Jsr305State.DEFAULT)
|
||||
}
|
||||
|
||||
object JvmDefaultModeDisabledByDefault {
|
||||
operator fun provideDelegate(instance: Any?, property: KProperty<*>) = Delegate(property.name, JvmDefaultMode.DISABLE)
|
||||
}
|
||||
|
||||
object ApiModeDisabledByDefault {
|
||||
operator fun provideDelegate(instance: Any?, property: KProperty<*>) = Delegate(property.name, ExplicitApiMode.DISABLED)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user