Dagger 2 Cross-Module Dependency
<p>In my current project we have an <code>ApplicationComponent</code>, which holds various modules including a <code>NetworkModule</code>:</p>

<pre><code>DaggerApplicationComponent.builder()
    .applicationModule(new ApplicationModule(this))
    .networkModule(new NetworkModule())
    .apiModule(new ApiModule())
    .build();
</code></pre>

<p>I now want to setup a <code>UserServices</code> module that will provide at least a <code>UserServices</code> object, and that object requires some of the provides from the other modules for configuration. For example, the <code>NetworkModule</code> provides an <code>HttpLoggingInterceptor.Level</code> that is used for other network calls in the app, and I would like to use the same in the <code>UserServices</code> calls. </p>

<p>Example from the debug version of the <code>NetworkModule</code>:</p>

<pre><code>@Module
public class NetworkModule extends BaseNetworkModule {
    HttpLoggingInterceptor.Level getHttpLoggingInterceptorLevel() {
        return HttpLoggingInterceptor.Level.BODY;
    }
}
</code></pre>

<p>I want to keep the <code>UserServices</code> provide in its own module for the sake of encapsulation. </p>

<p>How do I set up the <code>UserServices</code> module so it can be included in the same component, and have access to the Provides in the <code>NetworkModule</code> for configuring the <code>UserServices</code> object that it provides?</p>

<p>Thanks</p>