ANT: Return status from javac task

Discussion in 'Java' started by Lax, Jan 18, 2007.

  1. Lax

    Lax Guest

    Hi all,
    I dont know if this is the appropriate group for ANT build questions,
    sorry if its not.

    In my ANT build.xml, I've a compile task calling javac compiler, pretty
    basic.
    But, before running the javac task the build creates a bunch of temp
    files.
    If and when the compilation fails, the build exits and I'd like to
    delete the temp files before the build finishes/fails.
    Is there any way to trap the return status from the javac( or any)
    task? Is there any status or ERRORLEVEL like property/environment
    variable available after running the task?

    Sample code:

    <tasks to create bunch of temp files>
    <target name="javac">
    <javac>
    blah blah
    </javac>

    Check javac return status here...
    If javac is successful, do the mail
    If javac is not successful, cleanup the temp files
    </target>

    Any idea how I can test the success of a nested task?

    Thanks for your time.
    Lax, Jan 18, 2007
    #1
    1. Advertising

  2. Jean-Francois Briere, Jan 18, 2007
    #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. z3
    Replies:
    0
    Views:
    493
  2. sowbug
    Replies:
    4
    Views:
    1,093
    Tony Morris
    Jan 26, 2004
  3. Victor
    Replies:
    0
    Views:
    8,835
    Victor
    Sep 1, 2004
  4. Collin VanDyck
    Replies:
    2
    Views:
    645
    Collin VanDyck
    Nov 18, 2004
  5. krabhi
    Replies:
    1
    Views:
    9,287
    Marco Meschieri
    Aug 9, 2006
Loading...

Share This Page