ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Sauyet <li...@sauyet.com>
Subject Using Filterchains in place of a temporary file
Date Mon, 02 Jan 2006 22:01:52 GMT
I'm wondering if I can use Filterchains in place of a temporary file.  I 
don't have my head quite wrapped around filterchains, I guess, and I 
don't know if what I'm trying to do even makes sense, never mind whether 
it's possible.

I have an application property file that is partly static, partly 
generated during the build.  All build properties that start "app." are 
stripped of this prefix and copied to the output file.  I use 
<echoproperties> with a propertyset that has a prefix and a mapper to 
create a temporary file, then <concat> to combine this with the static 
stuff.  I'm bothered by creating and deleting this temporary file and 
was wondering if there is some way to do this with FilterChains inside 
the concat, skipping the temporary file.  I'd also like to hear of any 
other simple way of doing this.

Any suggestions are more than welcome.

Thanks,

   -- Scott

     <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="init, build-app-properties">
         <javac srcdir="${java.src.dir}" destdir="${class.dir}">
             <classpath refid="build.classpath"/>
         </javac>
         <concat destfile="${class.dir}/app.properties" >
             <fileset file="${application.properties.file}"/>
             <fileset file="${temp.properties}"/>
         </concat>
         <delete file="${temp.properties}"/>
     </target>



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


Mime
View raw message