You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, knowing the class, and scope, I'm trying to figure out how to get the list of included modules and interfaces. I just can't seem to find much documentation on using the compiler api itself, and nothing is jumping out at me when i'm perusing the code.
Any pointers as to how to get started would be appreciated.
Basically my end goal is to take the generated component, and produce a version of it with a full Component.Factory with functions for each module. This would allow me to auto generate a component suitable for use with daggermock.
something like this:
@Component(modules = [ MyModule::class ])
public interface MyComponent_Mockable : MyAccessors {
@Component.Factory
public interface Factory {
public fun create(myModule: MyModule): MyComponent_Mockable
}
}
I'm able to gather all the contributed classes and interfaces and the basic example above, but it will get hairy dealing with things like "replaces" and "excludes". I'm hoping to re-use the logic in the existing compiler to do that work for me of assembling the list of modules and interfaces.
The text was updated successfully, but these errors were encountered:
I had been hoping to use ClassScanner and perhaps FlushingCodeGenerator, but they are internal classes. And what i've done locally isn't picking up all my modules. It's only picking up ones in the current source tree:
I suspect this is because the module hints and such are used for sort of keeping track across the different sourcepaths, and i'm not able to use the classes required for that because it all seems to be internal
I am trying to write a compiler plug-in, and as part of that, i want to get the generated components and the things included in them.
So, knowing the class, and scope, I'm trying to figure out how to get the list of included modules and interfaces. I just can't seem to find much documentation on using the compiler api itself, and nothing is jumping out at me when i'm perusing the code.
Any pointers as to how to get started would be appreciated.
Basically my end goal is to take the generated component, and produce a version of it with a full Component.Factory with functions for each module. This would allow me to auto generate a component suitable for use with daggermock.
something like this:
I'm able to gather all the contributed classes and interfaces and the basic example above, but it will get hairy dealing with things like "replaces" and "excludes". I'm hoping to re-use the logic in the existing compiler to do that work for me of assembling the list of modules and interfaces.
The text was updated successfully, but these errors were encountered: