From 7f4ccd64e588c8f026d0b4030bbb096bf82aa6f5 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sun, 28 Jul 2024 13:24:45 +0300 Subject: [PATCH] Simplify building with OpenJDK 8 Don't require editing of build.properties. Now it's enough to use: ant -Djava8only=true --- README.md | 6 +++--- build.properties | 8 +++----- build.xml | 17 ++++++----------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 60d1b2ce..65af8726 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,9 @@ Building with Apache Ant * If you are using OpenJDK version older than 9: - Comment the `sourcever9` line in the file `build.properties`. - When it is commented, `module-info.java` and other files - requiring Java 9 won't be built. `xz.jar` won't be a modular JAR. + To build with OpenJDK 8, use `-Djava8only=true` on the `ant` + command line. Then the files requiring Java >= 9 won't be built, + and `xz.jar` won't be a modular JAR. * If you are using OpenJDK version older than 8: diff --git a/build.properties b/build.properties index fc24e3b9..4f6c63f3 100644 --- a/build.properties +++ b/build.properties @@ -14,14 +14,12 @@ debug = true # # sourcever9 does the same as sourcever but for files that require Java 9 or # later. The resulting classes are packaged as multi-release JAR, including -# module-info.java. If sourcever9 is commented out, these files won't be -# built but the package will still work. +# module-info.java. # -# If you need to build this on OpenJDK 8: -# - Set sourcever = 8 -# - Comment the sourcever9 line below to disable building Java 9 files. +# To build with OpenJDK 8, use -Djava8only=true on the ant command line. sourcever = 8 sourcever9 = 9 +java8only = false # If true, javadoc is called with en_US locale to force the headings and # such strings from javadoc to be in English, independent of the system diff --git a/build.xml b/build.xml index 9635ff12..bce9977a 100644 --- a/build.xml +++ b/build.xml @@ -55,18 +55,13 @@ - - - - - - - + + includesfile="fileset-src9.txt"> @@ -79,14 +74,14 @@ + unless:true="${java8only}"/> + unless:true="${java8only}"/>