ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Christiansen" <>
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"/>

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"/>

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}"/>

Which way is "the ant way"?

-- Nathan Christiansen
   Tahitian Noni International

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message