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 Fri, 24 Oct 2008 18:24:36 GMT
Hendrik Maryns a écrit :
> supareno schreef:
>   
>> 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>
>>     
>
> Thanks, indeed this was what I was thinking of, but unfortunately <jar>
> does not allow a nested <mapper> element.
>   
so, you could create a build directory where you can copy all the files 
needed for the jar (class files, properties files, ...)
and, after, you can do this:

<jar destfile="${dist}/lib/app.jar">
    <fileset dir="${build}/classes" excludes="**/Test.class"/>
    <!-- adding to the jar the folder where the files are renamed -->
    <fileset dir="${build}/resources"/>
</jar>

i will do it like that!
Do someone else have an alternative?

supareno

> Should I put in an rfe for this?
>
> H.
>   


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


Mime
View raw message