diff --git a/.ecj.metadata b/.ecj.metadata index 3e59eca..eb0225b 100644 --- a/.ecj.metadata +++ b/.ecj.metadata @@ -1 +1 @@ -cbbac0b172bf383e633269c1967e1ef2b32e7051 SOURCES/ecjsrc-4.2.1.jar +6c0f66f1badf6afa7f7a393df3cf5f7fc38848d8 SOURCES/ecjsrc-4.5.2.jar diff --git a/.gitignore b/.gitignore index 335e6f9..b0f398c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ecjsrc-4.2.1.jar +SOURCES/ecjsrc-4.5.2.jar diff --git a/SOURCES/MANIFEST.MF b/SOURCES/MANIFEST.MF new file mode 100644 index 0000000..a846b9c --- /dev/null +++ b/SOURCES/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Archiver-Version: Plexus Archiver +Created-By: Apache Maven +Built-By: e4Build +Build-Jdk: 1.8.0_51 +Bundle-SymbolicName: org.eclipse.jdt.core.compiler.batch +Export-Package: org.eclipse.jdt.core,org.eclipse.jdt.core.compiler,org + .eclipse.jdt.internal.antadapter;x-internal:=true,org.eclipse.jdt.int + ernal.compiler;x-internal:=true,org.eclipse.jdt.internal.compiler.apt + .dispatch;x-internal:=true,org.eclipse.jdt.internal.compiler.apt.mode + l;x-internal:=true,org.eclipse.jdt.internal.compiler.apt.util;x-inter + nal:=true,org.eclipse.jdt.internal.compiler.ast;x-internal:=true,org. + eclipse.jdt.internal.compiler.batch;x-internal:=true,org.eclipse.jdt. + internal.compiler.classfmt;x-internal:=true,org.eclipse.jdt.internal. + compiler.codegen;x-internal:=true,org.eclipse.jdt.internal.compiler.e + nv;x-internal:=true,org.eclipse.jdt.internal.compiler.flow;x-internal + :=true,org.eclipse.jdt.internal.compiler.impl;x-internal:=true,org.ec + lipse.jdt.internal.compiler.lookup;x-internal:=true,org.eclipse.jdt.i + nternal.compiler.parser;x-internal:=true,org.eclipse.jdt.internal.com + piler.parser.diagnose;x-internal:=true,org.eclipse.jdt.internal.compi + ler.problem;x-internal:=true,org.eclipse.jdt.internal.compiler.util;x + -internal:=true,org.eclipse.jdt.internal.compiler.tool;x-internal:=true +Bundle-Name: Eclipse Compiler for Java(TM) +Bundle-Version: 3.11.2.v20160128-0629 +Bundle-ClassPath: . +Bundle-ManifestVersion: 2 +Bundle-Vendor: Eclipse.org +Main-Class: org.eclipse.jdt.internal.compiler.batch.Main + diff --git a/SOURCES/core-3.3.0-v_771.pom b/SOURCES/core-3.3.0-v_771.pom deleted file mode 100644 index 69f33ec..0000000 --- a/SOURCES/core-3.3.0-v_771.pom +++ /dev/null @@ -1,13 +0,0 @@ - - 4.0.0 - org.eclipse.jdt - core - Java Development Tools Core - 3.3.0-v_771 - - - Eclipse Public License - v 1.0 - http://www.eclipse.org/org/documents/epl-v10.html - - - \ No newline at end of file diff --git a/SOURCES/ecj-4.5.2.pom b/SOURCES/ecj-4.5.2.pom new file mode 100644 index 0000000..1325427 --- /dev/null +++ b/SOURCES/ecj-4.5.2.pom @@ -0,0 +1,64 @@ + + + + 4.0.0 + org.eclipse.jdt.core.compiler + ecj + 4.5.2 + jar + Eclipse ECJ + Eclipse JDT Core Batch Compiler + http://www.eclipse.org/jdt/ + + UTF-8 + UTF-8 + 1.7 + 1.7 + + + + Eclipse Public License v1.0 + http://www.eclipse.org/org/documents/epl-v10.php + repo + + + + http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/ + :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse + + + + + Ralph Schaer + ralphschaer@gmail.com + + + + + + org.apache.ant + ant + 1.9.4 + true + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + -Xdoclint:none + + + + + + diff --git a/SOURCES/ecj-convertto1.6.patch b/SOURCES/ecj-convertto1.6.patch new file mode 100644 index 0000000..0823935 --- /dev/null +++ b/SOURCES/ecj-convertto1.6.patch @@ -0,0 +1,91 @@ +diff -ur a/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java b/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java +--- a/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java 2016-02-03 10:02:08.000000000 -0500 ++++ b/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java 2016-05-17 16:35:21.796601241 -0400 +@@ -776,7 +776,7 @@ + } + + public IteratorForReporting(List variables, Scope scope, boolean atExit) { +- this.varSet = new HashSet<>(variables); ++ this.varSet = new HashSet(variables); + this.scope = scope; + this.atExit = atExit; + setUpForStage(Stage.OuterLess); +diff -ur a/org/eclipse/jdt/internal/compiler/Compiler.java b/org/eclipse/jdt/internal/compiler/Compiler.java +--- a/org/eclipse/jdt/internal/compiler/Compiler.java 2016-02-03 10:02:08.000000000 -0500 ++++ b/org/eclipse/jdt/internal/compiler/Compiler.java 2016-05-17 16:35:21.789601239 -0400 +@@ -489,7 +489,7 @@ + for (CategorizedProblem problem : errors) { + if (problem.getCategoryID() == CategorizedProblem.CAT_UNSPECIFIED) { + if (this.aptProblems == null) { +- this.aptProblems = new HashMap<>(); ++ this.aptProblems = new HashMap(); + } + APTProblem[] problems = this.aptProblems.get(new String(unitDecl.getFileName())); + if (problems == null) { +diff -ur a/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java b/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java +--- a/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java 2016-02-03 10:02:08.000000000 -0500 ++++ b/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java 2016-05-17 16:35:21.810601244 -0400 +@@ -1113,9 +1113,9 @@ + // "Given a set of inference variables to resolve, let V be the union of this set and + // all variables upon which the resolution of at least one variable in this set depends." + Set v = new HashSet(); +- Map> dependencies = new HashMap<>(); // compute only once, store for the final loop over 'v'. ++ Map> dependencies = new HashMap>(); // compute only once, store for the final loop over 'v'. + for (InferenceVariable iv : subSet) { +- Set tmp = new HashSet<>(); ++ Set tmp = new HashSet(); + addDependencies(bounds, tmp, iv); + dependencies.put(iv, tmp); + v.addAll(tmp); +@@ -1131,7 +1131,7 @@ + // "... if αi depends on the resolution of a variable β, then either β has an instantiation or there is some j such that β = αj; ..." + Set set = dependencies.get(currentVariable); + if (set == null) // not an element of the original subSet, still need to fetch this var's dependencies +- addDependencies(bounds, set = new HashSet<>(), currentVariable); ++ addDependencies(bounds, set = new HashSet(), currentVariable); + // "... and ii) there exists no non-empty proper subset of { α1, ..., αn } with this property." + int cur = set.size(); + if (cur == 1) +diff -ur a/org/eclipse/jdt/internal/compiler/util/Util.java b/org/eclipse/jdt/internal/compiler/util/Util.java +--- a/org/eclipse/jdt/internal/compiler/util/Util.java 2016-02-03 10:02:08.000000000 -0500 ++++ b/org/eclipse/jdt/internal/compiler/util/Util.java 2016-05-17 16:35:21.802601243 -0400 +@@ -1125,7 +1125,7 @@ + bootclasspathProperty = System.getProperty("org.apache.harmony.boot.class.path"); //$NON-NLS-1$ + } + } +- List filePaths = new ArrayList<>(); ++ List filePaths = new ArrayList(); + if ((bootclasspathProperty != null) && (bootclasspathProperty.length() != 0)) { + StringTokenizer tokenizer = new StringTokenizer(bootclasspathProperty, File.pathSeparator); + while (tokenizer.hasMoreTokens()) { +diff -ur a/org/eclipse/jdt/internal/compiler/batch/ClasspathJsr199.java b/org/eclipse/jdt/internal/compiler/batch/ClasspathJsr199.java +--- a/org/eclipse/jdt/internal/compiler/batch/ClasspathJsr199.java 2016-02-03 10:01:58.000000000 -0500 ++++ b/org/eclipse/jdt/internal/compiler/batch/ClasspathJsr199.java 2016-05-17 16:35:21.790601240 -0400 +@@ -31,7 +31,7 @@ + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public class ClasspathJsr199 extends ClasspathLocation { +- private static final Set fileTypes = new HashSet<>(); ++ private static final Set fileTypes = new HashSet(); + + static { + fileTypes.add(JavaFileObject.Kind.CLASS); +@@ -78,11 +75,17 @@ + if (jfo == null) + return null; // most common case + +- try (InputStream inputStream = jfo.openInputStream()) { ++ InputStream inputStream = null; ++ try { ++ inputStream = jfo.openInputStream(); + ClassFileReader reader = ClassFileReader.read(inputStream, qualifiedBinaryFileName); + if (reader != null) { + return new NameEnvironmentAnswer(reader, fetchAccessRestriction(qualifiedBinaryFileName)); + } ++ } finally { ++ if (inputStream != null) { ++ inputStream.close(); ++ } + } + } catch (ClassFormatException e) { + // treat as if class file is missing diff --git a/SOURCES/ecj-generatedebuginfo.patch b/SOURCES/ecj-generatedebuginfo.patch deleted file mode 100644 index 2b7c3aa..0000000 --- a/SOURCES/ecj-generatedebuginfo.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up ./build.xml.sav ./build.xml ---- ./build.xml.sav 2009-03-11 13:30:38.000000000 -0400 -+++ ./build.xml 2009-03-11 13:30:34.000000000 -0400 -@@ -10,7 +10,7 @@ - - - -@@ -18,7 +18,7 @@ - - - diff --git a/SOURCES/ecj-include-props.patch b/SOURCES/ecj-include-props.patch deleted file mode 100644 index 990442c..0000000 --- a/SOURCES/ecj-include-props.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/build.xml 2012-10-09 13:56:47.695928242 -0400 -+++ b/build.xml 2012-10-09 13:57:06.822893233 -0400 -@@ -46,6 +46,7 @@ - - - -+ - - - diff --git a/SPECS/ecj.spec b/SPECS/ecj.spec index a5c3680..1c1b860 100644 --- a/SPECS/ecj.spec +++ b/SPECS/ecj.spec @@ -1,28 +1,35 @@ Epoch: 1 -%global qualifier 201209141800 +%global qualifier R-4.5.2-201602121500 +# Taken from MANIFEST.MF +%global bundle_version 3.11.2 +%global bundle_qualifier v20160128-0629 Summary: Eclipse Compiler for Java Name: ecj -Version: 4.2.1 -Release: 8%{?dist} +Version: 4.5.2 +Release: 3%{?dist} URL: http://www.eclipse.org License: EPL Group: Development/Languages -Source0: http://download.eclipse.org/eclipse/downloads/drops4/R-%{version}-%{qualifier}/%{name}src-%{version}.jar +Source0: http://download.eclipse.org/eclipse/downloads/drops4/%{qualifier}/%{name}src-%{version}.jar Source1: ecj.sh.in -#Patched from http://repo2.maven.org/maven2/org/eclipse/jdt/core/3.3.0-v_771/core-3.3.0-v_771.pom # No dependencies are needed for ecj, dependencies are for using of jdt.core which makes no sense outside of eclipse -Source2: core-3.3.0-v_771.pom +Source2: https://repo1.maven.org/maven2/org/eclipse/jdt/core/compiler/ecj/%{version}/ecj-%{version}.pom +# Extracted from https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/%%{qualifier}/ecj-%%{version}.jar +Source3: MANIFEST.MF + # Always generate debug info when building RPMs (Andrew Haley) Patch0: %{name}-rpmdebuginfo.patch Patch1: %{name}-defaultto1.5.patch -Patch2: %{name}-generatedebuginfo.patch -# build.xml fails to include a necessary .props file in the built ecj.jar -Patch3: %{name}-include-props.patch +# Convert ecj source to be source level 1.6 compatible +Patch2: ecj-convertto1.6.patch + +Requires: java >= 1:1.6.0 +BuildRequires: gzip BuildRequires: ant -BuildRequires: java-devel >= 1:1.7.0 +BuildRequires: java-devel >= 1:1.6.0 Provides: eclipse-ecj = %{epoch}:%{version}-%{release} Obsoletes: eclipse-ecj < 1:3.4.2-4 @@ -36,9 +43,18 @@ the JDT Core batch compiler. %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -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 +sed -i -e 's|import org.eclipse.jdt.core.JavaCore;||g' org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java +sed -i -e 's|JavaCore.getOptions()||g' org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java +# Insert bundle version into messages.properties +sed -i -e "s|bundle_version|%{bundle_version}|g" org/eclipse/jdt/internal/compiler/batch/messages.properties +sed -i -e "s|bundle_qualifier|%{bundle_qualifier}|g" org/eclipse/jdt/internal/compiler/batch/messages.properties cp %{SOURCE2} pom.xml +mkdir -p scripts/binary/META-INF/ +cp %{SOURCE3} scripts/binary/META-INF/MANIFEST.MF # Remove bits of JDT Core we don't want to build rm -r org/eclipse/jdt/internal/compiler/tool @@ -49,7 +65,8 @@ rm -f org/eclipse/jdt/core/BuildJarIndex.java rm -f org/eclipse/jdt/core/JDTCompilerAdapter.java %build -ant +ant -verbose +gzip ecj.1 %install mkdir -p $RPM_BUILD_ROOT%{_javadir} @@ -63,12 +80,16 @@ popd install -p -D -m0755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/ecj sed --in-place "s:@JAVADIR@:%{_javadir}:" $RPM_BUILD_ROOT%{_bindir}/ecj +# Install manpage +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +install -m 644 -p ecj.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/ecj.1.gz + # poms install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir} install -pm 644 pom.xml \ $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom -%add_maven_depmap -a "org.eclipse.tycho:org.eclipse.jdt.core,org.eclipse.jdt.core.compiler:ecj" JPP-%{name}.pom %{name}.jar +%add_maven_depmap -a "org.eclipse.tycho:org.eclipse.jdt.core,org.eclipse.jdt.core.compiler:ecj,org.eclipse.jdt:core" JPP-%{name}.pom %{name}.jar %files %doc about.html @@ -78,8 +99,24 @@ install -pm 644 pom.xml \ %{_javadir}/%{name}.jar %{_javadir}/eclipse-%{name}.jar %{_javadir}/jdtcore.jar +%{_mandir}/man1/ecj* %changelog +* Fri Jan 27 2017 Elliott Baron - 1:4.5.2-3 +- Add Maven alias for org.eclipse.jdt:core. +- Resolves: rhbz#1379855 + +* Fri Jan 27 2017 Elliott Baron - 1:4.5.2-2 +- Build for JDK 1.6 target. +- Add ecj-convertto1.6.patch. +- Add Requires: java >= 1:1.6.0. +- Resolves: rhbz#1379855 + +* Wed Sep 28 2016 Elliott Baron - 1:4.5.2-1 +- Update to upstream 4.5.2 release. +- Add man page. +- Resolves: rhbz#1379855, rhbz#1147565 + * Fri Jan 24 2014 Daniel Mach - 1:4.2.1-8 - Mass rebuild 2014-01-24