ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Murdoch <adammurd...@apache.org>
Subject Re: Using <fileset> in <jar>
Date Tue, 16 Apr 2002 07:51:45 GMT
On Tue, 16 Apr 2002 17:17, Holger Rauch wrote:
> Hi!
>
> I'm trying to use the <fileset> element in a <jar> element in order to
> reference things that I declared globally in my build.xml file in a
> <fileset> element. To be more precise:
>
> <patternset id="all-icons">
>     <include name="${empic.src}/**/*.jpg"/>
>     <include name="${empic.src}/**/images/*.gif"/>
>   </patternset>
>
>   <patternset id="all-i18n">
>     <include name="${empic.src}/**/*.properties"/>
>     <include name="${empic.src}/**/combo_values.txt"/>
>   </patternset>

Get rid of the '${empic.src}' from these patterns.  The patterns are matched 
against file names that are relative to the root dir of the fileset, i.e. 
they're relative to ${empic.src}.

>   <fileset id="all-resources" dir="${empic.src}">
>     <patternset refid="all-icons"></patternset>
>     <patternset refid="all-i18n"></patternset>
>   </fileset>
>
> (These are all defined globally). In order to create the JAR file I use:
>
> <target name="allapps">
>     <copy todir="${empic.bin}">
>       <fileset refid="all-resources"></fileset>
>     </copy>
>     <jar jarfile="${allapps.path}/allapps.jar" basedir="${empic.bin}">
>       <include name="**/*.class"/>
>       <fileset refid="all-resources"></fileset>
>       <exclude name="global.ex"/>
>     </jar>
> </target>
>

You're including stuff twice here - first it is copied to ${empic.bin}, and 
then it is jarred up from there, and also from it's original location, thanks 
to the nested <fileset>.

You want to either skip the copy, or get rid of the nested <fileset>.


-- 
Adam

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


Mime
View raw message