Wizard: add android extensions plugin only by flag
This commit is contained in:
+3
-1
@@ -69,7 +69,9 @@ interface AndroidModuleConfigurator : ModuleConfigurator,
|
||||
) = buildList<BuildSystemIR> {
|
||||
+GradleOnlyPluginByNameIR(reader.createAndroidPlugin(module).pluginName, priority = 1)
|
||||
|
||||
+GradleOnlyPluginByNameIR("kotlin-android-extensions", priority = 3)
|
||||
if (reader { AndroidPlugin.addAndroidExtensionPlugin.settingValue }) {
|
||||
+GradleOnlyPluginByNameIR("kotlin-android-extensions", priority = 3)
|
||||
}
|
||||
}
|
||||
|
||||
fun Reader.createAndroidPlugin(module: Module): AndroidGradlePlugin
|
||||
|
||||
+10
-1
@@ -22,7 +22,8 @@ class AndroidPlugin(context: Context) : Plugin(context) {
|
||||
override val path = pluginPath
|
||||
|
||||
override val settings: List<PluginSetting<*, *>> = listOf(
|
||||
androidSdkPath
|
||||
androidSdkPath,
|
||||
addAndroidExtensionPlugin,
|
||||
)
|
||||
override val pipelineTasks: List<PipelineTask> = listOf(
|
||||
addAndroidSdkToLocalProperties
|
||||
@@ -41,6 +42,14 @@ class AndroidPlugin(context: Context) : Plugin(context) {
|
||||
shouldExists()
|
||||
}
|
||||
|
||||
val addAndroidExtensionPlugin by booleanSetting(
|
||||
"<ADD_ANDROID_EXTENSIONS_PLUGIN>>",
|
||||
neededAtPhase = GenerationPhase.PROJECT_GENERATION,
|
||||
) {
|
||||
isAvailable = isAndroidContainingProject
|
||||
defaultValue = value(true)
|
||||
}
|
||||
|
||||
private val isAndroidContainingProject = checker {
|
||||
KotlinPlugin.modules.settingValue
|
||||
.withAllSubModules(includeSourcesets = true)
|
||||
|
||||
Reference in New Issue
Block a user