Skip to content

Commit

Permalink
Remove support for Java 7.
Browse files Browse the repository at this point in the history
We're aiming to add proper nullable annotations to Dagger's runtime API types in the upcoming Dagger release. In order to do this we need to drop support for Java 7.

Given Java 7 itself was officially out of support after July 2022, dropping support for Java 7 in Dagger seem reasonable.

RELNOTES=Remove support for Java 7
PiperOrigin-RevId: 668525969
  • Loading branch information
bcorso authored and Dagger Team committed Aug 28, 2024
1 parent 5d61a6c commit c06a25f
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 857 deletions.
4 changes: 1 addition & 3 deletions build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ DOCLINT_HTML_AND_SYNTAX = ["-Xdoclint:html,syntax"]

DOCLINT_REFERENCES = ["-Xdoclint:reference"]

JAVA_RELEASE_MIN = [
"-source 7 -target 7",
]
JAVA_RELEASE_MIN = ["-source 8 -target 8"]

POM_VERSION = "${project.version}"
5 changes: 1 addition & 4 deletions javatests/dagger/internal/codegen/CompilerMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
// TODO(bcorso): Consider moving the java version into its own separate enum.
public enum CompilerMode {
DEFAULT_MODE,
DEFAULT_JAVA7_MODE("-source", "7", "-target", "7"),
FAST_INIT_MODE("-Adagger.fastInit=enabled"),
FAST_INIT_JAVA7_MODE("-Adagger.fastInit=enabled", "-source", "7", "-target", "7"),
;
FAST_INIT_MODE("-Adagger.fastInit=enabled");

/** Returns the compiler modes as a list of parameters for parameterized tests */
public static final ImmutableList<Object[]> TEST_PARAMETERS =
Expand Down
13 changes: 2 additions & 11 deletions javatests/dagger/internal/codegen/InaccessibleTypeBindsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.google.testing.compile.Compilation;
import com.google.testing.compile.JavaFileObjects;
import dagger.testing.golden.GoldenFileRule;
import java.util.Collection;
import javax.tools.JavaFileObject;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -34,16 +33,8 @@
@RunWith(Parameterized.class)
public class InaccessibleTypeBindsTest {
@Parameters(name = "{0}")
public static Collection<Object[]> parameters() {
return ImmutableList.copyOf(
new Object[][] {
{CompilerMode.DEFAULT_MODE},
{CompilerMode.DEFAULT_JAVA7_MODE},
{CompilerMode.FAST_INIT_MODE},
// FastInit with Java7 is the mode that motivated this test, but do the other
// modes anyway for completeness.
{CompilerMode.FAST_INIT_JAVA7_MODE}
});
public static ImmutableList<Object[]> parameters() {
return CompilerMode.TEST_PARAMETERS;
}

@Rule public GoldenFileRule goldenFileRule = new GoldenFileRule();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.google.testing.compile.Compilation;
import com.google.testing.compile.JavaFileObjects;
import dagger.testing.golden.GoldenFileRule;
import java.util.Collection;
import javax.tools.JavaFileObject;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -34,14 +33,8 @@
@RunWith(Parameterized.class)
public class OptionalBindingRequestFulfillmentTest {
@Parameters(name = "{0}")
public static Collection<Object[]> parameters() {
return ImmutableList.copyOf(
new Object[][] {
{CompilerMode.DEFAULT_MODE},
{CompilerMode.DEFAULT_JAVA7_MODE},
{CompilerMode.FAST_INIT_MODE},
{CompilerMode.FAST_INIT_JAVA7_MODE}
});
public static ImmutableList<Object[]> parameters() {
return CompilerMode.TEST_PARAMETERS;
}

@Rule public GoldenFileRule goldenFileRule = new GoldenFileRule();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit c06a25f

Please sign in to comment.