-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathbuild.xml
More file actions
executable file
·319 lines (290 loc) · 13.1 KB
/
build.xml
File metadata and controls
executable file
·319 lines (290 loc) · 13.1 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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
<project name="javaforce" default="jar" basedir="." xmlns:if="ant:if" xmlns:unless="ant:unless">
<description>JavaForce SDK</description>
<!-- set global properties for this build -->
<property name="app" value="javaforce"/>
<property name="apptype" value="console"/>
<property name="src" location="src"/>
<property name="build" location="classes"/>
<property name="home" value="."/>
<property name="noelf" value="true"/>
<property name="maven" value="io/github/pquiring"/>
<property environment="env"/>
<fileset dir="." id="classpath">
<include name="bcprov.jar"/>
<include name="bctls.jar"/>
<include name="jargs.jar"/>
<include name="jcifs.jar"/>
<include name="jdom.jar"/>
<include name="llrp.jar"/>
<include name="sshd-common.jar"/>
<include name="sshd-core.jar"/>
<include name="sshd-sftp.jar"/>
<include name="sshd-scp.jar"/>
<include name="jsvg.jar"/>
<include name="slf4j-api.jar"/>
<include name="plc4j-api.jar"/>
</fileset>
<property file="versions.properties"/>
<property file="javaforce.properties"/>
<property name="version" value="${javaforce-version}"/>
<condition property="have-jfexec">
<or>
<available file="${user.home}/bin/jfexec.exe"/>
<available file="${user.home}/bin/jfexec"/>
</or>
</condition>
<import file="base.xml"/>
<!-- get native dependancies -->
<available property="have-glfw" file="native/glfw/src/window.c"/>
<target name="get-glfw" unless="have-glfw" description="download glfw">
<exec command="git clone https://github.com/glfw/glfw.git native/glfw"/>
<exec command="git checkout -q tags/${glfw-version}" dir="native/glfw"/>
</target>
<available property="have-stb" file="native/stb/stb_truetype.h"/>
<target name="get-stb" unless="have-stb" description="download stb">
<exec command="git clone https://github.com/nothings/stb.git native/stb"/>
</target>
<target name="update-stb" description="update stb">
<exec command="git pull" dir="native/stb"/>
</target>
<available property="have-opencl" file="native/opencl/CL/cl.h"/>
<target name="get-opencl" unless="have-opencl" description="download opencl headers">
<exec command="git clone https://github.com/KhronosGroup/OpenCL-Headers.git native/opencl"/>
<exec command="git checkout -q tags/${opencl-version}" dir="native/opencl"/>
</target>
<!-- download ffmpeg (windows only) -->
<target name="get-ffmpeg-win64-bin" description="download ffmpeg for Win64">
<echo message="Downloading: ffmpeg-win64-bin-${ffmpeg-version}.zip"/>
<get src="http://javaforce.sourceforge.net/ffmpeg/win64/amd64/ffmpeg-win64-bin-${ffmpeg-version}.zip" dest="ffmpeg-win64-bin-${ffmpeg-version}.zip"/>
<mkdir dir="ffmpeg-bin"/>
<unzip src="ffmpeg-win64-bin-${ffmpeg-version}.zip" dest="ffmpeg-bin"/>
</target>
<target name="get-ffmpeg-win64-src" description="download ffmpeg for Win64">
<echo message="Downloading: ffmpeg-win64-src-${ffmpeg-version}.zip"/>
<get src="http://javaforce.sourceforge.net/ffmpeg/win64/amd64/ffmpeg-win64-src-${ffmpeg-version}.zip" dest="ffmpeg-win64-src-${ffmpeg-version}.zip"/>
<mkdir dir="ffmpeg-src"/>
<unzip src="ffmpeg-win64-src-${ffmpeg-version}.zip" dest="ffmpeg-src"/>
</target>
<import file="get-jars.xml"/>
<available property="have-repo" file="repo/readme.txt"/>
<target name="get-repo" unless="have-repo" description="download repo">
<exec command="git clone https://github.com/pquiring/repo"/>
</target>
<target name="depjars" unless="fast-build">
<!-- depends via antcalls -->
<antcall target="depnatives"/>
<antcall target="get-glfw"/>
<antcall target="get-stb"/>
<antcall target="get-opencl"/>
<antcall target="get-repo"/>
<antcall target="getjars"/>
<antcall target="jar-jcifs"/>
<antcall target="jar-bcprov"/>
<antcall target="jar-bctls"/>
<antcall target="jar-bcutil"/>
<antcall target="jar-filters"/>
<antcall target="jar-llrp"/>
<antcall target="jar-jdom"/>
<antcall target="jar-sshd-core"/>
<antcall target="jar-sshd-common"/>
<antcall target="jar-sshd-sftp"/>
<antcall target="jar-sshd-scp"/>
<antcall target="jar-jargs"/>
<antcall target="jar-mina-core"/>
<antcall target="jar-slf4j-api"/>
<antcall target="jar-slf4j-simple"/>
<antcall target="jar-slf4j-nop"/>
<antcall target="jar-log4j-core"/>
<antcall target="jar-log4j-api"/>
<antcall target="jar-jsvg"/>
<antcall target="jar-netty-common"/>
<antcall target="jar-netty-buffer"/>
<antcall target="jar-netty-transport"/>
<antcall target="jar-netty-handler"/>
<antcall target="jar-netty-codec"/>
<antcall target="jar-plc4j-api"/>
<antcall target="jar-plc4j-spi"/>
<antcall target="jar-plc4j-transport-tcp"/>
<antcall target="jar-plc4j-transport-udp"/>
<antcall target="jar-plc4j-driver-s7"/>
</target>
<target name="compile" depends="depjars" unless="fast-build" description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<mkdir dir="${build}"/>
<javac srcdir="${src}" destdir="${build}" release="${java-version}" debug="true" includeantruntime="false" nativeheaderdir="native/headers">
<classpath>
<fileset refid="classpath"/>
</classpath>
</javac>
</target>
<target name="jar" depends="depjars,compile" unless="fast-build" description="build jar file">
<!-- Build jar file from class files -->
<jar destfile="javaforce.jar" includes="**/*.class" basedir="${build}">
<fileset dir="${src}">
<include name="**/*.png"/>
<exclude name="javaforce/icons/16/*.png"/>
<exclude name="javaforce/icons/32/*.png"/>
<include name="**/*.html"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
<include name="**/*.ttf"/>
</fileset>
<fileset dir=".">
<include name="META-INF/**/*"/>
</fileset>
</jar>
<copy file="javaforce.jar" tofile="${lib}/javaforce-${version}.jar"/>
<antcall target="icons"/>
</target>
<target name="icons" depends="" if="have-jfexec" description="create icons">
<sequential>
<mkdir dir="src/javaforce/icons/16"/>
<mkdir dir="src/javaforce/icons/32"/>
<java classpath="${home}/javaforce.jar;${home}/jsvg.jar" classname="javaforce.utils.GenIcons" fork="true" jvm="${user.home}/bin/jfexec">
</java>
<jar destfile="jficons.jar" includes="**/*.svg" basedir="${src}">
<fileset dir="${src}">
<include name="javaforce/icons/16/*.png"/>
<include name="javaforce/icons/32/*.png"/>
</fileset>
</jar>
<copy file="jficons.jar" tofile="${lib}/jficons-${version}.jar"/>
</sequential>
</target>
<target name="repo" description="download repo files">
<exec command="git clone https://github.com/pquiring/repo"/>
</target>
<target name="install" description="install files">
<copy file="javaforce.jar" todir="/usr/share/java"/>
<copy file="jficons.jar" todir="/usr/share/java"/>
</target>
<target name="jre-all" description="build JRE with all modules included">
<exec command="jlink --module-path ${java.home}/jmods --add-modules ALL-MODULE-PATH --output jre_all"/>
</target>
<target name="jre-base" description="build JRE for bundled JRE builds with only base">
<exec command="jlink --module-path ${java.home}/jmods --add-modules ${jre-base} --output jre_base"/>
<delete>
<fileset dir="jre_base/bin" includes="java**.exe"/>
</delete>
<delete dir="jre_base/include"/>
<delete dir="jre_base/legal"/>
</target>
<target name="jre-base-desktop" description="build JRE for bundled JRE builds with desktop (swing) support">
<exec command="jlink --module-path ${java.home}/jmods --add-modules ${jre-base},${jre-desktop} --output jre_base_desktop"/>
<delete>
<fileset dir="jre_base_desktop/bin" includes="java**.exe"/>
</delete>
<delete dir="jre_base_desktop/include"/>
<delete dir="jre_base_desktop/legal"/>
</target>
<target name="jre-base-desktop-java" description="build JRE for bundled JRE builds with desktop (swing) support (includes java executables)">
<exec command="jlink --module-path ${java.home}/jmods --add-modules ${jre-base},${jre-desktop} --output jre_base_desktop_java"/>
<delete dir="jre_base_desktop_java/include"/>
<delete dir="jre_base_desktop_java/legal"/>
</target>
<target name="jre-base-javac" description="build JRE for bundled JRE builds with base and Java compiler">
<exec command="jlink --module-path ${java.home}/jmods --add-modules ${jre-base},${jre-javac} --output jre_base_javac"/>
<delete>
<fileset dir="jre_base_javac/bin" includes="java**.exe"/>
</delete>
<delete dir="jre_base_javac/include"/>
<delete dir="jre_base_javac/legal"/>
</target>
<target name="jni2ffm" description="generate FFM sources">
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/GLJNI.java"/>
<arg value="src/javaforce/ffm/GLFFM.java"/>
<arg value="gl"/>
<arg value="implements"/>
<arg value="GL"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/CLJNI.java"/>
<arg value="src/javaforce/ffm/CLFFM.java"/>
<arg value="api"/>
<arg value="implements"/>
<arg value="CLAPI"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/CameraJNI.java"/>
<arg value="src/javaforce/ffm/CameraFFM.java"/>
<arg value="api"/>
<arg value="implements"/>
<arg value="CameraAPI"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/PCapJNI.java"/>
<arg value="src/javaforce/ffm/PCapFFM.java"/>
<arg value="api"/>
<arg value="implements"/>
<arg value="PCapAPI"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/MediaJNI.java"/>
<arg value="src/javaforce/ffm/MediaFFM.java"/>
<arg value="api,media"/>
<arg value="implements"/>
<arg value="MediaAPI"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/ComPortJNI.java"/>
<arg value="src/javaforce/ffm/ComPortFFM.java"/>
<arg value="api"/>
<arg value="implements"/>
<arg value="ComPortAPI"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/MonitorFolderJNI.java"/>
<arg value="src/javaforce/ffm/MonitorFolderFFM.java"/>
<arg value="api,io"/>
<arg value="implements"/>
<arg value="MonitorFolderAPI"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/SpeexJNI.java"/>
<arg value="src/javaforce/ffm/SpeexFFM.java"/>
<arg value="api"/>
<arg value="implements"/>
<arg value="SpeexAPI"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/GPIOJNI.java"/>
<arg value="src/javaforce/ffm/GPIOFFM.java"/>
<arg value="api"/>
<arg value="implements"/>
<arg value="GPIOAPI"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/I2CJNI.java"/>
<arg value="src/javaforce/ffm/I2CFFM.java"/>
<arg value="api"/>
<arg value="implements"/>
<arg value="I2CAPI"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/UIJNI.java"/>
<arg value="src/javaforce/ffm/UIFFM.java"/>
<arg value="api,ui"/>
<arg value="implements"/>
<arg value="UIAPI"/>
</java>
<java classpath="${home}/javaforce.jar" classname="javaforce.ffm.JNI2FFM" fork="true" jvm="${user.home}/bin/jfexec">
<arg value="src/javaforce/jni/VMJNI.java"/>
<arg value="src/javaforce/ffm/VMFFM.java"/>
<arg value="api,vm"/>
<arg value="implements"/>
<arg value="VMAPI"/>
</java>
</target>
<target name="clean" description="deletes compiled files">
<delete>
<fileset dir="classes" includes="**/*.class"/>
<fileset dir="${lib}" includes="javaforce-${version}.jar"/>
<fileset dir="." includes="*.jar"/>
<fileset dir="." includes="*.asc"/>
<fileset dir="native/headers" includes="*.h"/>
<fileset dir="src/javaforce/icons/16" includes="*.png"/>
<fileset dir="src/javaforce/icons/32" includes="*.png"/>
</delete>
</target>
</project>