|
12 | 12 | (cross-compile currently only configured/tested on w32ce-arm and
|
13 | 13 | android-arm/-x86)
|
14 | 14 |
|
15 |
| - Use ANT_OPTS=-Dskip-native to skip building native parts. |
| 15 | + Use ANT_OPTS=-Dskip-native=false to build native parts, or directly |
| 16 | + invoke the native or test targets |
16 | 17 | Use ANT_OPTS=-Dheadless to run tests headless
|
17 | 18 | Use ANT_OPTS=-Drelease to stage a final, non-snapshot version
|
18 | 19 | -->
|
|
78 | 79 | <property name="impl.title" value="com.sun.jna"/>
|
79 | 80 | <property name="impl.vendor" value="${spec.vendor}"/>
|
80 | 81 | <property name="impl.version" value="${jna.version} (b${jna.build})"/>
|
81 |
| - <condition property="jni.valid" value="true"> |
82 |
| - <isset property="skip-native"/> |
83 |
| - </condition> |
84 | 82 |
|
85 | 83 | <!-- Set up restrictions for w32ce, based on JavaME/CDC -->
|
86 | 84 | <condition property="compatibility" value="1.4">
|
|
138 | 136 |
|
139 | 137 | <target name="-dynamic-properties">
|
140 | 138 |
|
| 139 | + <condition property="-native" value="true"> |
| 140 | + <not><isset property="build-native"/></not> |
| 141 | + </condition> |
| 142 | + <condition property="jni.valid" value="true"> |
| 143 | + <isset property="-native"/> |
| 144 | + </condition> |
| 145 | + |
141 | 146 | <replaceregexp match="(<version>).*(</version>)"
|
142 | 147 | replace="\1${jna.version}\2"
|
143 | 148 | file="${pom}"/>
|
@@ -501,7 +506,7 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc
|
501 | 506 | </subant>
|
502 | 507 | </target>
|
503 | 508 |
|
504 |
| - <target name="javah" depends="compile" unless="skip-native"> |
| 509 | + <target name="javah" depends="compile" unless="-native"> |
505 | 510 | <javah classpath="${classes}" destdir="${build.native}" force="yes">
|
506 | 511 | <class name="com.sun.jna.Function"/>
|
507 | 512 | <class name="com.sun.jna.Native"/>
|
@@ -612,7 +617,7 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc
|
612 | 617 | file="${rsrc}" byline="true"/>
|
613 | 618 | </target>
|
614 | 619 |
|
615 |
| - <target name="native" depends="-setup,javah,-native-api-check,rsrc" unless="skip-native" |
| 620 | + <target name="native" depends="-enable-native,-setup,javah,-native-api-check,rsrc" unless="-native" |
616 | 621 | description="Build native libraries. Use 'ant -DCC=xxx' to build using a compiler other than gcc">
|
617 | 622 | <property name="comment" value="# auto-generated by ant"/>
|
618 | 623 | <replaceregexp match="^JNA_JNI_VERSION=.*"
|
@@ -832,9 +837,13 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc
|
832 | 837 | <chmod file="${shared}/*.dll" perm="+x"/>
|
833 | 838 | </target>
|
834 | 839 |
|
| 840 | + <target name="-enable-native" unless="-native"> |
| 841 | + <property name="build-native" value="true"/> |
| 842 | + </target> |
| 843 | + |
835 | 844 | <!-- When running tests from an IDE, be sure to set jna.library.path -->
|
836 | 845 | <!-- to where the test library (testlib) is found. -->
|
837 |
| - <target name="test" depends="jar,compile-tests" unless="cross-compile" |
| 846 | + <target name="test" depends="-enable-native,jar,compile-tests" unless="cross-compile" |
838 | 847 | description="Run all unit tests">
|
839 | 848 | <property name="test.fork" value="yes"/>
|
840 | 849 | <property name="reports.junit" location="${reports}/junit"/>
|
|
0 commit comments