From 74dcec5800490784a2dda1168d162151736122f3 Mon Sep 17 00:00:00 2001 From: Brad Corso Date: Tue, 27 Aug 2024 19:10:24 -0700 Subject: [PATCH] Remove support for Java 7. 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: 668231703 --- build_defs.bzl | 2 +- .../dagger/internal/codegen/CompilerMode.java | 5 +- .../codegen/InaccessibleTypeBindsTest.java | 4 - ...OptionalBindingRequestFulfillmentTest.java | 2 - ...EFAULT_JAVA7_MODE_test.DaggerTestComponent | 76 ------------- ...T_INIT_JAVA7_MODE_test.DaggerTestComponent | 98 ---------------- ...EFAULT_JAVA7_MODE_test.DaggerTestComponent | 72 ------------ ...T_INIT_JAVA7_MODE_test.DaggerTestComponent | 94 ---------------- ...EFAULT_JAVA7_MODE_test.DaggerTestComponent | 64 ----------- ...T_INIT_JAVA7_MODE_test.DaggerTestComponent | 90 --------------- ...EFAULT_JAVA7_MODE_test.DaggerTestComponent | 76 ------------- ...T_INIT_JAVA7_MODE_test.DaggerTestComponent | 106 ------------------ ...EFAULT_JAVA7_MODE_test.DaggerTestComponent | 72 ------------ ...T_INIT_JAVA7_MODE_test.DaggerTestComponent | 72 ------------ util/validate-artifacts.sh | 19 ++-- 15 files changed, 11 insertions(+), 841 deletions(-) delete mode 100644 javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoopScoped_DEFAULT_JAVA7_MODE_test.DaggerTestComponent delete mode 100644 javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoopScoped_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent delete mode 100644 javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoop_DEFAULT_JAVA7_MODE_test.DaggerTestComponent delete mode 100644 javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoop_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent delete mode 100644 javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_scopedInaccessibleTypeBound_DEFAULT_JAVA7_MODE_test.DaggerTestComponent delete mode 100644 javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_scopedInaccessibleTypeBound_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent delete mode 100644 javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_inlinedOptionalBindings_DEFAULT_JAVA7_MODE_test.DaggerTestComponent delete mode 100644 javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_inlinedOptionalBindings_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent delete mode 100644 javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_requestForFuture_DEFAULT_JAVA7_MODE_test.DaggerTestComponent delete mode 100644 javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_requestForFuture_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent diff --git a/build_defs.bzl b/build_defs.bzl index 70afaf0bfb1..6c2aa65b7da 100644 --- a/build_defs.bzl +++ b/build_defs.bzl @@ -19,7 +19,7 @@ DOCLINT_HTML_AND_SYNTAX = ["-Xdoclint:html,syntax"] DOCLINT_REFERENCES = ["-Xdoclint:reference"] JAVA_RELEASE_MIN = [ - "-source 7 -target 7", + "-source 8 -target 8", ] POM_VERSION = "${project.version}" diff --git a/javatests/dagger/internal/codegen/CompilerMode.java b/javatests/dagger/internal/codegen/CompilerMode.java index 7f167d7c055..57a9455bc22 100644 --- a/javatests/dagger/internal/codegen/CompilerMode.java +++ b/javatests/dagger/internal/codegen/CompilerMode.java @@ -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 TEST_PARAMETERS = diff --git a/javatests/dagger/internal/codegen/InaccessibleTypeBindsTest.java b/javatests/dagger/internal/codegen/InaccessibleTypeBindsTest.java index f4eda9c4ad1..72d16cd64b0 100644 --- a/javatests/dagger/internal/codegen/InaccessibleTypeBindsTest.java +++ b/javatests/dagger/internal/codegen/InaccessibleTypeBindsTest.java @@ -38,11 +38,7 @@ public static Collection 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} }); } diff --git a/javatests/dagger/internal/codegen/OptionalBindingRequestFulfillmentTest.java b/javatests/dagger/internal/codegen/OptionalBindingRequestFulfillmentTest.java index 188f4d67edd..53cb6773a3a 100644 --- a/javatests/dagger/internal/codegen/OptionalBindingRequestFulfillmentTest.java +++ b/javatests/dagger/internal/codegen/OptionalBindingRequestFulfillmentTest.java @@ -38,9 +38,7 @@ public static Collection parameters() { return ImmutableList.copyOf( new Object[][] { {CompilerMode.DEFAULT_MODE}, - {CompilerMode.DEFAULT_JAVA7_MODE}, {CompilerMode.FAST_INIT_MODE}, - {CompilerMode.FAST_INIT_JAVA7_MODE} }); } diff --git a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoopScoped_DEFAULT_JAVA7_MODE_test.DaggerTestComponent b/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoopScoped_DEFAULT_JAVA7_MODE_test.DaggerTestComponent deleted file mode 100644 index e9670026328..00000000000 --- a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoopScoped_DEFAULT_JAVA7_MODE_test.DaggerTestComponent +++ /dev/null @@ -1,76 +0,0 @@ -package test; - -import dagger.internal.DaggerGenerated; -import dagger.internal.DelegateFactory; -import dagger.internal.DoubleCheck; -import dagger.internal.Provider; -import javax.annotation.Generated; -import other.FooImpl_Factory; -import other.OtherEntryPoint; -import other.OtherEntryPoint_Factory; - -@DaggerGenerated -@Generated( - value = "dagger.internal.codegen.ComponentProcessor", - comments = "https://dagger.dev" -) -@SuppressWarnings({ - "unchecked", - "rawtypes", - "KotlinInternal", - "KotlinInternalInJava", - "cast", - "deprecation" -}) -final class DaggerTestComponent { - private DaggerTestComponent() { - } - - public static Builder builder() { - return new Builder(); - } - - public static TestComponent create() { - return new Builder().build(); - } - - static final class Builder { - private Builder() { - } - - public TestComponent build() { - return new TestComponentImpl(); - } - } - - private static final class TestComponentImpl implements TestComponent { - private final TestComponentImpl testComponentImpl = this; - - private Provider bindProvider; - - @SuppressWarnings("rawtypes") - private Provider fooImplProvider; - - private TestComponentImpl() { - - initialize(); - - } - - private Object fooImpl() { - return FooImpl_Factory.newInstance(bindProvider); - } - - @SuppressWarnings("unchecked") - private void initialize() { - this.bindProvider = new DelegateFactory<>(); - this.fooImplProvider = FooImpl_Factory.create(bindProvider); - DelegateFactory.setDelegate(bindProvider, DoubleCheck.provider((Provider) fooImplProvider)); - } - - @Override - public OtherEntryPoint getOtherEntryPoint() { - return OtherEntryPoint_Factory.newInstance(fooImpl()); - } - } -} diff --git a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoopScoped_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent b/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoopScoped_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent deleted file mode 100644 index df4d0583bd5..00000000000 --- a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoopScoped_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent +++ /dev/null @@ -1,98 +0,0 @@ -package test; - -import dagger.internal.DaggerGenerated; -import dagger.internal.DelegateFactory; -import dagger.internal.DoubleCheck; -import dagger.internal.Provider; -import javax.annotation.Generated; -import other.FooImpl_Factory; -import other.OtherEntryPoint; -import other.OtherEntryPoint_Factory; - -@DaggerGenerated -@Generated( - value = "dagger.internal.codegen.ComponentProcessor", - comments = "https://dagger.dev" -) -@SuppressWarnings({ - "unchecked", - "rawtypes", - "KotlinInternal", - "KotlinInternalInJava", - "cast", - "deprecation" -}) -final class DaggerTestComponent { - private DaggerTestComponent() { - } - - public static Builder builder() { - return new Builder(); - } - - public static TestComponent create() { - return new Builder().build(); - } - - static final class Builder { - private Builder() { - } - - public TestComponent build() { - return new TestComponentImpl(); - } - } - - private static final class TestComponentImpl implements TestComponent { - private final TestComponentImpl testComponentImpl = this; - - private Provider bindProvider; - - @SuppressWarnings("rawtypes") - private Provider fooImplProvider; - - private TestComponentImpl() { - - initialize(); - - } - - private Object fooImpl() { - return FooImpl_Factory.newInstance(bindProvider); - } - - @SuppressWarnings("unchecked") - private void initialize() { - this.bindProvider = new DelegateFactory<>(); - this.fooImplProvider = new SwitchingProvider(testComponentImpl, 0); - DelegateFactory.setDelegate(bindProvider, DoubleCheck.provider((Provider) fooImplProvider)); - } - - @Override - public OtherEntryPoint getOtherEntryPoint() { - return OtherEntryPoint_Factory.newInstance(fooImpl()); - } - - private static final class SwitchingProvider implements Provider { - private final TestComponentImpl testComponentImpl; - - private final int id; - - SwitchingProvider(TestComponentImpl testComponentImpl, int id) { - this.testComponentImpl = testComponentImpl; - this.id = id; - } - - @SuppressWarnings("unchecked") - @Override - public T get() { - switch (id) { - case 0: // other.FooImpl - return (T) FooImpl_Factory.newInstance(testComponentImpl.bindProvider); - - default: throw new AssertionError(id); - } - } - } - } -} diff --git a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoop_DEFAULT_JAVA7_MODE_test.DaggerTestComponent b/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoop_DEFAULT_JAVA7_MODE_test.DaggerTestComponent deleted file mode 100644 index 98375e615ff..00000000000 --- a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoop_DEFAULT_JAVA7_MODE_test.DaggerTestComponent +++ /dev/null @@ -1,72 +0,0 @@ -package test; - -import dagger.internal.DaggerGenerated; -import dagger.internal.DelegateFactory; -import dagger.internal.Provider; -import javax.annotation.Generated; -import other.FooImpl_Factory; -import other.OtherEntryPoint; -import other.OtherEntryPoint_Factory; - -@DaggerGenerated -@Generated( - value = "dagger.internal.codegen.ComponentProcessor", - comments = "https://dagger.dev" -) -@SuppressWarnings({ - "unchecked", - "rawtypes", - "KotlinInternal", - "KotlinInternalInJava", - "cast", - "deprecation" -}) -final class DaggerTestComponent { - private DaggerTestComponent() { - } - - public static Builder builder() { - return new Builder(); - } - - public static TestComponent create() { - return new Builder().build(); - } - - static final class Builder { - private Builder() { - } - - public TestComponent build() { - return new TestComponentImpl(); - } - } - - private static final class TestComponentImpl implements TestComponent { - private final TestComponentImpl testComponentImpl = this; - - @SuppressWarnings("rawtypes") - private Provider fooImplProvider; - - private TestComponentImpl() { - - initialize(); - - } - - private Object fooImpl() { - return FooImpl_Factory.newInstance(fooImplProvider); - } - - @SuppressWarnings("unchecked") - private void initialize() { - this.fooImplProvider = new DelegateFactory<>(); - DelegateFactory.setDelegate(fooImplProvider, FooImpl_Factory.create(fooImplProvider)); - } - - @Override - public OtherEntryPoint getOtherEntryPoint() { - return OtherEntryPoint_Factory.newInstance(fooImpl()); - } - } -} diff --git a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoop_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent b/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoop_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent deleted file mode 100644 index 31c32247e44..00000000000 --- a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_inaccessibleTypeBoundInALoop_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent +++ /dev/null @@ -1,94 +0,0 @@ -package test; - -import dagger.internal.DaggerGenerated; -import dagger.internal.DelegateFactory; -import dagger.internal.Provider; -import javax.annotation.Generated; -import other.FooImpl_Factory; -import other.OtherEntryPoint; -import other.OtherEntryPoint_Factory; - -@DaggerGenerated -@Generated( - value = "dagger.internal.codegen.ComponentProcessor", - comments = "https://dagger.dev" -) -@SuppressWarnings({ - "unchecked", - "rawtypes", - "KotlinInternal", - "KotlinInternalInJava", - "cast", - "deprecation" -}) -final class DaggerTestComponent { - private DaggerTestComponent() { - } - - public static Builder builder() { - return new Builder(); - } - - public static TestComponent create() { - return new Builder().build(); - } - - static final class Builder { - private Builder() { - } - - public TestComponent build() { - return new TestComponentImpl(); - } - } - - private static final class TestComponentImpl implements TestComponent { - private final TestComponentImpl testComponentImpl = this; - - @SuppressWarnings("rawtypes") - private Provider fooImplProvider; - - private TestComponentImpl() { - - initialize(); - - } - - private Object fooImpl() { - return FooImpl_Factory.newInstance(fooImplProvider); - } - - @SuppressWarnings("unchecked") - private void initialize() { - this.fooImplProvider = new DelegateFactory<>(); - DelegateFactory.setDelegate(fooImplProvider, new SwitchingProvider(testComponentImpl, 0)); - } - - @Override - public OtherEntryPoint getOtherEntryPoint() { - return OtherEntryPoint_Factory.newInstance(fooImpl()); - } - - private static final class SwitchingProvider implements Provider { - private final TestComponentImpl testComponentImpl; - - private final int id; - - SwitchingProvider(TestComponentImpl testComponentImpl, int id) { - this.testComponentImpl = testComponentImpl; - this.id = id; - } - - @SuppressWarnings("unchecked") - @Override - public T get() { - switch (id) { - case 0: // other.FooImpl - return (T) FooImpl_Factory.newInstance(testComponentImpl.fooImplProvider); - - default: throw new AssertionError(id); - } - } - } - } -} diff --git a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_scopedInaccessibleTypeBound_DEFAULT_JAVA7_MODE_test.DaggerTestComponent b/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_scopedInaccessibleTypeBound_DEFAULT_JAVA7_MODE_test.DaggerTestComponent deleted file mode 100644 index 4ed7a2588fe..00000000000 --- a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_scopedInaccessibleTypeBound_DEFAULT_JAVA7_MODE_test.DaggerTestComponent +++ /dev/null @@ -1,64 +0,0 @@ -package test; - -import dagger.internal.DaggerGenerated; -import dagger.internal.DoubleCheck; -import dagger.internal.Provider; -import javax.annotation.Generated; -import other.FooImpl_Factory; - -@DaggerGenerated -@Generated( - value = "dagger.internal.codegen.ComponentProcessor", - comments = "https://dagger.dev" -) -@SuppressWarnings({ - "unchecked", - "rawtypes", - "KotlinInternal", - "KotlinInternalInJava", - "cast", - "deprecation" -}) -final class DaggerTestComponent { - private DaggerTestComponent() { - } - - public static Builder builder() { - return new Builder(); - } - - public static TestComponent create() { - return new Builder().build(); - } - - static final class Builder { - private Builder() { - } - - public TestComponent build() { - return new TestComponentImpl(); - } - } - - private static final class TestComponentImpl implements TestComponent { - private final TestComponentImpl testComponentImpl = this; - - private Provider bindProvider; - - private TestComponentImpl() { - - initialize(); - - } - - @SuppressWarnings("unchecked") - private void initialize() { - this.bindProvider = DoubleCheck.provider((Provider) FooImpl_Factory.create()); - } - - @Override - public Foo getFoo() { - return bindProvider.get(); - } - } -} diff --git a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_scopedInaccessibleTypeBound_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent b/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_scopedInaccessibleTypeBound_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent deleted file mode 100644 index 2377f549c53..00000000000 --- a/javatests/dagger/internal/codegen/goldens/InaccessibleTypeBindsTest_scopedInaccessibleTypeBound_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent +++ /dev/null @@ -1,90 +0,0 @@ -package test; - -import dagger.internal.DaggerGenerated; -import dagger.internal.DoubleCheck; -import dagger.internal.Provider; -import javax.annotation.Generated; -import other.FooImpl_Factory; - -@DaggerGenerated -@Generated( - value = "dagger.internal.codegen.ComponentProcessor", - comments = "https://dagger.dev" -) -@SuppressWarnings({ - "unchecked", - "rawtypes", - "KotlinInternal", - "KotlinInternalInJava", - "cast", - "deprecation" -}) -final class DaggerTestComponent { - private DaggerTestComponent() { - } - - public static Builder builder() { - return new Builder(); - } - - public static TestComponent create() { - return new Builder().build(); - } - - static final class Builder { - private Builder() { - } - - public TestComponent build() { - return new TestComponentImpl(); - } - } - - private static final class TestComponentImpl implements TestComponent { - private final TestComponentImpl testComponentImpl = this; - - @SuppressWarnings("rawtypes") - private Provider fooImplProvider; - - private Provider bindProvider; - - private TestComponentImpl() { - - initialize(); - - } - - @SuppressWarnings("unchecked") - private void initialize() { - this.fooImplProvider = new SwitchingProvider(testComponentImpl, 0); - this.bindProvider = DoubleCheck.provider((Provider) fooImplProvider); - } - - @Override - public Foo getFoo() { - return bindProvider.get(); - } - - private static final class SwitchingProvider implements Provider { - private final TestComponentImpl testComponentImpl; - - private final int id; - - SwitchingProvider(TestComponentImpl testComponentImpl, int id) { - this.testComponentImpl = testComponentImpl; - this.id = id; - } - - @SuppressWarnings("unchecked") - @Override - public T get() { - switch (id) { - case 0: // other.FooImpl - return (T) FooImpl_Factory.newInstance(); - - default: throw new AssertionError(id); - } - } - } - } -} diff --git a/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_inlinedOptionalBindings_DEFAULT_JAVA7_MODE_test.DaggerTestComponent b/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_inlinedOptionalBindings_DEFAULT_JAVA7_MODE_test.DaggerTestComponent deleted file mode 100644 index 86824b7cefb..00000000000 --- a/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_inlinedOptionalBindings_DEFAULT_JAVA7_MODE_test.DaggerTestComponent +++ /dev/null @@ -1,76 +0,0 @@ -package test; - -import com.google.common.base.Optional; -import dagger.Lazy; -import dagger.internal.DaggerGenerated; -import dagger.internal.ProviderOfLazy; -import javax.annotation.Generated; -import javax.inject.Provider; -import other.DefinitelyNot; -import other.Maybe; -import other.Maybe_MaybeModule_ProvideMaybeFactory; - -@DaggerGenerated -@Generated( - value = "dagger.internal.codegen.ComponentProcessor", - comments = "https://dagger.dev" -) -@SuppressWarnings({ - "unchecked", - "rawtypes", - "KotlinInternal", - "KotlinInternalInJava", - "cast", - "deprecation" -}) -final class DaggerTestComponent { - private DaggerTestComponent() { - } - - public static Builder builder() { - return new Builder(); - } - - public static TestComponent create() { - return new Builder().build(); - } - - static final class Builder { - private Builder() { - } - - public TestComponent build() { - return new TestComponentImpl(); - } - } - - private static final class TestComponentImpl implements TestComponent { - private final TestComponentImpl testComponentImpl = this; - - private TestComponentImpl() { - - - } - - @Override - public Optional maybe() { - return Optional.of(Maybe_MaybeModule_ProvideMaybeFactory.provideMaybe()); - } - - @Override - public Optional>> providerOfLazyOfMaybe() { - return (Optional) Optional.of(ProviderOfLazy.create(Maybe_MaybeModule_ProvideMaybeFactory.create())); - } - - @Override - public Optional definitelyNot() { - return Optional.absent(); - } - - @Override - public Optional>> providerOfLazyOfDefinitelyNot() { - return (Optional) Optional.>>absent(); - } - } -} - diff --git a/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_inlinedOptionalBindings_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent b/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_inlinedOptionalBindings_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent deleted file mode 100644 index 289044aa0e0..00000000000 --- a/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_inlinedOptionalBindings_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent +++ /dev/null @@ -1,106 +0,0 @@ -package test; - -import com.google.common.base.Optional; -import dagger.Lazy; -import dagger.internal.DaggerGenerated; -import dagger.internal.Provider; -import dagger.internal.ProviderOfLazy; -import javax.annotation.Generated; -import other.DefinitelyNot; -import other.Maybe; -import other.Maybe_MaybeModule_ProvideMaybeFactory; - -@DaggerGenerated -@Generated( - value = "dagger.internal.codegen.ComponentProcessor", - comments = "https://dagger.dev" -) -@SuppressWarnings({ - "unchecked", - "rawtypes", - "KotlinInternal", - "KotlinInternalInJava", - "cast", - "deprecation" -}) -final class DaggerTestComponent { - private DaggerTestComponent() { - } - - public static Builder builder() { - return new Builder(); - } - - public static TestComponent create() { - return new Builder().build(); - } - - static final class Builder { - private Builder() { - } - - public TestComponent build() { - return new TestComponentImpl(); - } - } - - private static final class TestComponentImpl implements TestComponent { - private final TestComponentImpl testComponentImpl = this; - - private Provider provideMaybeProvider; - - private TestComponentImpl() { - - initialize(); - - } - - @SuppressWarnings("unchecked") - private void initialize() { - this.provideMaybeProvider = new SwitchingProvider(testComponentImpl, 0); - } - - @Override - public Optional maybe() { - return Optional.of(provideMaybeProvider.get()); - } - - @Override - public Optional>> providerOfLazyOfMaybe() { - return (Optional) Optional.of(ProviderOfLazy.create(provideMaybeProvider)); - } - - @Override - public Optional definitelyNot() { - return Optional.absent(); - } - - @Override - public Optional>> providerOfLazyOfDefinitelyNot() { - return (Optional) Optional.>>absent(); - } - - private static final class SwitchingProvider implements Provider { - private final TestComponentImpl testComponentImpl; - - private final int id; - - SwitchingProvider(TestComponentImpl testComponentImpl, int id) { - this.testComponentImpl = testComponentImpl; - this.id = id; - } - - @SuppressWarnings("unchecked") - @Override - public T get() { - switch (id) { - case 0: // other.Maybe - return (T) Maybe_MaybeModule_ProvideMaybeFactory.provideMaybe(); - - default: throw new AssertionError(id); - } - } - } - } -} - diff --git a/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_requestForFuture_DEFAULT_JAVA7_MODE_test.DaggerTestComponent b/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_requestForFuture_DEFAULT_JAVA7_MODE_test.DaggerTestComponent deleted file mode 100644 index 6f2a7e84503..00000000000 --- a/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_requestForFuture_DEFAULT_JAVA7_MODE_test.DaggerTestComponent +++ /dev/null @@ -1,72 +0,0 @@ -package test; - -import com.google.common.base.Optional; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import dagger.internal.DaggerGenerated; -import dagger.producers.internal.CancellationListener; -import javax.annotation.Generated; -import other.DefinitelyNot; -import other.Maybe; -import other.Maybe_MaybeModule_ProvideMaybeFactory; - -@DaggerGenerated -@Generated( - value = "dagger.internal.codegen.ComponentProcessor", - comments = "https://dagger.dev" -) -@SuppressWarnings({ - "unchecked", - "rawtypes", - "KotlinInternal", - "KotlinInternalInJava", - "cast", - "deprecation" -}) -final class DaggerTestComponent { - private DaggerTestComponent() { - } - - public static Builder builder() { - return new Builder(); - } - - public static TestComponent create() { - return new Builder().build(); - } - - static final class Builder { - private Builder() { - } - - public TestComponent build() { - return new TestComponentImpl(); - } - } - - private static final class TestComponentImpl implements TestComponent, CancellationListener { - private final TestComponentImpl testComponentImpl = this; - - private TestComponentImpl() { - - - } - - @Override - public ListenableFuture> maybe() { - return Futures.immediateFuture(Optional.of(Maybe_MaybeModule_ProvideMaybeFactory.provideMaybe())); - } - - @Override - public ListenableFuture> definitelyNot() { - return Futures.immediateFuture(Optional.absent()); - } - - @Override - public void onProducerFutureCancelled(boolean mayInterruptIfRunning) { - - - } - } -} - diff --git a/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_requestForFuture_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent b/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_requestForFuture_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent deleted file mode 100644 index 6f2a7e84503..00000000000 --- a/javatests/dagger/internal/codegen/goldens/OptionalBindingRequestFulfillmentTest_requestForFuture_FAST_INIT_JAVA7_MODE_test.DaggerTestComponent +++ /dev/null @@ -1,72 +0,0 @@ -package test; - -import com.google.common.base.Optional; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import dagger.internal.DaggerGenerated; -import dagger.producers.internal.CancellationListener; -import javax.annotation.Generated; -import other.DefinitelyNot; -import other.Maybe; -import other.Maybe_MaybeModule_ProvideMaybeFactory; - -@DaggerGenerated -@Generated( - value = "dagger.internal.codegen.ComponentProcessor", - comments = "https://dagger.dev" -) -@SuppressWarnings({ - "unchecked", - "rawtypes", - "KotlinInternal", - "KotlinInternalInJava", - "cast", - "deprecation" -}) -final class DaggerTestComponent { - private DaggerTestComponent() { - } - - public static Builder builder() { - return new Builder(); - } - - public static TestComponent create() { - return new Builder().build(); - } - - static final class Builder { - private Builder() { - } - - public TestComponent build() { - return new TestComponentImpl(); - } - } - - private static final class TestComponentImpl implements TestComponent, CancellationListener { - private final TestComponentImpl testComponentImpl = this; - - private TestComponentImpl() { - - - } - - @Override - public ListenableFuture> maybe() { - return Futures.immediateFuture(Optional.of(Maybe_MaybeModule_ProvideMaybeFactory.provideMaybe())); - } - - @Override - public ListenableFuture> definitelyNot() { - return Futures.immediateFuture(Optional.absent()); - } - - @Override - public void onProducerFutureCancelled(boolean mayInterruptIfRunning) { - - - } - } -} - diff --git a/util/validate-artifacts.sh b/util/validate-artifacts.sh index 5d7f4fbe923..3b0db51d840 100755 --- a/util/validate-artifacts.sh +++ b/util/validate-artifacts.sh @@ -3,7 +3,6 @@ set -eu readonly M2_DAGGER_REPO=~/.m2/repository/com/google/dagger -readonly JDK7="51" readonly JDK8="52" _validate_jar() { @@ -29,15 +28,15 @@ _validate_jar() { } # Dagger API artifacts -_validate_jar "dagger-gwt" "jar" $JDK7 -_validate_jar "dagger" "jar" $JDK7 -_validate_jar "dagger-android" "aar" $JDK7 -_validate_jar "dagger-android-legacy" "aar" $JDK7 -_validate_jar "dagger-android-support" "aar" $JDK7 -_validate_jar "dagger-android-support-legacy" "aar" $JDK7 -_validate_jar "dagger-producers" "jar" $JDK7 -_validate_jar "dagger-grpc-server" "jar" $JDK7 -_validate_jar "dagger-grpc-server-annotations" "jar" $JDK7 +_validate_jar "dagger-gwt" "jar" $JDK8 +_validate_jar "dagger" "jar" $JDK8 +_validate_jar "dagger-android" "aar" $JDK8 +_validate_jar "dagger-android-legacy" "aar" $JDK8 +_validate_jar "dagger-android-support" "aar" $JDK8 +_validate_jar "dagger-android-support-legacy" "aar" $JDK8 +_validate_jar "dagger-producers" "jar" $JDK8 +_validate_jar "dagger-grpc-server" "jar" $JDK8 +_validate_jar "dagger-grpc-server-annotations" "jar" $JDK8 _validate_jar "dagger-lint" "jar" $JDK8 _validate_jar "dagger-lint-aar" "aar" $JDK8