From aabd13fe0e748ce65f1810217a73362ae9960b01 Mon Sep 17 00:00:00 2001 From: YOUNG HO CHA Date: Wed, 19 Nov 2025 13:32:07 +0900 Subject: [PATCH 1/2] Migrate build scripts examples to kts for component/README.md --- component/README.md | 71 +++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/component/README.md b/component/README.md index 02e24b0..a64beb6 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,17 @@ 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("org.jetbrains.kotlin.kapt") +} 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") + kapt("com.google.auto.service:auto-service:x.x") } ``` @@ -544,10 +547,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") } ``` From 966a954826a60041133d809f04db483898317754 Mon Sep 17 00:00:00 2001 From: YOUNG HO CHA Date: Wed, 19 Nov 2025 13:33:59 +0900 Subject: [PATCH 2/2] Added ksp example on component/README.md --- component/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/component/README.md b/component/README.md index a64beb6..0ad7a0a 100644 --- a/component/README.md +++ b/component/README.md @@ -308,6 +308,21 @@ We recommend using `delegateToServiceLoader()` with the So, please add the following entries to `build.gradle.kts` of the "foo" module first. +```kotlin +plugins { + id("com.google.devtools.ksp") +} + +dependencies { + 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")