diff options
33 files changed, 1161 insertions, 11 deletions
diff --git a/maven/.gitignore b/maven/.gitignore new file mode 100644 index 0000000..ce3c8b8 --- /dev/null +++ b/maven/.gitignore @@ -0,0 +1,8 @@ +output +tests-cache +tests-repository +tests/*/.* +tests/*/pom.xml +tests/.* +tests/maven-settings.xml +tests/pom.xml diff --git a/maven/README.txt b/maven/README.txt index 7d6ea9a..a725c27 100644 --- a/maven/README.txt +++ b/maven/README.txt @@ -26,12 +26,12 @@ Instructions (deploying a release to Central) 1. Obtain the jogamp-all-platforms.7z release for the version of jogamp you wish to deploy to Central. As an example, we'll - use 2.0-rc11. Unpack the 7z file to the 'input' subdirectory, + use 2.3.0. Unpack the 7z file to the 'input' subdirectory, creating it if it doesn't exist: $ mkdir input $ cd input - $ wget http://jogamp.org/deployment/v2.0-rc11/archive/jogamp-all-platforms.7z + $ wget http://jogamp.org/deployment/v2.3.0/archive/jogamp-all-platforms.7z $ 7z x jogamp-all-platforms.7z 2. Switch back to the old directory: @@ -77,7 +77,7 @@ Instructions (deploying a release to Central) 4. Now, run make.sh with the desired version number to generate POM files and copy jar files to the correct places: - $ ./make.sh 2.0-rc11 + $ ./make.sh 2.3.0 5. The scripts will have created an 'output' directory, containing all the prepared releases. It's now necessary to deploy the releases, @@ -117,11 +117,11 @@ Instructions (deploying a release to Central) 6. Now we can deploy an individual project to the staging repository: - $ ./make-deploy-one.sh gluegen-rt-main 2.0-rc11 + $ ./make-deploy-one.sh gluegen-rt-main 2.3.0 Or deploy all of the projects defined in make-projects.txt: - $ ./make-deploy.sh 2.0-rc11 + $ ./make-deploy.sh 2.3.0 The scripts will upload all necessary jars, poms, signatures, etc. @@ -203,11 +203,11 @@ files were deployed along with the main jar file for each project. Using -Dclassifier="natives-${PLATFORM}" done - Assuming version 2.0-rc11, this results in: + Assuming version 2.3.0, this results in: - gluegen-rt-2.0-rc11.jar - gluegen-rt-2.0-rc11-natives-linux-amd64.jar - gluegen-rt-2.0-rc11-natives-linux-i586.jar + gluegen-rt-2.3.0.jar + gluegen-rt-2.3.0-natives-linux-amd64.jar + gluegen-rt-2.3.0-natives-linux-i586.jar ... This results in a project with a main jar and a set of native jar @@ -232,6 +232,29 @@ when added to the dependencies of any project, pulls in all of the real jogamp jars, native or otherwise. ------------------------------------------------------------------------ +Test suite +------------------------------------------------------------------------ + +The scripts now include a basic test suite for checking that the +produced packages actually work in Maven. + +Assuming that the packages have been created with the ./make.sh script +above: + + 1. Generate project files for the tests: + + $ ./make-tests.sh 2.3.0 + + 2. Deploy packages to a local directory for the unit tests + to use: + + $ ./make-tests-deploy.sh 2.3.0 + + 3. Run the tests. + + $ ./make-tests-run.sh + +------------------------------------------------------------------------ Notes ------------------------------------------------------------------------ diff --git a/maven/make-tests-clean.sh b/maven/make-tests-clean.sh new file mode 100755 index 0000000..9869060 --- /dev/null +++ b/maven/make-tests-clean.sh @@ -0,0 +1,25 @@ +#!/bin/sh -ex + +info() +{ + echo "make-tests-clean: info: $1" 1>&2 +} + +fatal() +{ + echo "make-tests-clean: fatal: $1" 1>&2 + exit 1 +} + +CURRENT_DIR=`pwd` || + fatal "could not save current working directory" + +cd tests + +rm -f pom.xml + +for d in test-* +do + rm -f "${d}/pom.xml" +done + diff --git a/maven/make-tests-deploy.sh b/maven/make-tests-deploy.sh new file mode 100755 index 0000000..e4aadd8 --- /dev/null +++ b/maven/make-tests-deploy.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ $# -ne 1 ] +then + echo "usage: version" 1>&2 + exit 1 +fi + +VERSION="$1" +shift + +PWD=`pwd` || exit 1 + +export REPOSITORY_ID="tests" +export REPOSITORY_URL="file://${PWD}/tests-repository" + +./make-deploy.sh "${VERSION}" diff --git a/maven/make-tests-run.sh b/maven/make-tests-run.sh new file mode 100755 index 0000000..84c0900 --- /dev/null +++ b/maven/make-tests-run.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +CACHE_PATH=`realpath tests-cache` || exit 1 + +cd tests || exit 1 + +rm -f maven-settings.xml || exit 1 + +cat > maven-settings.xml <<EOF +<?xml version="1.0" encoding="UTF-8"?> +<settings + xmlns="http://maven.apache.org/SETTINGS/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> + <localRepository>${CACHE_PATH}</localRepository> +</settings> +EOF + +exec mvn --settings maven-settings.xml -U -C clean test diff --git a/maven/make-tests.sh b/maven/make-tests.sh new file mode 100755 index 0000000..00dc35f --- /dev/null +++ b/maven/make-tests.sh @@ -0,0 +1,45 @@ +#!/bin/sh -ex + +info() +{ + echo "make-tests: info: $1" 1>&2 +} + +fatal() +{ + echo "make-tests: fatal: $1" 1>&2 + exit 1 +} + +if [ $# -ne 1 ] +then + echo "usage: version" 1>&2 + exit 1 +fi + +VERSION="$1" +shift + +CURRENT_DIR=`pwd` || + fatal "could not save current working directory" + +export REPOSITORY_URL="file://${PWD}/tests-repository" + +cd tests + +./pom.sh pom.in "${VERSION}" > pom.xml.tmp || + fatal "could not generate pom.xml" +mv pom.xml.tmp pom.xml || + fatal "could not rename pom.xml" + +CURRENT_TEST_DIR=`pwd` || + fatal "could not save current working directory" + +for d in test-* +do + ./pom.sh "${d}/pom.in" "${VERSION}" > "${d}/pom.xml.tmp" || + fatal "could not generate pom.xml" + mv "${d}/pom.xml.tmp" "${d}/pom.xml" || + fatal "could not rename pom.xml" +done + diff --git a/maven/projects/jogl-main/atomics b/maven/projects/jogl-main/atomics new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/maven/projects/jogl-main/atomics @@ -0,0 +1 @@ + diff --git a/maven/projects/jogl-main/main-jar b/maven/projects/jogl-main/main-jar new file mode 100644 index 0000000..421376d --- /dev/null +++ b/maven/projects/jogl-main/main-jar @@ -0,0 +1 @@ +dummy diff --git a/maven/projects/jogl-main/natives b/maven/projects/jogl-main/natives new file mode 100644 index 0000000..621e94f --- /dev/null +++ b/maven/projects/jogl-main/natives @@ -0,0 +1 @@ +none diff --git a/maven/projects/jogl-main/pom.sh b/maven/projects/jogl-main/pom.sh new file mode 100755 index 0000000..10e42d7 --- /dev/null +++ b/maven/projects/jogl-main/pom.sh @@ -0,0 +1,80 @@ +#!/bin/sh + +if [ $# -lt 2 ] +then + echo "usage: version platforms+" 1>&2 + exit 1 +fi + +VERSION="$1" +shift +PLATFORMS="$@" + +cat <<EOF +<?xml version="1.0" encoding="UTF-8"?> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- --> + <!-- Auto generated by jogl-main.pom.sh, do not edit directly! --> + <!-- --> + + <modelVersion>4.0.0</modelVersion> + <groupId>org.jogamp.jogl</groupId> + <artifactId>jogl-main</artifactId> + <version>${VERSION}</version> + <packaging>jar</packaging> + <name>JOGL atomics</name> + <description>Java™ Binding for the OpenGL® API (Atomics frontend)</description> + <url>http://jogamp.org/jogl/www/</url> + + <!-- --> + <!-- Explicitly depend on jogl, and all of its native binary jars. --> + <!-- --> + + <dependencies> + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>jogl</artifactId> + <version>\${project.version}</version> + </dependency> + +EOF + +for BACKEND in osx win x11 +do + cat <<EOF + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>jogl</artifactId> + <version>\${project.version}</version> + <classifier>os-${BACKEND}</classifier> + </dependency> +EOF +done + +echo + +for PLATFORM in ${PLATFORMS} +do + cat <<EOF + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>jogl</artifactId> + <version>\${project.version}</version> + <classifier>natives-${PLATFORM}</classifier> + </dependency> +EOF +done + +cat <<EOF + </dependencies> + +EOF + +cat ../jogl/pom.in || exit 1 +cat <<EOF +</project> +EOF diff --git a/maven/projects/jogl-main/source-zip b/maven/projects/jogl-main/source-zip new file mode 100644 index 0000000..d405da9 --- /dev/null +++ b/maven/projects/jogl-main/source-zip @@ -0,0 +1 @@ +dummy-src diff --git a/maven/projects/nativewindow-main/atomics b/maven/projects/nativewindow-main/atomics new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/maven/projects/nativewindow-main/atomics @@ -0,0 +1 @@ + diff --git a/maven/projects/nativewindow-main/main-jar b/maven/projects/nativewindow-main/main-jar new file mode 100644 index 0000000..421376d --- /dev/null +++ b/maven/projects/nativewindow-main/main-jar @@ -0,0 +1 @@ +dummy diff --git a/maven/projects/nativewindow-main/natives b/maven/projects/nativewindow-main/natives new file mode 100644 index 0000000..621e94f --- /dev/null +++ b/maven/projects/nativewindow-main/natives @@ -0,0 +1 @@ +none diff --git a/maven/projects/nativewindow-main/pom.sh b/maven/projects/nativewindow-main/pom.sh new file mode 100755 index 0000000..7dd1406 --- /dev/null +++ b/maven/projects/nativewindow-main/pom.sh @@ -0,0 +1,80 @@ +#!/bin/sh + +if [ $# -lt 2 ] +then + echo "usage: version platforms+" 1>&2 + exit 1 +fi + +VERSION="$1" +shift +PLATFORMS="$@" + +cat <<EOF +<?xml version="1.0" encoding="UTF-8"?> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- --> + <!-- Auto generated by nativewindow-main.pom.sh, do not edit directly! --> + <!-- --> + + <modelVersion>4.0.0</modelVersion> + <groupId>org.jogamp.jogl</groupId> + <artifactId>nativewindow-main</artifactId> + <version>${VERSION}</version> + <packaging>jar</packaging> + <name>Nativewindow (Atomics frontend)</name> + <description>Java™ Binding for the OpenGL® API (Nativewindow atomics frontend)</description> + <url>http://jogamp.org/jogl/www/</url> + + <!-- --> + <!-- Explicitly depend on nativewindow, and all of its native binary jars. --> + <!-- --> + + <dependencies> + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>nativewindow</artifactId> + <version>\${project.version}</version> + </dependency> + +EOF + +for BACKEND in win osx x11 +do + cat <<EOF + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>nativewindow</artifactId> + <version>\${project.version}</version> + <classifier>os-${BACKEND}</classifier> + </dependency> +EOF +done + +echo + +for PLATFORM in ${PLATFORMS} +do + cat <<EOF + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>nativewindow</artifactId> + <version>\${project.version}</version> + <classifier>natives-${PLATFORM}</classifier> + </dependency> +EOF +done + +cat <<EOF + </dependencies> + +EOF + +cat ../jogl/pom.in || exit 1 +cat <<EOF +</project> +EOF diff --git a/maven/projects/nativewindow-main/source-zip b/maven/projects/nativewindow-main/source-zip new file mode 100644 index 0000000..d405da9 --- /dev/null +++ b/maven/projects/nativewindow-main/source-zip @@ -0,0 +1 @@ +dummy-src diff --git a/maven/projects/nativewindow/pom.sh b/maven/projects/nativewindow/pom.sh index e4ceda0..f91bf63 100755 --- a/maven/projects/nativewindow/pom.sh +++ b/maven/projects/nativewindow/pom.sh @@ -25,7 +25,7 @@ cat <<EOF <artifactId>nativewindow</artifactId> <version>${VERSION}</version> <packaging>jar</packaging> - <name>JOGL</name> + <name>Nativewindow</name> <description>Java™ Binding for the OpenGL® API (Native window atomic jar files)</description> <url>http://jogamp.org/jogl/www/</url> diff --git a/maven/projects/newt-main/atomics b/maven/projects/newt-main/atomics new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/maven/projects/newt-main/atomics @@ -0,0 +1 @@ + diff --git a/maven/projects/newt-main/main-jar b/maven/projects/newt-main/main-jar new file mode 100644 index 0000000..421376d --- /dev/null +++ b/maven/projects/newt-main/main-jar @@ -0,0 +1 @@ +dummy diff --git a/maven/projects/newt-main/natives b/maven/projects/newt-main/natives new file mode 100644 index 0000000..621e94f --- /dev/null +++ b/maven/projects/newt-main/natives @@ -0,0 +1 @@ +none diff --git a/maven/projects/newt-main/pom.sh b/maven/projects/newt-main/pom.sh new file mode 100755 index 0000000..02a5f9d --- /dev/null +++ b/maven/projects/newt-main/pom.sh @@ -0,0 +1,93 @@ +#!/bin/sh + +if [ $# -lt 2 ] +then + echo "usage: version platforms+" 1>&2 + exit 1 +fi + +VERSION="$1" +shift +PLATFORMS="$@" + +cat <<EOF +<?xml version="1.0" encoding="UTF-8"?> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- --> + <!-- Auto generated by newt-main.pom.sh, do not edit directly! --> + <!-- --> + + <modelVersion>4.0.0</modelVersion> + <groupId>org.jogamp.jogl</groupId> + <artifactId>newt-main</artifactId> + <version>${VERSION}</version> + <packaging>jar</packaging> + <name>NEWT (Atomics frontend)</name> + <description>Java™ Binding for the OpenGL® API (NEWT atomics frontend)</description> + <url>http://jogamp.org/jogl/www/</url> + + <!-- --> + <!-- Explicitly depend on newt, and all of its native binary jars. --> + <!-- --> + + <dependencies> + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>newt</artifactId> + <version>\${project.version}</version> + </dependency> + + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>newt</artifactId> + <version>\${project.version}</version> + <classifier>event</classifier> + </dependency> + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>newt</artifactId> + <version>\${project.version}</version> + <classifier>ogl</classifier> + </dependency> + +EOF + +for DRIVER in android bcm-old bcm-vc intelgdl kd linux osx win x11 +do + cat <<EOF + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>newt</artifactId> + <version>\${project.version}</version> + <classifier>driver-${DRIVER}</classifier> + </dependency> +EOF +done + +echo + +for PLATFORM in ${PLATFORMS} +do + cat <<EOF + <dependency> + <groupId>\${project.groupId}</groupId> + <artifactId>newt</artifactId> + <version>\${project.version}</version> + <classifier>natives-${PLATFORM}</classifier> + </dependency> +EOF +done + +cat <<EOF + </dependencies> + +EOF + +cat ../jogl/pom.in || exit 1 +cat <<EOF +</project> +EOF diff --git a/maven/projects/newt-main/source-zip b/maven/projects/newt-main/source-zip new file mode 100644 index 0000000..d405da9 --- /dev/null +++ b/maven/projects/newt-main/source-zip @@ -0,0 +1 @@ +dummy-src diff --git a/maven/projects/newt/pom.sh b/maven/projects/newt/pom.sh index da45efc..7132b8e 100755 --- a/maven/projects/newt/pom.sh +++ b/maven/projects/newt/pom.sh @@ -25,7 +25,7 @@ cat <<EOF <artifactId>newt</artifactId> <version>${VERSION}</version> <packaging>jar</packaging> - <name>JOGL</name> + <name>NEWT</name> <description>Java™ Binding for the OpenGL® API (NEWT atomic jar files)</description> <url>http://jogamp.org/jogl/www/</url> diff --git a/maven/tests/pom.in b/maven/tests/pom.in new file mode 100644 index 0000000..97c33b7 --- /dev/null +++ b/maven/tests/pom.in @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- Auto generated by pom.sh - Do not edit! --> + + <modelVersion>4.0.0</modelVersion> + <groupId>org.jogamp.maven</groupId> + <artifactId>tests</artifactId> + <version>JOGAMP_VERSION</version> + <packaging>pom</packaging> + <name>tests</name> + <description>Test suite for Maven packages</description> + <url>http://jogamp.org/</url> + + <modules> + <module>test-jogl-all-mobile</module> + <module>test-jogl-all-noawt</module> + <module>test-jogl-all</module> + <module>test-jogl-atomics</module> + </modules> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + +</project> diff --git a/maven/tests/pom.sh b/maven/tests/pom.sh new file mode 100755 index 0000000..c7ca6f4 --- /dev/null +++ b/maven/tests/pom.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +if [ $# -ne 2 ] +then + echo "usage: pom.in version" 1>&2 + exit 1 +fi + +POM_IN="$1" +shift +VERSION="$1" +shift + +if [ -z "${REPOSITORY_URL}" ] +then + echo "REPOSITORY_URL is unset" 1>&2 + exit 1 +fi + +exec m4 \ + -DJOGAMP_VERSION="${VERSION}" -DREPOSITORY_URL="${REPOSITORY_URL}" < "${POM_IN}" diff --git a/maven/tests/test-jogl-all-mobile/pom.in b/maven/tests/test-jogl-all-mobile/pom.in new file mode 100644 index 0000000..33f48e8 --- /dev/null +++ b/maven/tests/test-jogl-all-mobile/pom.in @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- Auto generated by pom.sh - Do not edit! --> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.jogamp.maven</groupId> + <artifactId>tests</artifactId> + <version>JOGAMP_VERSION</version> + </parent> + + <artifactId>test-jogl-all-mobile</artifactId> + <packaging>jar</packaging> + <description>Test suite for Maven packages</description> + <url>http://jogamp.org/</url> + + <repositories> + <repository> + <releases> + <enabled>true</enabled> + </releases> + <id>tests</id> + <url>REPOSITORY_URL</url> + </repository> + </repositories> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.jogamp.jogl</groupId> + <artifactId>jogl-all-mobile-main</artifactId> + <version>JOGAMP_VERSION</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jogamp.gluegen</groupId> + <artifactId>gluegen-rt-main</artifactId> + <version>JOGAMP_VERSION</version> + <scope>test</scope> + </dependency> + </dependencies> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + + <build> + <plugins> + <!-- Require JDK >= 1.6 --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.1</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/maven/tests/test-jogl-all-mobile/src/test/java/org/jogamp/maven/tests/TestNEWT.java b/maven/tests/test-jogl-all-mobile/src/test/java/org/jogamp/maven/tests/TestNEWT.java new file mode 100644 index 0000000..8776f5e --- /dev/null +++ b/maven/tests/test-jogl-all-mobile/src/test/java/org/jogamp/maven/tests/TestNEWT.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL JogAmp Community OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of JogAmp Community. + */ + +package org.jogamp.maven.tests; + +import javax.media.opengl.GL; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLEventListener; +import javax.media.opengl.GLProfile; + +import org.junit.Test; + +import com.jogamp.newt.opengl.GLWindow; + +@SuppressWarnings("static-method") public final class TestNEWT +{ + @Test public void testOpen() + throws InterruptedException + { + final GLProfile pro = GLProfile.getDefault(); + final GLCapabilities caps = new GLCapabilities(pro); + final GLWindow window = GLWindow.create(caps); + + window.setSize(640, 480); + window.addGLEventListener(new GLEventListener() { + @Override public void reshape( + final GLAutoDrawable drawable, + final int w, + final int h, + final int x, + final int y) + { + // Nothing + } + + @Override public void init( + final GLAutoDrawable drawable) + { + // Nothing + } + + @Override public void dispose( + final GLAutoDrawable drawable) + { + // Nothing + } + + @Override public void display( + final GLAutoDrawable drawable) + { + final GL gl = drawable.getGL(); + gl.glClearColor(0.0f, 0.0f, 1.0f, 1.0f); + gl.glClear(GL.GL_COLOR_BUFFER_BIT); + } + }); + + window.display(); + window.setVisible(true); + Thread.sleep(1000); + window.setVisible(false); + window.destroy(); + } +} diff --git a/maven/tests/test-jogl-all-noawt/pom.in b/maven/tests/test-jogl-all-noawt/pom.in new file mode 100644 index 0000000..c254c56 --- /dev/null +++ b/maven/tests/test-jogl-all-noawt/pom.in @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- Auto generated by pom.sh - Do not edit! --> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.jogamp.maven</groupId> + <artifactId>tests</artifactId> + <version>JOGAMP_VERSION</version> + </parent> + + <artifactId>test-jogl-all-noawt</artifactId> + <packaging>jar</packaging> + <description>Test suite for Maven packages</description> + <url>http://jogamp.org/</url> + + <repositories> + <repository> + <releases> + <enabled>true</enabled> + </releases> + <id>tests</id> + <url>REPOSITORY_URL</url> + </repository> + </repositories> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.jogamp.jogl</groupId> + <artifactId>jogl-all-noawt-main</artifactId> + <version>JOGAMP_VERSION</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jogamp.gluegen</groupId> + <artifactId>gluegen-rt-main</artifactId> + <version>JOGAMP_VERSION</version> + <scope>test</scope> + </dependency> + </dependencies> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + + <build> + <plugins> + <!-- Require JDK >= 1.6 --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.1</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/maven/tests/test-jogl-all-noawt/src/test/java/org/jogamp/maven/tests/TestNEWT.java b/maven/tests/test-jogl-all-noawt/src/test/java/org/jogamp/maven/tests/TestNEWT.java new file mode 100644 index 0000000..8776f5e --- /dev/null +++ b/maven/tests/test-jogl-all-noawt/src/test/java/org/jogamp/maven/tests/TestNEWT.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL JogAmp Community OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of JogAmp Community. + */ + +package org.jogamp.maven.tests; + +import javax.media.opengl.GL; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLEventListener; +import javax.media.opengl.GLProfile; + +import org.junit.Test; + +import com.jogamp.newt.opengl.GLWindow; + +@SuppressWarnings("static-method") public final class TestNEWT +{ + @Test public void testOpen() + throws InterruptedException + { + final GLProfile pro = GLProfile.getDefault(); + final GLCapabilities caps = new GLCapabilities(pro); + final GLWindow window = GLWindow.create(caps); + + window.setSize(640, 480); + window.addGLEventListener(new GLEventListener() { + @Override public void reshape( + final GLAutoDrawable drawable, + final int w, + final int h, + final int x, + final int y) + { + // Nothing + } + + @Override public void init( + final GLAutoDrawable drawable) + { + // Nothing + } + + @Override public void dispose( + final GLAutoDrawable drawable) + { + // Nothing + } + + @Override public void display( + final GLAutoDrawable drawable) + { + final GL gl = drawable.getGL(); + gl.glClearColor(0.0f, 0.0f, 1.0f, 1.0f); + gl.glClear(GL.GL_COLOR_BUFFER_BIT); + } + }); + + window.display(); + window.setVisible(true); + Thread.sleep(1000); + window.setVisible(false); + window.destroy(); + } +} diff --git a/maven/tests/test-jogl-all/pom.in b/maven/tests/test-jogl-all/pom.in new file mode 100644 index 0000000..1e0f98c --- /dev/null +++ b/maven/tests/test-jogl-all/pom.in @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- Auto generated by pom.sh - Do not edit! --> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.jogamp.maven</groupId> + <artifactId>tests</artifactId> + <version>JOGAMP_VERSION</version> + </parent> + + <artifactId>test-jogl-all</artifactId> + <packaging>jar</packaging> + <description>Test suite for Maven packages</description> + <url>http://jogamp.org/</url> + + <repositories> + <repository> + <releases> + <enabled>true</enabled> + </releases> + <id>tests</id> + <url>REPOSITORY_URL</url> + </repository> + </repositories> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.jogamp.jogl</groupId> + <artifactId>jogl-all-main</artifactId> + <version>JOGAMP_VERSION</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jogamp.gluegen</groupId> + <artifactId>gluegen-rt-main</artifactId> + <version>JOGAMP_VERSION</version> + <scope>test</scope> + </dependency> + </dependencies> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + + <build> + <plugins> + <!-- Require JDK >= 1.6 --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.1</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/maven/tests/test-jogl-all/src/test/java/org/jogamp/maven/tests/TestNEWT.java b/maven/tests/test-jogl-all/src/test/java/org/jogamp/maven/tests/TestNEWT.java new file mode 100644 index 0000000..6a01aa1 --- /dev/null +++ b/maven/tests/test-jogl-all/src/test/java/org/jogamp/maven/tests/TestNEWT.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL JogAmp Community OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of JogAmp Community. + */ + +package org.jogamp.maven.tests; + +import javax.media.opengl.GL; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLEventListener; +import javax.media.opengl.GLProfile; + +import org.junit.Test; + +import com.jogamp.newt.opengl.GLWindow; + +@SuppressWarnings("static-method") public final class TestNEWT +{ + @Test public void testOpen() + throws InterruptedException + { + final GLProfile pro = GLProfile.get(GLProfile.GL3); + final GLCapabilities caps = new GLCapabilities(pro); + final GLWindow window = GLWindow.create(caps); + + window.setSize(640, 480); + window.addGLEventListener(new GLEventListener() { + @Override public void reshape( + final GLAutoDrawable drawable, + final int w, + final int h, + final int x, + final int y) + { + // Nothing + } + + @Override public void init( + final GLAutoDrawable drawable) + { + // Nothing + } + + @Override public void dispose( + final GLAutoDrawable drawable) + { + // Nothing + } + + @Override public void display( + final GLAutoDrawable drawable) + { + final GL gl = drawable.getGL(); + gl.glClearColor(0.0f, 0.0f, 1.0f, 1.0f); + gl.glClear(GL.GL_COLOR_BUFFER_BIT); + } + }); + + window.display(); + window.setVisible(true); + Thread.sleep(1000); + window.setVisible(false); + window.destroy(); + } +} diff --git a/maven/tests/test-jogl-atomics/pom.in b/maven/tests/test-jogl-atomics/pom.in new file mode 100644 index 0000000..f332b01 --- /dev/null +++ b/maven/tests/test-jogl-atomics/pom.in @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <!-- Auto generated by pom.sh - Do not edit! --> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.jogamp.maven</groupId> + <artifactId>tests</artifactId> + <version>JOGAMP_VERSION</version> + </parent> + + <artifactId>test-jogl-atomics</artifactId> + <packaging>jar</packaging> + <description>Test suite for Maven packages</description> + <url>http://jogamp.org/</url> + + <repositories> + <repository> + <releases> + <enabled>true</enabled> + </releases> + <id>tests</id> + <url>REPOSITORY_URL</url> + </repository> + </repositories> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.jogamp.gluegen</groupId> + <artifactId>gluegen-rt-main</artifactId> + <version>JOGAMP_VERSION</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jogamp.jogl</groupId> + <artifactId>jogl-main</artifactId> + <version>JOGAMP_VERSION</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jogamp.jogl</groupId> + <artifactId>jogl</artifactId> + <version>JOGAMP_VERSION</version> + <classifier>gldesktop</classifier> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jogamp.jogl</groupId> + <artifactId>nativewindow-main</artifactId> + <version>JOGAMP_VERSION</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jogamp.jogl</groupId> + <artifactId>newt-main</artifactId> + <version>JOGAMP_VERSION</version> + <scope>test</scope> + </dependency> + </dependencies> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + </properties> + + <build> + <plugins> + <!-- Require JDK >= 1.6 --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.1</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.17</version> + <!-- + <configuration> + <systemPropertyVariables> + <jogl.debug.GLContext>true</jogl.debug.GLContext> + <jogl.debug.GLProfile>true</jogl.debug.GLProfile> + </systemPropertyVariables> + </configuration> + --> + </plugin> + </plugins> + </build> + +</project> diff --git a/maven/tests/test-jogl-atomics/src/test/java/org/jogamp/maven/tests/TestNEWT.java b/maven/tests/test-jogl-atomics/src/test/java/org/jogamp/maven/tests/TestNEWT.java new file mode 100644 index 0000000..2be6c9e --- /dev/null +++ b/maven/tests/test-jogl-atomics/src/test/java/org/jogamp/maven/tests/TestNEWT.java @@ -0,0 +1,95 @@ +/* + * Copyright 2010 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL JogAmp Community OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of JogAmp Community. + */ + +package org.jogamp.maven.tests; + +import javax.media.opengl.GL; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLEventListener; +import javax.media.opengl.GLProfile; + +import org.junit.Test; + +import com.jogamp.newt.opengl.GLWindow; + +/** + * {@link com.jogamp.newt.opengl.GLWindow} + */ + +@SuppressWarnings("static-method") public final class TestNEWT +{ + @Test public void testOpen() + throws InterruptedException + { + final GLProfile pro = GLProfile.getDefault(); + final GLCapabilities caps = new GLCapabilities(pro); + final GLWindow window = GLWindow.create(caps); + + window.setSize(640, 480); + window.addGLEventListener(new GLEventListener() { + @Override public void reshape( + final GLAutoDrawable drawable, + final int w, + final int h, + final int x, + final int y) + { + // Nothing + } + + @Override public void init( + final GLAutoDrawable drawable) + { + // Nothing + } + + @Override public void dispose( + final GLAutoDrawable drawable) + { + // Nothing + } + + @Override public void display( + final GLAutoDrawable drawable) + { + final GL gl = drawable.getGL(); + gl.glClearColor(0.0f, 0.0f, 1.0f, 1.0f); + gl.glClear(GL.GL_COLOR_BUFFER_BIT); + } + }); + + window.display(); + window.setVisible(true); + Thread.sleep(1000); + window.setVisible(false); + window.destroy(); + } +} |