ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gulcu <...@urbanet.ch>
Subject Conditional compilation
Date Fri, 05 Jan 2001 16:48:41 GMT

Hello,

I am confronted with a probably common case of conditional compilation. I 
have a library that depends on a number of third party libraries. I would 
like my ANT build file to compile the components that have the required 
libraries and skip the components that do not have the required libraries.

Case 1)  Some component requires the presence of JNDI and JMS.

Case 2) Another component requries a JAXP compliant parser, i.e. either 
xerces or Sun's parser.

I know that it is possible to nest ifs and elses within different targets 
but it makes the build file harder to read and maintain. Nested targets are 
an inconvenient alternative to if-then-else blocks that one might call an 
antism. As far as I know, ORs are not supported in ANT nor are they in make.

The "available" target is a very useful one. However, it would be even more 
useful if it were supported by powerful boolean logic. Just my 2 cents. Ceki

ps: The echo target does not seem to support the if attribute. 
Mime
View raw message