1

I have 3 different build variant in my java gradle project. alpha, beta, gamma. I have to print the names of all the build variants available from a gradle task. can someone please show a sample gradle task for the same?

TIA!

Sandesh Baliga
  • 579
  • 5
  • 20
  • 1
    Does this answer your question? [How to list all flavors in buildConfig via gradle in Android](https://stackoverflow.com/questions/35478189/how-to-list-all-flavors-in-buildconfig-via-gradle-in-android) – Jake Lee Apr 05 '21 at 20:49
  • Hey Jake, thanks for answering.. The answer above lists all the product flavors. I actually need the build variants. (product flavor + build type) combinations – Sandesh Baliga Apr 06 '21 at 06:29
  • You can try with "./gradlew sourceSets". But i think it shows you a bit more data than you would need – Septimiu Apr 06 '21 at 07:56
  • @SandeshBaliga Sorry I should have mentioned, some of the answers handle all the build variants, then filter (which you won't need to do) e.g. https://stackoverflow.com/a/60209108/608312 – Jake Lee Apr 06 '21 at 13:31

1 Answers1

0

./gradlew outgoingVariants

this works on gradle 7.5.1

John Caron
  • 1,367
  • 1
  • 10
  • 15