ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duffey, Kevin" <KDuf...@BUYMEDIA.com>
Subject RE: Question on builds that fail
Date Wed, 03 Jan 2001 21:23:02 GMT
Seems to me this would be a fairly needed capability..maybe ant 1.3 will
include this feature?


> -----Original Message-----
> From: Diane Holt [mailto:holtdl@yahoo.com]
> Sent: Wednesday, January 03, 2001 1:22 PM
> To: ant-user@jakarta.apache.org
> Subject: Re: Question on builds that fail
> 
> 
> I can't think of any reason why it shouldn't be included in the CVS
> version of Javac.java -- it's off by default, so it's not going to
> interfere with anyone who doesn't want to set it.
> 
> In looking at the file Ken sent me, it looks like it's a 
> relatively old
> revision (maybe 1.54 or 1.55), so, since I don't know what rev other
> people are at, it's probably easiest for me to just explain what you'd
> need to add to your own Javac.java for now (I'll integrate 
> the change with
> the latest rev and offer it to ant-dev later).
> 
> To change Javac.java to include this functionality, just add the
> following:
>   1. Add it to the list of booleans at the beginning of the class --
>      ie., after "private boolean verbose = false ;", add:
>          private boolean proceed = false ;
>   2. Add the "setter" for it -- ie., after the one for verbose, add:
>          /**
>           * Set the proceed flag.
>           */
>          public void setProceed(boolean proceed) {
>              this.proceed = proceed;
>          }
>   3. This one gets a bit stickier, since you'll need to add 
> in the test
>      for "if( !proceed )" in various places, and according to which
>      compilers you use. For myself, since I never use 
> 'javac', I added it
>      after the if on executeJikesCompile() (and my one for 
> 'sj'), but Ken
>      had it in the doClassicCompile(), before the if on
>      ok.booleanValue() that comes after the "Boolean ok = ..." line.
>      Basically, you're just trying to allow a different 
> behaviour rather
>      than just the BuildException being thrown when a compile 
> fails. For
>      example, here's the one for the doClassicCompile():
>             Boolean ok = (Boolean)compile.invoke(compiler, 
> new Object[]
>                            {cmd.get Arguments()});
>             if (!proceed) {
>                 if (!ok.booleanValue()) {
>                     throw new BuildException(FAIL_MSG, location);
>                 }
>             } else {
>                 if (!ok.booleanValue()) {
>                     log("Warning: Errors reported, continuing ... ",
>                           Project.MSG_WARN);
>                 }
>             }
>      And here's the one for Jikes:
>         if (executeJikesCompile(cmd.getCommandline(), 
> firstFileName) != 0)
>         {
>             if (!proceed) {
>                     throw new BuildException(FAIL_MSG, location);
>             } else {
>                 log("*** Warning: Errors reported -- continuing ... ",
>                       Project.MSG_WARN);
>             }
>         }
> 
> Once you have your modified Javac.java, recompile it, rebuild ant.jar,
> then modify your <javac> tasks to include the "proceed" 
> attribute. I have
> all my <javac> tasks include it, with its value defined as 
> "${proceed}",
> which is defined as "false" in my standard-defaults 
> properties file that
> gets read in when Ant runs. That way, if a user wants to run 
> with proceed
> turned on, it can get defined as "true" on the 'ant' 
> command-line, which
> takes precedence over the define in the properties file. (If 
> a user always
> wants to run with proceed=true, they can define $PROCEED in their user
> env, and my 'ant' script will translate it into a 
> command-line define --
> or, they can just specify it manually with 'ant -Dproceed=true ...' if
> they only want it defined for a particular run.)
> 
> Hope this all helps -- if it was too weird having it not be the actual
> modified file, let me know, and I can still forward that.
> 
> Diane
> 
> --- Mike Pedersen <michael.pedersen@oracle.com> wrote:
> > Hello Diane, that would be great if you could forward it.  I wonder,
> > would 
> > it make sense for this functionality to be integrated into  
> the javac
> > task 
> > of ant as a parameter.  Does anyone know if this is planned for 1.3?
> > Thanks much
> > 
> > At 11:37 AM 1/3/2001 -0800, you wrote:
> > >Ken Wood wrote a mod for Javac.java that allows for a "proceed"
> > attribute,
> > >which when set to true will cause a compile failure to only issue a
> > >warning, not throw a BuildException. I don't think it was 
> ever posted
> > to
> > >the list, but I have it (and use it), so if you'd like me 
> to forward it
> > to
> > >you, I can.
> > >
> > >Diane
> > >
> > >--- Mike Pedersen <michael.pedersen@oracle.com> wrote:
> > > > Hello all, I am currently using ant to build several good sized
> > > > projects.  My team wishes to have access to builds that 
> fail as well
> > as
> > > > builds that complete successfully.  My question: is it 
> possible to
> > have
> > > > ant
> > > > continue even if the "javac" task fails?  The purpose 
> of this would
> > be
> > > > to
> > > > copy the source and zips of the failed build to our ftp 
> site to give
> > > > others
> > > > access.
> > > > What kinds of problems will I create for myself if I remove the
> > "javac"
> > > > task dependency from the subsequent task?
> > > > Thanks much
> > > >
> > > > .
> > > > hanks much
> > > >
> > > > .
> > > >
> > >
> > >
> > >=====
> > >(holtdl@yahoo.com)
> > >
> > >
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Yahoo! Photos - Share your holiday photos online!
> > >http://photos.yahoo.com/
> > 
> 
> 
> =====
> (holtdl@yahoo.com)
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - Share your holiday photos online!
> http://photos.yahoo.com/
> 

Mime
View raw message