Skip to content

Commit

Permalink
Register ProjectFacadeAdapter using OSGI DS
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelistria committed Apr 4, 2022
1 parent 66f578e commit 6bf6c3a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 11 deletions.
5 changes: 5 additions & 0 deletions org.eclipse.m2e.core/.project
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
classpath=true
dsVersion=V1_3
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
path=OSGI-INF
validationErrorLevel=error
validationErrorLevel.missingImplicitUnbindMethod=error
2 changes: 2 additions & 0 deletions org.eclipse.m2e.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ Export-Package: org.eclipse.m2e.core,
MavenArtifact-GroupId: org.eclipse.m2e
MavenArtifact-ArtifactId: org.eclipse.m2e.core
Import-Package: javax.inject;version="1.0.0",
org.osgi.service.component.annotations;version="1.3.0",
org.slf4j;version="1.6.2"
Automatic-Module-Name: org.eclipse.m2e.core
Service-Component: OSGI-INF/org.eclipse.m2e.core.internal.project.registry.ProjectFacadeAdapterFactory.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.m2e.core.internal.project.registry.ProjectFacadeAdapterFactory">
<property name="adaptableClass" value="org.eclipse.core.resources.IResource"/>
<service>
<provide interface="org.eclipse.core.runtime.IAdapterFactory"/>
</service>
<implementation class="org.eclipse.m2e.core.internal.project.registry.ProjectFacadeAdapterFactory"/>
</scr:component>
3 changes: 2 additions & 1 deletion org.eclipse.m2e.core/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ bin.includes = plugin.xml,\
schema/,\
about.html,\
m2eclipse.gif,\
about_files/
about_files/,\
OSGI-INF/
jars.compile.order = .
output.. = bin/
source.. = src/,\
Expand Down
10 changes: 0 additions & 10 deletions org.eclipse.m2e.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,5 @@
class="org.eclipse.m2e.core.internal.project.WorkspaceTestsClassifierResolver">
</resolver>
</extension>
<extension
point="org.eclipse.core.runtime.adapters">
<factory
adaptableType="org.eclipse.core.resources.IResource"
class="org.eclipse.m2e.core.internal.project.registry.ProjectFacadeAdapterFactory">
<adapter
type="org.eclipse.m2e.core.project.IMavenProjectFacade">
</adapter>
</factory>
</extension>

</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
*******************************************************************************/
package org.eclipse.m2e.core.internal.project.registry;

import org.osgi.service.component.annotations.Component;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdapterFactory;

import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.project.IMavenProjectFacade;


@Component(service = IAdapterFactory.class, property = {
IAdapterFactory.SERVICE_PROPERTY_ADAPTABLE_CLASS + "=org.eclipse.core.resources.IResource"})
public class ProjectFacadeAdapterFactory implements IAdapterFactory {

private static final Class<?>[] ADAPTER_LIST = {IMavenProjectFacade.class};
Expand Down

0 comments on commit 6bf6c3a

Please sign in to comment.