Skip to content

Commit

Permalink
Updated Guice to 7.0.0 (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
N1k145 authored Sep 28, 2023
1 parent 217822d commit dbfe315
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 14 deletions.
2 changes: 1 addition & 1 deletion plugins/org.eclipse.glsp.graph/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.emf.common;bundle-version="2.23.0",
com.google.gson;bundle-version="2.8.7",
org.eclipse.emf.ecore;bundle-version="2.25.0";visibility:=reexport,
com.google.guava;bundle-version="[30.1.0,31.0.0)";visibility:=reexport
com.google.guava;bundle-version="[30.1.0,33.0.0)";visibility:=reexport
Export-Package: org.eclipse.glsp.graph,
org.eclipse.glsp.graph,
org.eclipse.glsp.graph.builder,
Expand Down
2 changes: 1 addition & 1 deletion plugins/org.eclipse.glsp.layout/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.glsp.server;bundle-version="[1.0.0,2.0.0)",
org.eclipse.elk.core;bundle-version="0.8.1",
org.eclipse.elk.graph;bundle-version="0.8.1",
com.google.guava;bundle-version="[30.1.0,31.0.0]"
com.google.guava;bundle-version="[30.1.0,33.0.0)"
Export-Package: org.eclipse.glsp.layout
5 changes: 3 additions & 2 deletions plugins/org.eclipse.glsp.server/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Require-Bundle: org.eclipse.emf.ecore.change;bundle-version="2.14.0",
org.eclipse.lsp4j;bundle-version="0.11.0",
org.eclipse.lsp4j.jsonrpc;bundle-version="0.11.0",
org.apache.commons.cli;bundle-version="1.4.0";visibility:=reexport,
com.google.inject;bundle-version="[5.0.1,6.0.0)";visibility:=reexport,
com.google.inject;bundle-version="[5.0.1,8.0.0)";visibility:=reexport,
org.eclipse.glsp.graph;bundle-version="[1.0.0,2.0.0)";visibility:=reexport
Export-Package: org.eclipse.glsp.server.actions,
org.eclipse.glsp.server.di,
Expand Down Expand Up @@ -57,7 +57,8 @@ Export-Package: org.eclipse.glsp.server.actions,
org.eclipse.glsp.server.session,
org.eclipse.glsp.server.types,
org.eclipse.glsp.server.utils
Import-Package: javax.inject;version="1.0.0",
Import-Package: jakarta.inject;resolution:=optional,
javax.inject;version="1.0.0",
org.apache.logging.log4j;version="2.17.1",
org.apache.logging.log4j.core;version="2.17.1",
org.apache.logging.log4j.core.appender;version="2.17.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Provider;
import com.google.inject.internal.SingletonScope;

@SuppressWarnings("restriction")
public class DefaultDiagramGlobalScope implements DiagramGlobalScope {

private final Map<String, Map<Key<?>, Object>> diagramTypeStores = new ConcurrentHashMap<>();
Expand All @@ -39,14 +37,17 @@ public DefaultDiagramGlobalScope() {}

@Override
public <T> Provider<T> scope(final Key<T> key, final Provider<T> unscoped) {
return () -> {
Optional<String> diagramType = getDiagramType(unscoped);
if (diagramType.isEmpty()) {
throw new IllegalArgumentException(
"Could not complete scoping operation. Diagram type could not be derived."
+ " Injector needs to be create with a 'GLSPDiagramModule'!");
return new Provider<T>() {
@Override
public T get() {
Optional<String> diagramType = getDiagramType(unscoped);
if (diagramType.isEmpty()) {
throw new IllegalArgumentException(
"Could not complete scoping operation. Diagram type could not be derived."
+ " Injector needs to be create with a 'GLSPDiagramModule'!");
}
return getInstanceFromScope(diagramType.get(), key, unscoped);
}
return getInstanceFromScope(diagramType.get(), key, unscoped);
};
}

Expand All @@ -72,7 +73,7 @@ protected Optional<String> getDiagramType(final Provider<?> unscoped) {
}

/**
* Retrieve the injector from the provider. Looking at the implementation for {@link SingletonScope}
* Retrieve the injector from the provider. Looking at the implementation for SingletonScope
* we know that this provider will always be an instance of {@code ProviderToInternalFactoryAdapter}.
* From this we can retrieve the injector. However, {@code ProviderToInternalFactoryAdapter} is an internal class
* which means we have to use reflection here to access the injector.
Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@
<version>${project.version}</version>
</artifact>
</target>
<dependency-resolution>
<optionalDependencies>ignore</optionalDependencies>
</dependency-resolution>
</configuration>
</plugin>
</plugins>
Expand Down
80 changes: 80 additions & 0 deletions targetplatforms/r2023-09.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="2023-09 - Default" sequenceNumber="1695737932">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.emf.sdk.feature.group" version="2.35.0.v20230829-0934"/>
<unit id="org.eclipse.lsp4j" version="0.21.1.v20230829-0012"/>
<unit id="org.eclipse.lsp4j.websocket" version="0.21.1.v20230829-0012"/>
<unit id="org.apache.commons.cli" version="1.5.0"/>
<unit id="com.google.gson" version="2.10.1.v20230109-0753"/>
<unit id="com.google.inject" version="7.0.0"/>
<unit id="com.google.guava" version="32.1.2.jre"/>
<unit id="jakarta.inject.jakarta.inject-api" version="2.0.1"/>
<repository location="http://download.eclipse.org/releases/2023-09"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.junit" version="4.13.2.v20211018-1956"/>
<unit id="org.junit.jupiter.api" version="5.9.1.v20221103-2317"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20221123021534/repository/"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.elk.core" version="0.8.1"/>
<unit id="org.eclipse.elk.graph" version="0.8.1"/>
<unit id="org.eclipse.elk.graph.text" version="0.8.1"/>
<unit id="org.eclipse.elk.alg.layered" version="0.8.1"/>
<repository location="https://download.eclipse.org/elk/updates/releases/0.8.1/"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.jetty.websocket.javax.server" version="10.0.13"/>
<repository location="mvn:org.eclipse.jetty:jetty-p2:10.0.13:zip:p2site"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="javax.websocket" version="1.1.0.20180730"/>
<repository location="https://download.eclipse.org/gemini/updates/web/3.0.4"/>
</location>
<location includeDependencyDepth="infinite" includeDependencyScopes="compile,test" includeSource="false" missingManifest="generate" type="Maven" label="spifly">
<dependencies>
<dependency>
<groupId>org.apache.aries.spifly</groupId>
<artifactId>org.apache.aries.spifly.dynamic.bundle</artifactId>
<version>1.3.6</version>
<type>jar</type>
</dependency>
</dependencies>
</location>
<location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="false" missingManifest="generate" type="Maven" label="slf4j">
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.0</version>
<type>jar</type>
</dependency>
</dependencies>
</location>
<location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="false" missingManifest="generate" type="Maven" label="log4j">
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.19.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.19.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.19.0</version>
<type>jar</type>
</dependency>
</dependencies>
</location>
</locations>
</target>
34 changes: 34 additions & 0 deletions targetplatforms/r2023-09.tpd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

target "2023-09 - Default" with source requirements
include "maven-dependencies.tpd"

location "http://download.eclipse.org/releases/2023-09" {
org.eclipse.emf.sdk.feature.group
org.eclipse.lsp4j [0.19.0,1.0.0)
org.eclipse.lsp4j.websocket [0.19.0,1.0.0)
org.apache.commons.cli [1.4.0,2.0.0)
com.google.gson[2.8.7,3.0.0)
com.google.inject [7.0.0,8.0.0)
com.google.guava [32.0.0,33.0.0)
jakarta.inject.jakarta.inject-api [2.0.1,3.0.0)
}

location "https://download.eclipse.org/tools/orbit/downloads/drops/R20221123021534/repository/" {
org.junit [4.13.2,5.0.0)
org.junit.jupiter.api [5.8.1,6.0.0)
}

location "https://download.eclipse.org/elk/updates/releases/0.8.1/" {
org.eclipse.elk.core
org.eclipse.elk.graph
org.eclipse.elk.graph.text
org.eclipse.elk.alg.layered
}

location "mvn:org.eclipse.jetty:jetty-p2:10.0.13:zip:p2site" {
org.eclipse.jetty.websocket.javax.server
}

location "https://download.eclipse.org/gemini/updates/web/3.0.4" {
javax.websocket
}

0 comments on commit dbfe315

Please sign in to comment.