Skip to content

Commit 6733905

Browse files
committed
Merge branch 'main' into release
v0.5.0 release
2 parents 4ac8808 + 9189b86 commit 6733905

File tree

47 files changed

+520
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+520
-268
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Ignore Gradle project-specific cache directory
22
.gradle
33

4+
.kotlin
5+
46
# Ignore Gradle build output directory
57
build
68

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
Huanshankeji's common code libraries in Kotlin
77

8-
These include a core library to extend the Kotlin language and its standard library, and extension libraries for various Kotlin and Java libraries such as [Λrrow](https://arrow-kt.io/), Coroutines ([docs here](https://kotlinlang.org/docs/coroutines-overview.html) and [repository here](https://github.com/Kotlin/kotlinx.coroutines)), [Exposed](https://github.com/JetBrains/Exposed), [Ktor](https://ktor.io/), [reflection](https://kotlinlang.org/docs/reflection.html), Serialization ([docs here](https://kotlinlang.org/docs/serialization.html) and [repository here](https://github.com/Kotlin/kotlinx.serialization)), [Vert.x](https://vertx.io/), etc.
8+
These include a core library to extend the Kotlin language and its standard library, and extension libraries for various Kotlin and Java libraries such as [Λrrow](https://arrow-kt.io/), Coroutines ([docs here](https://kotlinlang.org/docs/coroutines-overview.html) and [repository here](https://github.com/Kotlin/kotlinx.coroutines)), [Exposed](https://github.com/JetBrains/Exposed), [Ktor](https://ktor.io/), [reflection](https://kotlinlang.org/docs/reflection.html), Serialization ([docs here](https://kotlinlang.org/docs/serialization.html) and [repository here](https://github.com/Kotlin/kotlinx.serialization)), [Vert.x](https://vertx.io/), etc. For common extensions for Compose Multiplatform, check out [compose-multiplatform-common](https://github.com/huanshankeji/compose-multiplatform-material/tree/main/compose-multiplatform-common).
9+
10+
Currently supported targets by multiplatform libraries: JVM, JS (browser), iOS (`iosX64`, `iosArm64`, and `iosSimulatorArm64`) (except for the Coroutines module), and Wasm JS.
911

1012
## Maven coordinates
1113

buildSrc/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ repositories {
1515
}
1616

1717
dependencies {
18-
implementation(kotlin("gradle-plugin", "1.9.23"))
19-
implementation("com.huanshankeji:common-gradle-dependencies:0.7.1-20240314-boostrap")
20-
implementation("com.huanshankeji.team:gradle-plugins:0.5.1")
18+
// With Kotlin 2.0.20, a "Could not parse POM" build error occurs in the JVM projects of some dependent projects.
19+
implementation(kotlin("gradle-plugin", "2.0.10"))
20+
implementation("com.huanshankeji:common-gradle-dependencies:0.8.0-20241016") // don't use a snapshot version in a main branch
21+
implementation("com.huanshankeji.team:gradle-plugins:0.6.0") // don't use a snapshot version in a main branch
2122
}

buildSrc/src/main/kotlin/VersionsAndDependencies.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import com.huanshankeji.CommonDependencies
22
import com.huanshankeji.CommonGradleClasspathDependencies
33
import com.huanshankeji.CommonVersions
44

5-
val projectVersion = "0.4.0"
5+
val projectVersion = "0.5.0"
66

7-
val commonVersions = CommonVersions()
7+
val commonVersions = CommonVersions(arrow = "2.0.0-alpha.4") // for Wasm JS
88
val commonDependencies = CommonDependencies(commonVersions)
99
val commonGradleClasspathDependencies = CommonGradleClasspathDependencies(commonVersions)
1010

1111
object DependencyVersions {
1212
val protobufPlugin = "0.9.4"
13-
val protobuf = "3.25.2"
13+
val protobuf = "3.25.2" // Not bumped. The version is a bit chaotic.
1414
}

buildSrc/src/main/kotlin/common-conventions.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import com.huanshankeji.team.pomForTeamDefaultOpenSource
33

44
plugins {
55
id("com.huanshankeji.team.with-group")
6+
id("maven-central")
67
id("com.huanshankeji.team.default-github-packages-maven-publish")
78
}
89

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
repositories {
2+
mavenCentral()
3+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
2+
3+
plugins {
4+
id("common-conventions")
5+
kotlin("multiplatform")
6+
id("com.huanshankeji.kotlin-multiplatform-sonatype-ossrh-publish-conventions")
7+
}
8+
9+
kotlin {
10+
jvm()
11+
jvmToolchain(8)
12+
13+
//androidTarget()
14+
15+
js()
16+
17+
@OptIn(ExperimentalWasmDsl::class)
18+
wasmJs()
19+
}
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
2+
13
plugins {
24
id("common-conventions")
3-
id("com.huanshankeji.kotlin-multiplatform-jvm-and-js-browser-conventions")
5+
id("com.huanshankeji.kotlin-multiplatform-conventional-targets")
46
id("com.huanshankeji.kotlin-multiplatform-sonatype-ossrh-publish-conventions")
57
}
68

7-
kotlin.jvmToolchain(8)
9+
kotlin {
10+
jvmToolchain(8)
11+
12+
@OptIn(ExperimentalWasmDsl::class)
13+
wasmJs()
14+
}

core/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id("multiplatform-conventions")
2+
`multiplatform-conventions`
33
}
44

55
kotlin.sourceSets {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.huanshankeji
2+
3+
/**
4+
* Used in places when curly braces are needed (`if` and `when`) to make the code look better.
5+
*/
6+
inline fun lambdaOf(noinline block: () -> Unit) =
7+
block
8+
9+
/**
10+
* Used in places when curly braces are needed (`if` and `when`) to make the code look better.
11+
*/
12+
inline fun <T, R> lambdaOf(noinline block: (T) -> R) =
13+
block
14+
15+
/**
16+
* A shortcut for the empty lambda, used in places when curly braces are needed (`if` and `when`) to make the code look better.
17+
*/
18+
inline fun emptyLambda() =
19+
{}

0 commit comments

Comments
 (0)