ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Pelz Sherman <mpelzsher...@yahoo.com>
Subject Re: inline property expansion not working as advertised
Date Mon, 14 Jan 2008 17:30:23 GMT
Thanks, but this is kind of ugly.

Turns out there is a bug open for this:

(http://issues.apache.org/bugzilla/show_bug.cgi?id=18732)

... but it's listed as an "enhancement".

IMHO this is more than an "enhancement".

At the very least, the Ant documentation should mention that in-line property expansion does
not work when -propertyfile is used.

David Weintraub <qazwart@gmail.com> wrote: There's a way around this. Do this to use
your property file:




This overrides the setting of the "property.file" property inside your
build.xml file, and gets its property values via the file
alt.properties instead of test.properties.

I'll have to play around with the -propertyfile parameter and see why
it might not have worked for you. I've never used that command line
parameter before, so maybe it simply doesn't work.

On Jan 11, 2008 10:14 AM, Michael Pelz Sherman  wrote:
> You're right - adding the following line to build build.xml did the trick:
>
>           

>
>   So why doesn't it work with -propertyfile? I want to be able to specify different property
files on the cmd line, and I was hoping to take advantage of this feature.
>
> Chuck Holzwarth  wrote:
>   You have to import the property file or declare the properties in the build file.
>
> Thank you,
> Chuck Holzwarth
> (804) 403-3478 (home)
> (540) 335-3171 (cell)
>
> ----- Original Message ----
> From: Michael Pelz Sherman
> To: Ant Users List
> Sent: Thursday, January 10, 2008 5:52:27 PM
> Subject: inline property expansion not working as advertised
>
>
> From the Property task docs
> (http://ant.apache.org/manual/CoreTasks/property.html)
>
> ================================
> In-file property expansion is very cool. Learn to use it.
> Example:
>
> build.compiler=jikes
> deploy.server=lucky
> deploy.port=8080
> deploy.url=http://${deploy.server}:${deploy.port}/
> ================================
>
> So I created a properties file with the above
> and the following build.xml file:
>
> ==================================
>
>
>
>
> deploy.url is ${deploy.url}
>
>
>
>
> ==================================
>
> The I ran it as follows:
>
> $ ant -propertyfile test.properties
>
> Here is the output:
>
> ==================================
> Buildfile: build.xml
>
> test:
> [echo] deploy.url is http://${deploy.server}:${deploy.port}/
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
> ==================================
> I'm using ant 7.0.
>
> What am I doing wrong?
>
> Thanks,
> - mps
>
>
>
>
>
>
>
>
>
> ____________________________________________________________________________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>



-- 
--
David Weintraub
qazwart@gmail.com

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





Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message