Is it possible to set/override plugin configuration from a command line?


(Marcin Zajączkowski) #1

I would like to be able to set (or override) a specific configuration property for a plugin. For example:

pitest {
    threads = 2
    ...
}

and with something like:

gradle pitest -Pplugins.pitest.threads=4

change a number of used threads for this specific run.

Is there available a mechanism similar to http://gradle.org/docs/current/userguide/tutorial_this_and_that.html#sec:gradle_properties_and_system_properties which would allow to do it without manual parsing parameters passed to Gradle with -P?


(Peter Niederwieser) #2

No, there isn’t currently such a mechanism. We certainly want to offer this at some point, but it’s surprisingly difficult to implement well.


(Marcin Zajączkowski) #3

Digging it out. Is is currently possible in Gradle?

I found it very useful to have different behavior on a developer station and CI server and keeping locally uncommitted files is asking for trouble (while using a gradle relase plugin even harder). Writing custom logic in a plugin to check available properties doesn’t sound good, especially in a case I would have to convince other plugin’s author to do that :).