1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<project name =" JNA" default =" default" basedir =" ."
3
3
xmlns : artifact =" antlib:org.apache.maven.artifact.ant"
4
- xmlns : as =" antlib:org.codehaus.mojo.animal_sniffer"
5
4
xmlns : if =" ant:if"
6
5
xmlns : unless =" ant:unless" >
7
6
<description >Builds and tests JNA</description >
13
12
support it).
14
13
15
14
Cross-compile by specifying -Dos.prefix={name-arch} to ant
16
- (cross-compile currently only configured/tested on w32ce-arm and
17
- android targets)
15
+ (cross-compile currently only configured/tested on android targets)
18
16
19
17
Use ANT_OPTS=-D-native=true to build native parts, or directly
20
18
invoke the native or test targets
33
31
34
32
<!-- global properties -->
35
33
<!-- (all build-related props should go in -dynamic-properties) -->
36
- <property name = " name " value = " jna " />
34
+ <import file = " common.xml " />
37
35
<property name =" jar" value =" ${ name } .jar" />
38
36
<property name =" aar" value =" ${ name } .aar" />
39
37
<property name =" minjar" value =" ${ name } -min.jar" />
55
53
<property name =" doc" location =" doc" />
56
54
<property name =" javadoc" location =" ${ doc } /javadoc" />
57
55
<property name =" stylesheet" location =" ${ javadoc } /doc/css/javadoc.css" />
58
- <property name =" vendor" value =" JNA Development Team" />
59
- <property name =" year" value =" 2018" />
60
- <property name =" copyright"
61
- value =" Copyright &copy; 2007-${ year } Timothy Wall. All Rights Reserved." />
62
- <buildnumber />
63
-
64
- <!-- JNA library release version - android versionCode is derived from mjar/minor/revision -->
65
- <property name =" jna.major" value =" 5" />
66
- <property name =" jna.minor" value =" 14" />
67
- <property name =" jna.revision" value =" 0" />
68
- <property name =" jna.build" value =" 0" /> <!-- ${build.number}-->
69
- <condition property =" version.suffix" value =" " else =" -SNAPSHOT" >
70
- <or >
71
- <isset property =" release" />
72
- <isset property =" maven-release" />
73
- </or >
74
- </condition >
75
- <property name =" jna.version" value =" ${ jna.major } .${ jna.minor } .${ jna.revision } ${ version.suffix } " />
76
- <property name =" osgi.version" value =" ${ jna.major } .${ jna.minor } .${ jna.revision } " />
77
- <!-- jnidispatch library release version -->
78
- <property name =" jni.major" value =" 7" />
79
- <property name =" jni.minor" value =" 0" />
80
- <property name =" jni.revision" value =" 0" />
81
- <property name =" jni.build" value =" 0" /> <!-- ${build.number}-->
82
- <property name =" jni.version" value =" ${ jni.major } .${ jni.minor } .${ jni.revision } " />
83
- <property name =" jni.md5" value =" 5fb98531302accd485c534c452dd952a" />
84
- <property name =" spec.title" value =" Java Native Access (JNA)" />
85
- <property name =" spec.vendor" value =" ${ vendor } " />
86
- <property name =" spec.version" value =" ${ jna.major } " />
87
- <property name =" impl.title" value =" com.sun.jna" />
88
- <property name =" impl.vendor" value =" ${ spec.vendor } " />
89
- <property name =" impl.version" value =" ${ jna.version } (b${ jna.build } )" />
90
-
91
- <!-- Set up restrictions for w32ce, based on JavaME/CDC -->
92
- <condition property =" compatibility" value =" 1.4" >
93
- <equals arg1=" ${ os.prefix } " arg2=" w32ce-arm" />
94
- </condition >
95
- <condition property =" test.compatibility" value =" 1.4" >
96
- <equals arg1=" ${ os.prefix } " arg2=" w32ce-arm" />
97
- </condition >
98
-
99
- <!--
100
- Default compatibility, 1.6, or whatever version is running
101
-
102
- Release builds of JNA target 1.6 and should be build on JDK 8, as JDK 9
103
- introduced changes in the ByteBuffer class, which result in classes, that
104
- can't be loaded on Java 6.
105
-
106
- JDK 11 is the last JDK, that supports creation of Java 6 compatible class
107
- files.
108
- -->
109
- <condition property =" compatibility" value =" 1.6" else =" 9" >
110
- <matches pattern =" ^1\.\d+$" string =" ${ ant.java.version } " />
111
- </condition >
112
-
113
- <condition property =" compatibility-check" value =" true" >
114
- <equals arg1=" ${ compatibility } " arg2=" 1.6" />
115
- </condition >
116
-
117
- <property name =" platform.compatibility" value =" ${ compatibility } " />
118
56
119
- <!-- JNA tests require at least 1.8 compatiblity -->
120
- <condition property =" test.compatibility" value =" 1.8" else =" ${ compatibility } " >
121
- <or >
122
- <equals arg1=" ${ compatibility } " arg2=" 1.6" />
123
- <equals arg1=" ${ compatibility } " arg2=" 1.7" />
124
- </or >
125
- </condition >
126
57
<condition property =" tests.exclude-patterns" value =" **/VarArgsTest.java,**/AnnotatedLibraryTest.java,**/WebStartTest.java,**/PointerBufferTest.java,**/HeadlessLoadLibraryTest.java,**/StructureBufferFieldTest.java,**/PerformanceTest.java,**/*BufferArgumentsMarshalTest.java" else =" **/wince/*.java,**/WebStartTest.java" >
127
58
<equals arg1=" ${ os.prefix } " arg2=" w32ce-arm" />
128
59
</condition >
189
120
</target >
190
121
191
122
<target name =" -dynamic-properties" depends =" -prepare-anttools" >
192
- <property name =" build.os.name" value =" ${ os.name } " />
193
- <condition property =" build.os.family" value =" windows" >
194
- <contains string =" ${ build.os.name } " substring =" windows" casesensitive =" false" />
195
- </condition >
196
- <condition property =" build.os.family" value =" mac" >
197
- <or >
198
- <contains string =" ${ build.os.name } " substring =" darwin" casesensitive =" false" />
199
- <contains string =" ${ build.os.name } " substring =" mac" casesensitive =" false" />
200
- </or >
201
- </condition >
202
- <property name =" build.os.family" value =" other" />
203
- <property name =" build.os.arch" value =" ${ os.arch } " />
204
- <property name =" build.os.endianess" value =" ${ sun.cpu.endian } " />
205
123
206
124
<condition property =" -native" value =" true" >
207
125
<not ><isset property =" build-native" /></not >
238
156
<condition property =" jar.omitted" value =" **/*jnidispatch*" else =" jnilib-included" >
239
157
<isset property =" omit-jnilib" />
240
158
</condition >
241
- <condition property =" cross-compile" value =" true" >
242
- <isset property =" os.prefix" />
243
- </condition >
244
159
245
160
<property name =" classes" location =" ${ build } /classes" />
246
161
<property name =" eclipse.classes" location =" build.eclipse/classes" />
256
171
/>
257
172
<BuildArmSoftFloatDetector targetProperty =" build.isArmSoftFloat" />
258
173
259
- <!-- Add other supported platforms here -->
260
- <condition property =" jre.arch" value =" x86" >
261
- <matches pattern =" (i[3456]86|pentium)" string =" ${ build.os.arch } " />
262
- </condition >
263
- <condition property =" jre.arch" value =" x86-64" >
264
- <matches pattern =" (x86_64|amd64|em64t)" string =" ${ build.os.arch } " />
265
- </condition >
266
- <condition property =" jre.arch" value =" ppc" >
267
- <matches pattern =" (powerpc|power)" string =" ${ build.os.arch } " />
268
- </condition >
269
- <condition property =" jre.arch" value =" ppc64le" >
270
- <or >
271
- <matches pattern =" (powerpc64le|power64le|ppc64le)" string =" ${ build.os.arch } " />
272
- <and >
273
- <matches pattern =" (powerpc64|power64|ppc64)" string =" ${ build.os.arch } " />
274
- <matches pattern =" little" string =" ${ build.os.endianess } " />
275
- </and >
276
- </or >
277
- </condition >
278
- <condition property =" jre.arch" value =" ppc64" >
279
- <matches pattern =" (powerpc64|power64)" string =" ${ build.os.arch } " />
280
- </condition >
281
- <condition property =" jre.arch" value =" armel" >
282
- <and >
283
- <matches pattern =" arm" string =" ${ build.os.arch } " />
284
- <matches pattern =" true" string =" ${ build.isArmSoftFloat } " />
285
- </and >
286
- </condition >
287
-
288
- <property name =" jre.arch" value =" ${ build.os.arch } " />
289
-
290
- <condition property =" os.prefix" value =" linux-${ jre.arch } " >
291
- <equals arg1=" ${ build.os.name } " arg2=" Linux" />
292
- </condition >
293
- <condition property =" os.prefix" value =" aix-${ jre.arch } " >
294
- <equals arg1=" ${ build.os.name } " arg2=" AIX" />
295
- </condition >
296
- <condition property =" os.prefix" value =" win32-${ jre.arch } " >
297
- <equals arg1=" ${ build.os.family } " arg2=" windows" />
298
- </condition >
299
- <condition property =" os.prefix" value =" darwin-${ jre.arch } " >
300
- <equals arg1=" ${ build.os.family } " arg2=" mac" />
301
- </condition >
302
- <condition property =" os.prefix" value =" sunos-${ jre.arch } " >
303
- <equals arg1=" ${ build.os.name } " arg2=" SunOS" />
304
- </condition >
305
- <condition property =" os.prefix" value =" freebsd-${ jre.arch } " >
306
- <equals arg1=" ${ build.os.name } " arg2=" FreeBSD" />
307
- </condition >
308
- <condition property =" os.prefix" value =" openbsd-${ jre.arch } " >
309
- <equals arg1=" ${ build.os.name } " arg2=" OpenBSD" />
310
- </condition >
311
- <condition property =" os.prefix" value =" netbsd-${ jre.arch } " >
312
- <equals arg1=" ${ build.os.name } " arg2=" NetBSD" />
313
- </condition >
314
- <condition property =" os.prefix" value =" kfreebsd-${ jre.arch } " >
315
- <equals arg1=" ${ build.os.name } " arg2=" GNU/kFreeBSD" />
316
- </condition >
317
- <property name =" resource.prefix" value =" ${ os.prefix } " description =" fallback" />
318
174
<fail unless =" os.prefix" message =" OS/arch not supported (${ os.name } /${ jre.arch } ), edit build.xml and native/Makefile to add it." />
319
175
<!-- Keep all natives separate -->
320
- <property name =" native.subdir" value =" native-${ os.prefix } " />
321
176
<condition property =" jdk.home" value =" ${ java.home } " >
322
177
<available file =" ${ java.home } /include" />
323
178
</condition >
352
207
<mkdir dir =" ${ doc } " />
353
208
<mkdir dir =" ${ build.aar } " />
354
209
355
- <echo >Java version ${ java.version } , compatibility: ${ compatibility } , ant: ${ ant.java.version } </echo >
210
+ <echo >Java version ${ java.version } , compatibility: ${ javac.release } , ant: ${ ant.java.version } </echo >
356
211
<echo >JNA version ${ jna.version } , native ${ jni.version } , android ${ android.versionCode } </echo >
357
212
<echo >${ java.vm.name } (${ java.vm.vendor } , ${ java.vm.version } )</echo >
358
213
<echo >java.home=${ java.home } </echo >
406
261
replace =' VERSION_NATIVE = "${ jni.version } ";'
407
262
file =" ${ build } /jna-src/com/sun/jna/Version.java" />
408
263
409
- <javac source =" ${ compatibility } "
410
- target =" ${ compatibility } "
264
+ <javac release =" ${ javac.release } "
411
265
destdir =" ${ classes } "
412
266
includeantruntime =" false"
413
267
deprecation =" on"
416
270
nativeheaderdir =" ${ build.headers } " >
417
271
<src location =" ${ build } /jna-src/com/sun/jna" />
418
272
</javac >
419
- <javac classpath =" ${ compatibility } "
420
- source =" ${ compatibility } "
421
- target =" ${ compatibility } "
273
+ <javac release =" ${ javac.release } "
422
274
destdir =" ${ classes } "
423
275
includeantruntime =" false"
424
276
deprecation =" on"
@@ -760,19 +612,6 @@ osname=macosx;processor=aarch64
760
612
761
613
<target name =" platform-jar" depends =" jar" >
762
614
<subant target =" jar" failonerror =" true" >
763
- <property name =" file.reference.jna.build" location =" ${ build } " />
764
- <property name =" file.reference.jna.jar" location =" ${ build } /${ jar } " />
765
- <property name =" libs.junit.classpath" refid =" test.libs" />
766
- <property name =" javac.source" value =" ${ platform.compatibility } " />
767
- <property name =" javac.target" value =" ${ platform.compatibility } " />
768
- <!-- OSGi manifest properties -->
769
- <property name =" vendor" value =" ${ vendor } " />
770
- <property name =" impl.title" value =" ${ impl.title } .platform" />
771
- <property name =" impl.version" value =" ${ impl.version } " />
772
- <property name =" spec.title" value =" ${ spec.title } " />
773
- <property name =" spec.vendor" value =" ${ spec.vendor } " />
774
- <property name =" spec.version" value =" ${ spec.version } " />
775
- <property name =" osgi.version" value =" ${ osgi.version } " />
776
615
<fileset dir =" ${ contrib } " includes =" platform/build.xml" />
777
616
</subant >
778
617
<!-- Sources package as required by maven -->
@@ -786,8 +625,9 @@ osname=macosx;processor=aarch64
786
625
<property name =" file.reference.jna.build" location =" ${ build } " />
787
626
<property name =" file.reference.jna.jar" location =" ${ build } /${ jar } " />
788
627
<property name =" libs.junit.classpath" refid =" test.libs" />
789
- <property name =" javac.source" value =" ${ compatibility } " />
790
- <property name =" javac.target" value =" ${ compatibility } " />
628
+ <property name =" javac.source" value =" ${ javac.release } " />
629
+ <property name =" javac.target" value =" ${ javac.release } " />
630
+ <property name =" javac.release" value =" ${ javac.release } " />
791
631
<fileset dir =" ${ contrib } " includes =" */build.xml" excludes =" platform/build.xml" />
792
632
</subant >
793
633
</target >
@@ -1189,11 +1029,10 @@ cd ..
1189
1029
description =" Compile test code which does not have additional native
1190
1030
dependencies" >
1191
1031
<javac classpathref =" compile-test.path"
1192
- source =" ${ test.compatibility } "
1193
- target =" ${ test.compatibility } "
1194
- destdir =" ${ test.classes } "
1032
+ release =" ${ javac.release } "
1195
1033
includeantruntime =" false"
1196
1034
includes =" **/StructureFieldOrderInspector.java"
1035
+ destdir =" ${ test.classes } "
1197
1036
deprecation =" on"
1198
1037
debug =" ${ debug } "
1199
1038
encoding =" UTF-8"
@@ -1205,8 +1044,7 @@ cd ..
1205
1044
<target name =" compile-tests" depends =" compile,native,jar"
1206
1045
description=" Compile all test code" >
1207
1046
<javac classpathref =" compile-test.path"
1208
- source =" ${ test.compatibility } "
1209
- target =" ${ test.compatibility } "
1047
+ release =" ${ javac.release } "
1210
1048
destdir =" ${ test.classes } "
1211
1049
includeantruntime =" false"
1212
1050
excludes =" ${ tests.exclude-patterns } "
@@ -1336,25 +1174,9 @@ cd ..
1336
1174
<property name =" build-native" value =" true" />
1337
1175
</target >
1338
1176
1339
- <target name =" -check-java6-compatibility" depends =" -enable-native,jar,compile-tests" if =" compatibility-check" unless =" clover" >
1340
- <echo >Checking JDK compatibility 1.6</echo >
1341
-
1342
- <echo ></echo >
1343
-
1344
- <as : check-signature signature =" lib/java16-1.1.signature" >
1345
- <path path =" ${ classes } " />
1346
- </as : check-signature >
1347
-
1348
- <echo ></echo >
1349
- </target >
1350
-
1351
- <target name =" -warn-java6-compatiblity" depends =" -enable-native,jar,compile-tests" unless =" compatibility-check" >
1352
- <echo level =" warn" >Build is not Java 6 compatible and NOT A PRODUCTION BUILD</echo >
1353
- </target >
1354
-
1355
1177
<!-- When running tests from an IDE, be sure to set jna.library.path -->
1356
1178
<!-- to where the test library (testlib) is found. -->
1357
- <target name =" test" depends =" -enable-native,jar,compile-tests,-check-java6-compatibility,-warn-java6-compatiblity " unless =" cross-compile"
1179
+ <target name =" test" depends =" -enable-native,jar,compile-tests" unless =" cross-compile"
1358
1180
description =" Run all unit tests" >
1359
1181
1360
1182
<property name =" test.fork" value =" yes" />
@@ -1429,12 +1251,8 @@ cd ..
1429
1251
1430
1252
<target name =" test-platform" depends =" compile-some-tests,platform-jar"
1431
1253
description =" Run platform-specific tests" >
1432
- <subant target =" test" failonerror =" true" inheritall =" true" inheritrefs =" true" >
1433
- <property name =" file.reference.jna.build" location =" ${ build } " />
1434
- <property name =" file.reference.jna.jar" location =" ${ build } /${ jar } " />
1435
- <property name =" libs.junit.classpath" refid =" test.libs" />
1436
- <property name =" javac.source" value =" ${ test.compatibility } " />
1437
- <property name =" javac.target" value =" ${ test.compatibility } " />
1254
+ <subant target =" test" failonerror =" true" >
1255
+ <property name =" javac.release" value =" ${ javac.release } " />
1438
1256
<fileset dir =" ${ contrib } " includes =" platform/build.xml" />
1439
1257
</subant >
1440
1258
</target >
@@ -1492,7 +1310,7 @@ cd ..
1492
1310
<doctitle >JNA API Documentation</doctitle >
1493
1311
<header >${ header } </header >
1494
1312
<bottom >${ footer } </bottom >
1495
- <link href =" http://download.oracle.com/javase/${ compatibility } /docs/api/" />
1313
+ <link href =" http://download.oracle.com/javase/${ javac.release } /docs/api/" />
1496
1314
1497
1315
<packageset dir =" ${ src } " defaultexcludes =" yes" >
1498
1316
<patternset >
0 commit comments