2

So I have a shell script ready to be ran by gradle. Problem is I don't know how to run the shell script.. I wish to run the script when my application is being built. This is first time messing with the build system.. I looked at creating a task but that doesn't seem to be invoked from the app/build.gradle file:

task runShellScript(type:Exec) {
doLast {
    println 'Shell Script finished'
}
executable './shell-script'
1

1 Answer 1

1

Create the task in build.gradle as:

task task_name(type: Exec) {
          commandLine './shell_script_name.sh'  
}

And run as:

gradle task_name
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.