From 6e28a966f8ebacf43a2307f9168767c3f2fc497e Mon Sep 17 00:00:00 2001
From: Marko Grönroos <magi@iki.fi>
Date: Tue, 30 Dec 2008 21:34:36 +0000
Subject: Don't compile with other than Java 1.5 compilers. For #2367.

svn changeset:6374/svn branch:trunk
---
 build/build.xml | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/build/build.xml b/build/build.xml
index 0ff57ace82..7a2c1ecfe7 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -110,8 +110,29 @@
 	<target name="init-oophm-platform"><property name="platform" value="oophm" /></target>
 	<target name="init-oophm" depends="init-oophm-platform,init"></target>
 
-	<!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - -->
-	<target name="init" depends="init-platform">
+    <!-- ================================================================== -->
+    <!-- Check that Java version is 1.5.                                    -->
+    <!-- ================================================================== -->
+    <target name="check-java-version">
+      <condition property="java.version.matches">
+        <equals arg1="${ant.java.version}" arg2="1.5"/>
+      </condition>
+      <fail unless="java.version.matches" message="IT Mill Toolkit must be compiled with genuine Java 1.5 compiler."/>
+      <echo>Java version is ${ant.java.version} as required.</echo>
+    </target>
+
+    <!-- Check that we use the old Servlet API to catch incompatibilities.. -->
+    <!-- This is unused at the moment. -->
+    <target name="check-servlet-version">
+      <available classname="javax.servlet.ServletRequestListener" property="servlet.version.is-2.4" />
+      <fail if="servlet.version.is-2.4" message="IT Mill Toolkit must be compiled with exactly Java Servlet 2.3."/>
+      <echo>Java Servlet 2.3 used.</echo>
+    </target>
+
+    <!-- ================================================================== -->
+	<!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+    <!-- ================================================================== -->
+	<target name="init" depends="check-java-version, init-platform">
 
 		<property file="build/build.properties" />
 		<property file="build/VERSION.properties" />
-- 
cgit v1.2.3