From 7d5793388a6ca64f20f3c44192c0f8bea441fde8 Mon Sep 17 00:00:00 2001 From: Scott Lewis Date: Mon, 13 Jan 2025 16:37:39 -0800 Subject: [PATCH 1/5] Added bndtools plugin and feature --- pom.xml | 4 +- .../feature.xml | 2 +- .../pom.xml | 2 +- .../.classpath | 18 +- .../META-INF/MANIFEST.MF | 7 +- ....tooling.bndtools.PreferencesComponent.xml | 5 - .../pom.xml | 4 +- .../tooling/bndtools/Activator.java | 105 ----------- .../bndtools/PreferencesComponent.java | 173 ------------------ .../tooling/bndtools/ecfrepos.txt | 1 - 10 files changed, 24 insertions(+), 297 deletions(-) delete mode 100644 tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/OSGI-INF/org.eclipse.ecf.remoteservices.tooling.bndtools.PreferencesComponent.xml delete mode 100644 tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/Activator.java delete mode 100644 tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/PreferencesComponent.java delete mode 100644 tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/ecfrepos.txt diff --git a/pom.xml b/pom.xml index b28283f2d..36d3103ea 100644 --- a/pom.xml +++ b/pom.xml @@ -181,7 +181,7 @@ tests/bundles/org.eclipse.ecf.tests.osgi.services.distribution.r-osgi tooling/plugins/org.eclipse.ecf.remoteservices.tooling.pde - + tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools releng/features/org.eclipse.ecf.console.feature releng/features/org.eclipse.ecf.core @@ -211,7 +211,7 @@ releng/features/org.eclipse.ecf.tests.feature releng/features/org.eclipse.ecf.tests.filetransfer.feature releng/features/org.eclipse.ecf.xmpp.feature - + releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature releng/org.eclipse.ecf.releng.target releng/org.eclipse.ecf.releng.repository diff --git a/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml b/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml index 889c5005e..50c1c05f3 100644 --- a/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml +++ b/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/pom.xml b/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/pom.xml index e230e13e6..8d0da8779 100644 --- a/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/pom.xml +++ b/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/pom.xml @@ -9,6 +9,6 @@ ../../../ org.eclipse.ecf.remoteservices.tooling.bndtools.feature - 1.2.0-SNAPSHOT + 1.3.0-SNAPSHOT eclipse-feature diff --git a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/.classpath b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/.classpath index 81fe078c2..5050774b8 100644 --- a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/.classpath +++ b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/.classpath @@ -1,7 +1,21 @@ - + + + + + - + + + + + + + + + + + diff --git a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/META-INF/MANIFEST.MF b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/META-INF/MANIFEST.MF index 72d0fca9e..d5e32ffb9 100644 --- a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/META-INF/MANIFEST.MF +++ b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/META-INF/MANIFEST.MF @@ -2,18 +2,15 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin.name Bundle-SymbolicName: org.eclipse.ecf.remoteservices.tooling.bndtools;singleton:=true -Bundle-Version: 1.3.0.qualifier +Bundle-Version: 1.4.0.qualifier Import-Package: org.eclipse.core.resources, org.eclipse.jface.resource, org.osgi.service.component.annotations;version="1.3.0";resolution:=optional -Bundle-Activator: org.eclipse.ecf.remoteservices.tooling.bndtools.Activator Bundle-Vendor: %plugin.provider Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui.workbench, - org.eclipse.swt, - bndtools.core;bundle-version="7.1.0" + org.eclipse.swt Bundle-RequiredExecutionEnvironment: JavaSE-17 Automatic-Module-Name: org.eclipse.ecf.remoteservices.tooling.bndtools Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Service-Component: OSGI-INF/org.eclipse.ecf.remoteservices.tooling.bndtools.PreferencesComponent.xml diff --git a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/OSGI-INF/org.eclipse.ecf.remoteservices.tooling.bndtools.PreferencesComponent.xml b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/OSGI-INF/org.eclipse.ecf.remoteservices.tooling.bndtools.PreferencesComponent.xml deleted file mode 100644 index 2ef41b816..000000000 --- a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/OSGI-INF/org.eclipse.ecf.remoteservices.tooling.bndtools.PreferencesComponent.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/pom.xml b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/pom.xml index 21be9074c..490f07f35 100644 --- a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/pom.xml +++ b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/pom.xml @@ -5,10 +5,10 @@ org.eclipse.ecf ecf-parent - 1.0.100-SNAPSHOT + 1.0.0-SNAPSHOT ../../../ org.eclipse.ecf.remoteservices.tooling.bndtools - 1.2.0-SNAPSHOT + 1.4.0-SNAPSHOT eclipse-plugin diff --git a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/Activator.java b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/Activator.java deleted file mode 100644 index cd2ddeba6..000000000 --- a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/Activator.java +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 Paul Verest, Benjamin Gurok, Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Apache Public License v2.0 which - * accompanies this distribution, and is available at - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: Paul Verest, Benjamin Gurok, and Composent, Inc. - initial - * API and implementation - ******************************************************************************/ -package org.eclipse.ecf.remoteservices.tooling.bndtools; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.ecf.remoteservices.tooling.bndtools"; // $NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext - * ) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext - * ) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given plug-in relative - * path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } - - /** - * Returns the active workbench shell or null if none - * - * @return the active workbench shell or null if none - */ - public static Shell getActiveWorkbenchShell() { - IWorkbenchWindow window = getActiveWorkbenchWindow(); - if (window != null) { - return window.getShell(); - } - return null; - } - - /** - * Returns the active workbench window - * - * @return the active workbench window - */ - public static IWorkbenchWindow getActiveWorkbenchWindow() { - return PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - } - -} diff --git a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/PreferencesComponent.java b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/PreferencesComponent.java deleted file mode 100644 index 4ed36958b..000000000 --- a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/PreferencesComponent.java +++ /dev/null @@ -1,173 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2023 Composent, Inc. and others. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * Contributors: - * Composent, Inc. - initial API and implementation - * - * SPDX-License-Identifier: EPL-2.0 - *****************************************************************************/ -package org.eclipse.ecf.remoteservices.tooling.bndtools; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URL; -import java.util.Arrays; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.ui.preferences.ScopedPreferenceStore; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.service.component.annotations.Activate; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Reference; - -@Component(immediate = true) -public class PreferencesComponent { - - @Reference - IWorkspace workspace; - - static class Attrs extends HashMap { - - private static final long serialVersionUID = -4017513476270109969L; - - public Attrs() {} - - private String name; - - public Attrs(Attrs a) { - mergeWith(a); - } - - void mergeWith(Attrs a) { - if (a.name != null) { - this.name = a.name; - } - for (Map.Entry e : a.entrySet()) { - put(e.getKey(), e.getValue()); - } - } - public String toString() { - StringBuffer sb = new StringBuffer(); - if (this.name != null) { - sb.append("name=").append(this.name); - } - String del = ""; - for (Map.Entry e : this.entrySet()) { - sb.append(del); - sb.append(e.getKey()); - sb.append("="); - sb.append(e.getValue()); - del = ";"; - } - return sb.toString(); - } - } - - class Repo extends HashMap { - - private static final long serialVersionUID = -7604521690360522452L; - - static void parseRepo(Repo r, String s) { - String[] repos = s.split(","); - if (repos != null && repos.length > 0) { - for(String repo : repos) { - String[] parts = repo.split(";"); - if (parts != null && parts.length > 0) { - String githuburl = parts[0].trim(); - Attrs attrs = new Attrs(); - if (parts.length > 1) { - for (int i = 1; i < parts.length; i++) { - String[] parts2 = parts[i].split("="); - attrs.put(parts2[0].strip(), parts2[1].strip()); - } - } - r.put(githuburl, attrs); - } - } - } - } - - public Repo() { - } - - public Repo(String s) { - parseRepo(this, s); - } - - public void mergeWith(Repo r) { - for (Map.Entry e : r.entrySet()) { - Attrs existing = get(e.getKey()); - if (existing == null) { - put(e.getKey(), new Attrs(e.getValue())); - } else - existing.mergeWith(e.getValue()); - } - } - - public String toString() { - StringBuffer sb = new StringBuffer(); - String del = ""; - for(Map.Entry e : this.entrySet()) { - sb.append(del); - sb.append(e.getKey()); - Attrs value = e.getValue(); - if (!value.isEmpty()) { - sb.append(";"); - sb.append(e.getValue().toString()); - } - del = ","; - } - return sb.toString(); - } - } - - private Repo getRepoParameters(InputStream ins) { - Repo result = new Repo(); - try (BufferedReader reader = new BufferedReader( - new InputStreamReader(ins))) { - while (reader.ready()) { - result.mergeWith(new Repo(reader.readLine())); - } - } catch (Exception e) { - // Ignore if this fails - } - return result; - } - - @Activate - void activate(BundleContext bundleContext) { - List bundles = Arrays.asList(bundleContext.getBundles()).stream() - .filter(b -> b.getSymbolicName().equals("org.bndtools.templating.gitrepo")).collect(Collectors.toList()); - Repo bndtoolsRepos = new Repo(); - if (bundles.size() > 0) { - Bundle b = bundles.get(0); - Enumeration entries = b.findEntries("org/bndtools/templating/jgit", "initialrepos.txt", false); - if (entries != null && entries.hasMoreElements()) { - try { - bndtoolsRepos = getRepoParameters(entries.nextElement().openStream()); - } catch (IOException e) { - // Ignore if can't read it - } - } - Repo ecfRepos = getRepoParameters(Activator.class.getResourceAsStream("ecfrepos.txt")); - if (ecfRepos.size() > 0) { - ScopedPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.bndtools.templating.gitrepo"); - store.setDefault("githubRepos", bndtoolsRepos.toString()); - bndtoolsRepos.mergeWith(ecfRepos); - store.setValue("githubRepos", bndtoolsRepos.toString()); - } - } - } -} diff --git a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/ecfrepos.txt b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/ecfrepos.txt deleted file mode 100644 index f7f3d6bb6..000000000 --- a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/src/org/eclipse/ecf/remoteservices/tooling/bndtools/ecfrepos.txt +++ /dev/null @@ -1 +0,0 @@ -ECF/bndtools.workspace;name=ECF Remote Services Workspace Template;branch=main \ No newline at end of file From ea8efa3ed236bf8bf6b4d25683870675f4901061 Mon Sep 17 00:00:00 2001 From: Scott Lewis Date: Mon, 13 Jan 2025 16:48:13 -0800 Subject: [PATCH 2/5] Fix for build.properties --- .../build.properties | 2 -- 1 file changed, 2 deletions(-) diff --git a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/build.properties b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/build.properties index ea404002a..a17dac8b7 100644 --- a/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/build.properties +++ b/tooling/plugins/org.eclipse.ecf.remoteservices.tooling.bndtools/build.properties @@ -2,9 +2,7 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ - OSGI-INF/,\ plugin.properties,\ - about.html,\ plugin.xml src.includes = ECF Remote Service Bndtools Tooling.launch,\ about.html From eba0ba06700b5c0f95db783cbe7a987da38d0367 Mon Sep 17 00:00:00 2001 From: Scott Lewis Date: Mon, 13 Jan 2025 17:11:30 -0800 Subject: [PATCH 3/5] Fixed bndtools feature --- .../feature.xml | 5 +---- releng/org.eclipse.ecf.releng.target/ecf-2024-06.target | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml b/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml index 50c1c05f3..15fe19f26 100644 --- a/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml +++ b/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml @@ -23,9 +23,6 @@ + version="0.0.0"/> diff --git a/releng/org.eclipse.ecf.releng.target/ecf-2024-06.target b/releng/org.eclipse.ecf.releng.target/ecf-2024-06.target index 6c18398fa..75c4b80a2 100644 --- a/releng/org.eclipse.ecf.releng.target/ecf-2024-06.target +++ b/releng/org.eclipse.ecf.releng.target/ecf-2024-06.target @@ -69,6 +69,12 @@ + + + + + + From c97fe4181deeeb36ebee09f456e9e4063f9edacd Mon Sep 17 00:00:00 2001 From: Scott Lewis Date: Mon, 13 Jan 2025 17:22:49 -0800 Subject: [PATCH 4/5] Fix for target --- .../org.eclipse.ecf.releng.target/ecf-2024-06.target | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/releng/org.eclipse.ecf.releng.target/ecf-2024-06.target b/releng/org.eclipse.ecf.releng.target/ecf-2024-06.target index 75c4b80a2..8ceeaf3b2 100644 --- a/releng/org.eclipse.ecf.releng.target/ecf-2024-06.target +++ b/releng/org.eclipse.ecf.releng.target/ecf-2024-06.target @@ -72,8 +72,6 @@ - - @@ -85,5 +83,15 @@ + + + + org.eclipse.jgit + org.eclipse.jgit + 7.0.0.202409031743-r + jar + + + \ No newline at end of file From 6b4d82a74dcd08dc18bca33fb1e54188997e823a Mon Sep 17 00:00:00 2001 From: Scott Lewis Date: Mon, 13 Jan 2025 17:58:14 -0800 Subject: [PATCH 5/5] Feature fixes --- .../feature.properties | 4 ++-- .../feature.xml | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.properties b/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.properties index a6b028a38..c7e0c30ad 100644 --- a/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.properties +++ b/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.properties @@ -7,8 +7,8 @@ # # SPDX-License-Identifier: EPL-2.0 ############################################################################ -feature.name=ECF Bndtools Support -featureProvider=Eclipse.org - ECF +featureName=ECF Bndtools Support +providerName=Eclipse.org - ECF copyright=Copyright (c) 2024 Composent, Inc. and others.\n\ \n\ diff --git a/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml b/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml index 15fe19f26..b6c88dc4c 100644 --- a/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml +++ b/releng/features/org.eclipse.ecf.remoteservices.tooling.bndtools.feature/feature.xml @@ -3,10 +3,12 @@ id="org.eclipse.ecf.remoteservices.tooling.bndtools.feature" label="ECF Remote Services Bndtools Support" version="1.3.0.qualifier" - provider-name="Eclipse.org - ECF"> + provider-name="%providerName" + license-feature="org.eclipse.license" + license-feature-version="0.0.0"> - This feature provides the ECF Remote Services Bndtools Support bundle. This bundle provides ECF Remote Services support and UI for Bndtools 7.1+. + This feature provides the ECF Remote Services Bndtools 7.1+ Support bundle.