Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19888

How to wrap an existing Gradle task with parameters into a custom task?

$
0
0

I am trying to create a custom task which invokes an existing task with parameters which are specific to my project. Here is how I invoke the task from the command line:

./gradlew downloadJson -Pendpoint=http://example.com/foo -Pdestination=src/main/com/example/foo.json

I would like to create a downloadFoo task which I can invoke without specifying the parameters explicitely.

tasks.register("downloadFoo" /* type needed? */) {
    // What goes here?
}

Viewing all articles
Browse latest Browse all 19888

Trending Articles