From 6a1c996a58fada8ec5cc0785dd098fea01ec08ce Mon Sep 17 00:00:00 2001 From: manu Date: Wed, 21 Feb 2024 22:56:46 +0100 Subject: [PATCH] ... --- README.md | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 97dea28d0..3539c6979 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,31 @@ suspend fun main() { } ``` +# Setup +```kotlin +// in your buildscript +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath("com.ivianuu.injekt:injekt-gradle-plugin:${latest_version}") + } +} + +// in your app module +plugins { + apply("com.ivianuu.injekt") +} + +dependencies { + // core runtime + implementation("com.ivianuu.injekt:core:${latest_version}") + // optional - common utilities + implementation("com.ivianuu.injekt:common:${latest_version}") +} +``` + # Provide injectables You can provide dependencies by annotating them with @Provide: ```kotlin @@ -166,30 +191,5 @@ typealias TrackId = @TrackIdTag String fun loadPlaylistTracks(playlistId: PlaylistId = inject, trackId: TrackId = inject): List = ... ``` -# Setup -```kotlin -// in your buildscript -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath("com.ivianuu.injekt:injekt-gradle-plugin:${latest_version}") - } -} - -// in your app module -plugins { - apply("com.ivianuu.injekt") -} - -dependencies { - // core runtime - implementation("com.ivianuu.injekt:core:${latest_version}") - // optional - common utilities - implementation("com.ivianuu.injekt:common:${latest_version}") -} -``` - # More complex uses can be found in my essentials project(base project for my apps) # https://github.com/IVIanuu/essentials \ No newline at end of file