Execute shell script in Gradle

前端 未结 6 439
北荒
北荒 2020-12-07 17:20

I have a gradle build setup at the beginning of which I want to execute a shellscript in a subdirectory that prepares my environment.

task build << {
         


        
6条回答
  •  猫巷女王i
    2020-12-07 18:19

    use

    commandLine 'sh', './myScript.sh'
    

    your script itself is not a program itself, that's why you have to declare 'sh' as the program and the path to your script as an argument.

提交回复
热议问题