looks ok to me. You going to submit it to go into ant1.6? ----- Original Message ----- From: "Dominique Devienne" <[EMAIL PROTECTED]> To: "'Ant Users List'" <[EMAIL PROTECTED]> Sent: Thursday, May 23, 2002 12:03 PM Subject: RE: Borland Jbuilder finally adds ant support (at a price)
> Not enough... Here's the code (that way someone can tell me how I should > *really* have done it ;-): > > package com.lgc.jax.tools; > > import java.util.regex.Pattern; > import java.util.regex.Matcher; > > import org.apache.tools.ant.BuildEvent; > import org.apache.tools.ant.DefaultLogger; > > /** > * An ANT build logger that reformats SUN's modern Javac compiler > * error messages so Microsoft Visual Studio can jump directly to > * the file and line of the error using F4. > * <p> > * Only reformats output of the <javac /> ANT task. Should be used > * in conjunction with -emacs ANT mode (unadorned messages) to work > * correctly with Visual Studio. > * <p> > * <em>Should tests whether the modern compiler from SUN's JDK is the > * current compiler, and only reformats error message of this compiler.</em> > * <p> > * To use this class with ANT, use the > * <tt>-emacs -logger com.lgc.jax.tools.MsdevAntBuildLogger</tt> > * switch on ANT's command line. > * > * @author <a href="mailto:[EMAIL PROTECTED]">Dominique Devienne</a> > * @version Nov 2001 - Copyright (c) 2001, Landmark Graphics Corp. > */ > public class MsdevAntBuildLogger extends DefaultLogger { > > private static final String INDEXOF = ".java:"; > private static final String PATTERN = "(.*\\.java):(\\d+): (.*)$"; > private Pattern _pattern = Pattern.compile(PATTERN); > > public void messageLogged(BuildEvent event) { > // task.getTaskName()=="javac" works, but is it portable? > if (event.getTask()!=null && event.getTask().getTaskName()=="javac") { > // Filter out messages based on priority, like the base class does! > if (event.getPriority() <= msgOutputLevel) { > // Quick test to avoid expense of REGEX in most cases > String msg = event.getMessage(); // original message > if (msg.indexOf(INDEXOF) >= 0) { > Matcher matcher = _pattern.matcher(msg); > if (matcher.matches()) { > // Reformat the message to be compatible with Visual Studio: > // from P:\java\com\lgc\gocad\TSurf.java:10: blablabla > // to P:\java\com\lgc\gocad\TSurf.java(10) : blablabla > StringBuffer buffer = new StringBuffer(msg.length()+3); > buffer.append(matcher.group(1)); // filename > buffer.append('('); // line number prefix > buffer.append(matcher.group(2)); // line number > buffer.append(") : "); // line number suffix > buffer.append(matcher.group(3)); // error message > event.setMessage(buffer.toString(), event.getPriority()); > } > } > } > } > super.messageLogged(event); > } > > } // END class MsdevAntBuildLogger > > -----Original Message----- > From: Erik Hatcher [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 23, 2002 12:04 PM > To: Ant Users List > Subject: Re: Borland Jbuilder finally adds ant support (at a price) > > The -emacs output was not what Visual Studio liked? > > > ----- Original Message ----- > From: "Dominique Devienne" <[EMAIL PROTECTED]> > To: "'Ant Users List'" <[EMAIL PROTECTED]> > Sent: Thursday, May 23, 2002 12:11 PM > Subject: RE: Borland Jbuilder finally adds ant support (at a price) > > > > Vaguely related to the subject only, but to jump to the correct line in > > source where javac compile errors occurred, when running an ant build from > > within Visual Studio (sic!), I wrote a tiny Ant build listener that > > reformatted error messages to be compatible with VS (since the latter > cannot > > be configured with an error format like any good editor). --DD > > > > -----Original Message----- > > From: max [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, May 22, 2002 11:03 AM > > To: Ant Users List > > Subject: Re: Borland Jbuilder finally adds ant support (at a price) > > > > You say awesome, and I ask you the following: > > > > How do you come from the possible error output from ant (e.g. javac > compile > > errors) to the proper location in the source file in Eclipse ? > > > > /max > > ----- Original Message ----- > > From: "GOMEZ Henri" <[EMAIL PROTECTED]> > > To: "Ant Users List" <[EMAIL PROTECTED]> > > Sent: Wednesday, May 22, 2002 12:02 PM > > Subject: RE: Borland Jbuilder finally adds ant support (at a price) > > > > > > Just use Eclipse IDE (www.eclipse.org), ant support > > is awesome ;) > > > > - > > Henri Gomez ___[_]____ > > EMAIL : [EMAIL PROTECTED] (. .) > > PGP KEY : 697ECEDD ...oOOo..(_)..oOOo... > > PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6 > > > > > > > > >-----Original Message----- > > >From: Steve Loughran [mailto:[EMAIL PROTECTED]] > > >Sent: Tuesday, May 21, 2002 2:22 AM > > >To: ant-user > > >Subject: Borland Jbuilder finally adds ant support (at a price) > > > > > > > > >From the feature set of JBuilder 7, I see that they have finally added > > >native ant support > > >http://www.borland.com/jbuilder/pdf/jb7_feamatrix.pdf > > > > > >but only on the enterprise edition. Like, they had to pay so much for > > >ant.jar that they had to put them in the prestige premium tool > > >that costs > > >the same as two laptops. > > > > > >It's funny; I'd have thought that ant would help deprecate the > > >selling price > > >of the premium stuff, or at least let IDEs focus on what they > > >are good at: > > >editing, refactoring and collaboration. But no, borland keep > > >ant part of the > > >premium product, perhaps to ensure that all the features ant > > >offers -junit, > > ><zip>, deployment are also kept at a premium. > > > > > >Sigh. > > > > > >On the plus side, it means that all of the mainstream IDEs > > >support Ant, even > > >the 'Enterprise' tools. This is a sign of progress. Even in > > >the enterprise, > > >your build can be independent of an IDE. I wonder if they > > >realise what they > > >have done. > > > > > >-Steve > > > > > >[running IDEA fullscreen in the other monitor, generating java > > >classes from > > >an XSD file via Castor and ant, then deploying to tomcat and > > >running http > > >unit tests] > > > > > > > > >-- > > >To unsubscribe, e-mail: > > ><mailto:[EMAIL PROTECTED]> > > >For > > >additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > > > > > > > -- > > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > > > > > > > -- > > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > -- > > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
