!2 update ecj to 4.23

From: @chen-jan 
Reviewed-by: @overweight 
Signed-off-by: @overweight
This commit is contained in:
openeuler-ci-bot 2022-05-18 09:17:38 +00:00 committed by Gitee
commit 36cadf41c9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 112 additions and 115 deletions

View File

@ -0,0 +1,47 @@
From e7ff390ef777bd818ccc6e6f8f3a56f36020abfe Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@gmail.com>
Date: Wed, 15 Sep 2021 10:21:53 +0100
Subject: [PATCH 1/2] Always generate bytecode debuginfo
When ecj is used to build RPMs
---
.../jdt/internal/compiler/batch/Main.java | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/org/eclipse/jdt/internal/compiler/batch/Main.java b/org/eclipse/jdt/internal/compiler/batch/Main.java
index f77372d..73a0d24 100644
--- a/org/eclipse/jdt/internal/compiler/batch/Main.java
+++ b/org/eclipse/jdt/internal/compiler/batch/Main.java
@@ -3109,6 +3109,29 @@ public void configure(String[] argv) {
this.options.put(CompilerOptions.OPTION_Process_Annotations, CompilerOptions.ENABLED);
}
+ {
+ // If we're building an RPM, force full debugging info to
+ // be generated, no matter what options have been passed
+ // by Ant. This is something of a kludge, but it is far
+ // better than the alternative, which is having class
+ // files with debug info mysteriously missing.
+
+ String RpmPackageName = System.getenv("RPM_PACKAGE_NAME");
+ String RpmArch = System.getenv("RPM_ARCH");
+ String RpmBuildRoot = System.getenv("RPM_BUILD_ROOT");
+ if (RpmPackageName != null && RpmArch != null && RpmBuildRoot != null) {
+ this.options.put(
+ CompilerOptions.OPTION_LocalVariableAttribute,
+ CompilerOptions.GENERATE);
+ this.options.put(
+ CompilerOptions.OPTION_LineNumberAttribute,
+ CompilerOptions.GENERATE);
+ this.options.put(
+ CompilerOptions.OPTION_SourceFileAttribute,
+ CompilerOptions.GENERATE);
+ }
+ }
+
this.logger.logCommandLineArguments(newCommandLineArgs);
this.logger.logOptions(this.options);
--
2.31.1

47
ecj-3.29.0.pom Normal file
View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2016, 2018 GK Software SE and others.
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Stephan Herrmann - initial implementation
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xsi:noNamespaceSchemaLocation="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>3.29.0</version>
<description>Eclipse Compiler for Java(TM)</description>
<name>Eclipse Compiler for Java(TM)</name>
<url>http://www.eclipse.org/jdt</url>
<licenses>
<license>
<name>Eclipse Public License - v 2.0</name>
<url>https://www.eclipse.org/legal/epl-2.0/</url>
<distribution>repo</distribution>
</license>
</licenses>
<organization>
<name>Eclipse Foundation</name>
<url>http://www.eclipse.org/</url>
</organization>
<issueManagement>
<system>Bugzilla</system>
<url>https://bugs.eclipse.org/</url>
</issueManagement>
<scm>
<connection>scm:git:https://git.eclipse.org/r/jdt/eclipse.jdt.core.git</connection>
<url>https://git.eclipse.org/c/jdt/eclipse.jdt.core.git</url>
</scm>
<developers>
<developer>
<url>https://projects.eclipse.org/projects/eclipse.jdt/who</url>
</developer>
</developers>
</project>

View File

@ -1,64 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!--
Originally downloaded here:
http://download.eclipse.org/eclipse/downloads/drops4/R-4.7.1-201709061700/#JDTCORE
-->
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
<version>4.9</version>
<packaging>jar</packaging>
<name>Eclipse ECJ</name>
<description>Eclipse JDT Core Batch Compiler</description>
<url>http://www.eclipse.org/jdt/</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<licenses>
<license>
<name>Eclipse Public License v1.0</name>
<url>http://www.eclipse.org/org/documents/epl-v10.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/</url>
<connection>:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse</connection>
</scm>
<developers>
<!-- I didn't develop ECJ, but the Central Sync Requirements mandate a developer in the POM:
https://docs.sonatype.org/display/Repository/Central+Sync+Requirements
-->
<developer>
<name>Ralph Schaer</name>
<email>ralphschaer@gmail.com</email>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.4</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,4 +0,0 @@
#!/bin/sh
CLASSPATH=$(build-classpath ecj):${CLASSPATH=.} \
java org.eclipse.jdt.internal.compiler.batch.Main "$@"

View File

