blob: 5a34effdaf7979de4bf832bf7b11fa2e36186ef0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Ant build for the JOAL 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
- (joal-demos.jar) must not be on the CLASSPATH.
-
- This build requires that the joal project has been checked out into a sibling
- directory to the joal-demos top-level directory and that the joal.jar has been
- built into its build directory.
-->
<project name="JOAL.demos" default="all">
<property name="project.root" value=".." />
<condition property="rootrel.build" value="build">
<not>
<isset property="rootrel.build"/>
</not>
</condition>
<property name="build" location="${project.root}/${rootrel.build}" />
<property name="gluegen.root" value="${project.root}/../gluegen" />
<property name="gluegen.build" value="${gluegen.root}/${rootrel.build}" />
<!-- Pull in GlueGen cpptasks build file -->
<import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
<import file="${gluegen.root}/make/jogamp-archivetasks.xml" />
<import file="${gluegen.root}/make/jogamp-env.xml" />
<property name="joal.root" value="${project.root}/../joal" />
<property name="joal.build" value="${joal.root}/${rootrel.build}" />
<property file="${build}/artifact.properties"/>
<property name="joal-demos.build.number" value="manual-build"/>
<property name="joal-demos.build.id" value="${version.timestamp}"/>
<property name="joal-demos.build.branch" value="master"/>
<property name="joal-demos.build.commit" value="manual"/>
<!--
- Make sure that joal-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.joal.demos.jar">
<available property="joal.demos.jar.on.class.path" classname="demos.devmaster.lesson1.SingleStaticSource" />
</target>
<target name="java.class.path.validate" depends="test.for.joal.demos.jar" if="joal.demos.jar.on.class.path">
<fail>
******************************************************************
** Your CLASSPATH environment variable appears to be set (some **
** JOAL 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="init" depends="jogamp.env.init, gluegen.cpptasks.detect.os, java.class.path.validate, gluegen.cpptasks.detect.os">
<property name="joal-demos.version" value="${jogamp.version.base}-${version.timestamp}" />
<property name="gluegen-rt.jar" value="${gluegen.build}/gluegen-rt.jar" />
<property name="joal.jar" value="${joal.build}/joal.jar" />
<property name="src.dir" value="../src/java" />
<property name="classes.dir" value="${build}/classes" />
<property name="joal.demos.jar" value="${build}/joal-demos.jar" />
<property name="archive.name" value="joal-demos-${joal-demos.version}-${os.and.arch}" />
<property name="archive" value="${build}/${archive.name}" />
<property name="obj.all.paths" value="${gluegen.build}/obj${path.separator}${joal.build}/obj" />
</target>
<target name="all" depends="jar, tag.build, developer-zip-archive"/>
<!-- Build binary zip archives for developers -->
<target name="developer-zip-archive" depends="init" if="build.archiveon">
<!-- Clean up and create temporary directory -->
<delete includeEmptyDirs="true" quiet="true" dir="${archive}" failonerror="false" />
<mkdir dir="${archive}" />
<copy file="${build}/artifact.properties" todir="${archive}"/>
<mkdir dir="${archive}/jar" />
<copy todir="${archive}/jar">
<fileset dir="${build}" includes="*.jar"/>
</copy>
<mkdir dir="${archive}/jnlp-files" />
<copy todir="${archive}/jnlp-files">
<fileset dir="${project.root}/jnlp-files" includes="*" />
</copy>
<mkdir dir="${archive}/www" />
<copy todir="${archive}/www">
<fileset dir="${project.root}/www" includes="*" />
</copy>
<archive.7z destfile="${build}/${archive.name}.7z"
basedir="${build}"
includes="${archive.name}/**" />
<!-- Clean up after ourselves -->
<delete includeEmptyDirs="true" quiet="true" dir="${archive}" failonerror="false" />
</target>
<target name="tag.build">
<copy file="${gluegen.build}/artifact.properties" todir="${build}" overwrite="true"/>
<echo message='joal-demos.build.number=${joal-demos.build.number}${line.separator}' file="${build}/artifact.properties" append="true"/>
<echo message='joal-demos.build.id=${joal-demos.build.id}${line.separator}' file="${build}/artifact.properties" append="true"/>
<echo message='joal-demos.build.branch=${joal-demos.build.branch}${line.separator}' file="${build}/artifact.properties" append="true"/>
<echo message='joal-demos.build.commit=${joal-demos.build.commit}${line.separator}' file="${build}/artifact.properties" append="true"/>
</target>
<target name="jar" depends="compile" description="Build JOAL demos jar file">
<jar manifest="manifest.mf" destfile="${joal.demos.jar}">
<fileset dir="${classes.dir}" />
<fileset dir="${src.dir}">
<include name="demos/data/**" />
</fileset>
</jar>
</target>
<target name="compile" depends="init">
<mkdir dir="${classes.dir}" />
<copy todir="${build}">
<fileset dir="${src.dir}/demos/lib" includes="j-ogg-*.jar" />
</copy>
<path id="joal.classpath">
<pathelement path="${classpath}" />
<pathelement location="${joal.jar}" />
<pathelement location="${build}/j-ogg-oggd.jar" />
<pathelement location="${build}/j-ogg-vorbisd.jar" />
</path>
<javac destdir="${classes.dir}"
includeantruntime="false"
memoryMaximumSize="${javac.memorymax}"
encoding="UTF-8"
source="${target.sourcelevel}"
target="${target.targetlevel}"
bootclasspath="${target.rt.jar}"
debug="${javacdebug}" debuglevel="${javacdebuglevel}">
<src path="${src.dir}" />
<classpath refid="joal.classpath" />
</javac>
</target>
<target name="clean" depends="init">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="../${rootrel.build}" />
</delete>
</target>
<target name="lesson1" depends="jar" description="Run lesson1 (Single Static Source)">
<java classname="demos.devmaster.lesson1.SingleStaticSource" fork="true">
<env key="${system.env.library.path}" path="${obj.all.paths}"/>
<jvmarg value="-Djava.library.path=${obj.all.paths}"/>
<classpath>
<pathelement location="${gluegen-rt.jar}" />
<pathelement location="${joal.jar}" />
<pathelement location="${joal.demos.jar}" />
</classpath>
</java>
</target>
<target name="lesson2" depends="jar" description="Run lesson2 (Looping and Fade Away)">
<java classname="demos.devmaster.lesson2.LoopingAndFadeaway" fork="true">
<env key="${system.env.library.path}" path="${obj.all.paths}"/>
<jvmarg value="-Djava.library.path=${obj.all.paths}"/>
<classpath>
<pathelement location="${gluegen-rt.jar}" />
<pathelement location="${joal.jar}" />
<pathelement location="${joal.demos.jar}" />
</classpath>
</java>
</target>
<target name="lesson3" depends="jar" description="Run lesson3 (Multiple Sources)">
<java classname="demos.devmaster.lesson3.MultipleSources" fork="true">
<env key="${system.env.library.path}" path="${obj.all.paths}"/>
<jvmarg value="-Djava.library.path=${obj.all.paths}"/>
<classpath>
<pathelement location="${gluegen-rt.jar}" />
<pathelement location="${joal.jar}" />
<pathelement location="${joal.demos.jar}" />
</classpath>
</java>
</target>
<target name="lesson5" depends="jar" description="Run lesson5 (Sources Sharing Buffers)">
<java classname="demos.devmaster.lesson5.SourcesSharingBuffers" fork="true">
<env key="${system.env.library.path}" path="${obj.all.paths}"/>
<jvmarg value="-Djava.library.path=${obj.all.paths}"/>
<classpath>
<pathelement location="${gluegen-rt.jar}" />
<pathelement location="${joal.jar}" />
<pathelement location="${joal.demos.jar}" />
</classpath>
</java>
</target>
<target name="lesson8" depends="jar" description="Run lesson8 (Ogg/Vorbis Streaming)">
<java classname="demos.devmaster.lesson8.OggStreamer" fork="true">
<env key="${system.env.library.path}" path="${obj.all.paths}"/>
<jvmarg value="-Djava.library.path=${obj.all.paths}"/>
<classpath>
<pathelement location="${gluegen-rt.jar}" />
<pathelement location="${joal.jar}" />
<pathelement location="${joal.demos.jar}" />
<pathelement location="${build}/j-ogg-oggd.jar" />
<pathelement location="${build}/j-ogg-vorbisd.jar" />
</classpath>
</java>
</target>
</project>
|