[med-svn] [biojava4-live] 01/02: fix javax.xml.bind compilation with jdk >= 1.8

Olivier Sallou osallou at debian.org
Mon Sep 11 11:30:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

osallou pushed a commit to branch master
in repository biojava4-live.

commit 0751cfa1ac825dd3140fc7270511db1a4d745378
Author: Olivier Sallou <osallou at debian.org>
Date:   Mon Sep 11 07:46:07 2017 +0000

    fix javax.xml.bind compilation with jdk >= 1.8
---
 debian/build.xml | 41 ++++++++++++++++++++++++++++++++++++-----
 debian/changelog |  6 ++++++
 debian/control   |  1 +
 debian/rules     |  2 +-
 4 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/debian/build.xml b/debian/build.xml
index c993062..250c143 100644
--- a/debian/build.xml
+++ b/debian/build.xml
@@ -1,5 +1,12 @@
 <?xml  version="1.0" ?>
 <project name="BJLIB" default="jar" basedir=".">
+
+        <taskdef resource="net/sf/antcontrib/antlib.xml">
+            <classpath>
+                <pathelement location="/usr/share/java/ant-contrib.jar" />
+            </classpath>
+        </taskdef>
+
 	<!-- Directory structure -->
 	<property name="build.dir" location="../build/BJLIB"/>
         <property name="test.dir" location="../buildtest/BJLIB"/>
@@ -66,15 +73,24 @@
 	<target name="javadocs">
                 <mkdir dir="${docs.dir}"/>
 		<mkdir dir="${docs.lib.dir}"/>
-		<javadoc destdir="${docs.lib.dir}" sourcepath="${src.dir}" packagenames="org.*" encoding="UTF-8">
-			<link href="http://java.sun.com/j2se/1.6.0/docs/api/"/>
-		</javadoc>
+                <if><equals arg1="${ant.java.version}" arg2="1.8" />
+                <then>
+                    <javadoc destdir="${docs.lib.dir}" sourcepath="${src.dir}" packagenames="org.*" encoding="UTF-8" additionalparam="-Xdoclint:none" classpathref="compile.classpath">
+                        <link href="http://java.sun.com/j2se/1.6.0/docs/api/"/>
+                    </javadoc>
+                </then>
+                <else>
+                    <javadoc destdir="${docs.lib.dir}" sourcepath="${src.dir}" packagenames="org.*" encoding="UTF-8" additionalparam="-Xdoclint:none --add-modules java.se.ee" classpathref="compile.classpath">
+                        <link href="http://java.sun.com/j2se/1.6.0/docs/api/"/>
+                    </javadoc>
+                </else>
+                </if>
 	</target>
 	
 	<target name="compile">
 		<mkdir dir="${class.dir}"/>
 		<mkdir dir="${dist.dir}"/>
-		<javac srcdir="${src.dir}" destdir="${class.dir}" classpathref="compile.classpath" debug="${debug}" optimize="${optimized}" nowarn="true" source="1.7" target="1.7">
+		<javac srcdir="${src.dir}" destdir="${class.dir}" classpathref="compile.classpath" debug="${debug}" optimize="${optimized}" nowarn="true" source="1.8" target="1.8">
 		</javac>
                 <copy todir="${class.dir}" failonerror="false">
                   <fileset dir="${resources.dir}"/>
@@ -83,7 +99,7 @@
 
         <target name="compile-test">
                 <mkdir dir="${test.class.dir}"/>
-                <javac srcdir="${test.src.dir}" destdir="${test.class.dir}" classpathref="compile.classpath" debug="${debug}" optimize="${optimized}" nowarn="true">
+                <javac srcdir="${test.src.dir}" destdir="${test.class.dir}" classpathref="compile.classpath" debug="${debug}" optimize="${optimized}" nowarn="true" source="1.8" target="1.8">
                 </javac>
                 <copy todir="${test.class.dir}" failonerror="false">
                   <fileset dir="${test.resources.dir}"/>
@@ -99,13 +115,28 @@
   </path>
 
   <target name="test" depends="compile-test">
+    <echo>Using java version ${java.version}</echo>
+    <if><equals arg1="${ant.java.version}" arg2="1.8" />
+    <then>
+    <junit haltonfailure="yes" printsummary="yes" fork="true">
+      <classpath refid="test.classpath"/>
+      <formatter type="plain" usefile="false" />
+      <batchtest>
+        <fileset dir="${test.class.dir}" includes="**/*Test.class" excludes="**/Abstract*.class" />
+      </batchtest>
+    </junit>
+    </then>
+    <else>
     <junit haltonfailure="yes" printsummary="yes" fork="true">
+      <jvmarg line="--add-modules java.se.ee"/>
       <classpath refid="test.classpath"/>
       <formatter type="plain" usefile="false" />
       <batchtest>
         <fileset dir="${test.class.dir}" includes="**/*Test.class" excludes="**/Abstract*.class" />
       </batchtest>
     </junit>
+    </else>
+    </if>
   </target>
 	
 	<target name="jar" depends="compile">
diff --git a/debian/changelog b/debian/changelog
index a297a5a..0c03e23 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+biojava4-live (4.2.7+dfsg-2) unstable; urgency=medium
+
+  * Fix openjdk 1.8/1.9 compilation/testing (Closes: #875334). 
+
+ -- Olivier Sallou <osallou at debian.org>  Mon, 11 Sep 2017 07:45:17 +0000
+
 biojava4-live (4.2.7+dfsg-1) unstable; urgency=medium
 
   * New upstream release 
diff --git a/debian/control b/debian/control
index 2fbb50a..f0e13f9 100644
--- a/debian/control
+++ b/debian/control
@@ -21,6 +21,7 @@ Build-Depends-Indep: libcommons-dbcp-java,
                      junit4,
                      javahelper,
                      ant-optional,
+                     ant-contrib,
                      icedtea-netx,
                      libhamcrest-java,
                      libjson-simple-java (>= 1.1.1),
diff --git a/debian/rules b/debian/rules
index b4426ea..bd53319 100755
--- a/debian/rules
+++ b/debian/rules
@@ -53,7 +53,7 @@ override_dh_auto_build:
 	cp -r biojava-*/src biojavadoc/
 	sed -e 's/BJLIB/biojava/g' debian/build.xml > biojavadoc/build.xml
 	cd biojavadoc && ant javadocs
-	rm -rf biojavadoc
+	# rm -rf biojavadoc
 
 override_dh_auto_test:
 	echo '*********************************************************************************'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/biojava4-live.git



More information about the debian-med-commit mailing list