ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phillip Lord" <p.l...@hgmp.mrc.ac.uk>
Subject confused over failure
Date Tue, 13 Feb 2001 15:35:24 GMT



       I've just started using ant, and I have a small question. 
I am a little confused about how ant copes with failures of
processes. 

       To give a little background....

       I have a file with the following construction in it


public final int ord;

protected Constructor()
{
        
    ord = 10;
}    

     which is perfectly legal java. Sadly due to a bug in Javac
is will not compile, instead telling me that I have to initialise
finals in the constructor (even though I have). 

       Now this code compiles fine with jikes. My code will of course
also work without the variable being final, but this opens the
possibility of modifying the variable, in which case lots of my code
will crash (which is why its final!). 

       What I want to do therefore during the build is the following.

       1) Compile the file with javac. 
       2) If this fails then I am falling foul of the bug
       3) So therefore trying compiling it with jikes if is
          available
       4) If neither of these two work, then I want to patch
          the file to change the variable to a non final one.
       5) And finally run javac. 


       But to do all of this I need to have compilation fail in 
a non fatal way, but act upon this failure. 

       Can anyone help?

       Phil


Mime
View raw message