ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schmetzer <...@exubero.com>
Subject Re: Newbie question: importing properties from XML file via command line
Date Mon, 14 Sep 2009 20:41:51 GMT
2009/9/14 Scott Stark <sstark@us.ibm.com>:
> Joe wrote:
>> That's not correct: ant properties in the file are expanded inline.
>> See http://ant.apache.org/manual/CoreTasks/property.html for details
>> (I don't know about ${file.separator}, though)
>
> I see that in the documentation; however it's not working for me.
>
> My properties file:
> script_dir=C:\\working\\scripts;
> test_Dir=${script_dir}\\myDir
>
> My target:
> <target name="propstest">
>  <echo>script_dir property: ${script_dir}</echo>
>  <echo>test_Dir property: ${test_Dir}</echo>
> </target>
>
> My output (ant -f test.xml -propertfile test.properties propstest
>
> propstest:
>     [echo] script_Dir property: C:\working\scripts
>     [echo] test_Dir property: ${script_dir}\myDir
>
> Am I doing something wrong? This is on Windows XP by the way.

I was able to duplicate the same problem on Linux. I tried some
different combinations, and it appears that when you specify the
properties file on the command line, inline expansion of properties
does not occur. However, if you use <property file="test.properties"/>
inside the build.xml, inline expansion works as expected. I suspect
this is an oversight. (would anyone care to confirm?)

Regards,
Joe

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


Mime
View raw message