forked from freemansoft/jacob-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
507 lines (465 loc) · 24.6 KB
/
build.xml
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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
<?xml version="1.0"?>
<!-- ======================================================================
Ant build file for JACOB.
Created Feb 4, 2005 1:23:05 PM as part of migration from ANT
Last Modified June 21, 2015
Tested on Eclipse 4.3 with the C++ plugins, Ant 1.8 and MS Visual C++ 12 (2013)
Eclipse users are pretty lucky because the whole project
can be built inside eclipse due to their built in ANT support.
The COM portion of this build requires MS Visual C++ Widnows SDK 7.1A
The build proces defined in this build.xml file does not support other versions
YOU MUST define a file named compilation_tools.properties!
This works for Visual Studio 2019 with the Win 10 tookits installed and Amazon Java 8
JDK=C\:\\Program Files\\Amazon Corretto\\jdk1.8.0_265
MSDEV_DIR=C\:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110
MSDEV_IDE_DIR=C\:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE
MSDEV_PLATFORM_DIR=C\:\\Program Files (x86)\\Windows Kits\\10
MSDEV_PLATFORM_DIR_BIN=C\:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.18362.0
MSDEV_PLATFORM_DIR_INC=C\:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.18362.0
MSDEV_PLATFORM_DIR_LIB=C\:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.18362.0
DO NOT check compilation_tools.properties into source control as the
values are specific to YOUR environment.
The JacobVersion.properties file is now completely autogenerated.
====================================================================== -->
<project name="jacob" default="default" basedir=".">
<!-- ======================================================================
First handle the properties that come from property files
Sets a default for properties that were not in the file.
Relies on the fact that properties cannot be reset once set.
================================================================== -->
<property file="compilation_tools.properties" />
<property environment="env"/>
<echo message="Number of Processors = ${env.NUMBER_OF_PROCESSORS}"/>
<property name="JDK" value="JDK not set in compilation_tools properties file"/>
<!-- MSDEV_DIR is a required parameter so set to a message if its not set -->
<property name="MSDEV_DIR" value="MSDEV_DIR not set in compilation_tools properties file"/>
<property name="MSDEV_PLATFORM_DIR" value="MSDEV_PLATFORM_DIR not set in compilation_tools properties file"/>
<echo message="executing with MSDEV_DIR=${MSDEV_DIR}" />
<!-- ======================================================================
Now build up all the derived properties
================================================================== -->
<property name="application.title" value="JACOB : Java COM Bridge" />
<property name="application.vendor" value="http://jacob-project.sourceforge.net" />
<property name="src.java.mainpackage" value="com.jacob" />
<property name="src.java.mainpackage.manifest" value="com/jacob/" />
<property name="generated.filename.dll.x86" value="jacob-${version}-x86.dll" />
<property name="generated.filename.dll.x64" value="jacob-${version}-x64.dll" />
<property name="generated.filename.jar" value="jacob.jar" />
<property name="generated.filename.zip" value="jacob-${version}" />
<property name="generated.filename.version" value="JacobVersion.properties" />
<property name="junit.jar" value="${basedir}/lib/junit-4.13.jar" />
<property name="hamcrest-core.jar" value="${basedir}/lib/hamcrest-2.2.jar" />
<property name="src.java.mainroot" value="${basedir}/src" />
<property name="src.java.samples" value="${basedir}/samples" />
<property name="src.java.unittest" value="${basedir}/unittest" />
<property name="src.cpp" value="${basedir}/jni" />
<property name="release.dir" value="${basedir}\release" />
<property name="release.dir.x86" value="${release.dir}\x86" />
<property name="release.dir.x86.cpp" value="${release.dir.x86}\jni" />
<property name="release.file.x86.dll" value="${release.dir.x86}\${generated.filename.dll.x86}" />
<property name="release.dir.x64" value="${release.dir}\x64" />
<property name="release.dir.x64.cpp" value="${release.dir.x64}\jni" />
<property name="release.file.x64.dll" value="${release.dir.x64}\${generated.filename.dll.x64}" />
<property name="release.dir.java" value="${release.dir}\java" />
<property name="release.dir.java.meta.inf" value="${release.dir.java}\META-INF" />
<property name="release.file.jar" value="${release.dir.java}\${generated.filename.jar}" />
<property name="include.x86_64" value="${MSDEV_DIR}\include" />
<property name="include.x86_64.atl" value="${MSDEV_DIR}\atlmfc\include" />
<property name="include.x86_64.platformSDK" value="${MSDEV_PLATFORM_DIR_INC}\um;${MSDEV_PLATFORM_DIR_INC}\ucrt;${MSDEV_PLATFORM_DIR_INC}\shared" />
<property name="compiler.x86" value="${MSDEV_DIR}\bin\Hostx64\x86\cl.exe" />
<property name="linker.x86" value="${MSDEV_DIR}\bin\Hostx64\x86\link.exe" />
<property name="manifestool.x86" value="${MSDEV_PLATFORM_DIR_BIN}\x86\mt.exe" />
<property name="library.x86" value="${MSDEV_DIR}\lib\x86" />
<property name="library.x86.atl" value="${MSDEV_DIR}\atlmfc\lib\x86" />
<property name="library.x86.platformSDK" value="${MSDEV_PLATFORM_DIR_LIB}" />
<property name="compiler.x64" value="${MSDEV_DIR}\bin\Hostx64\x64\cl.exe" />
<property name="linker.x64" value="${MSDEV_DIR}\bin\Hostx64\x64\link.exe" />
<property name="manifesttool.x64" value="${MSDEV_PLATFORM_DIR_BIN}\x64\mt.exe" />
<property name="library.x64" value="${MSDEV_DIR}\lib\x64" />
<property name="library.x64.atl" value="${MSDEV_DIR}\atlmfc\lib\x64" />
<property name="library.x64.platformSDK" value="${MSDEV_PLATFORM_DIR_LIB}" />
<!-- ======================================================================
Create the necessary directory structure (does nothing if it
already there)
================================================================== -->
<mkdir dir="${release.dir.java}"/>
<mkdir dir="${release.dir.java.meta.inf}"/>
<mkdir dir="${release.dir.x86.cpp}"/>
<mkdir dir="${release.dir.x64.cpp}"/>
<mkdir dir="${release.dir}"/>
<!-- ======================================================================
Writes out a version file to be included in the jar
build iteration is only the iteration since lat time releases directory cleaned
================================================================== -->
<property name="version" value="version not set in compilation_tools properties file"/>
<propertyfile file="${release.dir.java.meta.inf}/${generated.filename.version}">
<entry key="version" type="string" value="${version}" />
<entry key="build.iteration" type="int" operation="+" value="1" pattern="00" />
<entry key="build.date" type="date" value="now" operation="=" pattern="dd-MMMM-yyyy HH:mm:ss" />
</propertyfile>
<property file="${release.dir.java.meta.inf}/${generated.filename.version}" />
<!-- ======================================================================
32 bit X86 can only be built on 32 bit because of a JDK library issue.
arch=X86 true if on 32 bit, unset in all other cases.
This module used to rely on that. Now it just checks to see if we have
the right compilers.
================================================================== -->
<available file="${compiler.x86}" property="compilerAvailable.x86"/>
<echo message="compilerAvailable.x86=${compilerAvailable.x86} compiler.x86=${compiler.x86}" />
<available file="${compiler.x64}" property="compilerAvailable.x64"/>
<echo message="compilerAvailable.x64=${compilerAvailable.x64} compiler.x64=${compiler.x64}" />
<!-- ======================================================================
Compare the date/time of the DLL against that of the cpp source.
Up to date is only true if dll exists and is later than source
We should build if we can build and the dll is not up to date
================================================================== -->
<condition property="shouldBuild.x86">
<and>
<istrue value="${compilerAvailable.x86}"/>
<not>
<uptodate targetfile="${release.file.x86.dll}">
<srcfiles dir="${src.cpp}" includes="*.cpp" />
<srcfiles dir="${src.cpp}" includes="*.h" />
<!-- Check the build file itself as well -->
<srcfiles dir="${basedir}" includes="build.xml" />
</uptodate>
</not>
</and>
</condition>
<echo message="shouldBuild.x86= ${shouldBuild.x86}" />
<condition property="shouldBuild.x64">
<and>
<istrue value="${compilerAvailable.x64}"/>
<not>
<uptodate targetfile="${release.file.x64.dll}">
<srcfiles dir="${src.cpp}" includes="*.cpp" />
<srcfiles dir="${src.cpp}" includes="*.h" />
<!-- Check the build file itself as well -->
<srcfiles dir="${basedir}" includes="build.xml" />
</uptodate>
</not>
</and>
</condition>
<echo message="shouldBuild.x64= ${shouldBuild.x64}" />
<!--=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v
START of TASKS
=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^ -->
<!-- =================================
target: default
================================= -->
<target name="default"
depends="javaJarBin,makeDll.x86,makeDll.x64">
<echo message="${application.title} ${version} build ${build.iteration} : finished on ${build.date}" />
</target>
<!-- ======================================================================
Target (still in development) that removes all bin directories
================================================================== -->
<target name="clean">
<delete>
<fileset dir="${release.dir.java}"/>
<fileset dir="${release.dir.x86.cpp}"/>
<fileset dir="${release.dir.x64.cpp}"/>
<fileset dir="${release.dir}"/>
</delete>
</target>
<!-- ======================================================================
Compare the date/time of the JAR against that
of the java source
================================================================== -->
<target name="javaJarCheck">
<uptodate property="jarUpToDate" targetfile="${release.file.jar}">
<srcfiles dir="${src.java.mainroot}" includes="com/**/*.java" />
<!-- Check the build file itself as well -->
<srcfiles dir="${basedir}" includes="build.xml" />
</uptodate>
<echo message="javaJarCheck says jarUpToDate= ${jarUpToDate}" />
</target>
<!-- ======================================================================
Compile the java files and copy JacobVersion.properties to be jar'd up
Relies on ant recognizing when a file needs to be compiled
Unit tests compiled seperately because of junit dependency
================================================================== -->
<target name="javaCompile" >
<echo>Building Jacob classes in ${release.dir.java}</echo>
<javac srcdir="${src.java.mainroot}"
destdir="${release.dir.java}"
listfiles="true" debug="on"
includeantruntime="false" />
<echo>Building sample classes in ${release.dir.java}</echo>
<javac srcdir="${src.java.samples}"
destdir="${release.dir.java}"
classpath="${release.dir.java}"
listfiles="true" debug="on"
includeantruntime="false" />
<echo>Building Jacob test classes in ${release.dir.java} using junit jar ${junit.jar}</echo>
<javac srcdir="${src.java.unittest}"
destdir="${release.dir.java}"
classpath="${release.dir.java}:${junit.jar}"
excludes="com/jacob/test/safearray/SafeArrayBasicTest.java"
listfiles="true" debug="on"
includeantruntime="false" />
<!-- one test has different character encoding -->
<javac srcdir="${src.java.unittest}"
destdir="${release.dir.java}"
classpath="${release.dir.java}:${junit.jar}"
includes="com/jacob/test/safearray/SafeArrayBasicTest.java"
listfiles="true" debug="on"
includeantruntime="false"
encoding="UTF-16"/>
</target>
<!-- ======================================================================
Package the classes into a JAR.
Put JacobVersion.properties into the jar file so version retrieval method can find it
================================================================== -->
<target name="javaJarBin"
depends="javaCompile,javaJarCheck"
unless="jarUpToDate">
<echo>Removing old jars</echo>
<delete file="${release.file.jar}" />
<echo>Packaging java classes from ${release.dir.java} ...</echo>
<echo>Generated Version File is ${release.dir.java.meta.inf}/${generated.filename.version}</echo>
<jar destfile="${release.file.jar}" basedir="${release.dir.java}" update="false">
<exclude name="**/CVS" />
<!-- exclude all unit tests (ending in Test)
and everything in the samples and test packages -->
<exclude name="com/**/*Test*.class"/>
<exclude name="com/jacob/samples/**"/>
<exclude name="com/jacob/test/**"/>
<include name="com/**/*.class" />
<include name="META-INF/${generated.filename.version}" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<section name="${src.java.mainpackage.manifest}">
<attribute name="Specification-Title" value="${application.title}" />
<attribute name="Specification-Vendor" value="${application.vendor}" />
<attribute name="Implementation-Title" value="${application.title} Java libraries" />
<attribute name="Implementation-Version" value="${version} build ${build.iteration} on ${build.date}" />
<attribute name="Trusted-Library" value="true" />
<attribute name="Application-Name" value="Java-Windows Bridge" />
<attribute name="Permissions" value="all-permissions" />
<attribute name="Codebase" value="*" />
</section>
</manifest>
</jar>
</target>
<!-- ======================================================================
Compile the c source files.
================================================================== -->
<target name="compile.x86" if="shouldBuild.x86">
<echo>Clean up the (X86) target folders and file, for safety</echo>
<delete dir="${release.dir.x86.cpp}" />
<mkdir dir="${release.dir.x86.cpp}" />
<echo>Compiling (X86) C++ classes with JDK JNI library ${JDK}</echo>
<exec executable="${compiler.x86}" dir="${release.dir.x86.cpp}" failonerror="true">
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<env key="include" value="${JDK}\include;${JDK}\include\win32;${include.x86_64.platformSDK};${include.x86_64};${include.x86_64.atl}"/>
<arg value="/nologo"/>
<arg value="/c"/>
<arg value="/D WIN32"/>
<arg value="/D NDEBUG"/>
<arg value="/D _WINDOWS"/>
<arg value="/D _USRDLL"/>
<arg value="/D _WINDLL" />
<arg value="/D_USING_V110_SDK71_" /> <!-- evil hack added when no VS2010 installed 5/2014 -->
<!-- create a multi threaded dll -->
<arg value="/MT"/>
<!-- raise the warning level from the default -->
<!-- <arg value="/Wp64"/> -->
<arg value="/W3" />
<!-- sets the exception model -->
<arg value="/EHsc" />
<!-- /O2 and /RCT1 are incompatible -->
<!-- optimize build for speed. (is this VC specific? -->
<arg value="/O2" />
<!-- next two wipe out a lot of deprecated warnings about strings when using VC++ 8.0 and SDK-->
<arg value="/D _CRT_SECURE_NO_DEPRECATE" />
<arg value="/D _CRT_NONSTDC_NO_DEPRECATE" />
<arg value="/D _STATIC_CPPLIB" />
<arg value="${src.cpp}/*.cpp"/>
</exec>
</target>
<target name="compile.x64" if="shouldBuild.x64">
<echo>Clean up the (x64) target folders and file, for safety</echo>
<delete dir="${release.dir.x64.cpp}" />
<mkdir dir="${release.dir.x64.cpp}" />
<echo>Compiling C++ (x64) classes with JDK JNI library ${JDK}</echo>
<exec executable="${compiler.x64}" dir="${release.dir.x64.cpp}" failonerror="true">
<env key="include" value="${JDK}\include;${JDK}\include\win32;${include.x86_64.platformSDK};${include.x86_64};${include.x86_64.atl}"/>
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<arg value="/nologo"/>
<arg value="/c"/>
<arg value="/D WIN64"/>
<arg value="/D NDEBUG"/>
<arg value="/D _WINDOWS"/>
<arg value="/D _USRDLL"/>
<arg value="/D _WINDLL" />
<arg value="/D_USING_V110_SDK71_" /> <!-- evil hack added when no VS2010 installed 5/2014 -->
<!-- create a multi threaded dll -->
<arg value="/MT"/>
<!-- raise the warning level from the default -->
<!-- <arg value="/Wp64"/> -->
<arg value="/W3" />
<!-- sets the exception model -->
<arg value="/EHsc" />
<!-- /O2 and /RCT1 are incompatible -->
<!-- optimize build for speed. (is this VC specific? -->
<arg value="/O2" />
<!-- next two wipe out a lot of deprecated warnings about strings when using VC++ 8.0 and SDK-->
<arg value="/D _CRT_SECURE_NO_DEPRECATE" />
<arg value="/D _CRT_NONSTDC_NO_DEPRECATE" />
<arg value="/D _STATIC_CPPLIB" />
<arg value="${src.cpp}/*.cpp"/>
</exec>
</target>
<!-- ======================================================================
Link the obj files into a DLL.
DLL construction matrix (Yes=DLL can be built, No=DLL cannot)
_________________________________________________
Type of machine ANT is running on
32 bit 64 bit
32 bit target Yes No
64 bit target Yes Yes
================================================================== -->
<target name="makeDll.x86" depends="compile.x86" if="shouldBuild.x86">
<echo>Clean up the (x86) target folders and file, for safety</echo>
<echo>Using libs in ${library.x86}</echo>
<echo>Using libs in ${library.x86.platformSDK}</echo>
<delete file="${release.file.x86.dll}" />
<echo>Linking to create ${release.file.x86.dll}</echo>
<exec executable="${linker.x86}" dir="${release.dir.x86.cpp}" failonerror="true">
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<arg value="/nologo" />
<arg value="/MANIFEST" />
<arg value="/MANIFESTFILE:${release.dir.x86.cpp}/jacob.dll.manifest" />
<arg value="/dll" />
<arg value="/out:${release.file.x86.dll}" />
<arg value="/libpath:${library.x86}" />
<arg value="/libpath:${library.x86.atl}" />
<arg value="/libpath:${library.x86.platformSDK}\um\x86" />
<arg value="/libpath:${library.x86.platformSDK}\ucrt\x86" />
<arg value="${JDK}\lib\jvm.lib" />
<arg value="${release.dir.x86.cpp}/*obj"/>
</exec>
<exec executable="${manifestool.x86}" dir="${release.dir.x86.cpp}" failonerror="true">
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<arg value="-outputresource:${release.file.x86.dll};2"/>
<arg value="-manifest"/>
<arg value="${release.dir.x86.cpp}\jacob.dll.manifest" />
</exec>
</target>
<target name="makeDll.x64" depends="compile.x64" if="shouldBuild.x64">
<echo>Clean up the (x64) target folders and file, for safety</echo>
<echo>Using libs in ${library.x64}</echo>
<echo>Using libs in ${library.x64.platformSDK}</echo>
<delete file="${release.file.x64.dll}" />
<echo>Linking to create {$release.file.x64.dll}</echo>
<exec executable="${linker.x64}" dir="${release.dir.x64.cpp}" failonerror="true">
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<arg value="/nologo" />
<arg value="/MANIFEST" />
<arg value="/MANIFESTFILE:${release.dir.x64.cpp}/jacob.dll.manifest" />
<arg value="/dll" />
<arg value="/out:${release.file.x64.dll}" />
<arg value="/libpath:${library.x64}" />
<arg value="/libpath:${library.x64.atl}" />
<arg value="/libpath:${library.x64.platformSDK}\um\x64" />
<arg value="/libpath:${library.x64.platformSDK}\ucrt\x64" />
<arg value="${JDK}\lib\jvm.lib" />
<arg value="${release.dir.x64.cpp}/*.obj" />
</exec>
<exec executable="${manifestool.x86}" dir="${release.dir.x64.cpp}" failonerror="true">
<env key="Path" value="${MSDEV_IDE_DIR}"/>
<arg value="-outputresource:${release.file.x64.dll};2"/>
<arg value="-manifest"/>
<arg value="${release.dir.x64.cpp}\jacob.dll.manifest" />
</exec>
</target>
<!-- ======================================================================
Use this target to create javadoc from ${src.java.mainpackage}/*
================================================================== -->
<target name="generateJavaDoc">
<defaultexcludes add="**/*Test*"/>
<javadoc
packagenames="${src.java.mainpackage}/**"
sourcepath="${src.java.mainroot}"
destdir="${release.dir.java}/docs/api"
author="true"
version="true"
use="true"
windowtitle="${application.title} API Docs">
<doctitle><![CDATA[<h1>${application.title}</h1>]]></doctitle>
<bottom><![CDATA[<i>${application.vendor}</i>]]></bottom>
<group title="Core COM Communication" packages="${src.java.mainpackage}.com/**"/>
<group title="Higher Level Active X" packages="${src.java.mainpackage}.activeX/**"/>
<group title="API Stub Generator" packages="${src.java.mainpackage}.jacobgen/**"/>
<link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc="C:\tmp"/>
<link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
</javadoc>
<defaultexcludes default="true"/>
</target>
<!-- ======================================================================
Use this target to package all the files for a release
================================================================== -->
<target name="PackageRelease"
depends="makeDll.x86,makeDll.x64,javaJarBin,generateJavaDoc">
<echo>Packaging release... ${release.file.jar}</echo>
<zip
destfile="${release.dir}/${generated.filename.zip}.zip">
<exclude name="**/CVS" />
<exclude name="**/*.obj" />
<exclude name="**/*.class" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="LICENSE.* README.txt" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="docs/**" />
<zipfileset dir="${release.dir.x86}" prefix="${generated.filename.zip}" includes="${generated.filename.dll.x86}" />
<zipfileset dir="${release.dir.x64}" prefix="${generated.filename.zip}" includes="${generated.filename.dll.x64}" />
<zipfileset dir="${release.dir.java}" prefix="${generated.filename.zip}" includes="${generated.filename.jar}" />
<zipfileset dir="${release.dir.java}" prefix="${generated.filename.zip}" includes="docs/**"/>
</zip>
<zip
destfile="${release.dir}/${generated.filename.zip}_src.zip">
<exclude name="**/*.obj" />
<exclude name="**/*.class" />
<exclude name="**/*.dll" />
<exclude name="**/*.exp" />
<exclude name="**/*.jar" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="build.xml LICENSE.* README.txt" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="docs/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="lib/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="src/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="jni/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="samples/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="unittest/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="vstudio/jacob.vcproj" />
</zip>
</target>
<!-- ======================================================================
JUnit testing
This should probably be dependent on dll also
This assumes we are always testing on X86
This assumes that ant-junit is available
================================================================== -->
<target name='test' depends='javaCompile' >
<junit printsummary="yes"
haltonfailure="false"
fork="true"
dir="${release.dir.java}"
>
<!-- This is a bit of a hack because we hard code the test to build on a 64 bit system -->
<sysproperty key="java.library.path" value="${release.dir.x64}" />
<classpath>
<pathelement location="${junit.jar}"/>
<pathelement location="${hamcrest-core.jar}"/>
<pathelement location="${release.dir.java}"/>
<pathelement path="${src.java.unittest}"/>
</classpath>
<formatter type="brief" usefile="false"/>
<batchtest>
<!-- use the source directory because it tries to run inner classes
if we use the release directory -->
<fileset dir="${src.java.unittest}">
<include name="**/*.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>