The AssitedInject library from Square is actually an annotation processor that generates Dagger 2 modules. Dagger 2 is also an annotation processor.
And as I know there is no way to control the order of processors execution.
In this example (see snippet below) you can see that the module has dependency on generated by AssistedInject class AssistedInject_MainModule
. So in case if Dagger 2 will run first the build should fail because of at this moment AssistedInject_MainModule
does not exist.
But it can be compiled. How does it work?
@AssistedModule
@Module(includes = AssistedInject_MainModule.class)
public abstract class MainModule {
@Provides static @Exclamation String provideExclamation() {
return "!";
}
}