Jogamp
Adapt to JogAmp build infrastructure (get rid of 'dist' folder, drop jnlp files in...
[jocl-demos.git] / build.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <project name="jocl-demos" default="default" basedir=".">
4     <description>Builds, tests, and runs the project jocl-demos.</description>
5
6     <condition property="rootrel.build" value="build">
7       <not>
8           <isset property="rootrel.build"/>
9       </not>
10     </condition>
11
12     <import file="nbproject/build-impl.xml"/>
13     
14     <property file="nbproject/project.properties" />
15
16     <!-- Pull in GlueGen cpptasks build file -->
17     <import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
18     <import file="${gluegen.root}/make/jogamp-env.xml" />
19     <import file="${gluegen.root}/make/jogamp-archivetasks.xml" />
20
21     <target name="-pre-init" depends="jogamp.env.init">
22         <property name="javac.debug" value="${javacdebug}"/>
23         <property name="javac.source" value="${target.sourcelevel}"/>
24         <property name="javac.target" value="${target.targetlevel}"/>
25         <property name="javac.compilerargs" value="-bootclasspath ${target.rt.jar} -Xlint -g:${javacdebuglevel}"/>
26     </target>
27
28     <target name="-pre-jar" depends="jogamp.env.init">
29         <tstamp>
30             <format property="version.timestamp" pattern="yyyyMMdd"/>
31         </tstamp>
32
33         <property name="jocl-demos.build.number" value="manual" />
34         <property name="jocl-demos.build.id"     value="${version.timestamp}" />
35         <property name="jocl-demos.build.branch" value="master" />
36         <property name="jocl-demos.build.commit" value="manual" />
37
38         <property name="jocl-demos.version" value="${jocl_demos_base_version}-b${jocl-demos.build.number}-${version.timestamp}" />
39     </target>
40
41     <target name="-post-jar" depends="tag.build,create-all-jnlps,gluegen.cpptasks.detect.os,build-archive"/>
42
43     <target name="build-archive" if="build.archiveon">
44         <property name="archive.zip.name" value="jocl-demos-${jocl-demos.version}-${os.and.arch}"/>
45         
46         <mkdir dir="${build.dir}/${archive.zip.name}"/>
47         
48         <copy todir="${build.dir}/${archive.zip.name}" >
49             <fileset dir="." includes="www/**"/>
50             <fileset dir="${build.dir}" includes="jar/**"/>
51             <fileset dir="${build.dir}" includes="jnlp-files/**"/>
52             <fileset dir="${build.dir}" includes="*.properties"/>
53         </copy>
54         
55         <archive.7z basedir="${build.dir}" destfile="${build.dir}/${archive.zip.name}.7z"  includes="${archive.zip.name}/**"/>
56
57         <delete dir="${build.dir}/${archive.zip.name}"/>
58         
59     </target>
60
61     <target name="create-all-jnlps">
62
63         <!-- preset properties for local testing -->
64         <property name="jocl.codepase"       value="JOCL_CODEBASE_TAG"/>
65         <property name="jogl.codepase"       value="JOGL_CODEBASE_TAG"/>
66         <property name="jocl-demos.codepase" value="DEMO_CODEBASE_TAG"/>
67         
68         <antcall target="create-jnlp" inheritrefs="true">
69             <param name="jnlp.name"         value="glclinterop"/>
70             <param name="jnlp.title"        value="JOGL - JOCL interoperability example."/>
71             <param name="jnlp.jogl"         value="true"/>
72             <param name="jnlp.mainclass"    value="com.jogamp.opencl.demos.joglinterop.GLCLInteroperabilityDemo"/>
73         </antcall>
74
75         <antcall target="create-jnlp" inheritrefs="true">
76             <param name="jnlp.name"         value="julia3d"/>
77             <param name="jnlp.title"        value="3D Julia Set Fractal demo."/>
78             <param name="jnlp.jogl"         value="true"/>
79             <param name="jnlp.mainclass"    value="com.jogamp.opencl.demos.julia3d.Julia3d"/>
80         </antcall>
81
82         <antcall target="create-jnlp" inheritrefs="true">
83             <param name="jnlp.name"         value="multi-device-fractal"/>
84             <param name="jnlp.title"        value="Multi Device Mandelbrot Fractal example."/>
85             <param name="jnlp.jogl"         value="true"/>
86             <param name="jnlp.mainclass"    value="com.jogamp.opencl.demos.fractal.MultiDeviceFractal"/>
87         </antcall>
88
89         <antcall target="create-jnlp" inheritrefs="true">
90             <param name="jnlp.name"         value="clinfo"/>
91             <param name="jnlp.title"        value="OpenCL diagnostics."/>
92             <param name="jnlp.jogl"         value="false"/>
93             <param name="jnlp.mainclass"    value="com.jogamp.opencl.demos.info.CLInfo"/>
94         </antcall>
95
96         <antcall target="create-jnlp" inheritrefs="true">
97             <param name="jnlp.name"         value="gamma"/>
98             <param name="jnlp.title"        value="Simple gamma correction."/>
99             <param name="jnlp.jogl"         value="false"/>
100             <param name="jnlp.mainclass"    value="com.jogamp.opencl.demos.gamma.CLSimpleGammaCorrection"/>
101         </antcall>
102         
103     </target>
104
105     <target name="tag.build">
106         <copy file="${jocl.root}/dist/artifact.properties" todir="${build.dir}" overwrite="true"/>
107         <echo file="${build.dir}/artifact.properties" message="jocl-demos.build.number=${jocl-demos.build.number}${line.separator}" append="true" />
108         <echo file="${build.dir}/artifact.properties" message="jocl-demos.build.id=${jocl-demos.build.id}${line.separator}" append="true" />
109         <echo file="${build.dir}/artifact.properties" message="jocl-demos.build.branch=${jocl-demos.build.branch}${line.separator}" append="true" />
110         <echo file="${build.dir}/artifact.properties" message="jocl-demos.build.commit=${jocl-demos.build.commit}${line.separator}" append="true" />
111     </target>
112
113     <target name="create-jnlp">
114         <condition  property="jogl.extension"
115                     value='&lt;extension name="jogl-all-awt" href="${jogl.codepase}/jogl-all-awt.jnlp"/&gt;'
116                     else="">
117             <istrue value="${jnlp.jogl}"/>
118         </condition>
119         <copy file="demo-template.jnlp" tofile="${build.dir}/jnlp-files/${jnlp.name}.jnlp">
120             <filterchain>
121                 <replacestring from="DEMO_TITLE" to="${jnlp.title}"/>
122                 <replacestring from="NAME_TAG" to="${jnlp.name}"/>
123                 <replacestring from="CLASS_TAG" to="${jnlp.mainclass}"/>
124                 <replacestring from="DEMO_CODEBASE_TAG" to="${jocl-demos.codepase}"/>
125                 <replacestring from="JOCL_CODEBASE_TAG" to="${jocl.codepase}"/>
126                 <replacestring from="EXTENSION" to="${jogl.extension}"/>
127             </filterchain>
128         </copy>
129     </target>
130
131 </project>
http://JogAmp.org git info: FAQ, tutorial and man pages.