From 49ce2ce278e8f3eefbddac9d8341d9553293df2b Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Sun, 8 Sep 2024 11:50:44 +0200 Subject: [PATCH] Revert "Workaround for missing 4.31 SWT API descriptions" This reverts commit 2fd4268ab73151b8559fbd6b9c98dc97e014a5db and commit a6824f75205aca3e2fe3c802a406be4523c68830, introduced with https://github.com/eclipse-pde/eclipse.pde/pull/1191 and https://github.com/eclipse-pde/eclipse.pde/pull/1192 These workarounds for missing API description files are not necessary anymore because they are now correctly included again for some time. --- .../build.properties | 1 - ...h64-3.125.0.v20240227-1638.api_description | 189 ----------------- ...-64-3.125.0.v20240227-1638.api_description | 189 ----------------- ...h64-3.125.0.v20240227-1638.api_description | 193 ----------------- ...4le-3.125.0.v20240227-1638.api_description | 193 ----------------- ...-64-3.125.0.v20240227-1638.api_description | 193 ----------------- ...-64-3.125.0.v20240227-1638.api_description | 199 ------------------ .../tools/internal/model/BundleComponent.java | 48 +---- 8 files changed, 6 insertions(+), 1199 deletions(-) delete mode 100644 apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.cocoa.macosx.aarch64-3.125.0.v20240227-1638.api_description delete mode 100644 apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.cocoa.macosx.x86-64-3.125.0.v20240227-1638.api_description delete mode 100644 apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.aarch64-3.125.0.v20240227-1638.api_description delete mode 100644 apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.ppc64le-3.125.0.v20240227-1638.api_description delete mode 100644 apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.x86-64-3.125.0.v20240227-1638.api_description delete mode 100644 apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.win32.win32.x86-64-3.125.0.v20240227-1638.api_description diff --git a/apitools/org.eclipse.pde.api.tools/build.properties b/apitools/org.eclipse.pde.api.tools/build.properties index fe6981fcd7..e8cbb6eb1f 100644 --- a/apitools/org.eclipse.pde.api.tools/build.properties +++ b/apitools/org.eclipse.pde.api.tools/build.properties @@ -23,7 +23,6 @@ bin.includes = .,\ plugin.xml,\ lib/apitooling-ant.jar,\ scripts/,\ - fixed_api_descriptions/,\ OSGI-INF/ jars.extra.classpath=platform:/plugin/org.apache.ant/lib/ant.jar,platform:/plugin/org.objectweb.asm jars.compile.order = .,\ diff --git a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.cocoa.macosx.aarch64-3.125.0.v20240227-1638.api_description b/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.cocoa.macosx.aarch64-3.125.0.v20240227-1638.api_description deleted file mode 100644 index f7ff00f177..0000000000 --- a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.cocoa.macosx.aarch64-3.125.0.v20240227-1638.api_description +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.cocoa.macosx.x86-64-3.125.0.v20240227-1638.api_description b/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.cocoa.macosx.x86-64-3.125.0.v20240227-1638.api_description deleted file mode 100644 index 6a1f1ea83d..0000000000 --- a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.cocoa.macosx.x86-64-3.125.0.v20240227-1638.api_description +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.aarch64-3.125.0.v20240227-1638.api_description b/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.aarch64-3.125.0.v20240227-1638.api_description deleted file mode 100644 index 0dc92544be..0000000000 --- a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.aarch64-3.125.0.v20240227-1638.api_description +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.ppc64le-3.125.0.v20240227-1638.api_description b/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.ppc64le-3.125.0.v20240227-1638.api_description deleted file mode 100644 index 77bdfdd675..0000000000 --- a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.ppc64le-3.125.0.v20240227-1638.api_description +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.x86-64-3.125.0.v20240227-1638.api_description b/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.x86-64-3.125.0.v20240227-1638.api_description deleted file mode 100644 index b52cf6bf05..0000000000 --- a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.gtk.linux.x86-64-3.125.0.v20240227-1638.api_description +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.win32.win32.x86-64-3.125.0.v20240227-1638.api_description b/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.win32.win32.x86-64-3.125.0.v20240227-1638.api_description deleted file mode 100644 index 330449b915..0000000000 --- a/apitools/org.eclipse.pde.api.tools/fixed_api_descriptions/org.eclipse.swt.win32.win32.x86-64-3.125.0.v20240227-1638.api_description +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java index fc8d4a3241..a2fb215b2a 100644 --- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java +++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java @@ -38,10 +38,8 @@ import javax.xml.parsers.SAXParser; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.osgi.service.resolver.BundleDescription; import org.eclipse.osgi.service.resolver.BundleSpecification; @@ -78,7 +76,6 @@ import org.eclipse.pde.internal.core.MinimalState; import org.eclipse.pde.internal.core.TargetWeaver; import org.eclipse.pde.internal.core.util.ManifestUtils; -import org.osgi.framework.Bundle; import org.osgi.framework.BundleException; import org.osgi.framework.Constants; import org.osgi.framework.FrameworkUtil; @@ -813,16 +810,6 @@ protected static String readFileContents(String xmlFileName, File bundleLocation return null; } - // Content is from 3.125.0.v20240206-1259, id's are from 4.31 release - private static final List FIXED_API_DESCRIPTIONS = Arrays.asList( - "org.eclipse.swt.win32.win32.x86-64-3.125.0.v20240227-1638", //$NON-NLS-1$ - "org.eclipse.swt.gtk.linux.x86-64-3.125.0.v20240227-1638", //$NON-NLS-1$ - "org.eclipse.swt.gtk.linux.ppc64le-3.125.0.v20240227-1638", //$NON-NLS-1$ - "org.eclipse.swt.gtk.linux.aarch64-3.125.0.v20240227-1638", //$NON-NLS-1$ - "org.eclipse.swt.cocoa.macosx.aarch64-3.125.0.v20240227-1638", //$NON-NLS-1$ - "org.eclipse.swt.cocoa.macosx.x86-64-3.125.0.v20240227-1638" //$NON-NLS-1$ - ); - /** * Parses a bundle's .api_description XML into a string. The file may be in * a jar or in a directory at the specified location. @@ -836,22 +823,13 @@ protected static String loadApiDescription(File bundleLocation) throws IOExcepti InputStream stream = null; String contents; try { - String fileName = bundleLocation.getName(); - String extension = IPath.fromOSString(fileName).getFileExtension(); + String extension = IPath.fromOSString(bundleLocation.getName()).getFileExtension(); if (extension != null && extension.equals("jar") && bundleLocation.isFile()) { //$NON-NLS-1$ - // TODO: remove this if(FIXED_API_DESCRIPTIONS) branch after switching to 4.32 - // baseline (assuming it will have proper SWT API descriptions, see - // https://github.com/eclipse-pde/eclipse.pde/pull/1191) - String bundleAndVersion = fileName.substring(0, fileName.length() - ".jar".length()).replace('_', '-'); //$NON-NLS-1$ - if (FIXED_API_DESCRIPTIONS.contains(bundleAndVersion)) { - stream = loadFixedBundleApiDescription(bundleAndVersion); - } else { - jarFile = new ZipFile(bundleLocation, ZipFile.OPEN_READ); - ZipEntry manifestEntry = jarFile.getEntry(IApiCoreConstants.API_DESCRIPTION_XML_NAME); - if (manifestEntry != null) { - // new file is present - stream = jarFile.getInputStream(manifestEntry); - } + jarFile = new ZipFile(bundleLocation, ZipFile.OPEN_READ); + ZipEntry manifestEntry = jarFile.getEntry(IApiCoreConstants.API_DESCRIPTION_XML_NAME); + if (manifestEntry != null) { + // new file is present + stream = jarFile.getInputStream(manifestEntry); } } else { File file = new File(bundleLocation, IApiCoreConstants.API_DESCRIPTION_XML_NAME); @@ -871,20 +849,6 @@ protected static String loadApiDescription(File bundleLocation) throws IOExcepti return contents; } - /** - * See https://github.com/eclipse-platform/eclipse.platform.swt/issues/1093 and - * https://github.com/eclipse-pde/eclipse.pde/issues/1187. - * - * @param bundleAndVersion platform specific bundle name with version - * @return stream opened for reading api description - * @throws IOException - */ - private static InputStream loadFixedBundleApiDescription(String bundleAndVersion) throws IOException { - Bundle bundle = Platform.getBundle("org.eclipse.pde.api.tools"); //$NON-NLS-1$ - IPath pathInBundle = IPath.fromOSString("fixed_api_descriptions/" + bundleAndVersion + ".api_description"); //$NON-NLS-1$ //$NON-NLS-2$ - return FileLocator.openStream(bundle, pathInBundle, false); - } - @Override public List getExecutionEnvironments() throws CoreException { // Return the EE from the description only if explicitly specified in the