You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Robert Leftwich <di...@ix.net.au> on 2001/05/01 00:54:36 UTC

RE: Newbie question

At 05:38 AM 01-05-01 +1000, I wrote:

>At 11:06 AM 30-04-01 -0400, Pinar Bicioglu wrote:
>>I believe that all you need to do specify the property tag for
>>"buil.compiler". And the value should be "modern".
>
>Unless you are using Jikes to actually compile the files - which I am. Any 
>other ideas ?

Well, he says, answering his own question, thanks to "Nico Seessle" 
<ni...@apache.org> answer to 'Re: Platform specific targets???' I have a 
workable solution as follows :

<!-- Java version info -->
<property name="javaVersionIs${ant.java.version}" value="1"/>

<!-- check java version -->
<target name="version.check" unless="javaVersionIs1.3">
     <fail message="You need to be running with JDK1.3"/>
</target>

which, while not perfect, does what I am after.

Thanks Nico!

Robert


>>-----Original Message-----
>>From: Robert Leftwich [mailto:digital@ix.net.au]
>>Sent: Sunday, April 29, 2001 9:40 PM
>>To: ant-user@jakarta.apache.org
>>Subject: Newbie question
>>
>>
>>I have a newbie question that I cannot find the answer to in the doco or
>>the archive.
>>
>>I want to ensure that a project is only built under jdk1.3. I can see
>>several options :
>>a) Use a batch file/shell script file to control the build that sets the
>>values appropriately - but this requires that everybody always uses that
>>mechanism to run the build which you cannot ensure.
>>b) Fail the build if JAVA_HOME or ant.java.version is not correct - but the
>>only way I can find to do that is to write a script
>>(javascript/netrexx/etc) that checks the value and adds a target (or
>>enables a target) that does the fail - this seems overly complex.
>>c) Force the setting of JAVA_HOME to the appropriate place in the build
>>file - but I can't find a way to do this that is global in nature.
>>
>>As this is a simple task I am sure there is something I am missing, hence
>>this email.
>>
>>Thanks in advance
>>
>>Robert