From 7bd6d94952cb0710415c73b038963bf92275d2fb Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Fri, 20 May 2016 22:20:39 +0200 Subject: [PATCH] LUCENE-7292: Use '-release' instead of '-source/-target' during compilation on Java 9+ to ensure real cross-compilation --- dev-tools/maven/pom.xml.template | 10 ++-- dev-tools/scripts/smokeTestRelease.py | 4 +- lucene/CHANGES.txt | 6 ++ lucene/common-build.xml | 76 +++++++++----------------- lucene/default-nested-ivy-settings.xml | 4 -- lucene/queryparser/build.xml | 2 +- solr/common-build.xml | 12 ++-- solr/core/build.xml | 2 +- 8 files changed, 47 insertions(+), 69 deletions(-) diff --git a/dev-tools/maven/pom.xml.template b/dev-tools/maven/pom.xml.template index 7d49002faae..535958242c5 100644 --- a/dev-tools/maven/pom.xml.template +++ b/dev-tools/maven/pom.xml.template @@ -43,8 +43,10 @@ https://git1-us-west.apache.org/repos/asf?p=lucene-solr.git;a=tree @spec.version@ yyyy-MM-dd HH:mm:ss - 1.8 - 8.1.10.v20130312 + 8 + + 1.${java.compat.version} + 9.3.8.v20160314 1 @@ -166,7 +168,7 @@ The checker simply passes by default and only prints a warning. --> false - ${java.compat.version} + ${java.legacy-compat.version} **.SuppressForbidden @@ -381,7 +383,7 @@ Java ${java.compat.version}+ is required. - [${java.compat.version},) + [${java.legacy-compat.version},) Maven 2.2.1+ is required. diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py index b4d66f74716..fdb92889247 100644 --- a/dev-tools/scripts/smokeTestRelease.py +++ b/dev-tools/scripts/smokeTestRelease.py @@ -189,11 +189,11 @@ def checkJARMetaData(desc, jarFile, gitRevision, version): 'Specification-Vendor: The Apache Software Foundation', 'Implementation-Vendor: The Apache Software Foundation', # Make sure 1.8 compiler was used to build release bits: - 'X-Compile-Source-JDK: 1.8', + 'X-Compile-Source-JDK: 8', # Make sure 1.8 ant was used to build release bits: (this will match 1.8+) 'Ant-Version: Apache Ant 1.8', # Make sure .class files are 1.8 format: - 'X-Compile-Target-JDK: 1.8', + 'X-Compile-Target-JDK: 8', 'Specification-Version: %s' % version, # Make sure the release was compiled with 1.8: 'Created-By: 1.8'): diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 5d816b381bc..e60f695708c 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -133,6 +133,12 @@ Other * SOLR-9109/SOLR-9121: Allow specification of a custom Ivy settings file via system property "ivysettings.xml". (Misha Dmitriev, Christine Poerschke, Uwe Schindler, Steve Rowe) +Build + +* LUCENE-7292: Use '-release' instead of '-source/-target' during + compilation on Java 9+ to ensure real cross-compilation. + (Uwe Schindler) + ======================= Lucene 6.0.1 ======================= (No Changes) diff --git a/lucene/common-build.xml b/lucene/common-build.xml index a3477726e50..8fb9ea0721b 100644 --- a/lucene/common-build.xml +++ b/lucene/common-build.xml @@ -161,9 +161,8 @@ - - - + + @@ -178,34 +177,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -691,8 +662,8 @@ value="${version} ${checkoutid} - ${user.name} - ${DSTAMP} ${TSTAMP}"/> - - + + @@ -828,14 +799,12 @@ - - - + + + javac.release="@{javac.release}"> @@ -1950,29 +1919,30 @@ ${ant.project.name}.test.dependencies=${test.classpath.list} - - + + + + + + debug="${javac.debug}"> + @@ -2024,7 +1994,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list} - + @@ -2040,8 +2010,8 @@ ${ant.project.name}.test.dependencies=${test.classpath.list} encoding="${build.encoding}" srcdir="@{srcdir}" destdir="${ecj.trash.out}" - source="@{javac.source}" - target="@{javac.source}" + source="@{javac.release}" + target="@{javac.release}" taskname="ecj-lint"> @@ -2085,13 +2055,16 @@ ${ant.project.name}.test.dependencies=${test.classpath.list} + + + + + @@ -2389,8 +2362,9 @@ ${ant.project.name}.test.dependencies=${test.classpath.list} - - + + + diff --git a/lucene/default-nested-ivy-settings.xml b/lucene/default-nested-ivy-settings.xml index 97445e113df..522fd29bf26 100644 --- a/lucene/default-nested-ivy-settings.xml +++ b/lucene/default-nested-ivy-settings.xml @@ -36,9 +36,6 @@ - - - @@ -56,7 +53,6 @@ - diff --git a/lucene/queryparser/build.xml b/lucene/queryparser/build.xml index cdb0e6c55ef..b6e43c2ce26 100644 --- a/lucene/queryparser/build.xml +++ b/lucene/queryparser/build.xml @@ -165,7 +165,7 @@ import org.apache.lucene.queryparser.flexible.core.messages.*;" target="@{target}" outputDirectory="@{outputDir}" javacchome="${build.dir}/javacc" - jdkversion="${javac.source}" + jdkversion="1.${javac.release}" /> diff --git a/solr/common-build.xml b/solr/common-build.xml index 986033dfd99..b13d7372a13 100644 --- a/solr/common-build.xml +++ b/solr/common-build.xml @@ -25,10 +25,9 @@ - - - - + + + @@ -508,8 +507,9 @@ - - + + + diff --git a/solr/core/build.xml b/solr/core/build.xml index b3a654ee8c8..532a3c22d4a 100644 --- a/solr/core/build.xml +++ b/solr/core/build.xml @@ -110,7 +110,7 @@ target="@{target}" outputDirectory="@{outputDir}" javacchome="${build.dir}/javacc" - jdkversion="${javac.source}" + jdkversion="1.${javac.release}" />