aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.xml34
-rw-r--r--nbproject/project.properties7
-rw-r--r--src/com/jogamp/common/AutoCloseable.jtemplate (renamed from src/com/jogamp/opencl/AutoCloseable.java)8
-rw-r--r--src/com/jogamp/opencl/CLEventList.java4
-rw-r--r--src/com/jogamp/opencl/CLObject.java2
5 files changed, 50 insertions, 5 deletions
diff --git a/build.xml b/build.xml
index bbbf2c9d..d805ca41 100644
--- a/build.xml
+++ b/build.xml
@@ -34,7 +34,39 @@
<property name="dist.zip.name" value="jocl-${jocl.version}-${os.and.arch}"/>
</target>
- <target name="-pre-compile" depends="generate-binding"/>
+ <target name="-pre-compile" depends="detect-jdk,prepare-jdk5-build,prepare-jdk7-build,generate-binding"/>
+
+ <target name="detect-jdk">
+ <condition property="enable.jdk7.features">
+ <or>
+ <equals arg1="1.7" arg2="${javac.source}"/>
+ <equals arg1="1.8" arg2="${javac.source}"/>
+ </or>
+ </condition>
+ </target>
+
+ <target name="prepare-jdk5-build" if="${enable.jdk7.features}">
+
+ <echo message="JDK7 features enabled"/>
+
+ <copy file="${basedir}/src/com/jogamp/common/AutoCloseable.jtemplate"
+ tofile="${basedir}/gensrc/java/com/jogamp/common/AutoCloseable.java" overwrite="true">
+ <filterchain>
+ <replaceregex pattern="/\*extends java.lang.AutoCloseable\*/" replace="extends java.lang.AutoCloseable"/>
+ </filterchain>
+ </copy>
+
+ </target>
+
+ <target name="prepare-jdk7-build" unless="${enable.jdk7.features}">
+
+ <echo message="JDK7 features dissabled"/>
+
+ <copy file="${basedir}/src/com/jogamp/common/AutoCloseable.jtemplate"
+ tofile="${basedir}/gensrc/java/com/jogamp/common/AutoCloseable.java" overwrite="true">
+ </copy>
+
+ </target>
<target name="generate-binding" depends="prepare-build,preprocess-headers" unless="dont-generate">
diff --git a/nbproject/project.properties b/nbproject/project.properties
index d3baa179..7de4c49a 100644
--- a/nbproject/project.properties
+++ b/nbproject/project.properties
@@ -10,7 +10,7 @@ javac.processorpath=\
${javac.classpath}
application.title=JOCL
application.vendor=Michael Bien
-build.classes.excludes=**/*.java,**/*.form,**/*.c
+build.classes.excludes=**/*.java,**/*.jtemplate,**/*.form,**/*.c
# This directory is removed when the project is cleaned:
build.dir=${rootrel.build}
build.classes.dir=${build.dir}/classes
@@ -102,10 +102,15 @@ src.dir=src
src.java.dir=gensrc/java
src.native.dir=gensrc/native
test.src.dir=test
+#no classpath for jarfile
+jar.classpath=
#the jocl version you are building
jocl_base_version=0.9
+#force enable jdk7 features
+#enable.jdk7.features=true
+
#crosscompile=true
#enable compiletime linking
diff --git a/src/com/jogamp/opencl/AutoCloseable.java b/src/com/jogamp/common/AutoCloseable.jtemplate
index 383f42a4..a77e3df2 100644
--- a/src/com/jogamp/opencl/AutoCloseable.java
+++ b/src/com/jogamp/common/AutoCloseable.jtemplate
@@ -26,9 +26,11 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.opencl;
+package com.jogamp.common;
-// early import of JDK7's ARM interface for JDK6 backwards compatibility.
-public interface AutoCloseable {
+/**
+ * import of JDK7's ARM interface allowing JDK6 backwards compatibility.
+ */
+public interface AutoCloseable /*extends java.lang.AutoCloseable*/ {
void close() throws Exception;
}
diff --git a/src/com/jogamp/opencl/CLEventList.java b/src/com/jogamp/opencl/CLEventList.java
index 33149377..c20a1f82 100644
--- a/src/com/jogamp/opencl/CLEventList.java
+++ b/src/com/jogamp/opencl/CLEventList.java
@@ -28,6 +28,7 @@
package com.jogamp.opencl;
+import com.jogamp.common.AutoCloseable;
import com.jogamp.common.nio.PointerBuffer;
import java.util.Iterator;
@@ -78,6 +79,9 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
IDs.rewind();
}
+ /**
+ * @deprecated use {@link #release()} instead.
+ */
public final void close() throws Exception {
release();
}
diff --git a/src/com/jogamp/opencl/CLObject.java b/src/com/jogamp/opencl/CLObject.java
index 3653ae30..54031884 100644
--- a/src/com/jogamp/opencl/CLObject.java
+++ b/src/com/jogamp/opencl/CLObject.java
@@ -28,6 +28,8 @@
package com.jogamp.opencl;
+import com.jogamp.common.AutoCloseable;
+
/**
* Common superclass for all OpenCL objects.
* @author Michael Bien