Skip to content

Commit

Permalink
Generate all OSGi Declarative Services component files by PDE-DS/Tycho
Browse files Browse the repository at this point in the history
Remove the now generated OSGi Declarative Services component-xml files
from git.

Resolve wildcards in Service-Component header.
  • Loading branch information
HannesWell committed Oct 1, 2024
1 parent b95d0ec commit e0b08f6
Show file tree
Hide file tree
Showing 39 changed files with 105 additions and 198 deletions.
1 change: 1 addition & 0 deletions debug/org.eclipse.debug.ui.launchview/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/OSGI-INF/org.eclipse.*.xml

This file was deleted.

This file was deleted.

3 changes: 2 additions & 1 deletion resources/bundles/org.eclipse.core.resources/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
temp.folder
bin_ant
ant_tasks
ant_tasks
/OSGI-INF/org.eclipse.*.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
classpath=true
dsVersion=V1_3
dsVersion=V1_4
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Require-Bundle: org.eclipse.ant.core;bundle-version="[3.1.0,4.0.0)";resolution:=
org.eclipse.core.filesystem;bundle-version="[1.10.0,2.0.0)",
org.eclipse.core.runtime;bundle-version="[3.31.0,4.0.0)"
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/ResourceChangeListenerRegistrar.xml,
OSGI-INF/org.eclipse.core.internal.resources.CheckMissingNaturesListener.xml
Service-Component: OSGI-INF/org.eclipse.core.internal.resources.CheckMissingNaturesListener.xml,
OSGI-INF/org.eclipse.core.internal.resources.ResourceChangeListenerRegistrar.xml
Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: org.eclipse.core.resources
Import-Package: com.sun.jna;version="[5.14.0,6.0.0)",
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.osgi.service.debug.DebugOptionsListener;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
import org.osgi.service.log.Logger;
import org.osgi.service.log.LoggerFactory;

Expand All @@ -30,6 +35,7 @@
* that (for example) {@link DebugOptionsListener} is used to receive callbacks.
* </p>
*/
@Component
public final class ResourceChangeListenerRegistrar {

private final IWorkspace workspace;
Expand All @@ -40,7 +46,8 @@ public final class ResourceChangeListenerRegistrar {
*
* @param workspace the workspace to associate listeners with
*/
public ResourceChangeListenerRegistrar(IWorkspace workspace) {
@Activate
public ResourceChangeListenerRegistrar(@Reference IWorkspace workspace) {
this.workspace = workspace;
}

Expand All @@ -52,6 +59,7 @@ public ResourceChangeListenerRegistrar(IWorkspace workspace) {
* required
* {@link IWorkspace#addResourceChangeListener(IResourceChangeListener, int)}
*/
@Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.AT_LEAST_ONE)
public void addResourceChangeListener(IResourceChangeListener listener, Map<String, Object> properties) {
// TODO Add as public API https://bugs.eclipse.org/bugs/show_bug.cgi?id=564985
Object mask = properties.get(IResourceChangeListener.PROPERTY_EVENT_MASK);
Expand Down Expand Up @@ -81,14 +89,15 @@ public void removeResourceChangeListener(IResourceChangeListener listener) {
*
* @param factory the factory
*/
@Reference(unbind = "unsetLogger", policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.OPTIONAL)
public void setLoggerFactory(LoggerFactory factory) {
this.logger = factory.getLogger(ResourceChangeListenerRegistrar.class);
}

/**
* Unsets the logger generated from the associated logger factory
*/
public void unsetLogger() {
public void unsetLogger(LoggerFactory factory) {
this.logger = null;
}
}
1 change: 1 addition & 0 deletions runtime/bundles/org.eclipse.core.contenttype/.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_4
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
path=OSGI-INF
validationErrorLevel=error
validationErrorLevel.missingImplicitUnbindMethod=error
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Import-Package: javax.xml.parsers,
org.xml.sax.helpers
Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: org.eclipse.core.contenttype
Service-Component: OSGI-INF/contenttypemanager.xml
Service-Component: OSGI-INF/org.eclipse.core.internal.content.ContentTypeManager.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ bin.includes = META-INF/,\
.options,\
plugin.properties,\
about.html,\
OSGI-INF/contenttypemanager.xml,\
OSGI-INF/
src.includes = about.html,\
schema/
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,38 @@

import java.io.InputStream;
import java.io.Reader;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.content.*;
import org.eclipse.core.runtime.preferences.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IRegistryChangeEvent;
import org.eclipse.core.runtime.IRegistryChangeListener;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.InvalidRegistryObjectException;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.ServiceCaller;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.core.runtime.content.IContentTypeMatcher;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.osgi.service.debug.DebugOptions;
import org.eclipse.osgi.util.NLS;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
import org.osgi.service.prefs.BackingStoreException;

@Component(service = IContentTypeManager.class, immediate = true)
public class ContentTypeManager extends ContentTypeMatcher implements IContentTypeManager {
private static class ContentTypeRegistryChangeListener implements IRegistryChangeListener {
@Override
Expand Down Expand Up @@ -74,7 +97,7 @@ static class DebuggingHolder {
*/
protected final ListenerList<IContentTypeChangeListener> contentTypeListeners = new ListenerList<>();


@Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC)
public void addRegistryChangeListener(IExtensionRegistry registry) {
if (registry == null)
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/OSGI-INF/org.eclipse.*.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions runtime/bundles/org.eclipse.e4.core.services/.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_4
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
path=OSGI-INF
validationErrorLevel=error
validationErrorLevel.missingImplicitUnbindMethod=error
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ Export-Package: org.eclipse.e4.core.internal.services;x-friends:="org.eclipse.e4
org.eclipse.e4.core.services.statusreporter;x-friends:="org.eclipse.e4.ui.workbench.swt,org.eclipse.e4.ui.progress,org.eclipse.ui.ide",
org.eclipse.e4.core.services.translation
Eclipse-ExtensibleAPI: true
Service-Component: OSGI-INF/*.xml
Service-Component: OSGI-INF/org.eclipse.e4.core.internal.services.DefaultResourceBundleProvider.xml,
OSGI-INF/org.eclipse.e4.core.internal.services.MessageFactoryServiceImpl.xml,
OSGI-INF/org.eclipse.e4.core.internal.services.TranslationObjectSupplier.xml,
OSGI-INF/org.eclipse.e4.core.internal.services.about.InstalledBundles.xml,
OSGI-INF/org.eclipse.e4.core.internal.services.about.InstalledFeatures.xml,
OSGI-INF/org.eclipse.e4.core.internal.services.about.SystemEnvironment.xml,
OSGI-INF/org.eclipse.e4.core.internal.services.about.SystemProperties.xml,
OSGI-INF/org.eclipse.e4.core.internal.services.about.UserPreferences.xml
Require-Capability: osgi.extender;
filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"
Automatic-Module-Name: org.eclipse.e4.core.services

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.

This file was deleted.

Loading

0 comments on commit e0b08f6

Please sign in to comment.