ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Daniel Crocker <...@piclab.com>
Subject RE: Available task and JDK versions
Date Tue, 25 Jul 2000 06:48:29 GMT
> That seems like a reasonable short term solution. But wouldn't it be better
> to have a clearer approach? And one that won't require changes when the
> next version of the JDK comes out?

Seems to me as well that testing for specific JDK versions is exactly
the wrong thing to do.  What you really need to know is whether or not
a particular /feature/ is available, not some product-specific label
from which you then infer the feature.  To that end, "available" should
be able to test not only the presence of a class (this is enough to
tell you if you have, say, Swing or Collections), but also test for the
presence of a public member variable or method of a class with a certain
type and signature.

Maybe something like:

  <available property="has.character.encodings"
   classname="java.lang.String" method="String getBytes(String)"/>

with a similar attribute for members.  It might be easier to specify
the method signature or member types with the internal strings (those
are specified by the language).

--
Lee Daniel Crocker <lee@piclab.com> <http://www.piclab.com/lee/>
"All inventions or works of authorship original to me, herein and past,
are placed irrevocably in the public domain, and may be used or modified
for any purpose, without permission, attribution, or notification."--LDC



Mime
View raw message