Question about ANTs jar task

Discussion in 'Java' started by jy, Sep 11, 2003.

  1. jy

    jy Guest

    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
    jy, Sep 11, 2003
    #1
    1. Advertising

  2. * jy <>:
    > 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,
    * -------------------------------------
    * Your mind is like an umbrella.
    * It doesn't work unless you open it.
    * /Frank Zappa
    */
    Anders =?iso-8859-1?Q?Engstr=F6m?=, Sep 11, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    564
    Arnold Peters
    Jan 5, 2005
  2. Developer

    Fire Ants

    Developer, Sep 11, 2008, in forum: HTML
    Replies:
    1
    Views:
    483
    stermen
    May 22, 2009
  3. Developer

    Fire Ants?

    Developer, Sep 11, 2008, in forum: C Programming
    Replies:
    2
    Views:
    397
    Keith Thompson
    Sep 11, 2008
  4. fft1976
    Replies:
    7
    Views:
    786
    jgrant27
    Jun 19, 2009
  5. Brian Schröder
    Replies:
    4
    Views:
    94
    Brian Schröder
    Sep 29, 2004
Loading...

Share This Page