net.ltgt.dagger:bullet-compiler

Provides Dagger1-like ObjectGraph API around Dagger2 Components

Лицензия

Лицензия

Категории

Категории

Сеть Dagger Библиотеки уровня приложения Dependency Injection
Группа

Группа

net.ltgt.dagger
Идентификатор

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

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

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

0.20
Дата

Дата

Тип

Тип

jar
Описание

Описание

Provides Dagger1-like ObjectGraph API around Dagger2 Components

Скачать bullet-compiler

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

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

Зависимости

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
net.ltgt.dagger : bullet jar 0.20

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

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

Bullet

Provides Dagger†-like ObjectGraph API around Dagger‡ Components

Download

Releases are deployed to the Central Repository

Snapshots of the development version are available in Sonatype's snapshots repository.

When to use Bullet•

If you don't have a use-case for Bullet•, don't use it. If you do have a use-case for it, try to refactor your code to remove that need. Bullet• can possibly be useful when migrating from Dagger† to Dagger‡, but not everyone agrees.

Usage

Bullet• generates a class with a Bullet prefix next to your components (and next to the Dagger_-prefixed class that Dagger‡ generates), whose constructor expects an instance of your component as argument, and which implements the bullet.ObjectGraph interface providing:

  • a <T> T get(Class<T> type) method to get an instance of some type T
  • a <T> T inject(T instance) method to inject members of some existing instance of type T

The ObjectGraph will delegate to the appropriate method of the wrapped component depending on the argument and, similarly to Dagger†, throw an IllegalArgumentException if none can be found.

Bullet• is triggered by Dagger‡'s @Component and @Subcomponent annotations, so you only need to put Bullet• in your processor path to get it to work; no need to change anything to your component interfaces.

Notes on name and version

Dagger's name comes from a play on words because it builds a directed acyclic graph (DAG). It happens that Unicode has a character named dagger (†): codepoint U+2020. Dagger 2 is sometimes shortened to ‡, the double-dagger Unicode character, codepoint U+2021. Bullet is thus named after Unicode's U+2022.

Because I started this project only as a proof-of-concept and mostly for fun, and to learn more about annotation processors, I'll name versions after firearms calibers (not that I like guns or find them “fun” –I don't– but just to continue on the pun), possibly ending with a 1.0 silver bullet.

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.20
0.1