Age | Commit message (Collapse) | Author |
|
This reverts commit 399f4f61132f363e9479e59c550a7bcf005922d8.
Reason for revert: b/187908823
Change-Id: I81f7cd3672e65ce1f7e1fa846b6c3e2f87147a26
|
|
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
|
|
Fixes https://github.com/google/dagger/issues/2511
RELNOTES=Fix #2511 by updating the kotlinx-metadata dependency.
PiperOrigin-RevId: 365607461
|
|
Fixes #2481
RELNOTES=Bump fragment dependency to 1.3.1 and activity to 1.2.1.
PiperOrigin-RevId: 363265721
|
|
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
|
|
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
|
|
PiperOrigin-RevId: 353057330
|
|
release.
I'll roll this forward before the next minor release.
RELNOTES=N/A
PiperOrigin-RevId: 352656750
|
|
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
|
|
RELNOTES=n/a
PiperOrigin-RevId: 352100147
|
|
@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
|
|
@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
|
|
@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
|
|
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
|
|
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
|
|
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
|
|
Breaks users member injecting ViewModels without SavedStateHandle.
PiperOrigin-RevId: 342057045
|
|
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
|
|
RELNOTES=Fixes #2156: Update Dagger's androidx dependencies to the latest stable versions.
PiperOrigin-RevId: 339085202
|
|
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
|
|
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
|
|
RELNOTES=N/A
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=324646786
|
|
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
|
|
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
|
|
RELNOTES=Update macro and README with instructions for Bazel users.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=315389535
|
|
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
|
|
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
|
|
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
|
|
...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
|
|
RELNOTES=N/A
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=294322635
|
|
MOE configs.
RELNOTES=N/A
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=294300029
|
|
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
|
|
RELNOTES=N/A
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=291456493
|
|
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
|
|
RELNOTES=N/A
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=290335131
|
|
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
|
|
*** 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
|
|
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
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=278310622
|
|
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
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=276365033
|
|
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
|
|
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
|
|
truth target
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=257700177
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=251481609
|
|
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
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244715548
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=243134151
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=226277202
|
|
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=225035602
|