In my app, I have more than 30 build variants. Every time when I release the app, I need to publish it to different platforms, therefore I build 5 different build variants.
Currently, I am doing this:
- switch to build variant A
- wait for the Gradle build
- build APK/Bundle of build variant A
- the same steps for B, C, E, and D.
What I am looking for is a Gradle task that just builds me these specific build variants when I run it. I know there is a task to build all build variants but it is too much for me.
I searched SO but couldn't find anything related to a point that I started to think it is impossible.
Could someone point me in the right direction? Thanks.

Calling a gradle task from another gradle task is not the best idea. You should rather describe their relationship as it usually works with all other gradle parts - by using
mustRunAfter,dependsOnand so on. For your purposes you can useGradleBuild. I think you're searching for this - if I got your point right :DI would assume that your task will look something like that (add your flavours instead of mine mocked)