How to get which tasks are passed via command line? (continued)


(Róbert Papp) #1

@Rene How to get which tasks are passed via command line? gives a good example, but it doesn’t work if shortcuts are used, i.e. gradlew aD to call assembleDebug. Is there a way to get the resolved ones? In case of aD it actually resolves to :app:assembleDebug in a common Android project.


(Róbert Papp) #2

Example use case:

// if this is the only task being requested by the user, fail the build on failures
task.ignoreFailures = task.project.gradle.startParameter.taskNames != [ task.path ]