Is there a recommended way to disable platforms de...
# multiplatform
c
Is there a recommended way to disable platforms depending on your local environment? e.g. the Android library requires installing the Android SDK, which is painful for developers that only do CSS on the web platform.
b
If-else in plugins block and target declarations?
c
…I guess… it's going to make the build file really hard to read
it's already a pain to have to reconfigure everything about Android in all modules
b
Hide the complexity in convention plugin or buildSrc
c
Fair. I've heard about convention plugins but haven't had the time to put them in place
Is it possible for a plugin to depend on another one? E.g. to create a
conditional-android-library
plugin that adds the
android.library
if some environment variable is set, and does nothing otherwise?
b
Key things to note are symlinked gradle wrapper stuff, kotlin-dsl plugin application and included builds
c
So the main idea is that you create a
convention-<name>.gradle.kts
file that partially configures a build script, then you can just include it anywhere you want as a plugin?
b
Pretty much. Naming requirement is simply*.gradle.kts
I use convention prefix to help diferentiate them
c
And then it's just some Gradle configuration to make it work. Seems pretty nice indeed
b
But that's entirely optional
c
I'll probably end up moving all the Android conf in one of those to cleanup everything else, nice Is it possible for convention plugins to create their own configuration blocks?
It's just a different way of writing gradle plugins. You can do everything you could in a regular plugin.
c
I'm actually impressed I haven't heard more than their name so far, since they're so powerful
Thanks a lot, I'm going to jump on that
b
Enjoy!