ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Best way to have script fail if not using new enough JDK?
Date Mon, 21 Dec 2009 13:25:37 GMT
<fail message="Not a Java 1.6+">
  <not><available classname="java.util.ServiceLoader"/></not>
</fail> 

(see target "check_for_optional_packages" in Ants own buildfile)


Jan

>-----Urspr√ľngliche Nachricht-----
>Von: KARR, DAVID (ATTCINW) [mailto:dk068x@att.com] 
>Gesendet: Montag, 21. Dezember 2009 00:45
>An: Ant Users List
>Betreff: Best way to have script fail if not using new enough JDK?
>
>I need to have my Ant script abort if the current JDK version is older
>than the project needs (1.6).
>
>I noticed a "JavaVersionTask" sample at <http://onjava.com/lpt/a/6264>
>which would probably help, but I wonder if there's an easier way since
>that article was written (4 years ago).
>
>I can see the possibility of doing this with a Groovy 
>scriptcondition to
>set the property to check, but I can't figure out how I can get Groovy
>to set Ant properties, or to return a value that would set the 
>property.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message