diff options
Diffstat (limited to 'make/build.xml')
-rw-r--r-- | make/build.xml | 238 |
1 files changed, 238 insertions, 0 deletions
diff --git a/make/build.xml b/make/build.xml new file mode 100644 index 0000000..f5cd571 --- /dev/null +++ b/make/build.xml @@ -0,0 +1,238 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + - Ant build for the JOGL demos. This build has been tested with ANT 1.5.3. + - + - In order for this build to succeed the resulting jar files from this build + - (jogl-demos.jar, jogl-demos-data.jar, jogl-demos-util.jar) must not be on + - the CLASSPATH. + - + - This build requires that the jogl project has been checked out into a sibling + - directory to the jogl-demos top-level directory and that the jogl.jar has been + - built into its build directory. + --> +<project name="JOGL.demos" default="all"> + + <condition property="rootrel.build" value="build"> + <not> + <isset property="rootrel.build"/> + </not> + </condition> + + <!-- + - Make sure that jogl-demos.jar is not on the CLASSPATH; this can + - cause builds to fail since if this Java process has the jar file + - open we can not overwrite it. + --> + <target name="test.for.jogl.demos.jar"> + <available property="jogl.demos.jar.on.class.path" classname="demos.gears.Gears" /> + </target> + <target name="java.class.path.validate" depends="test.for.jogl.demos.jar" if="jogl.demos.jar.on.class.path"> + <fail> + + ****************************************************************** + ** Your CLASSPATH environment variable appears to be set (some ** + ** JOGL demos' classes are currently visible to the build.) ** + ** This can cause the build to fail. Please unset your ** + ** CLASSPATH variable and restart the build. ** + ****************************************************************** + </fail> + </target> + + <target name="setup.gles"> + <condition property="isGLES"> + <or> + <isset property="jogl.es" /> + </or> + </condition> + </target> + + <target name="setup.cg.excludes" unless="jogl.cg"> + <property name="jogl.cg.excludes" value="demos/cg/**,demos/hdr/CgPipeline.java,demos/hdr/shaders/cg/**" /> + </target> + + <target name="skip.cg.excludes" if="jogl.cg"> + <property name="jogl.cg.excludes" value="" /> + </target> + + <target name="init" depends="java.class.path.validate,setup.gles,setup.cg.excludes,skip.cg.excludes"> + <property name="jogl.core.jar" value="../../jogl/${rootrel.build}/jogl/jogl.core.jar" /> + <property name="jogl.gles12.jar" value="../../jogl/${rootrel.build}/jogl/jogl.gles12.jar" /> + <property name="jogl.gles12.dbg.jar" value="../../jogl/${rootrel.build}/jogl/jogl.gles12.dbg.jar" /> + <property name="jogl.gles1.jar" value="../../jogl/${rootrel.build}/jogl/jogl.gles1.jar" /> + <property name="jogl.gles1.dbg.jar" value="../../jogl/${rootrel.build}/jogl/jogl.gles1.dbg.jar" /> + <property name="jogl.gles2.jar" value="../../jogl/${rootrel.build}/jogl/jogl.gles2.jar" /> + <property name="jogl.gles2.dbg.jar" value="../../jogl/${rootrel.build}/jogl/jogl.gles2.dbg.jar" /> + <property name="jogl.egl.jar" value="../../jogl/${rootrel.build}/jogl/jogl.egl.jar" /> + <property name="jogl.gl2.jar" value="../../jogl/${rootrel.build}/jogl/jogl.gl2.jar" /> + <property name="jogl.gl2.dbg.jar" value="../../jogl/${rootrel.build}/jogl/jogl.gl2.dbg.jar" /> + <property name="jogl.awt.jar" value="../../jogl/${rootrel.build}/jogl/jogl.awt.jar" /> + <property name="jogl.util.jar" value="../../jogl/${rootrel.build}/jogl/jogl.util.jar" /> + <property name="jogl.util.awt.jar" value="../../jogl/${rootrel.build}/jogl/jogl.util.awt.jar" /> + <property name="jogl.util.fixedfuncemu.jar" value="../../jogl/${rootrel.build}/jogl/jogl.util.fixedfuncemu.jar" /> + <property name="jogl.util.gl2.jar" value="../../jogl/${rootrel.build}/jogl/jogl.util.gl2.jar" /> + <property name="nativewindow.core.jar" value="../../jogl/${rootrel.build}/nativewindow/nativewindow.core.jar" /> + <property name="nativewindow.x11.jar" value="../../jogl/${rootrel.build}/nativewindow/nativewindow.x11.jar" /> + <property name="nativewindow.awt.jar" value="../../jogl/${rootrel.build}/nativewindow/nativewindow.awt.jar" /> + <property name="newt.all.jar" value="../../jogl/${rootrel.build}/newt/newt.all.jar" /> + <property name="joal.jar" value="../lib/joal.jar" /> + <property name="joal-demos.jar" value="../lib/joal-demos.jar" /> + <property name="simple-xml.jar" value="../lib/simple-xml-1.1.1.jar" /> + <property name="classes" value="../${rootrel.build}/classes" /> + <property name="src" value="../src" /> + <property name="javadoc" value="../javadoc" /> + <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" /> + <property name="javadoc.link.jogl" value="../../jogl/javadoc-public/" /> + <property name="jogl.demos.jar" value="../${rootrel.build}/jogl-demos.jar" /> + <property name="jogl.demos.util.jar" value="../${rootrel.build}/jogl-demos-util.jar" /> + <property name="jogl.demos.data.jar" value="../${rootrel.build}/jogl-demos-data.jar" /> + <property name="jogl.demos.src.zip" value="../${rootrel.build}/jogl-demos-src.zip" /> + </target> + + <target name="nurbs" if="jogl.nurbs"> + <!-- NOTE: this target requires a 1.5 javac to be on the PATH --> + <javac destdir="${classes}" includes="demos/nurbs/**" source="1.5" debug="true" debuglevel="source,lines"> + <src path="${src}" /> + <classpath refid="jogl-demos.classpath" /> + </javac> + <!-- Copy icons to output dir --> + <copy todir="../${rootrel.build}"> + <fileset dir="${src}"> + <include name="demos/nurbs/icons/*.png" /> + </fileset> + </copy> + <!-- Copy dependent libraries to output dir --> + <copy file="../lib/simple-xml-1.1.1.jar" todir="../${rootrel.build}" /> + <copy file="../lib/stax-api-1.0.1.jar" todir="../${rootrel.build}" /> + <copy file="../lib/stax-1.2.0.jar" todir="../${rootrel.build}" /> + </target> + + <target name="all-desktop" unless="isGLES"> + <mkdir dir="${classes}" /> + <path id="jogl-demos.classpath"> + <pathelement location="${nativewindow.core.jar}" /> + <pathelement location="${nativewindow.x11.jar}" /> + <pathelement location="${nativewindow.awt.jar}" /> + <pathelement location="${jogl.core.jar}" /> + <pathelement location="${jogl.gles1.jar}" /> + <pathelement location="${jogl.gles1.dbg.jar}" /> + <pathelement location="${jogl.gles2.jar}" /> + <pathelement location="${jogl.gles2.dbg.jar}" /> + <pathelement location="${jogl.egl.jar}" /> + <pathelement location="${jogl.gl2.jar}" /> + <pathelement location="${jogl.gl2.dbg.jar}" /> + <pathelement location="${jogl.awt.jar}" /> + <pathelement location="${jogl.util.jar}" /> + <pathelement location="${jogl.util.fixedfuncemu.jar}" /> + <pathelement location="${jogl.util.awt.jar}" /> + <pathelement location="${jogl.util.gl2.jar}" /> + <pathelement location="${newt.all.jar}" /> + <pathelement location="${joal.jar}" /> + <pathelement location="${joal-demos.jar}" /> + <pathelement location="${simple-xml.jar}" /> + </path> + <!-- For the time being we exclude the VertexArrayRange and HDR demos, which rely on NVIDIA-specific extensions --> + <javac destdir="${classes}" excludes="${jogl.cg.excludes},demos/nurbs/**,jbullet/**,demos/vertexArrayRange/**" source="1.4" target="1.4" debug="true" debuglevel="source,lines"> + <src path="${src}" /> + <classpath refid="jogl-demos.classpath" /> + </javac> + <antcall target="nurbs" inheritrefs="true" /> + <jar destfile="${jogl.demos.jar}"> + <fileset dir="${classes}"> + <exclude name="gleem/**" /> + <exclude name="demos/util/**" /> + </fileset> + <fileset dir="${src}"> + <include name="demos/cg/**/*.cg" /> + </fileset> + <fileset dir="${src}"> + <include name="demos/hdr/shaders/**/*.cg" /> + <include name="demos/hdr/shaders/**/*.arbvp1" /> + <include name="demos/hdr/shaders/**/*.arbfp1" /> + <include name="demos/es1/bump/*.brs" /> + <include name="demos/es2/shader/**" /> + <include name="demos/es2/perftst/shader/**" /> + <include name="demos/es2/perftst/data/**" /> + <include name="demos/es2/openmax/shader/**" /> + </fileset> + <!-- Avoid requiring dependence on huge jogl-demos-data.jar for + particle engine demo --> + <fileset dir="${src}"> + <include name="demos/particles/engine/images/*.jpg" /> + </fileset> + </jar> + <jar destfile="${jogl.demos.util.jar}"> + <fileset dir="${classes}"> + <include name="gleem/**" /> + <include name="demos/util/**" /> + </fileset> + </jar> + <jar destfile="${jogl.demos.data.jar}"> + <fileset dir="${src}"> + <include name="demos/data/**" /> + </fileset> + </jar> + <!-- Build a source archive as well --> + <delete file="${jogl.demos.src.zip}" /> + <zip destfile="${jogl.demos.src.zip}" + basedir="../.." + includes="jogl-demos/doc/**,jogl-demos/make/**,jogl-demos/src/**,jogl-demos/lib/**" + excludes="**/*.class,**/*~" + /> + </target> + + <target name="all-gles" if="isGLES"> + <echo message="classes destdir ${classes}" /> + <mkdir dir="${classes}" /> + <path id="jogl-demos.classpath"> + <pathelement location="${nativewindow.core.jar}" /> + <pathelement location="${jogl.core.jar}" /> + <pathelement location="${jogl.gles1.jar}" /> + <pathelement location="${jogl.gles1.dbg.jar}" /> + <pathelement location="${jogl.gles2.jar}" /> + <pathelement location="${jogl.gles2.dbg.jar}" /> + <pathelement location="${jogl.egl.jar}" /> + <pathelement location="${jogl.util.jar}" /> + <pathelement location="${jogl.util.fixedfuncemu.jar}" /> + <pathelement location="${newt.all.jar}" /> + </path> + <javac destdir="${classes}" includes="demos/GLInfo*,demos/es1/**,demos/es2/**" source="1.4" target="1.4" debug="true" debuglevel="source,lines" + bootclasspath="../../gluegen/make/lib/cdc_fp.jar"> + <src path="${src}" /> + <classpath refid="jogl-demos.classpath" /> + </javac> + <jar destfile="${jogl.demos.jar}"> + <fileset dir="${classes}"> + <include name="**" /> + </fileset> + <fileset dir="${src}"> + <include name="demos/es1/bump/*.brs" /> + <include name="demos/es2/shader/**" /> + <include name="demos/es2/perftst/shader/**" /> + <include name="demos/es2/perftst/data/**" /> + <include name="demos/es2/openmax/shader/**" /> + </fileset> + </jar> + </target> + + <target name="all" depends="init, all-desktop, all-gles" /> + + <target name="javadoc" depends="init"> + <mkdir dir="${javadoc}" /> + <javadoc destdir="${javadoc}" windowtitle="JOGL Demos" + source="1.4"> + <packageset dir="${src}"> + <exclude name="demos/cg/**" /> + </packageset> + <link href="${javadoc.link}" /> + <!-- FIXME: this doesn't work --> + <link href="${javadoc.link.jogl}" /> + </javadoc> + </target> + + <target name="clean" depends="init"> + <delete includeEmptyDirs="true" quiet="true"> + <fileset dir="../${rootrel.build}" /> + <fileset dir="../javadoc" /> + </delete> + </target> + </project> |