Search code examples
androidandroid-studiogradlegradlew

How to run 2 tasks from command line with gradlew


Given a gradle wrapper (gradlew) from Android Studio distribution, is it possible to run two tasks with it within one command invocation? For example, right now I have to do the following:

./gradlew task1
./gradlew task2

Is it possible to invoke ./gradlew only once, while executing both tasks?

Please note, that I do not want to make task2 depend on task1.


Solution

  • That's an easy one:

    ./gradlew task1 task2
    

    Such as:

    ./gradlew clean assembleDebug