ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark.rus...@pncbank.com
Subject Re: PatternSet question
Date Wed, 16 Jul 2003 13:24:21 GMT

ant dose not care it will use either

Mark Russell
PNC
412-768-9603


|---------+----------------------------->
|         |           "Nathan           |
|         |           Christiansen"     |
|         |           <Nathan_Christians|
|         |           en@tni.com>       |
|         |                             |
|         |           07/15/2003 05:17  |
|         |           PM                |
|         |           Please respond to |
|         |           "Ant Users List"  |
|         |                             |
|---------+----------------------------->
  >---------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                      
                                                      |
  |        To:      "'Ant Users List' (E-mail)" <user@ant.apache.org>              
                                                            |
  |        cc:                                                                           
                                                      |
  |        Subject: PatternSet question                                                  
                                                      |
  >---------------------------------------------------------------------------------------------------------------------------------------------|



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