https://github.com/jbock-java/dapper
modular dagger
https://github.com/jbock-java/dapper
dagger dagger2 dependency-injection java jpms
Last synced: about 2 months ago
JSON representation
modular dagger
- Host: GitHub
- URL: https://github.com/jbock-java/dapper
- Owner: jbock-java
- License: apache-2.0
- Created: 2021-10-08T07:59:51.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-07T10:10:45.000Z (almost 3 years ago)
- Last Synced: 2025-04-05T06:31:45.898Z (3 months ago)
- Topics: dagger, dagger2, dependency-injection, java, jpms
- Language: Java
- Homepage:
- Size: 3.21 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://maven-badges.herokuapp.com/maven-central/io.github.jbock-java/dapper-compiler)
[](https://maven-badges.herokuapp.com/maven-central/io.github.jbock-java/dapper)Dapper is a fork of [dagger2](https://github.com/google/dagger),
with some modifications:* gradle project with JUnit 5 tests
* full jpms support with module-name: `dagger`
* removed the producers extension and all producers annotations like `@ProductionComponent`
* remove kotlin special-casing and the dependency on `xprocessing`
* remove gwt special-casing and guava special casing, like support for `c.g.c.b.Optional`
* remove internal guava dependency
* remove the `experimental_turbine_hjar` compiler optionDapper uses `jakarta.inject` annotations and ignores their `javax.inject` counterparts.
Existing dagger projects can use the following script to replace the imports:```bash
for F in `find src/main/java -name "*.java"`; do
for N in Singleton Scope Inject Qualifier Provider; do
sed -i .bak "s/^import javax.inject.$N;$/import jakarta.inject.$N;/" $F
done
rm ${F}.bak
done
```If you have a modular java build, add this to `module-info.java`:
```java
requires dagger;
```The gradle config is as follows:
```groovy
implementation('io.github.jbock-java:dapper:2.41.2')
annotationProcessor('io.github.jbock-java:dapper-compiler:2.41.2')
```