Sanendak
05/07/2022, 6:11 PMSanendak
05/07/2022, 6:12 PM/**
* Configures the [android][com.android.build.gradle.internal.dsl.BaseAppModuleExtension] extension.
*/
fun org.gradle.api.Project.`android`(configure: Action<com.android.build.gradle.internal.dsl.BaseAppModuleExtension>): Unit =
(this as org.gradle.api.plugins.ExtensionAware).extensions.configure("android", configure)
I’m talking about this extSanendak
05/07/2022, 6:14 PMVampire
05/07/2022, 9:09 PMSanendak
05/09/2022, 4:38 PM.gradle.kts
) to a Kotlin Plugin (.kt
). And everything works. Thanks @handstandsam for example!handstandsam
05/09/2022, 5:16 PMSanendak
05/09/2022, 5:28 PMhandstandsam
05/09/2022, 5:30 PMSanendak
05/09/2022, 5:34 PMVampire
05/09/2022, 5:50 PM*.gradle.kts
and you have to apply the Android plugin from its plugins
block to get the accessors generated. But I thought you use binary plugins coming from *.kt
files now.Vampire
05/09/2022, 5:55 PMSanendak
05/09/2022, 6:15 PM.gradle.kts
with android
block (screenshot). Now i’m switched to .kt and using project.extensions.getByName("android")
.
I hope that now I was able to correctly explain the problem 😉Vampire
05/09/2022, 7:17 PMandroid
block if you apply the corresponding Android plugin in the plugins { ... }
block of the same precompiled script plugin.
Getting the extension by Type or by name always works in both, precompiled script plugins, binary plugins, and everywhere else.