ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Christiansen" <Nathan_Christian...@tni.com>
Subject PatternSet question
Date Tue, 15 Jul 2003 21:17:25 GMT
I have a simple question regarding patternsets that is not answered in the docs.

Do patternsets expect the forward slash (/) as the file separator? Do they automatically convert
to the correct file separator based on the platform?

I have always used patternsets like this:

<property name="src.dir" location="${basedir}/src"/>
<property name="src.jsp.dir" location="${src.dir}/jsp"/>
<property name="deploy.jsp.dir" location="${basedir}/deploy"/>

<copy todir="${deploy.jsp.dir}">
  <fileset dir="${src.jsp.dir}">
    <include name="**/*.jsp"/>
    <include name="**/*.html"/>
  </fileset>
</copy>


I have seen patternsets used like this:

<copy todir="${deploy.jsp.dir}">
  <fileset dir="${src.jsp.dir}">
    <include name="**${file.separator}*.jsp"/>
    <include name="**${file.separator}*.html"/>
  </fileset>
</copy>


which leads to the possibility of doing this:

<property name="include.jsp.pattern" location="**/*.jsp"/>
<property name="include.html.pattern" location="**/*.html"/>

<copy todir="${deploy.jsp.dir}">
  <fileset dir="${src.jsp.dir}">
    <include name="${include.jsp.pattern}"/>
    <include name="${include.html.pattern}"/>
  </fileset>
</copy>


Which way is "the ant way"?

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

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


Mime
View raw message