Trying to work out how to specify a base gradle KTS file (for things like compile/min/target sdk etc) to be applied by each android library module. Is this still not possible? https://github.com/gradle/kotlin-dsl-samples/issues/1287
m
mbonnin
02/16/2020, 8:53 AM
Just don't use the generated accessors. replace
android {}
with
configure<BaseExtension>{}
mbonnin
02/16/2020, 10:05 AM
Ah no I missed that part:
Copy code
In other words they don't share the classpath of the plugins applied to the project build script, hence they cannot see com.android.*
mbonnin
02/16/2020, 10:06 AM
So it does look impossible indeed, sorry. It's more a limitation of gradle than kts though
m
Mark
02/16/2020, 10:07 AM
Thanks, yeah, I just found that out:
Unresolved reference: android
when trying to reference
com.android.build.gradle.BaseExtension
m
mbonnin
02/16/2020, 1:09 PM
I could really use some article/talk about how Gradle uses classloaders
mbonnin
02/16/2020, 1:09 PM
This whole part looks pretty complex
m
Mark
02/16/2020, 1:13 PM
For me, it has to be simple to implement/understand, otherwise better to stick with copy-paste!
t
tapchicoma
02/16/2020, 9:00 PM
I would advice you to put this shared logic inside