ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: AW: How to delete files from a zip/jar?
Date Tue, 07 Dec 2004 16:11:44 GMT
> >   jar tf compare.jar | grep \.class | xargs zip -d target.jar
> 
> I changed the command now to this, which is also working:
> 
> 	<target name="jardelete" depends="" >
> 		<exec executable="sh">
> 			<arg line="-c &quot;zip -d 
> ${jardelete.target} $(jar -tf ${jardelete.compare} | grep 
> \.class)&quot;"/>
> 		</exec>
> 	</target>
> 
> => sh -c "zip -d target.jar $(tar -tf compare.jar | grep \.class)"
> 
> the $(...) has the same functionality as the quotes `...` but 
> are easier to read. 


Be careful. Inside of Ant you often have some ${...} so a $(...) is
difficult
to read ... I think. You dont exspect to get some normal braces in the Ant
context.


> Now I only have to resolve some 
> backwards/forwards slashes problem, to get the issue resolved :-)

1. using tmp file: <replaceregexp> task
   --> but you have an external file ...
2. using properties: AntContrib <propertyregexp>
   --> properties are immutable ...
3. using non Ant conform way: <script> using project.setProperty() which
allows
   overriding of properties.
   --> breaks immutability of properties
  
           `-
>    Andreas Ebbert
>    Software Design Engineer - Nokia Networks OSS 
>    gsm: +49-177-941-3928, fax: +49-211-9412-3838
>    Heltorfer Straße 1, 40472 Düsseldorf, Germany 

Nice to hear from a guy working next to me :-)


Jan
Roßstrasse 131, 40476 Düsseldorf, Germany

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message