ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Manning <...@computer.org>
Subject Re: Passing property values with spaces to Ant
Date Tue, 07 Nov 2000 03:01:05 GMT
[Cyril Bouteille]
> I'm trying to pass a bunch of property values to Ant for dynamic
> variables in my build and I'm running into problems when these values
> contain spaces. For example, when passing a list of options as value of
> a property, Ant tries to interpret these options.
> 
> Here's a simple testcase:
> cyril@wyvern:~/p4/hotwire/2.0/build> ant -Dvar="-op1 -op2"
> Unknown arg: -op2
> cyril@wyvern:~/p4/hotwire/2.0/build> ant -Dvar='-op1 -op2'
> Unknown arg: -op2
> cyril@wyvern:~/p4/hotwire/2.0/build> ant -Dvar=-op1\ -op2 
> Unknown arg: -op2
> but nothing works...

In all of these cases, argv[1] will be -Dvar=-op1 -op2
so I'd probably give a double-wrapping trick a try:

ant '-Dvar="-op1 -op2"'

So argv[1] will now be -Dvar="-op1 -op2"

I have no idea if it will work
-- 
James Manning <jmm@computer.org>
GPG Key fingerprint = B913 2FBD 14A9 CE18 B2B7  9C8E A0BF B026 EEBB F6E4

Mime
View raw message