Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 52 additions & 34 deletions component/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
```

Expand All @@ -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")
}
```

Expand Down Expand Up @@ -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,<br> 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")
}
```

Expand Down Expand Up @@ -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")
}
```

Expand Down
Loading