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 Fri, 11 Sep 2009 21:09:02 GMT
2009/9/11 Scott Stark <sstark@us.ibm.com>:
>> Any particular reason you're not using a plain old properties file?
>
> Also I've noticed you can't "inherit" properties in a properties file. For
> example, this doesn't work:
>
> projectRoot=C:\\working
> documentSource=${projectRoot}\\documents
>
> And you can't even use ${file.separator}...
>
> Scott
>

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)

The import tag can use property expansion too. If you don't want to
hard-wire the file you import, you can use a propery. e.g.

ant -Dimport-file=test.xml

<project>
     <import file="${import-file}"/>
     ...

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