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

feat: Use com.google.inject over javax.inject to allow migrate to guice7+ #2884

Closed

Conversation

Nava2
Copy link
Contributor

@Nava2 Nava2 commented Jul 24, 2023

Proposal: #2863

This replaces usages to enable migration to Guice 7+. This is the first (only?) step to allow projects using Guice 6.0.0 or Guice 7.0.0 to use misk-inject.

By using com.google.inject instead of javax.inject, injections work in both 6+ and 7+ versions. The new project, :misk-inject-guice7-test sets up a test project with the classpath forced to Guice 7+. This acts as a guard project for basic usages. As needed, we can add more content.

Nava2 added 4 commits July 24, 2023 16:02
…ing to Guice 7

This replaces usages to enable migration to [Guice 7+](https://github.com/google/guice/wiki/Guice700). This is the first (only?) step to allow projects using Guice 6.0.0 *or* Guice 7.0.0 to use `misk-inject`.

By using `com.google.inject` instead of `javax.inject`, injections work in both 6+ and 7+ versions. The new project, `:misk-inject-guice7-test` sets up a test project with the classpath forced to Guice 7+. This acts as a guard project for basic usages. As needed, we can add more content.
@Nava2 Nava2 marked this pull request as ready for review July 24, 2023 20:18
@@ -0,0 +1,5 @@
## misk-inject-guice7-test
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files are the only not-renaming-import changes

@@ -0,0 +1,23 @@

plugins {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files are the only not-renaming-import changes

import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test

internal class Guice7IntegrationTest {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files are the only not-renaming-import changes

import org.assertj.core.api.Assertions.assertThat

@Singleton
internal class Guice7TestClass @Inject constructor(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files are the only not-renaming-import changes

@@ -0,0 +1,5 @@
package misk.inject.guice7

internal interface Guice7TestInterface {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files are the only not-renaming-import changes

@Nava2 Nava2 changed the title [Guice 7] Use com.google.inject over javax.inject to allow migrat… feat: Use com.google.inject over javax.inject to allow migrate to guice7+ Jul 24, 2023
@Nava2 Nava2 closed this Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant