-
-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathbuild.xml
More file actions
228 lines (197 loc) · 7.81 KB
/
build.xml
File metadata and controls
228 lines (197 loc) · 7.81 KB
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<?xml version="1.0"?>
<project name="Processing Core" default="build">
<property environment="env" />
<target name="methods-check">
<available file="methods/methods.jar" property="methods.present" />
</target>
<target name="methods-build" depends="methods-check" unless="methods.present">
<subant buildpath="methods" target="dist" />
</target>
<!-- Base URL for the current version of JOGL. -->
<!--
<property name="jogl.url"
value="https://jogamp.org/deployment/archive/rc/v2.4.0-rc-20210111/jar" />
-->
<!-- This is for posterity, and is not used at present. When updating
the release, also make a copy of the files on download.processing.org
so that they can be retrieved even after the original link goes dead. -->
<!--
<property name="jogl.url.backup"
value="https://download.processing.org/jogl/v2.4.0-rc-20210111" />
-->
<!-- Active version for Processing 4.0 to 4.1.3 -->
<property name="jogl.url"
value="https://download.processing.org/jogl/v2.4.0-rc-20210111y" />
<!-- TODO new RC versions posted in February 2023... -->
<!--
<property name="jogl.url"
value="https://jogamp.org/deployment/archive/rc/v2.4.0/jar" />
-->
<available file="library/jogl-all.jar" property="jogl.present" />
<!-- ok to ignore failed downloads if we at least have a version that's local -->
<condition property="jogl.ignorable" value="false" else="true">
<isset property="jogl.present" />
</condition>
<target name="download-jogl" unless="jogl.present">
<get dest="library" usetimestamp="true" ignoreerrors="${jogl.ignorable}">
<!--
<url url="${jogl.url}/gluegen-rt-natives-linux-aarch64.jar" />
<url url="${jogl.url}/gluegen-rt-natives-linux-amd64.jar" />
<url url="${jogl.url}/gluegen-rt-natives-linux-arm.jar" />
<url url="${jogl.url}/gluegen-rt-natives-macos-aarch64.jar" />
<url url="${jogl.url}/gluegen-rt-natives-macos-x86_64.jar" />
<url url="${jogl.url}/gluegen-rt-natives-windows-amd64.jar" />
-->
<url url="${jogl.url}/gluegen-rt.jar" />
<!--
<url url="${jogl.url}/jogl-all-natives-linux-aarch64.jar" />
<url url="${jogl.url}/jogl-all-natives-linux-amd64.jar" />
<url url="${jogl.url}/jogl-all-natives-linux-arm.jar" />
<url url="${jogl.url}/jogl-all-natives-macos-aarch64.jar" />
<url url="${jogl.url}/jogl-all-natives-macos-x86_64.jar" />
<url url="${jogl.url}/jogl-all-natives-windows-amd64.jar" />
-->
<url url="${jogl.url}/jogl-all.jar" />
</get>
<antcall target="retrieve-variant">
<param name="variant" value="linux-aarch64" />
</antcall>
<antcall target="retrieve-variant">
<param name="variant" value="linux-arm" />
</antcall>
<antcall target="retrieve-variant">
<param name="variant" value="linux-amd64" />
</antcall>
<antcall target="retrieve-variant">
<param name="variant" value="macos-aarch64" />
</antcall>
<antcall target="retrieve-variant">
<param name="variant" value="macos-x86_64" />
</antcall>
<antcall target="retrieve-variant">
<param name="variant" value="windows-amd64" />
</antcall>
</target>
<target name="retrieve-variant">
<get src="${jogl.url}/gluegen-rt-natives-${variant}.jar"
dest="temp-gluegen.jar"
ignoreerrors="${jogl.ignorable}"
usetimestamp="true" />
<get src="${jogl.url}/jogl-all-natives-${variant}.jar"
dest="temp-jogl.jar"
ignoreerrors="${jogl.ignorable}"
usetimestamp="true" />
<mkdir dir="library/${variant}" />
<unzip dest="library/${variant}" src="temp-gluegen.jar" overwrite="true">
<patternset>
<include name="**/*.dll" />
<include name="**/*.dylib" />
<include name="**/*.so" />
</patternset>
<mapper type="flatten" />
</unzip>
<unzip dest="library/${variant}" src="temp-jogl.jar" overwrite="true">
<patternset>
<include name="**/*.dll" />
<include name="**/*.dylib" />
<include name="**/*.so" />
</patternset>
<mapper type="flatten" />
</unzip>
<delete file="temp-gluegen.jar" />
<delete file="temp-jogl.jar" />
</target>
<path id="classpath.base">
<pathelement location="library/jogl-all.jar" />
<pathelement location="library/gluegen-rt.jar" />
</path>
<path id="classpath.test">
<pathelement location="library-test/junit-4.13.2.jar" />
<pathelement location="library-test/hamcrest-core-1.3.jar" />
<pathelement location="bin-test" />
<path refid="classpath.base" />
</path>
<macrodef name="compilecommon">
<attribute name="destdir" />
<attribute name="srcdir" />
<attribute name="classpath" />
<sequential>
<taskdef name="methods"
classname="PAppletMethods"
classpath="methods/methods.jar" />
<methods dir="${basedir}/src/processing/core" recorder="true" />
<!-- Where can I expect to find Java Mode JARs? -->
<property name="java.mode" value="../java/mode/" />
<mkdir dir="@{destdir}" />
<javac source="17"
target="17"
encoding="UTF-8"
includeAntRuntime="false"
debug="true"
destdir="@{destdir}"
nowarn="true">
<classpath refid="@{classpath}" />
<src path="@{srcdir}" />
<include name="processing/**" />
</javac>
<!-- Copy the jnilib to the bin folder so it's included. -->
<copy todir="bin/processing/core"
file="src/processing/core/libDifferent.jnilib" />
<!-- Copy the helper code for checking Windows resolution. -->
<copy todir="library/windows-amd64"
file="../build/windows/fenster/fenster.exe" />
<!-- Copy shaders to bin. (Eclipse does this automatically.) -->
<copy todir="bin">
<fileset dir="src">
<include name="processing/opengl/shaders/*.glsl" />
<include name="processing/opengl/cursors/*.png" />
<include name="font/ProcessingSansPro-*" />
<include name="icon/*.png" />
</fileset>
</copy>
</sequential>
</macrodef>
<target name="test-compile" description="Compile" depends="methods-build">
<compilecommon srcdir="src; test" destdir="bin-test" classpath="classpath.test" />
</target>
<target name="clean-pre-test" description="Required step prior to test">
<delete dir="resource-test/scratch" />
</target>
<target name="test" depends="build, test-compile, clean-pre-test">
<junit haltonfailure="true">
<classpath refid="classpath.test" />
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="test">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="compile" description="Compile">
<compilecommon srcdir="src" destdir="bin" classpath="classpath.base" />
</target>
<target name="build" depends="download-jogl, methods-build, compile"
description="Build core library jar">
<jar basedir="bin" destfile="library/core.jar" />
</target>
<target name="source-jar">
<property name="source.jar.path" location="core-sources.jar" />
<jar basedir="src" destfile="${source.jar.path}">
<fileset dir="src" includes="**/*.java" />
</jar>
<echo message="Wrote source jar to ${source.jar.path}" />
</target>
<target name="clean-libs" description="Clean out the JOGL binary downloads">
<delete>
<fileset dir="library" includes="gluegen-rt*.jar" />
<fileset dir="library" includes="jogl-all*.jar" />
</delete>
<!-- <antcall target="download-jogl" /> -->
</target>
<target name="clean" description="Clean out the build directories">
<delete dir="bin" />
<delete dir="bin-test" />
<delete file="library/core.jar" />
</target>
</project>