ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Porter <martin.por...@liberica.com>
Subject RE: Pattern Matching
Date Wed, 26 Mar 2003 15:54:12 GMT

Hi...you are right the source & target are the wrong way
around...a cut and paste error as I changed it to simply the example
as I am using properties in the real script..!

Anyway that worked....so thank you for your help. Much appreciated..:-)

-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com]
Sent: 26 March 2003 16:44
To: 'Ant Users List'
Subject: RE: Pattern Matching


I'm not fully sure to follow, but have you tried this one?

<copy todir="${source_dir}">
    <fileset defaultexcludes="no" dir="${target_dir}">
       <exclude name="**/.wlnotdelete_*/**" />
       <exclude name="**/_tmp_war/**" />
    </fileset>
</copy>

--DD

PS: Somehow I think I'd put the target_dir in todir myself...

-----Original Message-----
From: Martin Porter [mailto:martin.porter@liberica.com] 
Sent: Wednesday, March 26, 2003 9:38 AM
To: Ant Users List
Subject: RE: Pattern Matching


I tried that. I have tried just about every combination i can think of
without success which is why I am sure its the '.' thats causing it
a it works fine for the '_tmp' version. I cant add a slash at the
end as i have a number of different .notdelete directories
with different postfixes '.wlnotdelete_<servername>' where
there servername could be one of 6 or seven names. I dont want to hard code
them all specifically.

I also tried to use the following to delete them and that does not work
either:-

<delete>
   <fileset defaultexcludes="no" dir="${target_dir}" includes="**.wl**"/>
   <fileset defaultexcludes="no" dir="${target_dir}" includes="*.wl**"/>
   <fileset defaultexcludes="no" dir="${target_dir}" includes=".wl**"/>
   <fileset defaultexcludes="no" dir="${target_dir}" includes="/.wl**"/>
</delete>

-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com]
Sent: 26 March 2003 16:25
To: 'Ant Users List'
Subject: RE: Pattern Matching


How about:

<copy todir="${source_dir}">
    <fileset defaultexcludes="no" dir="${target_dir}">
       <exclude name="**/.wlnotdelete/**" />
       <exclude name="**/_tmp_war/**" />
    </fileset>
</copy>

Does it work? I don't see why directories starting with a dot wouldn't be
matched correctly. How do you know it's because of the dot? --DD

-----Original Message-----
From: Martin Porter [mailto:martin.porter@liberica.com] 
Sent: Wednesday, March 26, 2003 9:18 AM
To: user@ant.apache.org
Subject: Pattern Matching

I am trying to use a fileset to copy some directories & files to a new
target location as follows:-

<copy todir="${source_dir}">
    <fileset defaultexcludes="no" dir="${target_dir}">
       <exclude name="**/.wlnotdelete**"/>
       <exclude name="**/_tmp_war**"/>
    </fileset>
</copy>

This is working as expected and removing all instances of *_tmp_war
directories in the process
but still leaves all the '.wlnotdelete' directories. I know its because of
the '.' character at the start
of the directory name but I cant find any way of making it work. It must be
a regular expression
matching pattern but I cant find an example of how to do it....anyone got
any bright ideas or pointers
to any docs that might tell me.

TIA
Martin


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

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



Mime
View raw message