-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create SnapshotsPreviewRuntimeRetentionTransform to change Previews to runtime retention #139
Conversation
): MethodVisitor { | ||
val mv = super.visitMethod(access, name, descriptor, signature, exceptions) | ||
|
||
return object : MethodVisitor(api, mv) { |
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.
What's the need for this? Does the other override fun visitAnnotation()
not cover all cases?
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.
Nope, that will only cover the annotations on the class-level. We need a separate method visitor to visit the annotations on each method, which is what this is doing.
Without this, we'd just be marking class-level Preview annotations as runtime, instead of class and method level which is what we want.
The class annotation visitor handles multipreview annotation classes that have the preview annotation, and the method annotation visitor handles actual preview methods annotated with Preview.
dc4c21f
to
ebb84c5
Compare
243fa6c
to
2374b92
Compare
…o runtime retention
2374b92
to
799dad1
Compare
Creates an instrumentation/transform that finds all
Preview
/Preview.Container
(repeatable) annotations and forces them to be runtime visible. This is a workaround to https://issuetracker.google.com/issues/168524920, as D8 will unexpectedly strip Binary/Class annotations.Also:
debugOptions
and the ability to force invalidate a transform using a system time to make sure transforms aren't cached (taken from here).snapshots.experimentalTransformEnabled
which can act as an opt-in to this behavior until we've fully tested and are ready for 1.0