summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2012-01-22 18:24:23 +0100
committerSven Gothel <sgothel@jausoft.com>2012-01-22 18:24:23 +0100
commit64639b805a32338385421f168e12c1ef7f749d00 (patch)
tree6b027d14cf4b9cfe2a8db72ed8a000d98fca036a
parent36c99b43e09999a560a086be10e392aad915b1f3 (diff)
Fix Bug 516 (Determine Java Version); Minor fixes (jogamp/common/** ..)
Current minimum requirements are: - Java 1.6 (Level 6.0) - Android SDK API Level 9 (Version 2.3 Gingerbread) Official production builds are performed w/ Java 1.6. - Java 1.6 (Level 6.0) - Android SDK API Level 9 (Version 2.3 Gingerbread) Android supports Java language level 6.0. Nevertheless, it cannot be guaranteed whether the Android API supports all classes and methods of Java 1.6. It is required for JogAmp developers to validate Android compatibility by an Android crosscompilation build. Current GlueGen code utilizes some minor Java 1.6 features which could be replaced, however it's not desired at this point since we have no mode hard Java 1.5 constraints. Notes: - On OS X 10.5.8, only the 64bit version of Java6 is available and hence the only supported one on Leopard. +++ Pushing determination of host (compiletime) and target (runtime) Java version to 'jogamp-env.xml'. jogamp-env.xml uses: env: SOURCE_LEVEL -> propery: target.sourcelevel def.: ${ant.java.version} >=1.6 (!) env: TARGET_LEVEL -> propery: target.targetlevel def.: ${ant.java.version} >=1.6 (!) env: TARGET_RT_JAR -> propery: target.rt.jar def.: ${java.home}/lib/rt.jar Either all above values are set, or none at all (default), otherwise a build error is being thrown. Further more we have the compiletime properties: host.sourcelevel def.: ${ant.java.version} >= 1.6 (!) host.targetlevel def.: ${ant.java.version} >= 1.6 (!) host.rt.jar def.: ${java.home}/lib/rt.jar +++ - 'javac.memorymax' defaults to 1024m now.
-rw-r--r--make/build-test.xml13
-rw-r--r--make/build.xml39
-rw-r--r--make/jogamp-androidtasks.xml8
-rwxr-xr-xmake/jogamp-env.xml148
-rwxr-xr-xmake/scripts/make.gluegen.all.android-armv7-cross.sh3
-rwxr-xr-xmake/scripts/make.gluegen.all.linux-x86_64.sh7
-rwxr-xr-xmake/scripts/make.gluegen.all.macosx.sh8
7 files changed, 187 insertions, 39 deletions
diff --git a/make/build-test.xml b/make/build-test.xml
index 6728cd7..00fd396 100644
--- a/make/build-test.xml
+++ b/make/build-test.xml
@@ -100,14 +100,6 @@
<property name="test.archive.name" value="${archive.name}-test-results-${build.node.name}"/>
- <property name="target.sourcelevel" value="1.5" />
- <property name="host.sourcelevel" value="1.5" />
- <property name="javacdebug" value="true" />
- <property name="javacdebuglevel" value="source,lines" />
- <!--property name="javacdebuglevel" value="source,lines,vars" /-->
- <!-- property name="javac.memorymax" value="128m" /--> <!-- I ran out of memory with these .. linux x86_64 6u14 -->
- <property name="javac.memorymax" value="512m" />
-
</target>
<target name="java.build" depends="java.generate">
@@ -119,7 +111,10 @@
fork="yes"
includeAntRuntime="false"
memoryMaximumSize="${javac.memorymax}"
- source="${target.sourcelevel}" debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ source="${target.sourcelevel}"
+ target="${target.targetlevel}"
+ bootclasspath="${target.rt.jar}"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
<classpath refid="junit.compile.classpath"/>
<src path="${test.base.dir}"/>
<src path="${build_t.gen}" />
diff --git a/make/build.xml b/make/build.xml
index 87678bc..74f9078 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -11,14 +11,6 @@
-->
<project name="GlueGen" basedir="." default="all">
- <fail message="Please build using Ant 1.8.0 or higher.">
- <condition>
- <not>
- <antversion atleast="1.8.0"/>
- </not>
- </condition>
- </fail>
-
<import file="gluegen-cpptasks.xml" />
<import file="jogamp-archivetasks.xml" />
<import file="jogamp-androidtasks.xml" />
@@ -45,7 +37,8 @@
<!-- Declare all paths and user defined variables. -->
<!-- property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" /-->
- <property name="javadoc.link" value="http://download.oracle.com/javase/1.5.0/docs/api/" />
+ <!-- property name="javadoc.link" value="http://download.oracle.com/javase/1.5.0/docs/api/" /-->
+ <property name="javadoc.link" value="http://docs.oracle.com/javase/6/docs/api/" />
<!-- The source and build directories. -->
<property name="project.root" value=".." />
@@ -139,17 +132,9 @@
<property name="archive.name" value="gluegen-${gluegen.version}-${os.and.arch}" />
<property name="archive" value="${build}/${archive.name}" />
- <property name="target.sourcelevel" value="1.5" />
- <property name="host.sourcelevel" value="1.5" />
- <property name="javacdebug" value="true" />
- <property name="javacdebuglevel" value="source,lines" />
- <!--property name="javacdebuglevel" value="source,lines,vars" /-->
- <!-- property name="javac.memorymax" value="128m" /--> <!-- I ran out of memory with these .. linux x86_64 6u14 -->
- <property name="javac.memorymax" value="512m" />
-
<property name="gluegen.excludes.all" value="${gluegen.excludes.nsig}" />
<property name="gluegen-rt.classes" value="com/jogamp/gluegen/runtime/**"/>
- <property name="jogamp.common.classes" value="com/jogamp/common/**"/>
+ <property name="jogamp.common.classes" value="com/jogamp/common/** jogamp/common/**"/>
</target>
<!--
@@ -663,24 +648,30 @@
<!-- Build GlueGen using the generated Java files along with the
- original source. -->
- <!--compile gluegen-rt with source=1.5 first-->
+ <!--compile gluegen-rt first-->
<javac destdir="${classes}"
includeAntRuntime="false"
includes="${gluegen-rt.classes} ${jogamp.common.classes}"
excludes="${gluegen.excludes.all}"
memoryMaximumSize="${javac.memorymax}"
- source="${target.sourcelevel}" debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ source="${target.sourcelevel}"
+ target="${target.targetlevel}"
+ bootclasspath="${target.rt.jar}"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
<src path="${src.java}" />
<src path="${src.generated.java}" />
<classpath refid="gluegencompile.classpath" />
</javac>
- <!--compile gluegen with source=1.5-->
+ <!--compile gluegen (compile time) -->
<javac destdir="${classes}"
includeAntRuntime="true"
excludes="${gluegen.excludes.all} ${gluegen-rt.classes}"
memoryMaximumSize="${javac.memorymax}"
- source="${target.sourcelevel}" debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ source="${host.sourcelevel}"
+ target="${host.targetlevel}"
+ bootclasspath="${host.rt.jar}"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
<src path="${src.java}" />
<src path="${src.generated.java}" />
<classpath refid="gluegencompile.classpath" />
@@ -816,8 +807,8 @@
sourcepath="${src.java};${src.generated.java}"
destdir="${javadoc.gluegen.path}" windowtitle="GlueGen Runtime Documentation"
overview="../src/java/com/jogamp/gluegen/package.html"
- source="1.5"
- maxmemory="256m" >
+ source="${target.sourcelevel}"
+ maxmemory="${javac.memorymax}" >
<classpath path="${classes}"/>
<link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" />
</javadoc>
diff --git a/make/jogamp-androidtasks.xml b/make/jogamp-androidtasks.xml
index affd277..3f7b3f0 100644
--- a/make/jogamp-androidtasks.xml
+++ b/make/jogamp-androidtasks.xml
@@ -56,8 +56,6 @@
<var name="m.aapt.keystore.file" unset="true"/>
<var name="m.aapt.java.encoding" unset="true"/>
- <var name="m.aapt.java.target" unset="true"/>
- <var name="m.aapt.java.source" unset="true"/>
<property name="m.aapt.build.apk" value="@{jarbuilddir}/@{jarbasename}.apk.d" />
<property name="m.aapt.dex.file" location="${m.aapt.build.apk}/image/classes.dex" />
@@ -66,8 +64,6 @@
<property name="m.aapt.release.file.name" value="@{jarbuilddir}/@{jarbasename}.apk" />
<property name="m.aapt.java.encoding" value="UTF-8" />
- <property name="m.aapt.java.target" value="1.5" />
- <property name="m.aapt.java.source" value="1.5" />
<condition property="m.aapt.keystore.file" value="@{keystore.file}" else="${m.aapt.build.apk}/debug.keystore">
<available file="@{keystore.file}"/>
@@ -113,7 +109,9 @@
<echo>aapt.signed @{jarbasename}: compiling R.java...</echo>
<javac encoding="${m.aapt.java.encoding}"
- source="${m.aapt.java.source}" target="${m.aapt.java.target}"
+ source="${target.sourcelevel}"
+ target="${target.targetlevel}"
+ bootclasspath="${target.rt.jar}"
debug="true" extdirs=""
destdir="${m.aapt.build.apk}/image/lib/classes"
verbose="true">
diff --git a/make/jogamp-env.xml b/make/jogamp-env.xml
index e53ffe6..9ded98d 100755
--- a/make/jogamp-env.xml
+++ b/make/jogamp-env.xml
@@ -1,7 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Current minimum requirements are:
+ - Java 1.6 (Level 6.0)
+ - Android SDK API Level 9 (Version 2.3 Gingerbread)
+
+ Official production builds are performed w/ Java 1.6.
+ - Java 1.6 (Level 6.0)
+ - Android SDK API Level 9 (Version 2.3 Gingerbread)
+
+ Android supports Java language level 6.0.
+ Nevertheless, it cannot be guaranteed whether the Android API
+ supports all classes and methods of Java 1.6.
+ It is required for JogAmp developers to validate Android compatibility
+ by an Android crosscompilation build.
+
+ Current GlueGen code utilizes some minor Java 1.6 features
+ which could be replaced, however it's not desired at this point
+ since we have no mode hard Java 1.5 constraints.
+ -->
+
<project name="jogamp-env" basedir=".">
- <target name="jogamp.env.init">
+ <target name="jogamp.env.validation">
+ <echo message="ant.version ${ant.version}"/>
+ <echo message="ant.java.version ${ant.java.version}"/>
+ <echo message="java.version ${java.version}"/>
+ <echo message="java.home ${java.home}"/>
+
+ <fail message="Please build using Ant 1.8.0 or higher.">
+ <condition>
+ <not>
+ <antversion atleast="1.8.0"/>
+ </not>
+ </condition>
+ </fail>
+
+ <fail message="Unsupported Java version: ${ant.java.version}. Make sure that the version of the Java compiler is 1.6 (6.0) or greater.">
+ <condition>
+ <not>
+ <or>
+ <contains string="${ant.java.version}" substring="1.6" casesensitive="false" />
+ <contains string="${ant.java.version}" substring="1.7" casesensitive="false" />
+ <contains string="${ant.java.version}" substring="1.8" casesensitive="false" />
+ </or>
+ </not>
+ </condition>
+ </fail>
+
+ </target>
+
+ <target name="jogamp.env.init" depends="jogamp.env.validation">
<property environment="env" />
<!-- only set 'build.archiveon' if set in environment to trigger archive creation -->
@@ -21,6 +69,104 @@
</not>
</condition>
+ <condition property="target.sourcelevel" value="${env.SOURCE_LEVEL}">
+ <not>
+ <equals arg1="${env.SOURCE_LEVEL}" arg2="$${env.SOURCE_LEVEL}" casesensitive="true" />
+ </not>
+ </condition>
+
+ <condition property="target.targetlevel" value="${env.TARGET_LEVEL}">
+ <not>
+ <equals arg1="${env.TARGET_LEVEL}" arg2="$${env.TARGET_LEVEL}" casesensitive="true" />
+ </not>
+ </condition>
+
+ <condition property="target.rt.jar" value="${env.TARGET_RT_JAR}">
+ <not>
+ <equals arg1="${env.TARGET_RT_JAR}" arg2="$${env.TARGET_RT_JAR}" casesensitive="true" />
+ </not>
+ </condition>
+
+ <fail message="You need to specify all properties 'target.sourcelevel', 'target.targetlevel' and 'target.rt.jar' or none at all.">
+ <condition>
+ <and>
+ <or>
+ <isset property="target.sourcelevel"/>
+ <isset property="target.targetlevel"/>
+ <isset property="target.rt.jar"/>
+ </or>
+ <not>
+ <and>
+ <isset property="target.sourcelevel"/>
+ <isset property="target.targetlevel"/>
+ <isset property="target.rt.jar"/>
+ </and>
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+ <condition property="target.user.set" value="true">
+ <and>
+ <isset property="target.sourcelevel"/>
+ <isset property="target.targetlevel"/>
+ <isset property="target.rt.jar"/>
+ </and>
+ </condition>
+
+ <property name="target.sourcelevel" value="${ant.java.version}" /> <!-- default fallback values -->
+ <property name="target.targetlevel" value="${ant.java.version}" /> <!-- default fallback values -->
+ <property name="target.rt.jar" value="${java.home}/lib/rt.jar" /> <!-- default fallback values -->
+ <echo message="target.user.set ${target.user.set}"/>
+ <echo message="target.sourcelevel ${target.sourcelevel}"/>
+ <echo message="target.targetlevel ${target.targetlevel}"/>
+ <echo message="target.rt.jar ${target.rt.jar}"/>
+
+ <property name="host.sourcelevel" value="${ant.java.version}" /> <!-- default values for compile time components -->
+ <property name="host.targetlevel" value="${ant.java.version}" /> <!-- default values for compile time components -->
+ <property name="host.rt.jar" value="${java.home}/lib/rt.jar" /> <!-- default values for compile time components -->
+ <echo message="host.sourcelevel ${host.sourcelevel}"/>
+ <echo message="host.targetlevel ${host.targetlevel}"/>
+ <echo message="host.rt.jar ${host.rt.jar}"/>
+
+ <fail message="Unsupported Target Java version (sourcelevel): ${target.sourcelevel}. Make sure that the version of the Java compiler is 1.6 (6.0) or greater.">
+ <condition>
+ <not>
+ <or>
+ <contains string="${target.sourcelevel}" substring="1.6" casesensitive="false" />
+ <contains string="${target.sourcelevel}" substring="1.7" casesensitive="false" />
+ <contains string="${target.sourcelevel}" substring="1.8" casesensitive="false" />
+ </or>
+ </not>
+ </condition>
+ </fail>
+ <fail message="Unsupported Target Java version (targetlevel): ${target.targetlevel}. Make sure that the version of the Java compiler is 1.6 (6.0) or greater.">
+ <condition>
+ <not>
+ <or>
+ <contains string="${target.targetlevel}" substring="1.6" casesensitive="false" />
+ <contains string="${target.targetlevel}" substring="1.7" casesensitive="false" />
+ <contains string="${target.targetlevel}" substring="1.8" casesensitive="false" />
+ </or>
+ </not>
+ </condition>
+ </fail>
+
+ <property name="javacdebug" value="true" />
+ <property name="javacdebuglevel" value="source,lines" />
+ <!--property name="javacdebuglevel" value="source,lines,vars" /-->
+ <!-- property name="javac.memorymax" value="128m" /--> <!-- I ran out of memory with these .. linux x86_64 6u14 -->
+ <property name="javac.memorymax" value="1024m" />
+
+ <echo message="javacdebug ${javacdebug}"/>
+ <echo message="javacdebuglevel ${javacdebuglevel}"/>
+ <echo message="javac.memorymax ${javac.memorymax}"/>
+
+ <echo message="build.archiveon ${build.archiveon}"/>
+ <echo message="build.node.name ${build.node.name}"/>
+
+ <echo message="android.version ${android.version}"/>
+
</target>
</project>
diff --git a/make/scripts/make.gluegen.all.android-armv7-cross.sh b/make/scripts/make.gluegen.all.android-armv7-cross.sh
index 23b13b7..b294bed 100755
--- a/make/scripts/make.gluegen.all.android-armv7-cross.sh
+++ b/make/scripts/make.gluegen.all.android-armv7-cross.sh
@@ -105,6 +105,9 @@ ${TARGET_OS_PATH}/lib/crtend_android.o \
which gcc 2>&1 | tee make.gluegen.all.android-armv7-cross.log
ant \
+ -Dtarget.sourcelevel=1.6 \
+ -Dtarget.targetlevel=1.6 \
+ -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \
-Dgluegen-cpptasks.file=`pwd`/lib/gluegen-cpptasks-android-armv7.xml \
-Drootrel.build=build-android-armv7 \
-Dgluegen.cpptasks.detected.os=true \
diff --git a/make/scripts/make.gluegen.all.linux-x86_64.sh b/make/scripts/make.gluegen.all.linux-x86_64.sh
index 17ef15b..0ed640e 100755
--- a/make/scripts/make.gluegen.all.linux-x86_64.sh
+++ b/make/scripts/make.gluegen.all.linux-x86_64.sh
@@ -12,9 +12,16 @@ fi
# -DisLinux=true \
# -DisLinuxAMD64=true \
# -DisX11=true \
+#
+# -Dtarget.sourcelevel=1.6 \
+# -Dtarget.targetlevel=1.6 \
+# -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \
# BUILD_ARCHIVE=true \
ant \
+ -Dtarget.sourcelevel=1.6 \
+ -Dtarget.targetlevel=1.6 \
+ -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \
-Djavacdebuglevel="source,lines,vars" \
-Drootrel.build=build-x86_64 \
$* 2>&1 | tee make.gluegen.all.linux-x86_64.log
diff --git a/make/scripts/make.gluegen.all.macosx.sh b/make/scripts/make.gluegen.all.macosx.sh
index 06fb947..94bcd4e 100755
--- a/make/scripts/make.gluegen.all.macosx.sh
+++ b/make/scripts/make.gluegen.all.macosx.sh
@@ -5,7 +5,15 @@ if [ -e /opt-share/etc/profile.ant ] ; then
fi
# -Dc.compiler.debug=true
+#
+# -Dtarget.sourcelevel=1.6 \
+# -Dtarget.targetlevel=1.6 \
+# -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \
+
ant \
+ -Dtarget.sourcelevel=1.6 \
+ -Dtarget.targetlevel=1.6 \
+ -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \
-Drootrel.build=build-macosx \
$* 2>&1 | tee make.gluegen.all.macosx.log