Author: aaf
Date: Mon Jul 16 11:26:40 2012
New Revision: 1361974

URL: http://svn.apache.org/viewvc?rev=1361974&view=rev
Log:
Restored java version check

Modified:
    incubator/openmeetings/trunk/singlewebapp/build.xml

Modified: incubator/openmeetings/trunk/singlewebapp/build.xml
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/build.xml?rev=1361974&r1=1361973&r2=1361974&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/build.xml (original)
+++ incubator/openmeetings/trunk/singlewebapp/build.xml Mon Jul 16 11:26:40 2012
@@ -90,7 +90,7 @@
                <fileset dir="${project.lib.dir}" includes="*.jar" />
        </path>
 
-       <target name="prepare.mkdir">
+       <target name="prepare.mkdir" depends="-java6or7.check">
                <mkdir dir="${red5.server.lib}" />
                <mkdir dir="${red5.client.dir}/dist" />
                <mkdir dir="${dist.dir}" />
@@ -928,7 +928,7 @@
                <ivy:cleancache />
        </target>
 
-       <target name="prepare-eclipse" if="java6.installed" description="Layout 
various files necessary for development">
+       <target name="prepare-eclipse" if="java6.installed" description="Layout 
various files necessary for development" depends="-java6or7.check">
                <antcall target="-retrieve-mainlibs" inheritAll="true" 
inheritRefs="true" />
                <antcall target="-retrieve-om" inheritAll="true" 
inheritRefs="true" />
                <antcall target="-retrieve-junit" inheritAll="true" 
inheritRefs="true" />
@@ -938,4 +938,24 @@
                <antcall target="-retrieve-cmdadmin" inheritAll="true" 
inheritRefs="true" />
                <antcall target="-process-db" inheritAll="true" 
inheritRefs="true" />
        </target>
+       
+       <target name="-java6or7.check" unless="java6.installed">
+               <condition property="java6.installed" value="true">
+                       <and>
+                               <or>
+                                       <equals 
arg1="${java.specification.version}" arg2="1.6" />
+                                       <equals 
arg1="${java.specification.version}" arg2="1.7" />
+                               </or>
+                               <matches 
string="${java.vm.specification.vendor}" pattern=".*[sun,oracle].*" 
casesensitive="false" singleline="true" />
+                       </and>
+               </condition>
+               <echo message="Using Java ${java.version} specification: 
${java.specification.version}" />
+               <fail message="Unsupported Java version - detected: 
${java.version} Only Sun/Oracle Java compiler version 6 or 7 supported.">
+                       <condition>
+                               <not>
+                                       <equals arg1="${java6.installed}" 
arg2="true" />
+                               </not>
+                       </condition>
+               </fail>
+       </target>       
 </project>


Reply via email to