I’m writing a custom gradle plugin for gradle 4.5 via java and I having some troubles with command line parameters.
I having two tasks, where one depends from the other.
Both task should react for the same commandline option (–myparam) for that I created a parent class which extends from the DefaultTask.
@Option(option = "myparam", description = "Option to disable", order = 1) Boolean myparam = false; With setter and getter.
In the plugin Class I did the following:
Task taskA = project.getTasks().create(.....) Task taskB = project.getTasks().create(.....) taskB.dependsOn(taskA)
On the commandline I call
./gradlew taskA --myparam
I get the expected result, the value in the task is set
Same with calling ./gradlew taskB --myparam except the dependent taskA is called without the commandline value.
Can somebody point me in the right direction?
Thanks in advance.