From 3b9f1aeaf0bf84eb12bf2d7d65d7e3ea4abb1663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Mon, 25 Sep 2023 21:27:23 +0200 Subject: [PATCH] Move to JDK 8 as minimum runtie JDK and JDK 9+ as build JDK --- CHANGES.md | 2 + build-ant-tools.xml | 2 + build.xml | 212 +-- common.xml | 117 ++ contrib/platform/build.xml | 322 ++-- contrib/platform/nbproject/build-impl.xml | 1420 ----------------- .../platform/nbproject/ide-file-targets.xml | 93 ++ contrib/platform/nbproject/project.properties | 103 -- contrib/platform/nbproject/project.xml | 180 ++- .../jna/platform/win32/Win32ServiceDemo.java | 1 + nbproject/ide-file-targets.xml | 28 + nbproject/project.xml | 32 +- 12 files changed, 622 insertions(+), 1890 deletions(-) create mode 100644 common.xml delete mode 100644 contrib/platform/nbproject/build-impl.xml create mode 100644 contrib/platform/nbproject/ide-file-targets.xml delete mode 100644 contrib/platform/nbproject/project.properties diff --git a/CHANGES.md b/CHANGES.md index d347f12625..6d33fae33d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,8 @@ Important Changes ----------------- * The interfaces between Java and native code have changed, so `libjnidispatch` must be rebuilt to be compatible with this release. +* Release drops support for JDKs 6 + 7, so you'll need at least JDK 8 to + update to use this version. Release (5.13.0) ================ diff --git a/build-ant-tools.xml b/build-ant-tools.xml index bb73fc7462..8248b0bddb 100644 --- a/build-ant-tools.xml +++ b/build-ant-tools.xml @@ -1,5 +1,6 @@ + Builds and tests JNA @@ -8,6 +9,7 @@ destdir="${build}/ant-tools" includeantruntime="false" encoding="UTF-8" + release="${javac.release}" > diff --git a/build.xml b/build.xml index 1b668ce707..c8b6f55499 100644 --- a/build.xml +++ b/build.xml @@ -1,7 +1,6 @@ Builds and tests JNA @@ -13,8 +12,7 @@ support it). Cross-compile by specifying -Dos.prefix={name-arch} to ant - (cross-compile currently only configured/tested on w32ce-arm and - android targets) + (cross-compile currently only configured/tested on android targets) Use ANT_OPTS=-D-native=true to build native parts, or directly invoke the native or test targets @@ -33,7 +31,7 @@ - + @@ -55,74 +53,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -189,19 +120,6 @@ - - - - - - - - - - - - - @@ -238,9 +156,6 @@ - - - @@ -256,68 +171,8 @@ /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -352,7 +207,7 @@ - Java version ${java.version}, compatibility: ${compatibility}, ant: ${ant.java.version} + Java version ${java.version}, compatibility: ${javac.release}, ant: ${ant.java.version} JNA version ${jna.version}, native ${jni.version}, android ${android.versionCode} ${java.vm.name} (${java.vm.vendor}, ${java.vm.version}) java.home=${java.home} @@ -406,8 +261,7 @@ replace='VERSION_NATIVE = "${jni.version}";' file="${build}/jna-src/com/sun/jna/Version.java"/> - - - - - - - - - - - - - - - @@ -786,8 +625,9 @@ osname=macosx;processor=aarch64 - - + + + @@ -1189,11 +1029,10 @@ cd .. description="Compile test code which does not have additional native dependencies"> - - Checking JDK compatibility 1.6 - - - - - - - - - - - - Build is not Java 6 compatible and NOT A PRODUCTION BUILD - - - @@ -1429,12 +1251,8 @@ cd .. - - - - - - + + @@ -1492,7 +1310,7 @@ cd .. JNA API Documentation
${header}
${footer} - + diff --git a/common.xml b/common.xml new file mode 100644 index 0000000000..d126afcb0c --- /dev/null +++ b/common.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/platform/build.xml b/contrib/platform/build.xml index 167d39cabf..d13e636a8e 100644 --- a/contrib/platform/build.xml +++ b/contrib/platform/build.xml @@ -2,117 +2,119 @@ Builds and tests platform-specific code. - - + + + - -init-macrodef-javac: defines macro for javac compilation - -init-macrodef-junit: defines macro for junit execution - -init-macrodef-debug: defines macro for class debugging - -init-macrodef-java: defines macro for class execution - -do-jar-with-manifest: JAR building (if you are using a manifest) - -do-jar-without-manifest: JAR building (if you are not using a manifest) - run: execution of project - -javadoc-build: Javadoc generation - test-report: JUnit report generation + + + + + - An example of overriding the target for project execution could look like this: + - - - - - + - Notice that the overridden target depends on the jar target and not only on - the compile target as the regular run target does. Again, for a list of available - properties which you can use, check the target you are overriding in the - nbproject/build-impl.xml file. + + + + - --> + - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -178,21 +180,37 @@ com.sun.jna.platform.wince;version="${osgi.version}";uses:="com.s - - - - + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - + + - - - + + + - - - - - - Checking JDK compatibility 1.6 - - - - - - - - - - - - Build is not Java 6 compatible and NOT A PRODUCTION BUILD - - - - Running platform tests: ${test.src.dir} + + Running platform tests: ${test.src} + + + - - + + Saving test results in ${results.junit} - + + + + + + - + + + + + + - + + + + + + - + + + + + + + + + + @@ -284,6 +308,7 @@ com.sun.jna.platform.wince;version="${osgi.version}";uses:="com.s + tests.include=${tests.include} tests.platform.mac=${tests.platform.mac} tests.platform.windows=${tests.platform.windows} tests.platform.linux=${tests.platform.linux} @@ -291,7 +316,8 @@ com.sun.jna.platform.wince;version="${osgi.version}";uses:="com.s - + + @@ -301,13 +327,13 @@ com.sun.jna.platform.wince;version="${osgi.version}";uses:="com.s - + - + - + @@ -325,12 +351,4 @@ com.sun.jna.platform.wince;version="${osgi.version}";uses:="com.s One or more tests failed - - - - - - - - diff --git a/contrib/platform/nbproject/build-impl.xml b/contrib/platform/nbproject/build-impl.xml deleted file mode 100644 index 50e512324a..0000000000 --- a/contrib/platform/nbproject/build-impl.xml +++ /dev/null @@ -1,1420 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set src.dir - Must set test.src.dir - Must set build.dir - Must set dist.dir - Must set build.classes.dir - Must set dist.javadoc.dir - Must set build.test.classes.dir - Must set build.test.results.dir - Must set build.classes.excludes - Must set dist.jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No tests executed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set JVM to use for profiling in profiler.info.jvm - Must set profiler agent JVM arguments in profiler.info.jvmargs.agent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - java -jar "${dist.jar.resolved}" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - Must select one file in the IDE or set run.class - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set debug.class - - - - - Must select one file in the IDE or set debug.class - - - - - Must set fix.includes - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - Must select one file in the IDE or set profile.class - This target only works when run from inside the NetBeans IDE. - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - - - Must select some files in the IDE or set test.includes - - - - - Must select one file in the IDE or set run.class - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - Some tests failed; see details above. - - - - - - - - - Must select some files in the IDE or set test.includes - - - - Some tests failed; see details above. - - - - Must select some files in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - Some tests failed; see details above. - - - - - Must select one file in the IDE or set test.class - - - - Must select one file in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - - - - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/contrib/platform/nbproject/ide-file-targets.xml b/contrib/platform/nbproject/ide-file-targets.xml new file mode 100644 index 0000000000..4d439b0c36 --- /dev/null +++ b/contrib/platform/nbproject/ide-file-targets.xml @@ -0,0 +1,93 @@ + + + + Must set property 'run.class' + + + + + + + + + + + + Must set property 'debug.class' + + + + + + + + + + + + + + + + + + Must set property 'run.class' + + + + + + + + + + + + + + Must set property 'debug.class' + + + + + + + + + + + + + + + + + + + Must set property 'tests.include.fullpath' + + + + test.includes: ${tests.include} + + + + + + + + Must set property 'tests.include.fullpath' + + + + test.includes: ${tests.include} + + + + + + + + + + diff --git a/contrib/platform/nbproject/project.properties b/contrib/platform/nbproject/project.properties deleted file mode 100644 index fe6ceb7564..0000000000 --- a/contrib/platform/nbproject/project.properties +++ /dev/null @@ -1,103 +0,0 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false -annotation.processing.processors.list= -annotation.processing.run.all.processors=true -application.args= -application.title=jna-platform -application.vendor=JNA project -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -debug.classpath=\ - ${run.classpath} -debug.modulepath=\ - ${run.modulepath} -debug.test.classpath=\ - ${run.test.classpath} -debug.test.modulepath=\ - ${run.test.modulepath} -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/jna-platform.jar -dist.javadoc.dir=${dist.dir}/javadoc -endorsed.classpath= -excludes= -file.reference.bcpkix-jdk15on-161.jar=../../lib/test/bcpkix-jdk15on-161.jar -file.reference.bcprov-jdk15on-161.jar=../../lib/test/bcprov-jdk15on-161.jar -file.reference.hamcrest-core-1.3.jar=../../lib/hamcrest-core-1.3.jar -file.reference.jna.jar=../../build/jna.jar -file.reference.jna-test.jar=../../build/jna-test.jar -file.reference.junit.jar=../../lib/junit.jar -includes=** -javac.external.vm=false -javac.modulepath= -javac.processormodulepath= -javac.processorpath=\ - ${javac.classpath} -javac.test.modulepath=\ - ${javac.modulepath} -javadoc.html5=false -jlink.launcher=false -jlink.launcher.name=platform -jar.compress=false -javac.classpath=\ - ${file.reference.jna.jar} -# Space-separated list of extra javac options -javac.compilerargs=-XDignore.symbol.file -javac.deprecation=false -javac.source=1.6 -javac.target=1.6 -javac.test.classpath=\ - ${javac.classpath}:\ - ${file.reference.jna-test.jar}:\ - ${build.classes.dir}:\ - ${file.reference.junit.jar}:\ - ${file.reference.hamcrest-core-1.3.jar}:\ - ${file.reference.bcpkix-jdk15on-161.jar}:\ - ${file.reference.bcprov-jdk15on-161.jar} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding= -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -main.class= -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=false -platform.active=default_platform -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value -# or test-sys-prop.name=value to set system properties for unit tests): -run.jvmargs= -run.modulepath=\ - ${javac.modulepath} -run.test.classpath=\ - ${javac.test.classpath}:\ - ../../lib/test/reflections-0.9.11.jar:\ - ../../lib/test/guava-27.1-jre.jar:\ - ../../lib/test/javassist-3.12.1.GA.jar:\ - ../../lib/test/slf4j-api-1.6.1.jar:\ - ../../lib/test/dom4j-1.6.1.jar:\ - ${build.test.classes.dir} -run.test.modulepath=\ - ${javac.test.modulepath} -src.dir=src -test.src.dir=test -source.encoding=UTF-8 -file.encoding=UTF-8 diff --git a/contrib/platform/nbproject/project.xml b/contrib/platform/nbproject/project.xml index 94a0dfa0be..1a14a7faae 100644 --- a/contrib/platform/nbproject/project.xml +++ b/contrib/platform/nbproject/project.xml @@ -1,16 +1,164 @@ - - - org.netbeans.modules.java.j2seproject - - - platform - 1.6.5 - - - - - - - - - + + + org.netbeans.modules.ant.freeform + + + platform + + + + platform + + + + + java + src + UTF-8 + + + + java + test + UTF-8 + + + + + compile-tests + jar + + + clean + + + test + + + clean + compile-tests + jar + + + + run-selected-file-in-src + + run.class + src + \.java$ + java-name + + + + + + + + debug-selected-file-in-src + + debug.class + src + \.java$ + java-name + + + + + + + + debug-selected-file-in-test + + debug.class + test + \.java$ + java-name + + + + + + + + run-selected-file-in-test + + run.class + test + \.java$ + java-name + + + + + + + + test-single + + tests.include.fullpath + test + \.java$ + absolute-path + + + + + + + + debug-test-single + + tests.include.fullpath + test + \.java$ + absolute-path + + + + + + + + + + + src + + + + test + + + build.xml + + + + + + + + + + + + + + + src + ../../build/jna.jar + 1.8 + + + test + + src:../../build/jna.jar:../../build/jna-test.jar:../../build/test-classes:../../lib/junit.jar:../../lib/hamcrest-core-1.3.jar:../../lib/test/bcpkix-jdk15on-161.jar:../../lib/test/bcprov-jdk15on-161.jar + 1.8 + + + + diff --git a/contrib/platform/test/com/sun/jna/platform/win32/Win32ServiceDemo.java b/contrib/platform/test/com/sun/jna/platform/win32/Win32ServiceDemo.java index 99200fd8da..a77fa51e4b 100644 --- a/contrib/platform/test/com/sun/jna/platform/win32/Win32ServiceDemo.java +++ b/contrib/platform/test/com/sun/jna/platform/win32/Win32ServiceDemo.java @@ -78,6 +78,7 @@ public static void main(String[] args) { SUFFIXES.add("jna.jar"); SUFFIXES.add("jna-test.jar"); SUFFIXES.add("classes"); + SUFFIXES.add("test-classes"); } private final Object waitObject = new Object(); diff --git a/nbproject/ide-file-targets.xml b/nbproject/ide-file-targets.xml index 149419762a..4d439b0c36 100644 --- a/nbproject/ide-file-targets.xml +++ b/nbproject/ide-file-targets.xml @@ -62,4 +62,32 @@
+ + + Must set property 'tests.include.fullpath' + + + + test.includes: ${tests.include} + + + + + + + + Must set property 'tests.include.fullpath' + + + + test.includes: ${tests.include} + + + + + + + + +
diff --git a/nbproject/project.xml b/nbproject/project.xml index c05eefc132..e284dbe752 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -41,6 +41,7 @@ auxiliary.show.customizer.message= + compile-tests jar @@ -54,6 +55,7 @@ auxiliary.show.customizer.message= clean + compile-tests jar @@ -108,6 +110,32 @@ auxiliary.show.customizer.message= + + + test-single + + tests.include.fullpath + test + \.java$ + absolute-path + + + + + + + + debug-test-single + + tests.include.fullpath + test + \.java$ + absolute-path + + + + + @@ -141,7 +169,7 @@ auxiliary.show.customizer.message= src src - 1.6 + 1.8 test @@ -152,7 +180,7 @@ auxiliary.show.customizer.message= ant-tools-src src:lib/ant.jar:lib/asm-8.0.1.jar - 1.6 + 1.8