ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <sc...@alodar.com>
Subject How do I add an idref to a zipfileset?
Date Thu, 15 Aug 2002 05:45:28 GMT
I have been asked to put the contents of my resources directory at the 
top level.  What makes this hard is that the resources dirctory may not 
exist.

If I do:

     <jar
       jarfile="${jar.dist}/${jar.baseName}.jar"
       compress="${jar.compress}">
       <zipfileset dir="${project.work.dir}">
         <include name="resources/*" />
       </zipfileset>

on

foo
-resources
--blah.gif

the jar has
foo.jar
-resources
--blah.gif

when what i want it to have is

foo.jar
-blah.gif

I had thought I could resolve this via a clever dirset:

   <dirset id="jar.source.dirs" dir="${project.work.dir}">
     <include name="resources"/>
   </dirset>

   <target name="jar">
     <jar
       jarfile="${jar.dist}/${jar.baseName}.jar"
       compress="${jar.compress}" >
       <zipfileset dir="jar.source.dirs"/>
   </jar>

but zipfileset does not seem to accept an idref, complaining that this 
is actually a dirset.  I suppose that it is right, but my goal is to 
have zipfileset, or a plain old fileset, put my resources at the top 
level so getResource can find them, without requiring the resources 
directory to exist.

I note that
       <zipfileset dir="${project.work.dir}" prefix="..">
         <include name="resources/*" />
       </zipfileset>

puts the resources in
foo.jar
-..
--resources
---blah.gif

not quite what I had in mind...

Scott


--
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