Is it possible to chain tasks to run on a subproject on the command line without retyping the subproject name?

(Matt Bellinger) #1

For example, if I would like to run clean and then test on a subproject, the only way I know to do it is:

./gradlew :subProjectName:clean :subProjectName:test

Is there a shortcut way to do it without retyping the subproject name?

(Peter Niederwieser) #2

If you ‘cd’ into the subproject, you won’t have to qualify the task names.

(Matt Bellinger) #3

I forgot to mention I knew that method as well. The downside is that you lose the ease of just typing ./gradlew to run the gradle wrapper without aliasing it. If that is all there is, it will have to do. Thanks. :slight_smile:

(Peter Niederwieser) #4

The SpringSource folks wrote a small launcher script that searches upwards for ‘gradlew’ and then invokes it.