Command line option to set a property on a task


(Ramon Nogueira) #1

I’d like a command line option to set task properties. For example, I have a JavaExec task that runs my cucumber tests and I would like to sometimes run it with debug enabled. I expect to do something like: ./gradlew -o cucumber.debug=true cucumber Perhaps there is another way to accomplish this without having to modify the build.gradle every time I want to switch to debug and without adding complexity to my normal cucumber task?


(Peter Niederwieser) #2

There is no generic way to configure build model properties from the command line. Where necessary you’ll have to implement this in the build script or plugin, in one way or another (e.g. ‘myTask.myProperty = System.getProperty(“cucumberDebug”, false)’.