ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tibor Strausz <Tibor.Stra...@tridion.com>
Subject RE: Task to remove a method from .java file
Date Wed, 07 Aug 2002 10:59:36 GMT
thats cool, in a way ;-)

> -----Original Message-----
> From: Stefan Kost [mailto:s.kost@webmacher.de]
> Sent: Wednesday, August 07, 2002 1:52 PM
> To: Ant Users List
> Subject: Re: Task to remove a method from .java file
> 
> 
> There is another possible solution, it's abit hackish too.
> Even though java has no real preprocessor, the compiler can behave the
> same way. Just have a static class
> 
> final class SourceConfig {
> 	final static boolean ejbVersion=true;
> }
> 
> Then use in the source
> 
> if(SourceConfig.ejbConfig==true) {
> ...
> }
> 
> Finally, the ant-script just need to patch the SourceConfig 
> class. SUch
> comparissions with final static vars get optimized and if it 
> evalues to
> fasle, the innercode can never be called, so it is dropped when
> compiling(I verified this with jode). Unfortunately this leaves empty
> method skelletons in there. I am not sure how we could persuade the
> compiler to drop them too.
> I've just used this approch to wrap debug-output statements, so that I
> can 100% drop them.
> 
> Stefan
> 
> 
> > Sounds like #ifdef. Actually, some preprocessor-like stuff would be 
> > quite a nice thing in Java, and in Ant. Is there anything 
> like that, or 
> > a clever way to do it with Ant? I didn't notice it, if there is, 
> > although it sounds like the regex stuff could do it. Never 
> thought to 
> > try!
> > 
> > -Ian
> > 
> > On Tuesday, August 6, 2002, at 01:40  PM, Luis N. Polasek wrote:
> > 
> > > Quoting Matt Benson <gudnabrsam@yahoo.com>:
> > >
> > >> What is your purpose in removing a method from a Java
> > >> source file?
> > >
> > >         That´s becaus I have a two releases of the same 
> project, one 
> > > using EJB and the other using only Tomcat. The idea is to 
> strip the 
> > > EJB methods form the <ComponentName>Beam  source file. 
> This methods 
> > > are (ejbCreate, ejbPassivate, etc).
> > >
> > >         And I´m trying using ant to automate the 
> construction of the 
> > > Tomcat version out from the EJB version.
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   
> > > <mailto:ant-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail: 
> > > <mailto:ant-user-help@jakarta.apache.org>
> > >
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: 
> <mailto:ant-user-help@jakarta.apache.org>
> > 
> -- 
> 
>  < W E B M A C H E R > 
> EDV+INTERNETSERVICE GMBH
> 
> POST: August Bebel Str. 69
>       04275 Leipzig
> 
> FON:  +49 341 30 34 833
> FAX:  +49 341 30 34 840
> WEB:  www.webmacher.de
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:ant-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message