ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: Command-line property overrides with 'location' semantics?
Date Thu, 15 Jan 2004 10:35:03 GMT
You are correct.
The "declaration" in the build script is ignored as the property has 
already been defined,
so it has "value" semantics.
Peter

Patrick Surry wrote:

> It seems like specifying a property at the command-line via -D always 
> uses 'value' semantics, even if the property is declared in the 
> project with 'location' semantics.  For example, on a windows machine 
> with this project:
>
> <?xml version="1.0"?>
> <project name="parameters" default="all" basedir=".">
>   <property name="foo" value="c:/some/filename.txt"/>
>   <property name="bar" location="c:/some/othername.txt"/>
>   <target name="all">
>     <echo message="foo = [${foo}] and bar = [${bar}]"/>
>   </target>
> </project>
>
> So plain 'ant' gives:
>
>     [echo] foo = [c:/some/filename.txt] and bar = [C:\some\othername.txt]
>
> but 'ant -Dbar=/a/b/c' gives:
>
>     [echo] foo = [c:/some/filename.txt] and bar = [/a/b/c]
>
> i.e. it's not converting bar as a location anymore.
>
> Is there any way around this other than re-converting the property in 
> the plan (ie. <property name="bar2" location="${bar}"/> ) ?
>
> Thanks,
> Patrick
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message