8000 MOE Sync 2020-05-08 by nick-someone · Pull Request #1838 · google/dagger · GitHub
[go: up one dir, main page]

Skip to content

MOE Sync 2020-05-08 - #1838

Merged
nick-someone merged 6 commits into
masterfrom
sync-master-2020/05/07
May 8, 2020
Merged

nick-someone merged 6 commits into
masterfrom
sync-master-2020/05/07

Conversation

@nick-someone
Copy link
Copy Markdown
Member

This code has been reviewed and submitted internally. Feel free to discuss on
the PR, and we can submit follow-up changes as necessary.

Commits:

rename ViewComponent.class to ViewWithFragmentComponent.class and ViewComponentBuilder.class to ViewWithFragmentComponentBuilder.class

RELNOTES=N/A

e7559c7


[Hilt Refactor]: Merge root testing classes into processor/internal/root

These classes are only used by the RootProcessor, and merging helps simplify a lot of the boiler plate and reduces public visibility. This CL also simplifies how the test and test application entry points get added to the component.

RELNOTES=N/A

adb091c


Transform super call invocations to reference generated superclass.

Iterates over each declared method, finding in its bodies super calls.
(e.g. super.onCreate()) and rewrites the method reference of the
invokespecial instruction to one that uses the new superclass.

The invokespecial instruction is emitted for code that between other
things also invokes a method of a superclass of the current class.
The opcode invokespecial takes two operands, each of 8 bit, that
together represent an address in the constant pool to a method
reference. The method reference is computed at compile-time by looking
the direct superclass declaration, but at runtime the code behaves
like invokevirtual, where as the actual method invoked is looked up
based on the class hierarchy.

However, it has been observed that on APIs 19 to 22 the Android
Runtime (ART) jumps over the direct superclass and into the method
reference class, causing unexpected behaviours. Therefore, this method
performs the additional transformation to rewrite direct super call
invocations to use a method reference whose class in the pool is the
new superclass. Note that this is not necessary for constructor calls
since the Javassist library takes care of those.

359dd3e


Rollback adb091c due to internal failures

*** Original change description ***

[Hilt Refactor]: Merge root testing classes into processor/internal/root

These classes are only used by the RootProcessor, and merging helps simplify a lot of the boiler plate and reduces public visibility. This CL also simplifies how the test and test application entry points get added to the component.


7f6d0ac


Add DaggerKotlinIssuesDetector

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 #1805

RELNOTES="Add custom lint checks to Dagger"

38dd765


Add dagger-compiler as a maven dep of hilt-android-compiler.

This adds dagger-compiler to the list of dependencies of the
hilt-android-compiler POM so that depending on Hilt also includes
Dagger on the compiler classpath.

f191937

< 8000 /div>

mahsabadian and others added 6 commits May 7, 2020 14:39
and ViewComponentBuilder.class to ViewWithFragmentComponentBuilder.class

RELNOTES=N/A

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=310232879
These classes are only used by the RootProcessor, and merging helps simplify a lot of the boiler plate and reduces public visibility. This CL also simplifies how the test and test application entry points get added to the component.

RELNOTES=N/A

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=310236493
Iterates over each declared method, finding in its bodies super calls.
(e.g. super.onCreate()) and rewrites the method reference of the
invokespecial instruction to one that uses the new superclass.

The invokespecial instruction is emitted for code that between other
things also invokes a method of a superclass of the current class.
The opcode invokespecial takes two operands, each of 8 bit, that
together represent an address in the constant pool to a method
reference. The method reference is computed at compile-time by looking
the direct superclass declaration, but at runtime the code behaves
like invokevirtual, where as the actual method invoked is looked up
based on the class hierarchy.

However, it has been observed that on APIs 19 to 22 the Android
Runtime (ART) jumps over the direct superclass and into the method
reference class, causing unexpected behaviours. Therefore, this method
performs the additional transformation to rewrite direct super call
invocations to use a method reference whose class in the pool is the
new superclass. Note that this is not necessary for constructor calls
since the Javassist library takes care of those.

RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=310243862
*** Original change description ***

[Hilt Refactor]: Merge root testing classes into processor/internal/root

These classes are only used by the RootProcessor, and merging helps simplify a lot of the boiler plate and reduces public visibility. This CL also simplifies how the test and test application entry points get added to the component.

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=310259874
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 #1805

RELNOTES="Add custom lint checks to Dagger"

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=310269729
This adds dagger-compiler to the list of dependencies of the
hilt-android-compiler POM so that depending on Hilt also includes
Dagger on the compiler classpath.

RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=310391575
@googlebot
Copy link
Copy Markdown
Collaborator

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@nick-someone
Copy link
Copy Markdown
Member Author

CLA:yes from #1805

@googlebot
Copy link
Copy Markdown
Collaborator

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@nick-someone
nick-someone merged commit 98580bb into master May 8, 2020
@nick-someone
nick-someone deleted the sync-master-2020/05/07 branch May 8, 2020 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

0