aboutsummaryrefslogtreecommitdiff
path: root/WORKSPACE
AgeCommit message (Collapse)Author
2021-05-12Revert "Merge commit 'upstream/dagger-2.35.1^'"Aurimas Liutikas
This reverts commit 399f4f61132f363e9479e59c550a7bcf005922d8. Reason for revert: b/187908823 Change-Id: I81f7cd3672e65ce1f7e1fa846b6c3e2f87147a26
2021-03-31Update the androidx fragment, lifecycle and activity dependencies which ↵Daniel Santiago
contain patch fixes. Fixes: https://github.com/google/dagger/issues/2519 RELNOTES="Update the androidx fragment, lifecycle and activity dependencies which contain patch fixes." PiperOrigin-RevId: 366108621
2021-03-29Bump kotlinx-metadata version to 0.2.0.Daniel Santiago
Fixes https://github.com/google/dagger/issues/2511 RELNOTES=Fix #2511 by updating the kotlinx-metadata dependency. PiperOrigin-RevId: 365607461
2021-03-16Bump fragment dependency to 1.3.1 and activity to 1.2.1.Eric Chang
Fixes #2481 RELNOTES=Bump fragment dependency to 1.3.1 and activity to 1.2.1. PiperOrigin-RevId: 363265721
2021-02-18Add Hilt tests to GitHubBrad Corso
This CL sets up robolectric tests in the Dagger workspace and adds some previously existing, but never synced, tests (note: these tests are just now being synced to GitHub since we didn't have robolectric working before). RELNOTES=N/A PiperOrigin-RevId: 358192699
2021-02-16Perform Hilt Activity injection on a OnContextAvailableListener.Daniel Santiago
Delay Hilt activity injection to a OnContextAvailableListener to enable member injecting ViewModels with SavedStateHandle. Note that this means base Hilt classes should not rely on their fields being injected before their onCreate() since injection is moved into super.onCreate() as opposed to before. RELNOTES=Delay Hilt activity injection to a OnContextAvailableListener to enable member injecting ViewModels with SavedStateHandle. To use the ContextAware APIs androidx.activity, androidx.fragment and androidx.lifecycle dependencies are updated across the Dagger libraries. PiperOrigin-RevId: 357829271
2021-01-21Rollback since this was an unintended effect on the deps of the release.Eric Chang
PiperOrigin-RevId: 353057330
2021-01-19This feature may be a breaking change, so rolling it back for a Dagger patch ↵Brad Corso
release. I'll roll this forward before the next minor release. RELNOTES=N/A PiperOrigin-RevId: 352656750
2021-01-19Clears Fragment reference in FragmentContextWrapper after Fragment#onDestroy()Brad Corso
This CL uses the fragment Lifecycle to clear the fragment instance from the FragmentContextWrapper after onDestroy. Fixes: #2070 See https://github.com/google/dagger/issues/2070 RELNOTES=Fixes #2070: clears Fragment reference in FragmentContextWrapper after Fragment#onDestroy() PiperOrigin-RevId: 352579115
2021-01-15Internal refactorEric Chang
RELNOTES=n/a PiperOrigin-RevId: 352100147
2020-12-29Add a plugin to check for injections of @HiltViewModel types. Since ↵Eric Chang
@HiltViewModel has an @Inject constructor, it is possible to erroneously inject it instead of accessing it via the Android APIs. This check should prevent that from happening. RELNOTES=Injections of @HiltViewModel types now cause an error PiperOrigin-RevId: 349480648
2020-12-28Add a plugin to check for injections of @HiltViewModel types. Since ↵Dagger Team
@HiltViewModel has an @Inject constructor, it is possible to erroneously inject it instead of accessing it via the Android APIs. This check should prevent that from happening. RELNOTES=Injections of @HiltViewModel types now cause an error PiperOrigin-RevId: 349357974
2020-12-28Add a plugin to check for injections of @HiltViewModel types. Since ↵Eric Chang
@HiltViewModel has an @Inject constructor, it is possible to erroneously inject it instead of accessing it via the Android APIs. This check should prevent that from happening. RELNOTES=Injections of @HiltViewModel types now cause an error PiperOrigin-RevId: 349339906
2020-12-14Update Android SDK and build tools to 30 along with AGP to 4.1.1. AGP also ↵Dagger Team
requires newer Gradle version, so bumping the wrapper to 6.7. Robolectric also had tro be updates to 4.5-alpha which supports API 30. RELNOTES=N/A PiperOrigin-RevId: 347443545
2020-12-04Update Bazel to 3.7.1 and use Kotlin toolchain 1.4.Dagger Team
Additionally, update the Dagger compiler tests that verify Guava is not in the classpath by using the newer .withClasspath() API along with additionally filtering out Bazel's runner deploy jar which leaks Guava classes into the compile testing classpath. RELNOTES=n/a PiperOrigin-RevId: 345731509
2020-11-30Roll forward with fix of 'Migrating @ViewModelInject into Hilt's codebase'.Dagger Team
Additional changes compared to the original CL: * An additional Module per @ViewModelInject-annotated ViewModel class will be created to bind the class name to a Set<String>. * The Set<String> of injected view models class names will be used by the HiltViewModelFactory to determine whether the view model to create should come from the ViewModelComponent or not. By filtering out non-injected view models the factory can avoid eagerly creating a SavedStateHandle for a view model that will not be created via the ViewModelComponent. PiperOrigin-RevId: 344909991
2020-11-12Rollback of Migrating @ViewModelInject into Hilt's codebase.Dagger Team
Breaks users member injecting ViewModels without SavedStateHandle. PiperOrigin-RevId: 342057045
2020-11-11Migrating @ViewModelInject into Hilt's codebase.Dagger Team
This CL brings the ViewModel extension from AndroidX into Hilt's codebase to provide first party support for ViewModels within Hilt. It does not update the mechanism for which the HiltViewModelFactory is provided into the @AndroidEntryPoint-annotated classes. RELNOTES=Migrating @ViewModelInject into Hilt's codebase. PiperOrigin-RevId: 341977365
2020-10-26Update Dagger's androidx dependencies to the latest stable versions.Brad Corso
RELNOTES=Fixes #2156: Update Dagger's androidx dependencies to the latest stable versions. PiperOrigin-RevId: 339085202
2020-09-25Roll forward with fix of 'Support Kotlin val properties with @BindValue.'Dagger Team
Two additional changes compared to the original CL: * When matching javax.lang elements with Kotlin metadata we rely on descriptors. When generating the descriptor of an element whose type is an error (type is not yet resolved, probably a generated type) a fully modeled type is not needed and instead the ErrorType can be treated as a DeclaredType, using its reference names to generate a descriptor containing the class name in its internal form. The fix here is to do just that instead of defaulting to throwing an error when visiting an ErrorType while generating a descriptor. * When inspecting fields to match them against their Kotlin property metadata we rely on the JVM descriptors. However, for generated type the descriptors is incorrect due to https://youtrack.jetbrains.com/issue/KT-35124, for such cases we rely on matching the Kotlin metadata property with the field element by name. Matching by name must also take into account the field suffixes used by kotlinc, specifically delegate properties end up creating a field whose name is that of the property plus '$delegate'. This consideration must now be done since KotlinMetadata will now contain a map of all fields matched with their Kotlin metadata property where as before only @Inject annotated fields were mapped. Since @Inject can't be placed in a property with delegate this was not an issue before. PiperOrigin-RevId: 333817683
2020-08-14[Dagger]: Remove auto-common forks from Dagger.bcorso
This CL updates auto-common to use v0.11, which contains all of the changes in our forked version, so the forks can now be removed. Note: we are now pulling in auto-common ourselves rather than getting it from bazel-common. This prevents us from having to first update bazel-common before updating Dagger. RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=326293402
2020-08-04Add bzl_library rules for .bzl files without one.bcorso
RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=324646786
2020-07-09Update Dagger's Bazel Common dependency that contains the JavaPoet 1.13.0 ↵danysantiago
update. Fixes https://github.com/google/dagger/issues/1909 RELNOTES=Update Dagger's JavaPoet dependency to 1.13.0 containing fixes for Dagger & Hilt related to generating code with overriding methods without annotations. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=320417787
2020-06-17Error out when default param is in constructor of base class.danysantiago
This change detects when the immediate base class of an AndroidEntryPoint in Kotlin has a constructor with default values. Hilt currently cannot bytecode transform the op `invokespecial` when the ClassAndType ref points to the Kotlin synthetic method with a `kotlin/jvm/internal/DefaultConstructorMarker` because such method won't be present in the Java source generated Hilt_ class. The correct transformation requires interpreting the bitmask to call the right overloaded constructor. This means users have to use `@JvmOverloads` and requires Hilt to know about the Kotlin compilers implementation and code produced for methods with default values. This helps detect https://github.com/google/dagger/issues/1904. RELNOTES=Restrict usage of default params in constructor of immediate base class of an AndroidEntryPoint. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=316797025
2020-06-09Add macros for Dagger users to easily import Dagger targets.bcorso
RELNOTES=Update macro and README with instructions for Bazel users. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=315389535
2020-05-13Update bazel_common containing jarjar fix.danysantiago
Fixes https://github.com/google/dagger/issues/1812 RELNOTES=Fix deploy script for Mac by updating bazel_common containing a fix in the jarjar macro. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=311169973
2020-05-08Add DaggerKotlinIssuesDetectorZac Sweers
This is a set of custom lints along with fixes to help with migration to improved kotlin support in Dagger. This covers the following cases: * Using field: site target in injected properties * Using @JvmStatic in object modules * Annotating companion objects with @Module This CL also includes the necessary infrastructure changes to build, package and deploy lint rules in the Dagger project. For Kotlin-only projects, a new artifact 'com.google.dagger:dagger-lint' will be published so that lint checks can be added via the lintChecks configuration in Gradle: ``` apply plugin: "com.android.lint" dependencies { lintChecks "com.google.dagger:dagger-lint:<version>" } ``` Meanwhile for users of Hilt and dagger-android, the lint checks will be applied from a new transitive dependency 'com.google.dagger:dagger-lint-aar'. Closes https://github.com/google/dagger/pull/1805 RELNOTES="Add custom lint checks to Dagger" ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=310269729
2020-03-21Create a ActivityRetainedComponent for non-config scoped bindings.danysantiago
Introduce a new component and scope between the Application and Activity components for scoping bindings that survive configuration changes. For Hilt activities whose base is a support lib activity, then ViewModels are used to retain the component, otherwise onRetainNonConfigurationInstance is overriden on the parent-most Hilt activity to support retaining the component. RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=302129555
2020-02-27Prepare for external Bazel change --incompatible_load_java_rules_from_bzl.cpovirk
...by load()-ing java_library and other rules wherever we use them. Compare to CL 297412705 for Flogger. This CL includes updating to a new version of bazel_common to avoid --incompatible_load_java_rules_from_bzl errors in bazel_common. See https://github.com/google/bazel-common/pull/104. Note that this CL also changes the way we get zlib() (a dependency of protobuf) from bind() to http_archive(). http_archive() seems to be the more recommended pattern: - https://docs.bazel.build/versions/master/external.html#repository-rules - https://github.com/bazelbuild/bazel/issues/1952 But my immediate motivation was that bind() wasn't working with the new version of protobuf. (The new version of protobuf is necessary to avoid --incompatible_load_java_rules_from_bzl errors inside protobuf. It comes with the new version of bazel_common.) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=297608393
2020-02-10Update bazel_common for new jarjar merge attribute.danysantiago
RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=294322635
2020-02-10Add test artifact and add a gradle test to the example project, and update ↵bcorso
MOE configs. RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=294300029
2020-01-28Use guava "-android" artifacts for "guava_jdk5" deps.bcorso
Previously, we were replacing "//third_party/java/android_libs/guava_jdk5" with the non-android artifact, which can cause build issues for android libraries. This CL switches over to use the "guava:*-android" artifact for guava used with android_libraries. RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=291759173
2020-01-28Add dependencies for internal-only change.bcorso
RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=291456493
2020-01-28Dagger AndroidX Migrationdanysantiago
Update imports and dependencies to use AndroidX APIs. For backwards compatibility, produce two new artifacts, "dagger-android-legacy" and "dagger-android-support-legacy" that are dejetified artifacts of the AndroidX versions. Resolves #1652 Resolves #1619 Resolves #1489 Resolves #1444 Resolves #1313 Resolves #1271 Resolves #1248 Resolves #1264 Co-authored-by: Zac Sweers <zsweers@slack-corp.com> RELNOTES=Migrate dagger-android to AndroidX. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=291051989
2020-01-22Upgrade Dagger to the latest bazel_common to fix sonatype https issues.bcorso
RELNOTES=N/A ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=290335131
2019-12-16Roll forward of Propagate qualifiers for field injections in MemberInjectors.danysantiago
NEW: Added logic InjectionAnnotations to deduplicate qualifiers annotation in the case that a qualifier is present in the field but a missing property annotation is also detected and the annotations from the members injector are also gathered. Automated g4 rollback of changelist 284670569. *** Reason for rollback *** Rolling forward *** Original change description *** Automated g4 rollback of changelist 283574407. *** Reason for rollback *** Caused b/145946461 *** Original change description *** Propagate qualifiers for field injections in MemberInjectors. Having qualifiers in the generated MemberInjectors helps the root downstream processor read Kotlin property annotations that are lost across compilations due to https://youtrack.jetbrains.com/issue/KT-34684 When Dagger is applied to all subprojects with @Inject fields or constructors then this change f... *** ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=284863380
2019-12-16Automated g4 rollback of changelist 283574407.danysantiago
*** Reason for rollback *** Caused b/145946461 *** Original change description *** Propagate qualifiers for field injections in MemberInjectors. Having qualifiers in the generated MemberInjectors helps the root downstream processor read Kotlin property annotations that are lost across compilations due to https://youtrack.jetbrains.com/issue/KT-34684 When Dagger is applied to all subprojects with @Inject fields or constructors then this change fixes #1659. *** ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=284670569
2019-12-06Propagate qualifiers for field injections in MemberInjectors.danysantiago
Having qualifiers in the generated MemberInjectors helps the root downstream processor read Kotlin property annotations that are lost across compilations due to https://youtrack.jetbrains.com/issue/KT-34684 When Dagger is applied to all subprojects with @Inject fields or constructors then this change fixes #1659. RELNOTES=Workaround missing Kotlin qualifiers annotations across compilation units by propagating qualifiers along with MemberInjectors when Dagger processor is applied to upstream projects. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=283574407
2019-11-07Add bazel_common's sha256mplano
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=278310622
2019-10-28Update Dagger to API 29 and Bazel 1.1.0.erichang
RELNOTES=Bump Android API to 29 and build tools to 29.02. Also bazel 1.1.0. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=276783784
2019-10-24Add maven targets for support library dependencieserichang
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=276365033
2019-09-05Understand @Qualified annotation in Kotlin properties.danysantiago
Use Kotlin Metadata library to find the synthetic method where Kotlin property annotations are placed, then treat the annotations in such method as if they were part of the backing field. This allows for @Qualified annotations with vague targets to be understood by Dagger when placed in Kotlin properties and specifically without the need of the user writing "@field:MyQualifier". Connecting Kotlin Metadata properties with AST elements requires finding and matching JVM Signatures (also known as descriptors). DaggerElements now contains methods to generate descriptors for both an ExecutableElement and a VariableElement. RELNOTES=Understand @Qualifier annotation in Kotlin properties. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=267373331
2019-08-16Migrate org.mockito.Matchers#any* to org.mockito.ArgumentMatcherstvanderlippe
The former is deprecated and replaced by the latter in Mockito 2. However, there is a functional difference: ArgumentMatchers will reject `null` and check the type if the matcher specified a type (e.g. `any(Class)` or `anyInt()`). `any()` will remain to accept anything. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=262101303
2019-07-16Update to a version of bazel-common that exports truth8 from the regular ↵ronshapiro
truth target ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=257700177
2019-06-05Update bazel-common to pull in Truth 0.45 and Compile-Testing 0.18.cpovirk
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=251481609
2019-05-30Remove simple_jar in favor of the Gradle Incremental Annotation Processor ↵ronshapiro
helper library This avoids the back-and-forth issues we've had with simple_jar and the sometimes-nested directories that the files are placed in and replaces it with a reliable solution that is not based on file paths. Fixes https://github.com/google/dagger/issues/1514 RELNOTES=Fix support for gradle incremental annotation processing ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=250582166
2019-05-02Update to new bazel_common to pick up Truth 0.44 -- and Guava 27.1.cpovirk
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=244715548
2019-04-16Update to Bazel 0.24.1 and fix a few things that came up during upgradingronshapiro
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=243134151
2018-12-23Use the http_archive in @bazel_tools. The default version is going awayronshapiro
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=226277202
2018-12-11Update version of bazel-commonnbeck
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=225035602