Calling a task with parameters from the shell !

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling a task with parameters from the shell !

uthere
This post has NOT been accepted by the mailing list yet.
Hello all, I'm new to gradle, can you plz tell me how to call a gradle task with arguments from the shell.

Exemple :
How to create a task that copy files from FolderA to FolderB ?

I want to use a shell command like this : gradle copy FolderA FolderB

build.gradle contain something like that :
task copy (I dont know what to put here){
    def a = FolderA
    def b = FolderB
    copy {
        from a
        into b
      }

Help me plz, and thx so much
Reply | Threaded
Open this post in threaded view
|

Re: Calling a task with parameters from the shell !

ppstay
This post has NOT been accepted by the mailing list yet.
I think gradle doesn't take parameter directly. You could use environment variables to carry parameters.

to get the environment variable:

System.getenv()['PARAM_NAME']