Split Gradle arguments on comma vs. spaces

Prior to this commit, Gradle was configured to take a -Pargs property
and split the value on whitespace, passing the result to the Gradle
application plugin's 'args' property, for example:

    gradle run -Pargs="--id=foo --ip=1.1.1.1 --port=10001"

While this approach works fine when passing a single argument (i.e. when
no space delimiters are required), when multiple arguments are passed,
such as in the example above, it would result in the following error
from Gradle's own command line parser:

    Unknown command-line option '--ip'

This commit simply splits the value of -Pargs on commas rather than
spaces, meaning that now multiple -Pargs values should be supplied as
follows:

    gradle run -Pargs="--id=foo,--ip=1.1.1.1,--port=10001"

Resolves #264
This commit is contained in:
Chris Beams 2014-11-09 23:00:21 +01:00
parent c12b94b7c2
commit dfbe6973e7
No known key found for this signature in database
GPG key ID: 3D214F8F5BC5ED73

View file

@ -21,7 +21,7 @@ mainClassName = "io.bitsquare.app.gui.Main"
run { run {
if (project.hasProperty('args')) { if (project.hasProperty('args')) {
args project.args.split('\\s+') args project.args.split(',')
} }
} }