adding script to build.gradle


Question

I have a build.gradle file. I need to add a code that executes a python script which I have written. Can anyone tell me how to do it? The build.gradle is written in groovy . So, please ask more questions if you feel my question is not sufficient.

1
18
10/12/2018 4:00:35 PM

Accepted Answer

Take a look at the Exec task. It can be used for running command line processes.

You could create a task like:

task runPython(type:Exec) {
   workingDir 'path_to_script'

   commandLine 'python', 'my_script.py'
} 
35
8/1/2012 9:39:13 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon