ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <jakarta-...@ehatchersolutions.com>
Subject Re: PatternSet question
Date Wed, 16 Jul 2003 01:25:20 GMT
Ant is bi-slashual :)

I just use forward-slashes, and I'm pretty sure that is the Ant 
Way(tm).  Back-slashes are fine too, but there is no need to use 
${file.separator} at all.

	Erik

On Tuesday, July 15, 2003, at 05:17  PM, Nathan Christiansen wrote:

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


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


Mime
View raw message