Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass parameter to gradle Exec task

Tags:

android

gradle

I have defined a simple Gradle task of type Exec and I'm trying to pass a parameter to that task when calling it from another task.

How does one do that ?

like image 793
slott Avatar asked Sep 17 '26 18:09

slott


1 Answers

It isn't possible to call a task from another task. Instead, declare two tasks and make one depend on the other. (Calling the internal task.execute() method is unsupported, and its behavior is undefined.) For cases where having a second task isn't feasible, there is a project.exec {} method, which has exactly the same API as the task.

like image 60
Peter Niederwieser Avatar answered Sep 19 '26 10:09

Peter Niederwieser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!