Skip to content

Commit

Permalink
Use compileOnly for coroutines dependency (Jvm/Android)
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm committed Mar 19, 2024
1 parent 56d64d7 commit eb7f1ae
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ functionality is backported for Android and tested against API 15+.

## Example

**NOTE:** Async API usage on `Jvm` & `Android` requires the `kotlinx.coroutines.core` dependency.

```kotlin
val builder = Process.Builder(command = "cat")
// Optional arguments
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ kotlin.mpp.applyDefaultHierarchyTemplate=false
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.stability.nowarn=true
kotlin.native.ignoreDisabledTargets=true
kotlin.native.ignoreIncorrectDependencies=true

SONATYPE_HOST=S01
RELEASE_SIGNING_ENABLED=true
Expand Down
7 changes: 6 additions & 1 deletion library/process/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ kmpConfiguration {
dependencies {
api(libs.kmp.file)
implementation(libs.immutable.collections)
implementation(libs.kotlinx.coroutines.core)
compileOnly(libs.kotlinx.coroutines.core)
}
}
sourceSetTest {
Expand All @@ -40,6 +40,11 @@ kmpConfiguration {

kotlin {
with(sourceSets) {
findByName("nonJvmMain")?.apply {
dependencies {
implementation(libs.kotlinx.coroutines.core)
}
}
findByName("unixMain")?.apply {
dependencies {
implementation(libs.kotlincrypto.endians)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ public fun interface OutputFeed {
* was called (i.e. never started)
* - Has already stopped
*
* **NOTE:** For Jvm & Android the `kotlinx.coroutines.core`
* dependency is needed.
*
* @return [Process] for chaining calls
* @see [io.matthewnelson.kmp.process.Blocking.Waiter.awaitStop]
* */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ public abstract class Process internal constructor(
/**
* Delays the current coroutine until [Process] completion.
*
* **NOTE:** For Jvm & Android the `kotlinx.coroutines.core`
* dependency is needed.
*
* **NOTE:** Care must be had when using Async APIs such that,
* upon cancellation, [Process.destroy] is still called.
*
Expand All @@ -190,6 +193,9 @@ public abstract class Process internal constructor(
* or until [Process.exitCode] is available (i.e. the
* [Process] completed).
*
* **NOTE:** For Jvm & Android the `kotlinx.coroutines.core`
* dependency is needed.
*
* **NOTE:** Care must be had when using Async APIs such that,
* upon cancellation, [Process.destroy] is still called.
*
Expand Down
2 changes: 1 addition & 1 deletion library/process/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires transitive io.matthewnelson.kmp.file;
requires io.matthewnelson.immutable.collections;
requires java.management;
requires kotlinx.coroutines.core;
requires static kotlinx.coroutines.core;

exports io.matthewnelson.kmp.process;
}

0 comments on commit eb7f1ae

Please sign in to comment.