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

Time to switch to jakarta namespace #16

Open
wants to merge 6 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
2 changes: 1 addition & 1 deletion .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: Java CI with Maven
on:
push:
branches: [ "master" ]
pull_request:
pull_request_target:
branches: [ "master" ]

jobs:
Expand Down
65 changes: 34 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,26 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<java.release>1.8</java.release>
<guice.version>4.2.3</guice.version>
<gwt.version>2.9.0</gwt.version>
<java.release>11</java.release>
<guice.version>7.0.0</guice.version>
<gwt.version>2.12.1</gwt.version>

<jsr330.version>1</jsr330.version> <!-- @Inject, @Singleton -->
<jsr330.version>2.0.1</jsr330.version> <!-- @Inject, @Singleton -->
<jsr305.version>3.0.2</jsr305.version> <!-- @Nullable -->
<jsr250.version>1.3.2</jsr250.version> <!-- @Generated, @PostConstruct -->
<jsr250.version>3.0.0</jsr250.version> <!-- @Generated, @PostConstruct -->
</properties>

<dependencies>
<!-- JSR-330 -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>${jsr330.version}</version>
<!-- with our internal javax.inject.Inject.gwt.xml module -->
<!-- with our internal jakarta.inject.Inject.gwt.xml module -->
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>${jsr330.version}</version>
<classifier>sources</classifier>
</dependency>
Expand All @@ -139,13 +139,13 @@

<!-- GWT -->
<dependency>
<groupId>com.google.gwt</groupId>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
Expand All @@ -159,8 +159,8 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${jsr250.version}</version>
<scope>provided</scope>
</dependency>
Expand All @@ -169,13 +169,13 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.1</version>
<version>5.5.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -211,7 +211,7 @@
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.1</version>
<version>3.6.0</version>
<executions>
<execution>
<id>validate</id>
Expand All @@ -231,21 +231,21 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.33</version>
<version>10.21.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.13.0</version>
<configuration>
<source>${java.release}</source>
<target>${java.release}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<version>3.3.1</version>
<executions>
<execution>
<id>client-sources</id>
Expand All @@ -268,7 +268,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<version>3.5.2</version>
<configuration>
<!-- test-rebind -->
<includes>
Expand All @@ -278,7 +278,7 @@
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.21.0</version>
<version>3.5.2</version>
<configuration>
<includes>
<include>com/google/gwt/inject/*TestSuite.java</include>
Expand All @@ -301,6 +301,7 @@
<goal>verify</goal>
</goals>
<configuration>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
<systemPropertyVariables>
<!-- Add -logLevel TRACE to get more debug output -->
<gwt.args>
Expand All @@ -319,6 +320,7 @@
<goal>verify</goal>
</goals>
<configuration>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
<systemPropertyVariables>
<!-- Add -logLevel TRACE to get more debug output -->
<gwt.args>
Expand All @@ -334,7 +336,7 @@
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<version>3.4.2</version>
<configuration>
<archive>
<manifest>
Expand All @@ -353,7 +355,7 @@
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<version>3.3.1</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -365,12 +367,12 @@
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7</version>
<version>3.21.0</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
<version>1.8</version>
<version>2.0.0</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -382,7 +384,7 @@
<plugins>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
<version>3.8.0</version>
</plugin>
</plugins>
</reporting>
Expand All @@ -395,7 +397,7 @@
<plugin>
<!-- TODO: Fix javadoc warnings -->
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<version>3.11.2</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -412,12 +414,13 @@
<detectJavaApiLink>true</detectJavaApiLink>
<quite>true</quite>
<doclint>none</doclint>
<source>8</source>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<version>3.1.1</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
<developmentVersion>HEAD-SNAPSHOT</developmentVersion>
Expand All @@ -427,7 +430,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -447,7 +450,7 @@
<plugins>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.0.1</version>
<version>3.9.0</version>
<configuration>
<streamLogs>true</streamLogs>
<localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
Expand Down
4 changes: 3 additions & 1 deletion src/config/gwt-checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ Description:
<module name="JavadocMethod">
<metadata name="com.atlassw.tools.eclipse.checkstyle.lastEnabledSeverity" value="info"/>
<property name="severity" value="info"/>
<property name="scope" value="protected"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="tokens" value="METHOD_DEF"/>
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="protected"/>
</module>
<module name="ImportOrder">
<property name="severity" value="error"/>
<property name="groups" value="org.gwtproject, com.google, cern, com, junit, net, org, java, javax"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.google.inject.Key;
import com.google.inject.TypeLiteral;

import javax.inject.Provider;
import jakarta.inject.Provider;

/**
* See the EDSL examples at {@link GinBinder}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public GinLinkedBindingBuilder<V> addBinding(K key) {
* @see #addBinding(Object)
*/
public GinLinkedBindingBuilder<V> addBinding(
Class<? extends javax.inject.Provider<? extends K>> keyProvider) {
Class<? extends jakarta.inject.Provider<? extends K>> keyProvider) {
return addBinding(TypeLiteral.get(keyProvider));
}

