How to get which tasks are passed via command line?


(Maciek Opała) #1

Hi, Is there any way to get tasks that were passed for execution via command line from ‘project’ instance? I know that there’s a whole bunch of listeners, but they’re all executed too late. I need to know what tasks were entered at applying plugin time.


How to get which tasks are passed via command line? (continued)
(René Groeschke) #2

Hello,

this should do the trick:

project.gradle.startParameter.taskNames

gives you a List that contains the task names you passed in via commandline.

cheers, René


(Maciek Opała) #3

Awesome! Thanks!