From b5205e951af64dd23006efe2dc040f3d320711f5 Mon Sep 17 00:00:00 2001 From: bppleman Date: Sat, 17 Aug 2024 02:49:20 +0800 Subject: [PATCH 1/2] upgrade kotlin version to 2.0.10 --- .gitignore | 3 +++ build.gradle.kts | 6 ------ settings.gradle.kts | 6 +++--- .../kotlin/com/kgit2/kommand/io/BufferedReader.native.kt | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index de17a73..943c48b 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,6 @@ gradle-app.setting # End of https://www.toptal.com/developers/gitignore/api/macos,intellij+iml,vim,visualstudiocode,gradle,kotlin build-cache + +### kotlin ### +.kotlin diff --git a/build.gradle.kts b/build.gradle.kts index dfe8596..088595c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -95,12 +95,6 @@ tasks { showStandardStreams = true } } - - val testArg by creating { - doLast { - println(testString) - } - } } val ossrhUrl: String = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" diff --git a/settings.gradle.kts b/settings.gradle.kts index e5c99df..e9528e4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,8 +1,8 @@ pluginManagement { plugins { - kotlin("jvm") version "1.9.21" apply false - kotlin("multiplatform") version "1.9.21" apply false - id("org.jetbrains.dokka") version "1.9.10" apply false + kotlin("jvm") version "2.0.10" apply false + kotlin("multiplatform") version "2.0.10" apply false + id("org.jetbrains.dokka") version "1.9.20" apply false id("io.github.gradle-nexus.publish-plugin") version "1.3.0" apply false } diff --git a/src/nativeMain/kotlin/com/kgit2/kommand/io/BufferedReader.native.kt b/src/nativeMain/kotlin/com/kgit2/kommand/io/BufferedReader.native.kt index 210a3f7..3fe9352 100644 --- a/src/nativeMain/kotlin/com/kgit2/kommand/io/BufferedReader.native.kt +++ b/src/nativeMain/kotlin/com/kgit2/kommand/io/BufferedReader.native.kt @@ -20,7 +20,7 @@ actual class BufferedReader( private val type: ReaderType, ) { - val cleaner = createCleaner(inner) { reader -> + val cleaner = createCleaner(inner to type) { (reader, type) -> when (type) { ReaderType.STDOUT -> { drop_stdout(reader) From 30a25048eba8515aad6d3ef900630f12e4dd6d31 Mon Sep 17 00:00:00 2001 From: bppleman Date: Sat, 17 Aug 2024 03:00:29 +0800 Subject: [PATCH 2/2] update kommand version number to 2.2.0 --- README.md | 9 ++++----- build.gradle.kts | 21 +++++++++++++++------ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index cb058a2..8ebcf83 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Kotlin Native library for create sub-process and redirect their I/O. -# v2.1.2 +# v2.2.0 Rust is an excellent language that takes into account both performance and engineering. @@ -21,7 +21,7 @@ In version 1.x, we use the following API to provide the function of creating chi - `CreateChildProcess` of [win32 api] - `java.lang.ProcessBuilder` of JVM -In version 2.0, we use the Rust standard library to provide the function of creating child processes. +In version 2.x, we use the Rust standard library to provide the function of creating child processes. - `std::process::Command` of Rust - `java.lang.ProcessBuilder` of JVM @@ -45,8 +45,8 @@ It will bring # Dependent -- Rust Standard Library 1.69.0 -- Kotlin Multiplatform 1.9.21 +- Rust Standard Library 1.69.0 (No support for later versions) +- Kotlin Multiplatform 2.0.10 # Usage @@ -99,7 +99,6 @@ Dependency: ### 1. Dependencies - rust toolchain - <= 1.69.0 (https://rustup.rs) (recommend) - - cross (install with `cargo install cross`) - just (install with `cargo install just`) - cross-compile toolchain - x86_64-apple-darwin diff --git a/build.gradle.kts b/build.gradle.kts index 088595c..6895da5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,6 @@ +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { kotlin("multiplatform") id("org.jetbrains.dokka") @@ -6,8 +9,11 @@ plugins { id("io.github.gradle-nexus.publish-plugin") } -group = "com.kgit2" -version = "2.1.2" +val sharedGroup = "com.kgit2" +val sharedVersion = "2.2.0" + +group = sharedGroup +version = sharedVersion repositories { mavenCentral() @@ -15,15 +21,17 @@ repositories { } subprojects { - group = "com.kgit2" - version = "1.2.0" + group = sharedGroup + version = sharedVersion } kotlin { jvm { - compilations.all { - kotlinOptions.jvmTarget = "17" + @OptIn(ExperimentalKotlinGradlePluginApi::class) + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) } + withJava() testRuns["test"].executionTask.configure { useJUnitPlatform() @@ -63,6 +71,7 @@ kotlin { languageSettings.optIn("kotlin.ExperimentalStdlibApi") languageSettings { + @OptIn(ExperimentalKotlinGradlePluginApi::class) compilerOptions { freeCompilerArgs.add("-Xexpect-actual-classes") }