Expand All @@ -253,7 +253,7 @@ public GinLinkedBindingBuilder<V> addBinding(
* @see #addBinding(Object)
*/
public GinLinkedBindingBuilder<V> addBinding(
TypeLiteral<? extends javax.inject.Provider<? extends K>> keyProvider) {
TypeLiteral<? extends jakarta.inject.Provider<? extends K>> keyProvider) {
BindingRecorder recorder = createRecorder();
recorder.bind(keyType).toProvider(Key.get(keyProvider));
return recorder.bind(valueType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import java.util.List;
import java.util.Set;

import javax.inject.Provider;
import jakarta.inject.Provider;

/**
* Builds up the bindings and scopes for this {@code Ginjector}. This uses
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import java.util.Map;
import java.util.Set;

import javax.inject.Provider;
import jakarta.inject.Provider;

/**
* Stores information that describes the bindings present in a given injector,
Expand Down Expand Up @@ -380,7 +380,7 @@ public GinScope determineScope(Key<?> key) {
// the "real" binding every time we need the value.
scope = GinScope.NO_SCOPE;
} else if (raw.getAnnotation(Singleton.class) != null
|| raw.getAnnotation(javax.inject.Singleton.class) != null) {
|| raw.getAnnotation(jakarta.inject.Singleton.class) != null) {
// Look for scope annotation as a fallback
scope = GinScope.SINGLETON;
} else if (RemoteServiceProxyBinding.isRemoteServiceProxy(key.getTypeLiteral())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public String generate(TreeLogger logger, GeneratorContext context, String typeN
private ClassLoader createGinClassLoader(TreeLogger logger, GeneratorContext context) {
Set<String> exceptions = new LinkedHashSet<String>();
exceptions.add("com.google.inject"); // Need the non-super-source version during generation.
exceptions.add("javax.inject"); // Need the non-super-source version during generation.
exceptions.add("jakarta.inject"); // Need the non-super-source version during generation.
exceptions.add("com.google.gwt.inject.client"); // Excluded to allow class-literal comparison.

// Required by GWT 2.8.0+ to prevent loading of GWT script only java.lang.JsException class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import java.lang.annotation.Annotation;
import java.util.List;

import javax.inject.Provider;
import jakarta.inject.Provider;

/**
* Gathers information about Guice Bindings and adds the information to a {@link GinjectorBindings}.
Expand Down Expand Up @@ -136,15 +136,15 @@ public Void visitEagerSingleton() {
}

// TODO(schmitt): We don't support this right now in any case, but it's
// strange to be using the Guice Scope instead of javax.inject.Scope
// strange to be using the Guice Scope instead of jakarta.inject.Scope
public Void visitScope(Scope scope) {
messages.add(new Message(PrettyPrinter.format("Explicit scope unsupported: key=%s scope=%s",
targetKey, scope)));
return null;
}

public Void visitScopeAnnotation(Class<? extends Annotation> scopeAnnotation) {
if (scopeAnnotation == Singleton.class || scopeAnnotation == javax.inject.Singleton.class) {
if (scopeAnnotation == Singleton.class || scopeAnnotation == jakarta.inject.Singleton.class) {
bindingsCollection.putScope(targetKey, GinScope.SINGLETON);
} else {
messages.add(new Message(PrettyPrinter.format("Unsupported scope annotation: key=%s scope=%s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import java.lang.annotation.Annotation;

import javax.inject.Provider;
import jakarta.inject.Provider;

class AnnotatedBindingBuilderAdapter<T> implements GinAnnotatedBindingBuilder<T> {
private final AnnotatedBindingBuilder<T> annotatedBindingBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import java.lang.annotation.Annotation;

import javax.inject.Provider;
import jakarta.inject.Provider;

class LinkedBindingBuilderAdapter<T> implements GinLinkedBindingBuilder<T> {
private final LinkedBindingBuilder<T> linkedBindingBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.util.Collection;
import java.util.List;

import javax.inject.Provider;
import jakarta.inject.Provider;

/**
* A binding to call the requested {@link com.google.inject.Provider}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.lang.reflect.Constructor;
import java.util.Map;

import javax.inject.Provider;
import jakarta.inject.Provider;

/**
* Factory interface for creating bindings. The parameters to each method are the not guice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import java.lang.reflect.Constructor;
import java.util.Map;

import javax.inject.Provider;
import jakarta.inject.Provider;

/**
* Guice-based implementation of the binding factory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.lang.reflect.Member;
import java.lang.reflect.Modifier;

import javax.inject.Named;
import jakarta.inject.Named;

/**
* Generic member representation preserving the member's type parameters.
Expand Down
Loading