diff --git a/component/README.md b/component/README.md index 02e24b0..0ad7a0a 100644 --- a/component/README.md +++ b/component/README.md @@ -34,14 +34,14 @@ This library offers the following benefits: First, add the following entries to your `build.gradle` file. -```groovy +```kotlin dependencies { - implementation 'com.linecorp.lich:component:x.x.x' + implementation("com.linecorp.lich:component:x.x.x") // For Jetpack Compose - implementation 'com.linecorp.lich:component-compose:x.x.x' + implementation("com.linecorp.lich:component-compose:x.x.x") // Optional: Enables diagnostic features for debug builds. - debugRuntimeOnly 'com.linecorp.lich:component-debug:x.x.x' + debugRuntimeOnly("com.linecorp.lich:component-debug:x.x.x") } ``` @@ -52,38 +52,38 @@ In addition, helper functions to work with [MockK](https://mockk.io/) or If you are using [MockK](https://mockk.io/), add the following dependencies: -```groovy +```kotlin dependencies { - testImplementation 'com.linecorp.lich:component-test-mockk:x.x.x' - testImplementation 'androidx.test:runner:x.x.x' - testImplementation 'androidx.test.ext:junit:x.x.x' - testImplementation 'io.mockk:mockk:x.x.x' - testImplementation 'org.robolectric:robolectric:x.x' + testImplementation("com.linecorp.lich:component-test-mockk:x.x.x") + testImplementation("androidx.test:runner:x.x.x") + testImplementation("androidx.test.ext:junit:x.x.x") + testImplementation("io.mockk:mockk:x.x.x") + testImplementation("org.robolectric:robolectric:x.x") - androidTestImplementation 'com.linecorp.lich:component-test-mockk:x.x.x' - androidTestImplementation 'androidx.test:runner:x.x.x' - androidTestImplementation 'androidx.test.ext:junit:x.x.x' - androidTestImplementation 'io.mockk:mockk-android:x.x.x' + androidTestImplementation("com.linecorp.lich:component-test-mockk:x.x.x") + androidTestImplementation("androidx.test:runner:x.x.x") + androidTestImplementation("androidx.test.ext:junit:x.x.x") + androidTestImplementation("io.mockk:mockk-android:x.x.x") } ``` If you are using [Mockito-Kotlin](https://github.com/mockito/mockito-kotlin), add the following dependencies instead: -```groovy +```kotlin dependencies { - testImplementation 'com.linecorp.lich:component-test-mockitokotlin:x.x.x' - testImplementation 'androidx.test:runner:x.x.x' - testImplementation 'androidx.test.ext:junit:x.x.x' - testImplementation 'org.mockito:mockito-inline:x.x.x' - testImplementation 'org.mockito.kotlin:mockito-kotlin:x.x.x' - testImplementation 'org.robolectric:robolectric:x.x' + testImplementation("com.linecorp.lich:component-test-mockitokotlin:x.x.x") + testImplementation("androidx.test:runner:x.x.x") + testImplementation("androidx.test.ext:junit:x.x.x") + testImplementation("org.mockito:mockito-inline:x.x.x") + testImplementation("org.mockito.kotlin:mockito-kotlin:x.x.x") + testImplementation("org.robolectric:robolectric:x.x") - androidTestImplementation 'com.linecorp.lich:component-test-mockitokotlin:x.x.x' - androidTestImplementation 'androidx.test:runner:x.x.x' - androidTestImplementation 'androidx.test.ext:junit:x.x.x' - androidTestImplementation 'org.mockito:mockito-android:x.x.x' - androidTestImplementation 'org.mockito.kotlin:mockito-kotlin:x.x.x' + androidTestImplementation("com.linecorp.lich:component-test-mockitokotlin:x.x.x") + androidTestImplementation("androidx.test:runner:x.x.x") + androidTestImplementation("androidx.test.ext:junit:x.x.x") + androidTestImplementation("org.mockito:mockito-android:x.x.x") + androidTestImplementation("org.mockito.kotlin:mockito-kotlin:x.x.x") } ``` @@ -305,14 +305,32 @@ delegates the creation of a component to [ServiceLoader](https://developer.andro We recommend using `delegateToServiceLoader()` with the [AutoService](https://github.com/google/auto/tree/master/service) library. -So, please add the following entries to `build.gradle` of the "foo" module first. +So, please add the following entries to `build.gradle.kts` of the "foo" module first. + -```groovy -apply plugin: 'kotlin-kapt' +```kotlin +plugins { + id("com.google.devtools.ksp") +} dependencies { - compileOnly 'com.google.auto.service:auto-service-annotations:x.x' - kapt 'com.google.auto.service:auto-service:x.x' + compileOnly("com.google.auto.service:auto-service-annotations:x.x") + ksp("dev.zacsweers.autoservice:auto-service-ksp:x.x") +} +``` + +| ℹ️ | +|:---| +| KAPT was deprecated,
but you can still use like this. | + +```kotlin +plugins { + id("org.jetbrains.kotlin.kapt") +} + +dependencies { + compileOnly("com.google.auto.service:auto-service-annotations:x.x") + kapt("com.google.auto.service:auto-service:x.x") } ``` @@ -544,10 +562,10 @@ class ComponentY(context: Context) { The `component-debug` module provides some useful features for debugging. -```groovy +```kotlin dependencies { - implementation 'com.linecorp.lich:component:x.x.x' - debugImplementation 'com.linecorp.lich:component-debug:x.x.x' + implementation("com.linecorp.lich:component:x.x.x") + debugImplementation("com.linecorp.lich:component-debug:x.x.x") } ```