@ -1,22 +1,23 @@
Epoch: 1
%global bundle_ver 3.29.0
Name: ecj
Version: 4.9
Release: 3
Version: 4.23
Release: 1
Summary: the Eclipse Compiler for Java
License: EPL-2.0
URL: http://www.eclipse.org
Source0: http://download.eclipse.org/eclipse/downloads/drops4/R-4.9-201809060745/ecjsrc-4.9.jar
Source1: ecj.sh.in
Source3: https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/%{version}/ecj-%{version}.pom
Source4: MANIFEST.MF
Source5: java10api.jar
Source0: https://download.eclipse.org/eclipse/downloads/drops4/R-%{version}-202203080310/ecjsrc-%{version}.jar
Source1: https://repo1.maven.org/maven2/org/eclipse/jdt/ecj/%{bundle_ver}/ecj-%{bundle_ver}.pom
Source2: MANIFEST.MF
Patch0: javaAPI.patch
Patch0: 0001-Always-generate-bytecode-debuginfo.patch
BuildArch: noarch
BuildRequires: ant javapackages-local
BuildRequires: java-11-openjdk-devel
%description
ECJ is the the Eclipse Compiler for Java. It is also known as the JDT Core batch compiler.
@ -26,31 +27,24 @@ ECJ is the the Eclipse Compiler for Java. It is also known as the JDT Core batc
%prep
%autosetup -c -n %{name}-%{version} -p1
sed -i -e 's|debuglevel=\"lines,source\"|debug=\"yes\"|g' build.xml
sed -i -e "s/Xlint:none/Xlint:none -encoding cp1252/g" build.xml
rm -f org/eclipse/jdt/core/JDTCompilerAdapter.java
cp %{SOURCE3} pom.xml
cp %{SOURCE1} pom.xml
mkdir -p scripts/binary/META-INF/
cp %{SOURCE4} scripts/binary/META-INF/MANIFEST.MF
cp %{SOURCE2} scripts/binary/META-INF/MANIFEST.MF
%pom_remove_dep org.apache.ant:ant
%mvn_file :ecj ecj jdtcore
%mvn_alias org.eclipse.jdt.core.compiler:ecj org.eclipse.jdt:core org.eclipse.jdt:ecj \
%mvn_alias org.eclipse.jdt:ecj org.eclipse.jdt:core org.eclipse.jdt.core.compiler:ecj \
org.eclipse.tycho:org.eclipse.jdt.core org.eclipse.tycho:org.eclipse.jdt.compiler.apt
%mvn_artifact "org.eclipse:java10api:jar:10" %{SOURCE5}
%mvn_alias "org.eclipse:java10api:jar:10" "org.eclipse:java9api:jar:9"
%build
ant -Djavaapi=%{SOURCE5}
export JAVA_HOME=/usr/lib/jvm/java-11
ant
%install
%mvn_artifact pom.xml ecj.jar
%mvn_install
sed -i 's/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/f2f42549-cfab-4d71-be48-5e9f9a41e5f5/g' $(find %{_buildrootdir} -name ecj.xml)
install -p -D -m0755 %{SOURCE1} %{buildroot}%{_bindir}/ecj
%jpackage_script org.eclipse.jdt.internal.compiler.batch.Main '' '' ecj ecj true
mkdir -p %{buildroot}%{_mandir}/man1
install -m 644 -p ecj.1 %{buildroot}%{_mandir}/man1/ecj.1
@ -64,5 +58,8 @@ install -m 644 -p ecj.1 %{buildroot}%{_mandir}/man1/ecj.1
%{_mandir}/man1/ecj*
%changelog
* Wed May 18 2022 chenchen <chen_aka_jan@163.com> - 1:4.23-1
- update to 4.23
* Wed Dec 4 2019 openEuler Buildteam <buildteam@openeuler.org> - 1:4.9-3
- Package init

BIN
ecjsrc-4.23.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,26 +0,0 @@
--- a/build.xml.orig 2018-03-20 15:15:57.063810672 +0000
+++ b/build.xml 2018-03-20 15:16:26.018700633 +0000
@@ -15,16 +15,20 @@
<property name="output" value="bin" />
<property name="jar_file" value="ecj.jar" />
+ <path id="build.path">
+ <pathelement path="${javaapi}"/>
+ <pathelement path="/usr/lib/jvm/java-1.8.0/jre/lib/rt.jar"/>
+ </path>
<target name="build">
<delete file="${basedir}/${jar_file}" failonerror="no" />
<delete dir="${output}" failonerror="no" />
<mkdir dir="${output}" />
- <javac srcdir="${basedir}" destdir="${output}"
- debuglevel="lines,source"
+ <javac srcdir="${basedir}" destdir="${output}" bootclasspathref="build.path"
+ debug="yes"
source="1.8"
target="1.8">
- <compilerarg line="-Xlint:none"/>
+ <compilerarg line="-Xlint:none -encoding cp1252 -encoding cp1252"/>
</javac>
<delete file="${basedir}/META-INF/MANIFEST.MF" failonerror="false"/>