aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2018-01-02 21:32:31 +0200
committerLasse Collin <lasse.collin@tukaani.org>2018-01-02 21:41:23 +0200
commite5067e29ef032e160decf43fbba6d3f29a58539b (patch)
treeb1d550015c3e9cd11f7a56199b806c5047000cc6
parent24b31e2439a38af0c9fa02fe2427b35f854a7065 (diff)
downloadxz-java-e5067e29ef032e160decf43fbba6d3f29a58539b.tar.gz
Restore the -source option and add also an explicit -target.
Removing the source version was a big mistake because setting the source version also implicitly set the target version. I had forgotten this. When the -source option was removed, the resulting binaries ran only on a recent JDK version. This commit restores the -source option and also adds an explicit -target that is always set to the same value as the -source. In this commit it's set to Java 5 even though OpenJDK 8 is the last one that supports it. Thanks to Brett Okken and Stefan Bodewig.
-rw-r--r--build.properties7
-rw-r--r--build.xml3
2 files changed, 9 insertions, 1 deletions
diff --git a/build.properties b/build.properties
index 581e0eb..7bf5ad9 100644
--- a/build.properties
+++ b/build.properties
@@ -12,6 +12,13 @@ homepage = https://tukaani.org/xz/java.html
version = 1.7
debug = false
+# sourcever sets -source and -target options for javac.
+#
+# The source code is Java 5 compatible but the oldest -source/-target pair
+# that OpenJDK 9 supports is 1.6 (Java 6). Edit this if you are using
+# OpenJDK 9 or later.
+sourcever = 1.5
+
src_dir = src
build_dir = build
dist_dir = ${build_dir}/dist
diff --git a/build.xml b/build.xml
index 52d3764..60dee3c 100644
--- a/build.xml
+++ b/build.xml
@@ -38,7 +38,7 @@
<get src="${extdoc_url}/package-list"
dest="${extdoc_dir}/package-list" skipexisting="true"/>
<javadoc sourcepath="${src_dir}" destdir="${doc_dir}"
- packagenames="org.tukaani.xz"
+ source="${sourcever}" packagenames="org.tukaani.xz"
windowtitle="XZ data compression"
linkoffline="${extdoc_url} ${extdoc_dir}"/>
</target>
@@ -47,6 +47,7 @@
<mkdir dir="${classes_dir}"/>
<javac srcdir="." sourcepath="${src_dir}" destdir="${classes_dir}"
includeAntRuntime="false" debug="${debug}"
+ source="${sourcever}" target="${sourcever}"
includesfile="fileset-src.txt"
excludes="**/package-info.java">
<compilerarg compiler="modern" value="-Xlint"/>