Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Question about ANTs jar task

Reply
Thread Tools

Question about ANTs jar task

 
 
jy
Guest
Posts: n/a
 
      09-11-2003
Hy,

I need help for one point using ant.
I have a directory (/src) and I want to make a jar file using the jar
task.
The trouble is that I don't want any resulting jar file to be created
if there is no java file under (/src).
For the moment, when there is no file under (/src), the jar task
creates a jar file containing only the manifest file.

Can someone help me ?

JY
 
Reply With Quote
 
 
 
 
Anders =?iso-8859-1?Q?Engstr=F6m?=
Guest
Posts: n/a
 
      09-11-2003
* jy <(E-Mail Removed)>:
> Hy,
>
> I need help for one point using ant.
> I have a directory (/src) and I want to make a jar file using the jar
> task.
> The trouble is that I don't want any resulting jar file to be created
> if there is no java file under (/src).
> For the moment, when there is no file under (/src), the jar task
> creates a jar file containing only the manifest file.
>
> Can someone help me ?
>


Untested:

<target name="jar" depends="something" description="Jars the src
directory">
<jar destfile="${jar.file}" whenempty="skip">
<fileset dir="${src.dir}" includes="**/*.java"/>
</jar>
</target>

//Anders

--
/**
* Anders Engström, http://www.velocityreviews.com/forums/(E-Mail Removed)
* -------------------------------------
* Your mind is like an umbrella.
* It doesn't work unless you open it.
* /Frank Zappa
*/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java -cp a.jar -jar b.jar => Works on Windows, not on Debian cyberco Java 4 02-14-2006 06:27 AM
jaas.jar, jta.jar jdbc-stdext.jar missing from jdk1.5 RPM muttley Java 0 10-20-2005 02:40 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters Java 0 01-05-2005 10:59 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters XML 0 01-05-2005 10:59 PM
Re: Kodak DX6490 : ANTS Rudy Garcia Digital Photography 60 04-16-2004 01:08 AM



Advertisments