Okay, I've put the ANTLR output in build/generated-src and changed the
compile target accordingly.  I have also adjusted the code style settings in
my IDE to be a little more compatible with the Hibernate coding standards.

Unforutunately, I have encountered what I call 'the really annoying ANT
classloader problem' yet again.  Anyone who has used ANT with Weblogic knows
*exactly* what I mean.

Here's the deal:
* Added lib/antlr-2.7.2.jar to CVS.
* At first, I put antlr-x.x.x.jar in ANT's classpath because the ANTLR task
is defined in ant-optional-x.x.x.jar which is also in the ANT classpath (via
build.bat).  This is similar to the way the Hibernate build.xml uses the
Junit task.
* Unfortunately, checkstyle-all.jar has a *different* version of ANLTR in
it, and if ANTLR was loaded by the *root* classloader, the checkstlye task
goes insane.

I've solved the problem by eliminating ant-optional-x.x.x.jar from the ANT
classpath and defining the tasks from that jar with individual taskdefs so
that ANT will make a separate classloader for each task, eliminating the
checkstlye / antlr conflict.  This works great except for the fact that the
checkstyle target does *not* work from inside my IDE (IDEA 4.0.1) because
IDEA puts ant-optional-x.x.x.jar in the classpath.  :-P

There are other ways I have solved this type of problem which are more
intrusive... should I bother?

Josh

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Max Rydahl Andersen
> Sent: Wednesday, March 17, 2004 2:54 PM
> To: Joshua Davis
> Cc: Gavin King; Emmanuel Bernard; hibernate-devel
> Subject: Re: [Hibernate] Coding conventions
> 
> 
> +1 for separate directory.
> e.g. build/autosrc or something.
> 
> Joshua Davis wrote:
> 
> >The ANTLR-generated code doesn't need to comply does
> >it?
> >
> >BTW, I haven't created a directory for ANTLR generated
> >sources in the build directory.  Instead, I have ANTLR 
> generating code 
> >into the source tree and *not* adding it to version control. 
>  Should I 
> >change the build so that the generated sources are in a separate
> >directory?
> >
> >--- Gavin King <[EMAIL PROTECTED]> wrote:
> >  
> >
> >>Eeewwww yucky :)
> >>
> >>Emmanuel Bernard wrote:
> >>
> >>    
> >>
> >>>Fixed in my code, but be sympathetic, checkstyle
> >>>      
> >>>
> >>parser is quite angry
> >>    
> >>
> >>>with metadata ;)
> >>> 
> >>>
> >>>      
> >>>
> >>--
> >>Gavin King
> >>JBoss Group
> >>+61 410534454
> >>http://hibernate.org
> >>
> >>
> >>
> >>
> >>    
> >>
> >-------------------------------------------------------
> >  
> >
> >>This SF.Net email is sponsored by: IBM Linux
> >>Tutorials
> >>Free Linux tutorial presented by Daniel Robbins,
> >>President and CEO of
> >>GenToo technologies. Learn everything from
> >>fundamentals to system
> >>
> >>    
> >>
> >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> >  
> >
> >>_______________________________________________
> >>hibernate-devel mailing list [EMAIL PROTECTED]
> >>
> >>    
> >>
> >https://lists.sourceforge.net/lists/listinfo/hibernate-devel
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Mail - More reliable, more storage, less spam 
> >http://mail.yahoo.com
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by: IBM Linux Tutorials
> >Free Linux tutorial presented by Daniel Robbins, President 
> and CEO of 
> >GenToo technologies. Learn everything from fundamentals to system 
> >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> >_______________________________________________
> >hibernate-devel mailing list [EMAIL PROTECTED]
> >https://lists.sourceforge.net/lists/listinfo/hibernate-devel
> >  
> >
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President 
> and CEO of GenToo technologies. Learn everything from 
> fundamentals to system 
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> hibernate-devel mailing list [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
> 




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to