Home | History | Annotate | Download | only in dagger2
      1 Dagger 2
      2 ========
      3 
      4 A fast dependency injector for Android and Java.
      5 
      6 About Google's Fork
      7 -------------
      8 
      9 Dagger 2 is a compile-time evolution approach to dependency injection.  Taking the approach
     10 started in Dagger 1.x to its ultimate conclusion, Dagger 2.0 eliminates all reflection, and
     11 improves code clarity by removing the traditional ObjectGraph/Injector in favor of
     12 user-specified @Component interfaces. 
     13 
     14 This github project represents the Dagger 2 development stream.  The earlier 
     15 [project page][square] (Square, Inc's repository) represents the earlier 1.0 development stream.  
     16 Both versions have benefitted from strong involvement from Square, Google, and other contributors. 
     17 
     18 ## [Dagger 2's main documentation website can be found here.][website]
     19 
     20 Status
     21 ------
     22 
     23   - ***Release Version:* 2.0.1**
     24   - ***Snapshot Version:* 2.1-SNAPSHOT**
     25 
     26 Dagger is currently in active development, primarily internally at Google, with regular pushes
     27 to the open-source community.  Snapshot releases are auto-deployed to sonatype's central maven
     28 repository on a clean build with the version `2.1-SNAPSHOT`.
     29 
     30 Documentation
     31 -------------
     32 
     33 You can [find the dagger documentation here][website] which has extended usage
     34 instructions and other useful information.  Substantial usage information can be
     35 found in the [API documentation][20api].
     36 
     37 You can also learn more from [the original proposal][proposal], 
     38 [this talk by Greg Kick][gaktalk], and on the dagger-discuss (a] googlegroups.com
     39 mailing list. 
     40 
     41 Installation
     42 --------
     43 
     44 You will need to include the `dagger-2.0.1.jar` in your application's runtime.
     45 In order to activate code generation and generate implementations to manage
     46 your graph you will need to include `dagger-compiler-2.0.1.jar` in your build
     47 at compile time.
     48 
     49 In a Maven project, include the `dagger` artifact in the dependencies section
     50 of your `pom.xml` and the `dagger-compiler` artifact as either an `optional` or
     51 `provided` dependency:
     52 
     53 ```xml
     54 <dependencies>
     55   <dependency>
     56     <groupId>com.google.dagger</groupId>
     57     <artifactId>dagger</artifactId>
     58     <version>2.0.1</version>
     59   </dependency>
     60   <dependency>
     61     <groupId>com.google.dagger</groupId>
     62     <artifactId>dagger-compiler</artifactId>
     63     <version>2.0.1</version>
     64     <optional>true</optional>
     65   </dependency>
     66 </dependencies>
     67 ```
     68 
     69 If you use the beta `dagger-producers` extension (which supplies parallelizable execution graphs),
     70 then add this to your maven configuration:
     71 
     72 ```xml
     73 <dependencies>
     74   <dependency>
     75     <groupId>com.google.dagger</groupId>
     76     <artifactId>dagger-producers</artifactId>
     77     <version>2.0-beta</version>
     78   </dependency>
     79 </dependencies>
     80 ```
     81 
     82 
     83 ### Download 
     84 
     85   * 2.x (google/dagger)
     86     * [Dagger 2.0 Documentation][website]
     87     * [Dagger 2.0 Javadocs][20api]
     88     * [Dagger development Javadocs][latestapi] (from the `master` branch on GitHub)
     89     * [Google's Dagger project site on GitHub][project]
     90     * <a href="https://plus.google.com/118328287768685565185" rel="publisher">Google+ Dagger Project Page</a>
     91     * [Google+ Dagger Users Community][community]
     92   * 1.x (square/dagger)
     93     * [Square's original Dagger project site on GitHub][square]
     94     * [Square Open Source Community][squarecommunity]
     95 
     96 
     97 If you do not use maven, gradle, ivy, or other build systems that consume maven-style binary
     98 artifacts, they can be downloaded directly via the [Maven Central Repository][mavensearch].
     99 
    100 Developer snapshots are available from [Sonatype's snapshot repository][dagger-snap], and
    101 are built on a clean build of the GitHub project's master branch.
    102 
    103 License
    104 -------
    105 
    106     Copyright 2012 Square, Inc.
    107     Copyright 2012 Google, Inc.
    108 
    109     Licensed under the Apache License, Version 2.0 (the "License");
    110     you may not use this file except in compliance with the License.
    111     You may obtain a copy of the License at
    112 
    113        http://www.apache.org/licenses/LICENSE-2.0
    114 
    115     Unless required by applicable law or agreed to in writing, software
    116     distributed under the License is distributed on an "AS IS" BASIS,
    117     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    118     See the License for the specific language governing permissions and
    119     limitations under the License.
    120 
    121 
    122 
    123  [mavensearch]: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.google.dagger%22
    124  [dagger-snap]: https://oss.sonatype.org/content/repositories/snapshots/com/google/dagger/
    125  [website]: http://google.github.io/dagger
    126  [latestapi]: http://google.github.io/dagger/api/latest/
    127  [20api]: http://google.github.io/dagger/api/2.0/
    128  [gaktalk]: https://www.youtube.com/watch?v=oK_XtfXPkqw
    129  [proposal]: https://github.com/square/dagger/issues/366
    130  [project]: http://github.com/google/dagger/
    131  [community]: https://plus.google.com/communities/111933036769103367883
    132  [square]: http://github.com/square/dagger/
    133  [squarecommunity]: https://plus.google.com/communities/109244258569782858265
    134 
    135