I’m using Gradle library features to create different flavours of my dependency. My goal is to have different variants of the dependency so I can map them to Build Flavours in Android.
I have stage and production source sets and I’m registering them like below:
When I publish them using Maven Publish plugin, they are all published together.
Is there a way to publish a single capability, production?
Also, if there is a better approach to map Java only modules to Android build flavours, please let me know.
Not that I’m aware of.
You can publish publications individually.
But the feature variants are part of one publication and listed together in the Gradle Module Metadata.
Usually it does not make sense to only publish some.
You probably need to make the register call conditional is you really want to do that.
Ah, for Android libraries it does, yes.
But OP explicitly said it is about a pure Java library, not an Android library.
For a Java library it would probably need a feature request or pull request first.