Re: ant-contrib, iterating files

"Peter Reilly" <[email protected]> Mon, 3 Mar 2008 09:34:18 +0000
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
You do not need to use ant-call,
but use <var unset="yes"/> to reuse properties for
each iteration.

P

On Sun, Mar 2, 2008 at 7:42 PM, Christopher Heiny <[email protected]> wrote:
> On Sunday 02 March 2008, ground control picked up the following
>  transmission from Thomas Rene Vervik:
>
> > Hello
>  >
>  > I want to go through all the jar files in a give folder, unjar it,
>  > copy some class files to it, and jar it again. I have therefor made
>  > something like this:
>  >
>  > <for param="file">
>  >               <path>
>  >               <fileset dir="${suclient.home}/dist" includes="*.jar" />
>  >               </path>
>  >               <sequential>
>  >               <echo>Filename === @{file}</echo>
>  >                       <mkdir dir="${suclient.home}/dist/tmp" />
>  >                       <unjar src="@{file}" dest="${suclient.home}/dist/tmp"/>
>  >               </sequential>
>  >
>  >       </for>
>  >
>  > But since I need to give the destination jar file the same name as
>  > the one I unjar'ed, I have to know the filename. With @{file} you get
>  > the whole path and file extension - I just want the name of the jar
>  > file. Anyone having suggestions how this can be done?
>
>  The documentation is your friend.
>
>  Check out the the <basename> ant task
>    http://ant.apache.org/manual/CoreTasks/basename.html
>
>  Your life might, or might not, be made easier by using the 'update'
>  paramter of the <jar> task.
>     http://ant.apache.org/manual/CoreTasks/jar.html
>
>  You might have to split the actions out into a separate target and
>  invoke that with <antcall>.
>
>
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  _______________________________________________
>  Ant-contrib-developers mailing list
>  [email protected]
>  https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/