Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/griffio/dagger2-kotlin
dagger2,querydsl kotlin 1.7.x annotation processor, gradle 7.x
https://github.com/griffio/dagger2-kotlin
dagger2 gradle kapt kotlin
Last synced: 8 days ago
JSON representation
dagger2,querydsl kotlin 1.7.x annotation processor, gradle 7.x
- Host: GitHub
- URL: https://github.com/griffio/dagger2-kotlin
- Owner: griffio
- Created: 2015-05-26T06:55:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-08-29T12:25:57.000Z (about 2 years ago)
- Last Synced: 2024-04-16T18:27:00.265Z (7 months ago)
- Topics: dagger2, gradle, kapt, kotlin
- Language: Kotlin
- Homepage:
- Size: 184 KB
- Stars: 56
- Watchers: 4
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
dagger2-example with Kotlin (1.7.x) kapt annotation processor supported Gradle build
=================================[kapt documentation](https://kotlinlang.org/docs/reference/kapt.html)
[kapt-annotation-processing-for-kotlin](http://blog.jetbrains.com/kotlin/2015/05/kapt-annotation-processing-for-kotlin)
[better-annotation-processing-supporting-stubs-in-kapt](http://blog.jetbrains.com/kotlin/2015/06/better-annotation-processing-supporting-stubs-in-kapt)
[Implement Annotation Processing API (JSR 269) natively in Kotlin](https://youtrack.jetbrains.com/issue/KT-13499)
[Use javac annotation processing implementation, generate AST stubs for Kotlin classes](https://youtrack.jetbrains.com/issue/KT-14937#tab=Linked%20Issues)
[Dagger2 site ](http://google.github.io/dagger/)
Notes:-
* @Component
* @Module
* @ProvidesShows Planets being injected via constructor by qualifier
~~~ kotlin
public class TerrestrialPlanets @Inject (@Named("Mercury") val mercury: Planet,
@Named("Venus") val venus: Planet,
@Named("Earth") val earth: Planet,
@Named("Mars") val mars: Planet) {
}
~~~The TerrestrialPlanetsModule, for example, provides a singleton named "Mercury" etc.
~~~ kotlin
@Module
public class TerrestrialPlanetsModule {@Provides @Singleton @Named("Mercury")
public fun first() : Planet {
return Mercury()
}@Provides @Singleton @Named("Venus")
public fun second() : Planet {
return Venus()
}@Provides @Singleton @Named("Earth")
public fun third() : Planet {
return Earth()
}@Provides @Singleton @Named("Mars")
public fun fourth() : Planet {
return Mars()
}}
~~~* Outer Planets module
* Jupiter
* Saturn
* Uranus
* Neptune---
**Gradle build**
~~~
./gradlew run
~~~~~~
./gradlew test
~~~