-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure binding module code gen #877
Conversation
Duplicated here since we already have it on the ContributesTo annotation
val suffix = "As" + | ||
contribution.boundType.generateClassNameString().capitalize() + | ||
"To" + | ||
contribution.scope.generateClassNameString().capitalize() + | ||
bindingModuleNameSuffix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we break this up with some underscores?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we could I was less worried about readability given this is never accessed directly by users and trying to minimize chars to avoid too-long class names
If we make any changes while syncing the local state with our internal cache, that will affect the source files and PSI parsing, but it doesn't affect the state represented by the ModuleDescriptor. In order to get things in sync, we need to return a `RetryWithAdditionalRoots`. While doing that analysis, the compiler will also sync its own files -- which means it will delete any `.class` files that are no longer current. See discussion here: #877 (comment)
If we make any changes while syncing the local state with our internal cache, that will affect the source files and PSI parsing, but it doesn't affect the state represented by the ModuleDescriptor. In order to get things in sync, we need to return a `RetryWithAdditionalRoots`. While doing that analysis, the compiler will also sync its own files -- which means it will delete any `.class` files that are no longer current. See discussion here: #877 (comment)
@RBusarow wanna take a look at the updated 1:1 impl before I merge? |
This PR reimplements binding module generation to perform all merging at the IR level and eliminate intermediate merged binding modules.
At a high level, this does the following
@ContributesBinding
and@ContributesMultiBinding
to instead generate binding modules per-binding.@InternalBindingMarker
annotation that contains a minimal amount of metadataoriginClass
- the origin class that contributed the bindingisMultibinding
- indicates if the binding is a multibindingpriority
- corresponds toContributesBinding.Priority
.qualifierKey
- the computed "qualifier key"@ContributesTo
and propagated via that infrastructure.ModuleMergerIr
, these binding modules are merged and metadata read from@InternalBindingMarker
to properly allow forexcludes
,replaces
, priority, etc all work correctly.This also functionally completes #751!
ModuleMergerIr
+ new modeling using@InternalBindingMarker
ModuleMergerIr
. This is a little tricky becauseBindingModuleMerger
speaks classes butModuleMergerIr
speaks modules.