NoArg: Do not invoke initializers by default. Require "invokeInitializers" option to be set explicitly (KT-18667, KT-18668)
This commit is contained in:
committed by
Yan Zhulanow
parent
a983137978
commit
b99007961f
+2
@@ -20,6 +20,8 @@ open class NoArgExtension {
|
||||
internal val myAnnotations = mutableListOf<String>()
|
||||
internal val myPresets = mutableListOf<String>()
|
||||
|
||||
open var invokeInitializers: Boolean = false
|
||||
|
||||
open fun annotation(fqName: String) {
|
||||
myAnnotations.add(fqName)
|
||||
}
|
||||
|
||||
+5
@@ -71,6 +71,7 @@ class NoArgKotlinGradleSubplugin : KotlinGradleSubplugin<AbstractCompile> {
|
||||
|
||||
private val ANNOTATION_ARG_NAME = "annotation"
|
||||
private val PRESET_ARG_NAME = "preset"
|
||||
private val INVOKE_INITIALIZERS_ARG_NAME = "invokeInitializers"
|
||||
}
|
||||
|
||||
override fun isApplicable(project: Project, task: AbstractCompile) = NoArgGradleSubplugin.isEnabled(project)
|
||||
@@ -96,6 +97,10 @@ class NoArgKotlinGradleSubplugin : KotlinGradleSubplugin<AbstractCompile> {
|
||||
options += SubpluginOption(PRESET_ARG_NAME, preset)
|
||||
}
|
||||
|
||||
if (noArgExtension.invokeInitializers) {
|
||||
options += SubpluginOption(INVOKE_INITIALIZERS_ARG_NAME, "true")
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user