Closed dbachelder closed 9 years ago
Ah, if Transfuse doesn't run in your library then you'll need to use the @Install
annotation on your module:
@TransfuseModule
@Install(LibraryFactory.class)
class Module{}
This will trigger Transfuse to run on the given class.
And I added a fail fast exception when Transfuse can't find an element in a utility class: 4bd8faae227c2fc7cb062078cbe9217e8a8dbfcc FYI, I also added this to Parceler a while back: https://github.com/johncarl81/parceler/commit/bf4e1c5dba76af357364b53241aac6e150002eb9
And this fix should allow you to use Application
in @Factory
level providers: 0110fe0f5e669de52c202178e07dd37b2a84835d
Working great on both counts
I have a library "utils" that has many of the fundamentals we use in a couple apps, base fragment, activity and module, and I have recently added a @Factory class that I was going to get at via
Factories.get()
in those base classes (not within the TF dependency graph).This fails with an exception:
So first, what am I not doing correctly? I am running apt with the transfuse processor on both the library and the app. If I move the Factory interface into the app project and go after it in a baseclass in the app project, everything is fine.
Second, the factory should throw an exception like new IllegalArgumentException("unable to find factory of type: " + type + ". Please do blah blah blah and read this link: http://blah.com for possible help"