ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Burgess, Benjamin" <BBurg...@tiaa-cref.org>
Subject RE: Combining static file with <echoproperties> results
Date Wed, 04 Jan 2006 15:10:33 GMT
Using Ant-Contrib (not recommended unless necessary) you can do it like
this:

		<propertyselector property="app.properties.list"
			delimiter=","
			match="app\.(.*)"
			select="\1"/>
		
		<for list="${app.properties.list}" param="prop">
			<sequential>
				<propertycopy property="@{prop}.value"
from="app.@{prop}"/>
				<propertyfile
file="${class.dir}/app.properties">
					<entry key="@{prop}"
value="${@{prop}.value}"/>
				</propertyfile>
			</sequential>
		</for>

Ben

-----Original Message-----
From: Scott Sauyet [mailto:lists@sauyet.com] 
Sent: Tuesday, January 03, 2006 4:45 PM
To: user@ant.apache.org
Subject: Combining static file with <echoproperties> results

I asked a question yesterday with too much of a preconceived idea of the

solution (http://tinyurl.com/cqqw3) and I'd like to try again in a more 
general fashion.

Can anyone suggest a way of combining the information from one file with

the results of an <echoproperties> that doesn't involve a temporary 
file.  I'm doing it now using one, but that grates on me, and I feel 
there must be a simple way of doing so.

Currently I'm doing it like this:

     <target name="build-app-properties" depends="init">
         <echoproperties destfile="${temp.properties}">
             <propertyset>
                 <propertyref prefix="app."/>
                 <mapper type="glob" from="app.*" to="*"/>
             </propertyset>
         </echoproperties>
     </target>

     <target name="compile" depends="build-app-properties">
         <javac .../>
         <concat destfile="${class.dir}/app.properties" >
             <fileset file="${application.properties.file}"/>
             <fileset file="${temp.properties}"/>
         </concat>
         <delete file="${temp.properties}"/>
     </target>

Thanks,

   -- Scott


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



**************************************************************
This message, including any attachments, contains confidential information intended for a
specific individual and purpose, and is protected by law.  If you are not the intended recipient,
please contact sender immediately by reply e-mail and destroy all copies.  You are hereby
notified that any disclosure, copying, or distribution of this message, or the taking of any
action based on it, is strictly prohibited.
TIAA-CREF
**************************************************************


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


Mime
View raw message