Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2007

Tip: Looking for answers? Try searching our database.

ANT: Return status from javac task

Thread view: 
Lax - 18 Jan 2007 17:19 GMT
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.
Jean-Francois Briere - 18 Jan 2007 19:40 GMT
You could use the Ant-Contrib Tasks:
http://ant-contrib.sourceforge.net/

First you download it:
http://sourceforge.net/project/showfiles.php?group_id=36177

Then you could use the TryCatch task:
http://ant-contrib.sourceforge.net/tasks/tasks/trycatch.html

Regards


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.