[java9] don't set add-modules param if jdk<9
authorAsier Lostalé <asier.lostale@openbravo.com>
Tue, 17 Oct 2017 11:26:47 +0200
changeset 32951 1b784e90fb3c
parent 32950 26d2c3eb1e2a
child 32952 4e11895dd1f3
[java9] don't set add-modules param if jdk<9
build.xml
src/build.xml
--- a/build.xml	Tue Oct 17 10:12:47 2017 +0200
+++ b/build.xml	Tue Oct 17 11:26:47 2017 +0200
@@ -98,6 +98,15 @@
  
   <available file=".hg" property="is.hg" />
 
+  <condition property="j9.module.args" value="--add-modules=java.activation,java.xml.ws.annotation" else="">
+    <not>
+      <or>
+        <equals arg1="${ant.java.version}" arg2="1.7"/>
+        <equals arg1="${ant.java.version}" arg2="1.8"/>
+      </or>
+    </not>
+  </condition>
+
   <condition property="calculate.core.rev">
    <istrue value="${calculate.core.revision}"/>
   </condition>
@@ -545,7 +554,7 @@
         </fileset>
       </classpath>
       <link href="http://docs.oracle.com/javase/7/docs/api/"/>
-      <arg value="--add-modules=java.activation,java.xml.ws.annotation" />
+      <arg value="${j9.module.args}"/>
     </javadoc>
   </target>
 
--- a/src/build.xml	Tue Oct 17 10:12:47 2017 +0200
+++ b/src/build.xml	Tue Oct 17 11:26:47 2017 +0200
@@ -251,7 +251,7 @@
     <javac excludes="*/src-wad/**,*/src-util/**,**/org/openbravo/erpWindows/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" nowarn="${friendlyWarnings}" includeantruntime="false">
       <src refid="my-src-dirs"/>
       <classpath refid="project.class.path" />
-      <compilerarg value="--add-modules=java.activation,java.xml.ws.annotation" />
+      <compilerarg value="${j9.module.args}" compiler="javac1.9"/>
     </javac>
 
     <javac srcdir="${build.sqlc}/srcAD" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" nowarn="${friendlyWarnings}" includeantruntime="false">