How to use shell script functionalities in gradle

(Rajendra Rawat) #1

Hi Team,

I did not find enaugh information on how to use shell script funtionalities with gradle.
could you please help me provide some tutorials, links etc.

(Mark Vieira) #2

I believe what you’re looking for is the Exec task.

(Rajendra Rawat) #3

Thanks Mark. This is what I was looking for.
I have passes single parameter using ‘args’ option but could not get success on it passing two or more parameter.
Please suggest how to pass more than one parameter using this Exec command.

(Mark Vieira) #4

The args() and commandLine() methods accept a variable number of strings.

task listProcesses(type: Exec) {
    commandLine 'ps', '-e', '-x'