Add 0007-update-java-target.patch to fix JDK 11 build.

This commit is contained in:
Jerry James 2020-05-12 08:38:57 -06:00
parent f1bb8d6396
commit 05c26cb870
2 changed files with 98 additions and 10 deletions

View File

@ -0,0 +1,92 @@
--- a/antlr3-maven-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/antlr3-maven-archetype/src/main/resources/archetype-resources/pom.xml
@@ -106,8 +106,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
- <source>1.6</source>
- <target>jsr14</target>
+ <source>1.8</source>
+ <target>1.8</target>
<sourceDirectory>src</sourceDirectory>
</configuration>
</plugin>
--- a/pom.xml
+++ b/pom.xml
@@ -52,12 +52,10 @@
-->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <java5.home>${env.JAVA5_HOME}</java5.home>
- <java6.home>${env.JAVA6_HOME}</java6.home>
- <bootclasspath.java5>${java5.home}/lib/rt.jar</bootclasspath.java5>
- <bootclasspath.java6>${java6.home}/lib/rt.jar</bootclasspath.java6>
- <bootclasspath.compile>${bootclasspath.java5}</bootclasspath.compile>
- <bootclasspath.testCompile>${bootclasspath.java6}</bootclasspath.testCompile>
+ <java.home>${env.JAVA_HOME}</java.home>
+ <bootclasspath.java>${java.home}/lib/rt.jar</bootclasspath.java>
+ <bootclasspath.compile>${bootclasspath.java}</bootclasspath.compile>
+ <bootclasspath.testCompile>${bootclasspath.java}</bootclasspath.testCompile>
</properties>
<licenses>
@@ -145,8 +143,8 @@
<execution>
<id>default-compile</id>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.8</source>
+ <target>1.8</target>
<compilerArgs>
<arg>-Xlint</arg>
<arg>-Xlint:-serial</arg>
@@ -158,8 +156,8 @@
<execution>
<id>default-testCompile</id>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.8</source>
+ <target>1.8</target>
<compilerArgs>
<arg>-Xlint</arg>
<arg>-Xlint:-serial</arg>
@@ -235,15 +233,15 @@
<execution>
<id>default-compile</id>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.8</source>
+ <target>1.8</target>
</configuration>
</execution>
<execution>
<id>default-testCompile</id>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.8</source>
+ <target>1.8</target>
</configuration>
</execution>
</executions>
@@ -290,6 +288,7 @@
<!-- override the version inherited from the parent -->
<version>2.9.1</version>
<configuration>
+ <source>8</source>
<quiet>true</quiet>
</configuration>
</plugin>
@@ -311,6 +310,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
+ <configuration>
+ <source>8</source>
+ </configuration>
</plugin>
<plugin>

View File

@ -15,7 +15,7 @@ Source0: https://github.com/antlr/antlr3/archive/%{antlr_version}/%{n
#Source2: http://www.antlr3.org/download/Python/antlr_python_runtime-%{python_runtime_version}.tar.gz
Source3: http://www.antlr3.org/download/antlr-javascript-runtime-%{javascript_runtime_version}.zip
Patch0: 0001-java8-fix.patch
Patch0: 0001-java8-fix.patch
# Generate OSGi metadata
Patch1: osgi-manifest.patch
# Increase the default conversion timeout to avoid build failures when complex
@ -29,6 +29,8 @@ Patch4: 0004-eof-token.patch
Patch5: 0005-reproducible-parsers.patch
# Fix for C++20
Patch6: 0006-antlr3memory.hpp-fix-for-C-20-mode.patch
# Compile for target 1.8 to fix build with JDK 11
Patch7: 0007-update-java-target.patch
BuildRequires: ant
BuildRequires: maven-local
@ -161,15 +163,6 @@ find -type f -a -name *.class -delete
%pom_remove_plugin :maven-source-plugin
%pom_remove_plugin :maven-javadoc-plugin
# compile for target 1.6, see BZ#842572
sed -i 's/jsr14/1.6/' antlr3-maven-archetype/src/main/resources/archetype-resources/pom.xml \
antlr3-maven-plugin/pom.xml \
gunit/pom.xml \
gunit-maven-plugin/pom.xml \
pom.xml \
runtime/Java/pom.xml \
tool/pom.xml
# workarounds bug in filtering (Mark invalid)
%pom_xpath_remove pom:resource/pom:filtering
@ -281,6 +274,9 @@ install -pm 644 runtime/Cpp/include/* $RPM_BUILD_ROOT/%{_includedir}/
%doc tool/LICENSE.txt
%changelog
* Tue May 12 2020 Jerry James <loganjerry@gmail.com> - 1:3.5.2-27
- Add 0007-update-java-target.patch to fix JDK 11 build
* Tue May 12 2020 Avi Kivity <avi@scylladb.com> - 1:3.5.2-27
- Fix for C++20 mode (#1834782)