On 08/03/2012 22:26, Rene Groeschke wrote:
Hello Glen,
sorry for the late reply. You can pass properties from the commandLine to your
run task by
using a bit groovy:
You can dynamically add args to the run task:
----------------
run{
if(project.hasProperty("appProp")){
args appProp
}
}
----------------
this checks if a property named "appProp" is defined. If true, it passes the
property to
the arg method of the run task.
Now you can run your app via gradle from the commandline:
----------
gradle run -PappProp=test
----------
That's the detailed version of what I wrote, but as I said, it isn't very practical if you
want several parameters, some being quoted (eg. a path), and so on.
I would prefer to have something like:
gradle run --someGradleOption -R -o "C:/Foo ark/bar.x" -v 5
for example, where after the -R, Gradle doesn't see the parameters as being for itself but
pass them (properly parsed according to the underlying system) to the executed task.
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email