From 74f693b2a49680ccb69dd9445790a1d56d87149c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sun, 10 Dec 2023 07:50:39 +0100 Subject: [PATCH] Adapt to latest PDE changes + use latest update site --- .../java/org/eclipse/tycho/TychoConstants.java | 2 +- .../runner/ConvertSchemaToHtmlRunner.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tycho-api/src/main/java/org/eclipse/tycho/TychoConstants.java b/tycho-api/src/main/java/org/eclipse/tycho/TychoConstants.java index 5b5ead3643..bda95f4351 100644 --- a/tycho-api/src/main/java/org/eclipse/tycho/TychoConstants.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/TychoConstants.java @@ -18,7 +18,7 @@ public interface TychoConstants { - public static final String ECLIPSE_LATEST = "https://download.eclipse.org/releases/2023-09/"; + public static final String ECLIPSE_LATEST = "https://download.eclipse.org/releases/2023-12/"; static final String ANY_QUALIFIER = "qualifier"; diff --git a/tycho-extras/tycho-document-bundle-plugin/src/main/java/org/eclipse/tycho/extras/docbundle/runner/ConvertSchemaToHtmlRunner.java b/tycho-extras/tycho-document-bundle-plugin/src/main/java/org/eclipse/tycho/extras/docbundle/runner/ConvertSchemaToHtmlRunner.java index 8f727ee4fe..f4d058d69d 100644 --- a/tycho-extras/tycho-document-bundle-plugin/src/main/java/org/eclipse/tycho/extras/docbundle/runner/ConvertSchemaToHtmlRunner.java +++ b/tycho-extras/tycho-document-bundle-plugin/src/main/java/org/eclipse/tycho/extras/docbundle/runner/ConvertSchemaToHtmlRunner.java @@ -41,12 +41,15 @@ import org.eclipse.pde.internal.core.XMLDefaultHandler; import org.eclipse.pde.internal.core.builders.SchemaTransformer; import org.eclipse.pde.internal.core.ischema.ISchema; +import org.eclipse.pde.internal.core.ischema.ISchemaDescriptor; import org.eclipse.pde.internal.core.ischema.ISchemaInclude; import org.eclipse.pde.internal.core.plugin.ExternalFragmentModel; import org.eclipse.pde.internal.core.plugin.ExternalPluginModel; import org.eclipse.pde.internal.core.plugin.ExternalPluginModelBase; +import org.eclipse.pde.internal.core.schema.PathSchemaProvider; import org.eclipse.pde.internal.core.schema.Schema; import org.eclipse.pde.internal.core.schema.SchemaDescriptor; +import org.eclipse.pde.internal.core.schema.SchemaProvider; import org.eclipse.pde.internal.core.util.HeaderMap; import org.osgi.framework.Constants; @@ -100,7 +103,7 @@ public ConvertSchemaToHtmlResult call() throws Exception { .parse(schemaFile, handler); @SuppressWarnings("deprecation") URL url = schemaFile.toURL(); - SchemaDescriptor desc = new SchemaDescriptor(extPoint.getFullId(), url, + PathSchemaProvider pathSchemaProvider = new PathSchemaProvider( additionalSearchPaths.stream().map(pathString -> { IPath path = IPath.fromOSString(pathString); if (!path.isAbsolute()) { @@ -108,6 +111,15 @@ public ConvertSchemaToHtmlResult call() throws Exception { } return path; }).toList()); + SchemaDescriptor desc = new SchemaDescriptor(extPoint.getFullId(), url, new SchemaProvider() { + + @Override + public ISchema createSchema(ISchemaDescriptor descriptor, String location) { + // TODO if the path return null we should search inside the bundle target + // platform for the schema! + return pathSchemaProvider.createSchema(descriptor, schemaLocation); + } + }); schema = (Schema) desc.getSchema(false); // Check that all included schemas are available