ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Ashby <ant-u...@cashby.me.uk>
Subject Re: Mapping properties before filtering
Date Wed, 18 Aug 2004 12:17:51 GMT
Just to slightly redefine the problem:

> 	I want to setup a FilterSet from a user configuration properties file.
>
<snip>
>
> 	Am I missing a cleaner solution, or is this about the only way to
> achieve this aim?

	Basically the <FileSet> needs to be able to contain a <PropertySet>; I've 
done the conversion as below:

    <!-- Get tokens as a propertyset -->
    <propertyset id="deploy.tokens">
        <propertyref prefix="token." />
        <mapper type="glob" from="token.*" to="*" />
    </propertyset>
    <!-- Get server-specific tokens as a propertyset -->
    <propertyset id="server.deploy.tokens">
        <propertyref prefix="${server.type}.token." />
        <mapper type="glob" from="${server.type}.token.*" to="*" />
    </propertyset>

    <echoproperties>
        <propertyset refid="deploy.tokens"/>
        <propertyset refid="server.deploy.tokens"/>
    </echoproperties>

	And therefore have a propertyset of all tokens. At the moment I'm having 
to write this to a properties file befora calling:

<copy toDir="${dest.dir}">
  <fileset dir="${src.dir}">
    <include name="**/*.html">
  </fileset>
  <filterset begintoken="%" endtoken="*">
    <filtersfile file="${temp.dir}/user.tokens"/>
    <filtersfile file="${temp.dir}/server.tokens"/>
  </filterset>
</copy>

	Rather than (which would be nicer!)

<copy toDir="${dest.dir}">
  <fileset dir="${src.dir}">
    <include name="**/*.html">
  </fileset>
  <filterset begintoken="%" endtoken="*">
    <propertyset refid="deploy.tokens"/>
    <propertyset refid="server.deploy.tokens"/>
  </filterset>
</copy>

	Is this worth implementing? I may well attempt to do so if people think it 
worthwhile.

Thanks for your time,

Christian.

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


Mime
View raw message