ant-contrib, iterating files

Thomas Rene Vervik <[email protected]> Sun, 2 Mar 2008 11:06:13 -0800 (PST)
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
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?

Thanks for all help

have a great day
best regards
Thomas
Norway
-- 
View this message in context: http://www.nabble.com/ant-contrib%2C-iterating-files-tp15790597p15790597.html
Sent from the Ant Contrib mailing list archive at Nabble.com.


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