From cc3b8086d49f8e0e46383a73a0fd4e15bfa9fd99 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Thu, 19 Sep 2024 17:09:28 +0200 Subject: [PATCH 1/5] [fixes #3728] Remove signature files eclipse plugin jars --- .../DownloadEclipseDependencies.java | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/support/lombok/eclipse/dependencies/DownloadEclipseDependencies.java b/src/support/lombok/eclipse/dependencies/DownloadEclipseDependencies.java index 0e8d58950..0aa9934dd 100644 --- a/src/support/lombok/eclipse/dependencies/DownloadEclipseDependencies.java +++ b/src/support/lombok/eclipse/dependencies/DownloadEclipseDependencies.java @@ -36,6 +36,9 @@ import java.util.Arrays; import java.util.List; import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; /** * Download eclipse bundles. @@ -87,12 +90,22 @@ private static void downloadFile(String filename, String repositoryUrl, String t return; } System.out.print("Downloading '" + filename + "'... "); - InputStream in = null; - OutputStream out = null; + ZipInputStream in = null; + ZipOutputStream out = null; try { - in = getStreamForUrl(repositoryUrl + filename); - out = new FileOutputStream(targetFile); - copy(in, out); + in = new ZipInputStream(getStreamForUrl(repositoryUrl + filename)); + out = new ZipOutputStream(new FileOutputStream(targetFile)); + + ZipEntry zipEntry; + while ((zipEntry = in.getNextEntry()) != null) { + String name = zipEntry.getName(); + + // Remove signature files + if (name.matches("META-INF/.*\\.(SF|RSA)")) continue; + + out.putNextEntry(new ZipEntry(name)); + copy(in, out); + } System.out.println("[done]"); } catch (IOException e) { System.out.println("[error]"); From 6fba0cb2da05ea2a5be666154892aa557ec0c467 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Thu, 19 Sep 2024 17:09:45 +0200 Subject: [PATCH 2/5] Add eclipse 2024-09 test targets --- .github/workflows/ant.yml | 2 ++ buildScripts/ivy.xml | 18 ++++++++++++++++-- buildScripts/setup.ant.xml | 4 ++++ buildScripts/tests.ant.xml | 9 +++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml index 4a53d4278..a31cb3e3e 100644 --- a/.github/workflows/ant.yml +++ b/.github/workflows/ant.yml @@ -108,6 +108,7 @@ jobs: - eclipse-202312 - eclipse-202403 - eclipse-202406 + - eclipse-202409 - eclipse-I-build - eclipse-oxygen-full - eclipse-2022-03-full @@ -115,6 +116,7 @@ jobs: - eclipse-2023-12-full - eclipse-2024-03-full - eclipse-2024-06-full + - eclipse-2024-09-full - eclipse-I-build-full - ecj11 - ecj14 diff --git a/buildScripts/ivy.xml b/buildScripts/ivy.xml index 38b487856..de31decdf 100644 --- a/buildScripts/ivy.xml +++ b/buildScripts/ivy.xml @@ -35,6 +35,7 @@ + @@ -148,7 +149,7 @@ - + @@ -161,7 +162,7 @@ - + @@ -175,6 +176,19 @@ + + + + + + + + + + + + + diff --git a/buildScripts/setup.ant.xml b/buildScripts/setup.ant.xml index 91d3d478b..abd8d386f 100644 --- a/buildScripts/setup.ant.xml +++ b/buildScripts/setup.ant.xml @@ -180,6 +180,10 @@ This buildfile is part of projectlombok.org. It sets up the build itself. + + + + diff --git a/buildScripts/tests.ant.xml b/buildScripts/tests.ant.xml index 604455182..766d2b5fd 100644 --- a/buildScripts/tests.ant.xml +++ b/buildScripts/tests.ant.xml @@ -233,6 +233,11 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn + + + + + @@ -313,6 +318,10 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn + + + + From ddf4ebce52d66432e6ed8fe88b8a04317effde10 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Thu, 19 Sep 2024 17:32:54 +0200 Subject: [PATCH 3/5] Remove deprecated inlineJsrBytecode ECJ ignored this setting for Java 1.5+ --- test/core/src/lombok/RunTestsViaEcj.java | 1 - 1 file changed, 1 deletion(-) diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java index 352ba4e6c..5f1390954 100644 --- a/test/core/src/lombok/RunTestsViaEcj.java +++ b/test/core/src/lombok/RunTestsViaEcj.java @@ -79,7 +79,6 @@ protected CompilerOptions ecjCompilerOptions(TestParameters parameters) { options.targetJDK = ecjCompilerVersionConstant; options.docCommentSupport = false; options.parseLiteralExpressionsAsConstants = true; - options.inlineJsrBytecode = true; options.reportUnusedDeclaredThrownExceptionExemptExceptionAndThrowable = false; options.reportUnusedDeclaredThrownExceptionIncludeDocCommentReference = false; options.reportUnusedDeclaredThrownExceptionWhenOverriding = false; From 09ac596dd8d01b3fc6e0bc031d1a711d30480333 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Thu, 19 Sep 2024 17:41:30 +0200 Subject: [PATCH 4/5] Set ecj target version --- test/core/src/lombok/RunTestsViaEcj.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java index 5f1390954..3a0f02e26 100644 --- a/test/core/src/lombok/RunTestsViaEcj.java +++ b/test/core/src/lombok/RunTestsViaEcj.java @@ -95,6 +95,7 @@ protected CompilerOptions ecjCompilerOptions(TestParameters parameters) { warnings.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, "warning"); warnings.put("org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures", "ignore"); warnings.put(CompilerOptions.OPTION_Source, (ecjCompilerVersion < 9 ? "1." : "") + ecjCompilerVersion); + warnings.put(CompilerOptions.OPTION_TargetPlatform, (ecjCompilerVersion < 9 ? "1." : "") + ecjCompilerVersion); warnings.put("org.eclipse.jdt.core.compiler.codegen.useStringConcatFactory", "disabled"); options.set(warnings); return options; From 0bc7f199007c6403d02c45d56b2e88e8f6314583 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 18 Oct 2024 00:04:21 +0200 Subject: [PATCH 5/5] [refactor] The 'copy zip files stripping signatures' code cleaned up ever so slightly; timestamps of zip entries is now preserved. --- .../DownloadEclipseDependencies.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/support/lombok/eclipse/dependencies/DownloadEclipseDependencies.java b/src/support/lombok/eclipse/dependencies/DownloadEclipseDependencies.java index 0aa9934dd..eff44bf73 100644 --- a/src/support/lombok/eclipse/dependencies/DownloadEclipseDependencies.java +++ b/src/support/lombok/eclipse/dependencies/DownloadEclipseDependencies.java @@ -90,22 +90,14 @@ private static void downloadFile(String filename, String repositoryUrl, String t return; } System.out.print("Downloading '" + filename + "'... "); - ZipInputStream in = null; - ZipOutputStream out = null; + + InputStream in = null; + OutputStream out = null; try { - in = new ZipInputStream(getStreamForUrl(repositoryUrl + filename)); - out = new ZipOutputStream(new FileOutputStream(targetFile)); + in = getStreamForUrl(repositoryUrl + filename); + out = new FileOutputStream(targetFile); - ZipEntry zipEntry; - while ((zipEntry = in.getNextEntry()) != null) { - String name = zipEntry.getName(); - - // Remove signature files - if (name.matches("META-INF/.*\\.(SF|RSA)")) continue; - - out.putNextEntry(new ZipEntry(name)); - copy(in, out); - } + copyZipButStripSignatures(in, out); System.out.println("[done]"); } catch (IOException e) { System.out.println("[error]"); @@ -118,6 +110,18 @@ private static void downloadFile(String filename, String repositoryUrl, String t } } + private static void copyZipButStripSignatures(InputStream rawIn, OutputStream rawOut) throws IOException { + ZipInputStream in = new ZipInputStream(rawIn); + ZipOutputStream out = new ZipOutputStream(rawOut); + + ZipEntry zipEntry; + while ((zipEntry = in.getNextEntry()) != null) { + if (zipEntry.getName().matches("META-INF/.*\\.(SF|RSA)")) continue; + out.putNextEntry(zipEntry); + copy(in, out); + } + } + private static void copy(InputStream from, OutputStream to) throws IOException { byte[] b = new byte[4096]; while (true) {