com.wemakebetterapps:bullet-compiler

Provides Dagger1-like ObjectGraph API around Dagger2 Components

Лицензия

Лицензия

Группа

Группа

com.wemakebetterapps
Идентификатор

Идентификатор

bullet-compiler
Последняя версия

Последняя версия

0.21
Дата

Дата

Тип

Тип

jar
Описание

Описание

Provides Dagger1-like ObjectGraph API around Dagger2 Components

Скачать bullet-compiler

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.wemakebetterapps/bullet-compiler/ -->
<dependency>
    <groupId>com.wemakebetterapps</groupId>
    <artifactId>bullet-compiler</artifactId>
    <version>0.21</version>
</dependency>
// https://jarcasting.com/artifacts/com.wemakebetterapps/bullet-compiler/
implementation 'com.wemakebetterapps:bullet-compiler:0.21'
// https://jarcasting.com/artifacts/com.wemakebetterapps/bullet-compiler/
implementation ("com.wemakebetterapps:bullet-compiler:0.21")
'com.wemakebetterapps:bullet-compiler:jar:0.21'
<dependency org="com.wemakebetterapps" name="bullet-compiler" rev="0.21">
  <artifact name="bullet-compiler" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.wemakebetterapps', module='bullet-compiler', version='0.21')
)
libraryDependencies += "com.wemakebetterapps" % "bullet-compiler" % "0.21"
[com.wemakebetterapps/bullet-compiler "0.21"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
com.google.dagger : dagger jar 2.0
com.google.auto.service : auto-service Необязательный jar 1.0-rc2
com.google.auto.value : auto-value Необязательный jar 1.0

test (3)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
com.google.testing.compile : compile-testing jar 0.7
com.wemakebetterapps : bullet jar 0.21

Модули Проекта

Данный проект не имеет модулей.

Bullet

Provides Dagger1-like ObjectGraph API around Dagger2 Components, without using reflection.

Download

Releases are deployed to [the Central Repository][releases] [releases]: https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.wemakebetterapps%22

compile 'com.wemakebetterapps:bullet:0.21'
provided 'com.wemakebetterapps:bullet-compiler:0.21'

If using Gradle and Android, you could use android-apt:

compile 'com.wemakebetterapps:bullet:0.21'
apt 'com.wemakebetterapps:bullet-compiler:0.21'
<dependencies>
  <dependency>
    <groupId>com.wemakebetterapps</groupId>
    <artifactId>bullet</artifactId>
    <version>${bullet.version}</version>
  </dependency>
  <dependency>
    <groupId>com.wemakebetterapps</groupId>
    <artifactId>bullet-compiler</artifactId>
    <version>${bullet.version}</version>
    <optional>true</optional>
  </dependency>
</dependencies>

Example

// 1. Create Dagger 2 Component
ComponentA componentA = DaggerComponentA.builder().build();

// 2. Create Bullet Component using the Dagger 2 Component
ObjectGraph objectGraph = new BulletComponentA(componentA);

// 3. The Bullet Component implements the ObjectGraph interface.

// Inject any Class that has an 'inject', or 'MembersInject' method on the component.
ClassToInject classToInject = new ClassToInject();
objectGraph.inject(classToInject);

// Get any object by Class that has a `get`, `Lazy`, or `Provider` method on the component.
ClassA classASingleton = objectGraph.get(ClassA.class);
@Singleton
@Component(modules = ModuleA.class)
public interface ComponentA {
    void inject(ClassToInject obj);
    ClassA getClassA();
}
@Module
public class ModuleA {
    @Provides @Singleton ClassA providesClassA() {
         return new ClassA();
    }
}
public class ClassA {
}
public class ClassToInject {
    @Inject ClassA classA;
}

Proguard

Just like Dagger 2, Bullet doesn't use any reflection, and thus is completely compatible with Proguard.

How does it work?

Bullet is an annotation processor triggered by Dagger 2's @Component and @Subcomponent annotations. All you need to do is put Bullet in your processor path. It should work with all component configurations.

License

Copyright 2014 Thomas Broyer

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Версии библиотеки

Версия
0.21