Bug 8972 - allow property expansion in <filterset> property values
Summary: allow property expansion in <filterset> property values
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.4.1
Hardware: Other other
: P3 enhancement with 5 votes (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords: PatchAvailable
: 18253 25988 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-10 10:54 UTC by Leon J. Breedt
Modified: 2009-07-31 03:56 UTC (History)
2 users (show)



Attachments
An ancient hack I've used to work around this limitation. (5.83 KB, text/plain)
2002-05-29 08:07 UTC, Jani Kaarela
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leon J. Breedt 2002-05-10 10:54:25 UTC
i currently have one set of properties for my build system, and these are 
loaded using <property file="xxx.properties"/>. they contain embedded 
references to other properties using ${} syntax. this works fine in general use 
in my build file, however, when i want to use these same properties for a 
filtercopy, the ${} variables are not expanded in the output files.

i can't do a <replace> since i may not know which properties were used as 
@name@ tokens in the file, and i don't want to hardcode the list of properties 
to replace.

i don't see how the <expandproperties> feature of <filterchain> of 1.5 helps me 
in this case, so i would request that the ability be added to the <filterset> 
and the <replace> task to expand the values of properties contained in the 
property files they load.
Comment 1 Leon J. Breedt 2002-05-10 10:56:11 UTC
the version missing this functionality is 1.4.1, and reading the 1.5 docs on 
<filterchain> did not provide any obvious solutions to this problem in 1.5.
Comment 2 Jani Kaarela 2002-05-29 08:07:41 UTC
Created attachment 1964 [details]
An ancient hack I've used to work around this limitation.
Comment 3 Jani Kaarela 2002-05-29 08:15:58 UTC
I've faced the same problem and modifier Filter to do the trick. In 1.5 I'm 
using ExpandProperties filter with an added "prefix" attribute to limit which 
properties get expanded - otherwise system properties such as ${java.home} would 
get replaced by the ${java.home} of the build platform instead of being resolved 
at runtime on the running platform!

I've submitted a request for enhancement with a diff included, see bug #9481.

Hmm. Maybe ReplaceTokens should support a filterfile and something like 
expand="true|false" to control property expansion?
Comment 4 Stefan Bodewig 2003-03-24 09:20:30 UTC
*** Bug 18253 has been marked as a duplicate of this bug. ***
Comment 5 Stefan Bodewig 2009-07-31 03:56:07 UTC
*** Bug 25988 has been marked as a duplicate of this bug. ***