ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34144] New: - properties are not expanded when using -propertyfile
Date Wed, 23 Mar 2005 10:26:28 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34144>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34144

           Summary: properties are not expanded when using -propertyfile
           Product: Ant
           Version: 1.6.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: whaefelinger@epo.org


Property expansion takes place when using <property> tag. Property expansion
does NOT take place using command line option -propertyfile. This problem has
been reported, amongst other things, as bug #18732. Comments added to #18732
indicate that this anoying behaviour of ANT is not a bug but a feature. 

FEATURE ENHANCEMENT REQUEST:
ANT's behaviour regarding expansion of properties should be 
 a. clearly documented
 b. consistent

EXAMPLE:
== build.xml ==
<project [..] default="default">
 <property file="${config}"/>
 <target name="default"><echo>src.dir=${src.dir}</echo></target>
</project>

== build.properties ==
root.dir = .
src.dir  = ${root.dir}/src

Here are three example session to demonstrate how ANT behaves now. I simplified
the output a bit:

$ ant 
src.dir=${src.dir}          # expected output 

$ ant -propertyfile build.properties
src.dir=${root.dir}/src     # unexpected, root.dir has not been expanded.

$ ant -Dconfig=build.properties
src.dir=./src               # expansion takes place when using property tag.

Just to clarify. This is how ANT  s h o u l d   behave:

$ ant -propertyfile build.properties
src.dir=./src

This should also work (of course):
$ ant -Droot.dir=. -Dsrc.dir=${root.dir}/src     # Footnote 1.
src.dir=./src

 
Footnotes:
1. The example shown assumes that no shell variable expansion takes
    place. Windows user may safely ignore this remark.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message