Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage OSGi-DS component-xml file generation of PDE-DS/Tycho #661

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bundles/org.eclipse.equinox.ds.tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/scr_test
OSGI-INF/org.eclipse.*.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
classpath=true
dsVersion=V1_3
eclipse.preferences.version=1
enabled=true
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.equinox.ds.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Bundle-Name: Declarative Services Tests
Bundle-Vendor: Eclipse.org - Equinox
Bundle-Category: test
Bundle-SymbolicName: org.eclipse.equinox.ds.tests
Bundle-Version: 1.7.100.qualifier
Bundle-Version: 1.7.200.qualifier
Bundle-Activator: org.eclipse.equinox.ds.tests.DSTestsActivator
Bundle-ActivationPolicy: lazy
Require-Bundle: org.junit
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions bundles/org.eclipse.equinox.ds.tests/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
61 changes: 61 additions & 0 deletions bundles/org.eclipse.equinox.ds.tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2024, 2024 Hannes Wellmann and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/org/documents/edl-v10.php

Contributors:
Hannes Wellmann - initial implementation
-->
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>parent</artifactId>
<version>4.34.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>org.eclipse.equinox.ds.tests</artifactId>
<version>1.7.200-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
<testClass>org.eclipse.equinox.ds.tests.AllTests</testClass>
</properties>
<build>
<testSourceDirectory>src</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<!-- The tycho-ds-plugin generates component-xml files into
target/classes/OSGI-INF, but when this Plugin is exected in a tycho-surefire
runtime, the bundle-root is this project's root directory and the
Service-Component-Runtime only searches for component-xml files only in
<bundle-root>/OSGI-INF and does not consider the classpath-->
<execution>
<id>copy-ds-component-xml</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<resources>
<resource>
<directory>${project.build.outputDirectory}/OSGI-INF</directory>
<include>*.xml</include>
</resource>
</resources>
<outputDirectory>${project.basedir}/OSGI-INF</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
1 change: 1 addition & 0 deletions bundles/org.eclipse.equinox.event/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/OSGI-INF/org.eclipse.*.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dsVersion=V1_3
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
path=OSGI-INF
validationErrorLevel=error
validationErrorLevel.missingImplicitUnbindMethod=error
4 changes: 2 additions & 2 deletions bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-Version: 1.7.100.qualifier
Bundle-Version: 1.7.200.qualifier
Bundle-SymbolicName: org.eclipse.equinox.event
Import-Package: org.eclipse.osgi.framework.eventmgr;version="1.1.0",
org.eclipse.osgi.util;version="1.1.0",
Expand All @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions bundles/org.eclipse.equinox.event/OSGI-INF/component.xml

This file was deleted.

3 changes: 1 addition & 2 deletions bundles/org.eclipse.equinox.event/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,20 +15,24 @@

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();
eventRedeliverer = new EventRedeliverer(context, eventAdmin);
eventRedeliverer.open();
}

@Deactivate
void deactivate(BundleContext context) {
eventRedeliverer.close();
eventAdmin.stop();
Expand Down
Loading