Neo
(C.M.T)
October 25, 2022, 12:15pm
1
Dear Sir
The Android project has buildtype(rlease/debug ) & Productflavor (dev/stage/prod)
like this
i found https://stackoverflow.com/ & gradle doc
get those ref :
https://docs.gradle.org/current/userguide/variant_model.html
the post at stackoverflow is too old ,can not use over gradle 6.X.X
so i ref gradle doc to create a demo
But something is wrong !!
as image
i set two variant ( dev/actuator ) and put differnet spring controller class at their sourcesets
but when generate jar/bootjar
can not select taget variant
the jar file only include main sourceset , the class of variants (dev/actuator ) lost
can help me understand & fix it ?
THX
Vampire
(Björn Kautler)
October 25, 2022, 3:31pm
2
Those are feature variants for libraries.
So you make library A with feature variant X, Y, and Z.
And then you develop application B where you say I want features X and Y of A.
They are not feature variants the spring boot plugin would handle.
Or at least I’d wonder if it does.
Neo
(C.M.T)
October 25, 2022, 3:50pm
3
Dear Sir
the gradle variant is for libray not for application ?
so it is differnet Andoid gradle Plugin ( andorid application & andorid library all can use buildtype & Productflavor ) ?
can not use in application
THX
Vampire
(Björn Kautler)
October 26, 2022, 1:13pm
4
Yes, exactly. The AGP buildtypes and flavors have nothing to do with feature variants, but are a completely separate approach exclusive to the AGP.