adding script to build.gradle

17,585

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'
} 
Share:
17,585
Curious Guy 007
Author by

Curious Guy 007

Updated on June 14, 2022

Comments

  • Curious Guy 007
    Curious Guy 007 almost 2 years

    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.