ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hendrik Maryns <qwizv9...@sneakemail.com>
Subject Can I rename a file when jarring it?
Date Wed, 22 Oct 2008 09:31:37 GMT
Hi,

I create a jar with some of my own files and another jar as zipfileset.
 I’d like one of the files of the other jar (which I do not produce) to
be renamed on the fly.  Is this possible?

What I have:

<target name="jar" depends="build" description="Make a jar file">
  <jar destfile="${releasedir}/${name}.jar" manifestencoding="UTF-8">
  	<manifest>
    <attribute name="Main-Class"
           value="de.uni_tuebingen.sfb.lichtenstein.main.MonaSearch" />
    <attribute name="Class-Path" value="." />
    <attribute name="Implementation-Title" value="${name}" />
    <attribute name="Implementation-Version" value="${version}" />
  	</manifest>
 	<metainf dir="${releasedir}" includes="COPYING,AUTHORS,THANKS" />
  	<zipfileset dir="${bindir}" excludes="**/tests/*,Mona/*" />
<!-- note “dir”-->
  	<zipfileset src="commons-cli-2.0-SNAPSHOT.jar"
               excludes="META-INF/*.SF,META-INF/LICENSE.txt" />
<!-- note “src”, see
http://ant.apache.org/manual/CoreTypes/zipfileset.html-->
  </jar>
  <signjar jar="${releasedir}/${name}.jar"
           alias="MonaSearch"
           storepass="monasearch"
           keystore="keystore"
           keypass="monasearch" />
</target>

Regarding the two comments: the error messages emitted by Ant are not
really helpful, it took me quite some googling around before I noticed
that I had a ‘src’ in the first case, the error message ‘the archive
can't be a directory’ is, like, not helpful at all.

Another very unhelpful error message was ‘only single argument resource
collections are supported as archives’ which was caused because I had a
<fileset> inside of <meta-inf>.  Here the documentation could be made
better: it just says ‘The nested metainf element specifies a FileSet.’
I interpreted that as that is should contain a FileSet.

Is a developer reading this, or should I create bugs all around?

H.
-- 
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html


Mime
View raw message