ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: How do I load a wilcard properties file?
Date Thu, 23 May 2002 20:26:56 GMT
Works with <fileset> out of the box with 1.4.1 I believe, but you can prove
me wrong ;-) --DD

-----Original Message-----
From: Sayatovic, Brian [mailto:Brian.Sayatovic@divine.com] 
Sent: Thursday, May 23, 2002 3:23 PM
To: Ant Users List
Subject: RE: How do I load a wilcard properties file?

I tried htis, and it works, with one alteration:

	<path id="version">
		<fileset dir="${build.dir}" includes="*.version"/>
	</path>
	<property name="version.file" refid="version"/>
	<property file="${version.file}"/>

The refid on a fileset returned a raw .toString() on it which is not useful.
Only "PATH like elements" are usefil in properties (at least in Ant 1.4)

Regards,
Brian.

-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com]
Sent: Thursday, May 23, 2002 4:11 PM
To: 'Ant Users List'
Subject: RE: How do I load a wilcard properties file?


If has you say, the file is unique where you look for it, define a <fileset>
that finds it, then convert that <fileset> to a <property>. Then use that
property in property file...

<fileset id=" propfile " dir="somedir" includes="**/*version.properties" />
<property name="propfile" refid="propfile" />
<property file="${propfile}" />

If the fileset picks up more that one file, or none, it will likely crap
out. --DD

-----Original Message-----
From: Sayatovic, Brian [mailto:Brian.Sayatovic@divine.com] 
Sent: Thursday, May 23, 2002 3:01 PM
To: Ant Users List (E-mail)
Subject: How do I load a wilcard properties file?

I have a properties file that will be of the form "*version.properties".
How can I load properties form this file into Ant?  I don't know what the
prefix will be and there *should* only be one instance of that file in the
directory I want to search.  I just don't know the entire name of the file
is going to be.

As near as I can, the "roperty" task expects a full filename, not a
wildcard.

Regards,
Brian.

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

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


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

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


Mime
View raw message