Mikhail
Mikhail

Reputation: 3746

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.

Upvotes: 6

Views: 8933

Answers (2)

artonbej
artonbej

Reputation: 287

This is how i clean, run tests and build releases for all variants for a module.

./gradlew clean modulename:connectedAndroidTest assembleRelease

Upvotes: 2

user2984747
user2984747

Reputation:

That's an easy one:

./gradlew task1 task2

Such as:

./gradlew clean assembleDebug

Upvotes: 27

Related Questions