ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From supareno <reno.rkc...@free.fr>
Subject Re: Can I rename a file when jarring it?
Date Wed, 22 Oct 2008 18:21:02 GMT
Hendrik ,

check out this:
http://ant.apache.org/manual/CoreTypes/mapper.html#identity-mapper
and this:
http://ant.apache.org/manual/CoreTasks/copy.html
"[...]

*Copy a set of files to a directory, appending |.bak| to the file name 
on the fly*

  <copy todir="../backup/dir">
    <fileset dir="src_dir"/>
    <globmapper from="*" to="*.bak"/>
  </copy>

[...]"
> 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.
>   


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


Mime
View raw message