From ddfd814321c3a52285e9307d9880b44abe46fab2 Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Fri, 9 Aug 2024 19:04:30 +0200 Subject: [PATCH] Leverage OSGi-DS component-xml file generation of PDE-DS/Tycho Remove generated xml-files from equinox.ds.tests. --- .../org.eclipse.equinox.ds.tests/.gitignore | 1 + .../org.eclipse.pde.ds.annotations.prefs | 1 - ...onentActivationDeadLockTest$Component1.xml | 9 --- ...onentActivationDeadLockTest$Component2.xml | 8 --- ...onentActivationDeadLockTest$Component3.xml | 9 --- ...t$Component4$AwaitComponent5Activation.xml | 7 --- ...onentActivationDeadLockTest$Component4.xml | 9 --- ...$Component5$ActivationStartedIndicator.xml | 7 --- ...onentActivationDeadLockTest$Component5.xml | 9 --- .../build.properties | 3 - bundles/org.eclipse.equinox.ds.tests/pom.xml | 61 +++++++++++++++++++ bundles/org.eclipse.equinox.event/.gitignore | 1 + .../org.eclipse.pde.ds.annotations.prefs | 7 +++ .../META-INF/MANIFEST.MF | 2 +- .../OSGI-INF/component.xml | 7 --- .../build.properties | 3 +- .../internal/event/EventComponent.java | 6 +- 17 files changed, 77 insertions(+), 73 deletions(-) delete mode 100644 bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component1.xml delete mode 100644 bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component2.xml delete mode 100644 bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component3.xml delete mode 100644 bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component4$AwaitComponent5Activation.xml delete mode 100644 bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component4.xml delete mode 100644 bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component5$ActivationStartedIndicator.xml delete mode 100644 bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component5.xml create mode 100644 bundles/org.eclipse.equinox.ds.tests/pom.xml create mode 100644 bundles/org.eclipse.equinox.event/.gitignore create mode 100644 bundles/org.eclipse.equinox.event/.settings/org.eclipse.pde.ds.annotations.prefs delete mode 100644 bundles/org.eclipse.equinox.event/OSGI-INF/component.xml diff --git a/bundles/org.eclipse.equinox.ds.tests/.gitignore b/bundles/org.eclipse.equinox.ds.tests/.gitignore index f02e6a763a3..ab5a20ade52 100644 --- a/bundles/org.eclipse.equinox.ds.tests/.gitignore +++ b/bundles/org.eclipse.equinox.ds.tests/.gitignore @@ -1 +1,2 @@ /scr_test +OSGI-INF/org.eclipse.*.xml diff --git a/bundles/org.eclipse.equinox.ds.tests/.settings/org.eclipse.pde.ds.annotations.prefs b/bundles/org.eclipse.equinox.ds.tests/.settings/org.eclipse.pde.ds.annotations.prefs index 73a356b6d05..38f9eecff8e 100644 --- a/bundles/org.eclipse.equinox.ds.tests/.settings/org.eclipse.pde.ds.annotations.prefs +++ b/bundles/org.eclipse.equinox.ds.tests/.settings/org.eclipse.pde.ds.annotations.prefs @@ -1,4 +1,3 @@ -classpath=true dsVersion=V1_3 eclipse.preferences.version=1 enabled=true diff --git a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component1.xml b/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component1.xml deleted file mode 100644 index 44f687c323c..00000000000 --- a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component1.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component2.xml b/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component2.xml deleted file mode 100644 index 64489925cd1..00000000000 --- a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component2.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component3.xml b/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component3.xml deleted file mode 100644 index 1319cf7230e..00000000000 --- a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component3.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component4$AwaitComponent5Activation.xml b/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component4$AwaitComponent5Activation.xml deleted file mode 100644 index 2609119d768..00000000000 --- a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component4$AwaitComponent5Activation.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component4.xml b/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component4.xml deleted file mode 100644 index 30db282c7ac..00000000000 --- a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component4.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component5$ActivationStartedIndicator.xml b/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component5$ActivationStartedIndicator.xml deleted file mode 100644 index fcc7811c4a9..00000000000 --- a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component5$ActivationStartedIndicator.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component5.xml b/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component5.xml deleted file mode 100644 index ae5faaa6a34..00000000000 --- a/bundles/org.eclipse.equinox.ds.tests/OSGI-INF/org.eclipse.equinox.ds.tests.LazyServiceComponentActivationDeadLockTest$Component5.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/bundles/org.eclipse.equinox.ds.tests/build.properties b/bundles/org.eclipse.equinox.ds.tests/build.properties index 073d924563e..3cc01180546 100644 --- a/bundles/org.eclipse.equinox.ds.tests/build.properties +++ b/bundles/org.eclipse.equinox.ds.tests/build.properties @@ -134,6 +134,3 @@ source.scr_test/tb26.jar = bundles_src/tb26/ manifest.scr_test/tb26.jar = META-INF/MANIFEST.MF source.scr_test/tb27.jar = bundles_src/tb27/ manifest.scr_test/tb27.jar = META-INF/MANIFEST.MF - -# Maven properties, see https://github.com/eclipse/tycho/wiki/Tycho-Pomless -pom.model.property.testClass = org.eclipse.equinox.ds.tests.AllTests diff --git a/bundles/org.eclipse.equinox.ds.tests/pom.xml b/bundles/org.eclipse.equinox.ds.tests/pom.xml new file mode 100644 index 00000000000..55effb9d3c6 --- /dev/null +++ b/bundles/org.eclipse.equinox.ds.tests/pom.xml @@ -0,0 +1,61 @@ + + + + 4.0.0 + + org.eclipse.equinox + parent + 4.34.0-SNAPSHOT + ../.. + + org.eclipse.equinox.ds.tests + 1.7.200-SNAPSHOT + eclipse-test-plugin + + org.eclipse.equinox.ds.tests.AllTests + + + src + + + org.apache.maven.plugins + maven-resources-plugin + + + + copy-ds-component-xml + + copy-resources + + process-test-resources + + + + ${project.build.outputDirectory}/OSGI-INF + *.xml + + + ${project.basedir}/OSGI-INF + + + + + + + diff --git a/bundles/org.eclipse.equinox.event/.gitignore b/bundles/org.eclipse.equinox.event/.gitignore new file mode 100644 index 00000000000..7bec98dd976 --- /dev/null +++ b/bundles/org.eclipse.equinox.event/.gitignore @@ -0,0 +1 @@ +/OSGI-INF/org.eclipse.*.xml diff --git a/bundles/org.eclipse.equinox.event/.settings/org.eclipse.pde.ds.annotations.prefs b/bundles/org.eclipse.equinox.event/.settings/org.eclipse.pde.ds.annotations.prefs new file mode 100644 index 00000000000..38f9eecff8e --- /dev/null +++ b/bundles/org.eclipse.equinox.event/.settings/org.eclipse.pde.ds.annotations.prefs @@ -0,0 +1,7 @@ +dsVersion=V1_3 +eclipse.preferences.version=1 +enabled=true +generateBundleActivationPolicyLazy=true +path=OSGI-INF +validationErrorLevel=error +validationErrorLevel.missingImplicitUnbindMethod=error diff --git a/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF index 9f43017424a..348f7a3288b 100644 --- a/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF @@ -13,7 +13,7 @@ Export-Package: org.eclipse.equinox.internal.event;x-internal:=true, Bundle-Vendor: %bundleVendor Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-17 -Service-Component: OSGI-INF/component.xml +Service-Component: OSGI-INF/org.eclipse.equinox.internal.event.EventComponent.xml Bundle-ActivationPolicy: lazy Provide-Capability: osgi.service; diff --git a/bundles/org.eclipse.equinox.event/OSGI-INF/component.xml b/bundles/org.eclipse.equinox.event/OSGI-INF/component.xml deleted file mode 100644 index 89812d4617c..00000000000 --- a/bundles/org.eclipse.equinox.event/OSGI-INF/component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bundles/org.eclipse.equinox.event/build.properties b/bundles/org.eclipse.equinox.event/build.properties index 10f84b53b76..c109c59603c 100644 --- a/bundles/org.eclipse.equinox.event/build.properties +++ b/bundles/org.eclipse.equinox.event/build.properties @@ -12,10 +12,9 @@ # IBM Corporation - initial API and implementation ############################################################################### bin.includes = META-INF/,\ - plugin*.properties,\ + plugin.properties,\ about.html,\ .,\ - OSGI-INF/component.xml,\ OSGI-INF/ output.. = bin/ src.includes = about.html diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventComponent.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventComponent.java index e7efe8d5908..88d7c2a3333 100644 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventComponent.java +++ b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventComponent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2018 IBM Corporation and others. + * Copyright (c) 2009, 2024 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -15,13 +15,16 @@ import org.eclipse.equinox.internal.event.mapper.EventRedeliverer; import org.osgi.framework.BundleContext; +import org.osgi.service.component.annotations.*; import org.osgi.service.event.Event; import org.osgi.service.event.EventAdmin; +@Component(service = EventAdmin.class) public class EventComponent implements EventAdmin { private EventRedeliverer eventRedeliverer; private EventAdminImpl eventAdmin; + @Activate void activate(BundleContext context) { eventAdmin = new EventAdminImpl(context); eventAdmin.start(); @@ -29,6 +32,7 @@ void activate(BundleContext context) { eventRedeliverer.open(); } + @Deactivate void deactivate(BundleContext context) { eventRedeliverer.close(); eventAdmin.stop();