title: Use Dagger modules without the "injects" directive
body: <p>I am trying to make Dagger work without the "injects" directive inside the @Module annotation. I am basing my test project on the <a href="https://github.com/square/dagger/tree/master/examples/android-simple" rel="noreferrer">Android Simple Dagger example</a> </p>
  
  <p>This is the part that is giving me problems:</p>
  
  <pre><code>@Module(
      injects = HomeActivity.class,
      complete = false
  )
  public class DemoModule {
    // TODO put your application-specific providers here!
  }
  </code></pre>
  
  <p>(Edit): Which in my code is <a href="https://github.com/pepitoria/DaggerTests/blob/master/src/com/ef/daggertestproject/dagger/CTXModules.java" rel="noreferrer">CTXModules.java</a></p>
  
  <p>The part that I'd like to remove is the "injects = HomeActivity.class". I know I can mark my own modules with the @Inject annotation in the constructor to remove that part there, but somehow it doesn't work with the module that is added to the graph. With that line there, everything works just fine.</p>
  
  <p>The reason I need this is because dagger will be implemented in a base-library project that will be the foundation for some projects that share a common code base and therefore at the moment or writing the this part of the code I don't know what classes will inject modules.</p>
  
  <p>Is what I am trying to do even possible?</p>
  
  <p>I assume it is possible because the <a href="https://github.com/square/dagger/blob/master/examples/android-simple/src/main/java/com/example/dagger/simple/AndroidModule.java" rel="noreferrer">Android Module class</a> does not use that directive.</p>
  
  <p>Hope it's clear enough. Thanks in advance!</p>
  
  <p>(EDIT)</p>
  
  <p>I should have mentioned it. In my module I remove "injects = HomeActivity.class" and add "library = true" like in the <a href="https://github.com/square/dagger/blob/master/examples/android-simple/src/main/java/com/example/dagger/simple/AndroidModule.java" rel="noreferrer">Android Module class</a>. What happens then is that I get this error (my bad I not added it before):</p>
  
  <pre><code>12-10 09:21:16.807: E/AndroidRuntime(21783): FATAL EXCEPTION: main
  12-10 09:21:16.807: E/AndroidRuntime(21783): Process: com.ef.daggertestproject, PID: 21783
  12-10 09:21:16.807: E/AndroidRuntime(21783): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ef.daggertestproject/com.ef.daggertestproject.MainActivity}: java.lang.IllegalArgumentException: No inject registered for members/com.ef.daggertestproject.MainActivity. You must explicitly add it to the 'injects' option in one of your modules.
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at android.app.ActivityThread.access$700(ActivityThread.java:135)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at android.os.Handler.dispatchMessage(Handler.java:102)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at android.os.Looper.loop(Looper.java:137)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at android.app.ActivityThread.main(ActivityThread.java:4998)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at java.lang.reflect.Method.invokeNative(Native Method)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at java.lang.reflect.Method.invoke(Method.java:515)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at dalvik.system.NativeStart.main(Native Method)
  12-10 09:21:16.807: E/AndroidRuntime(21783): Caused by: java.lang.IllegalArgumentException: No inject registered for members/com.ef.daggertestproject.MainActivity. You must explicitly add it to the 'injects' option in one of your modules.
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at dagger.ObjectGraph$DaggerObjectGraph.getInjectableTypeBinding(ObjectGraph.java:281)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at dagger.ObjectGraph$DaggerObjectGraph.inject(ObjectGraph.java:258)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at com.ef.daggertestproject.MyApplication.inject(MyApplication.java:47)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at com.ef.daggertestproject.BaseActivity.onCreate(BaseActivity.java:27)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at com.ef.daggertestproject.MainActivity.onCreate(MainActivity.java:16)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at android.app.Activity.performCreate(Activity.java:5243)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
  12-10 09:21:16.807: E/AndroidRuntime(21783):    ... 11 more
  </code></pre>
  
  <p>Also, I've uploaded <a href="https://github.com/pepitoria/DaggerTests" rel="noreferrer">my test project to github</a></p>
  
  <p>(Final Edit) according to Jake's answer: "Declaring a module as a library does not alleviate the needs of Dagger to know about injection points." And therefore the answer to my original question is that it's not possible.</p>