Skip to content

Commit 4ac8808

Browse files
committed
Merge branch 'main' into release
v0.4.0 release
2 parents 5f4a007 + e99fb42 commit 4ac8808

File tree

71 files changed

+1603
-1083
lines changed

Some content is hidden

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

71 files changed

+1603
-1083
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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/), 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.
99

1010
## Maven coordinates
1111

buildSrc/build.gradle.kts

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

1717
dependencies {
18-
implementation(kotlin("gradle-plugin", "1.8.10"))
19-
implementation("com.huanshankeji:common-gradle-dependencies:0.5.0-20230310")
20-
implementation("com.huanshankeji.team:gradle-plugins:0.4.0")
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")
2121
}

buildSrc/src/main/kotlin/VersionsAndDependencies.kt

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

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

77
val commonVersions = CommonVersions()
88
val commonDependencies = CommonDependencies(commonVersions)
99
val commonGradleClasspathDependencies = CommonGradleClasspathDependencies(commonVersions)
10+
11+
object DependencyVersions {
12+
val protobufPlugin = "0.9.4"
13+
val protobuf = "3.25.2"
14+
}

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

Lines changed: 0 additions & 17 deletions
This file was deleted.

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

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import com.huanshankeji.team.`Shreck Ye`
2+
import com.huanshankeji.team.pomForTeamDefaultOpenSource
3+
4+
plugins {
5+
id("com.huanshankeji.team.with-group")
6+
id("com.huanshankeji.team.default-github-packages-maven-publish")
7+
}
8+
9+
version = projectVersion
10+
11+
afterEvaluate {
12+
publishing.publications.withType<MavenPublication> {
13+
pomForTeamDefaultOpenSource(
14+
project,
15+
"Huanshankeji Kotlin Common",
16+
"Huanshankeji's common code libraries in Kotlin"
17+
) {
18+
`Shreck Ye`()
19+
}
20+
}
21+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
2-
id("common-conventions-before")
2+
id("common-conventions")
33
id("com.huanshankeji.kotlin-jvm-library-sonatype-ossrh-publish-conventions")
4-
id("common-conventions-after")
54
}
65

76
kotlin.jvmToolchain(8)
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
plugins {
2-
id("common-conventions-before")
2+
id("common-conventions")
33
id("com.huanshankeji.kotlin-multiplatform-jvm-and-js-browser-conventions")
44
id("com.huanshankeji.kotlin-multiplatform-sonatype-ossrh-publish-conventions")
5-
id("common-conventions-after")
65
}
76

87
kotlin.jvmToolchain(8)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.huanshankeji
2+
3+
interface BidirectionalConversion<T1, T2> {
4+
fun to(value: T1): T2
5+
fun from(value: T2): T1
6+
}

core/src/jvmMain/kotlin/com/huanshankeji/codec/BasicCodecs.kt renamed to core/src/commonMain/kotlin/com/huanshankeji/codec/BasicCodecs.kt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.huanshankeji.codec
22

3-
import java.util.*
3+
import kotlin.io.encoding.Base64
4+
import kotlin.io.encoding.ExperimentalEncodingApi
45

56
fun uLongBigEndianShiftOffset(index: Int): Int =
67
(7 - index) * 8
@@ -36,8 +37,18 @@ fun List<Byte>.bigEndianToLong(): Long =
3637
map { it.toUByte() }.bigEndianToULong().toLong()
3738

3839

40+
@Deprecated(
41+
"Use `Base64` in the Kotlin Standard Library directly.",
42+
ReplaceWith("Base64.encode(this)", "kotlin.io.encoding.Base64")
43+
)
3944
fun ByteArray.toBase64String(): String =
40-
Base64.getEncoder().encodeToString(this)
45+
@OptIn(ExperimentalEncodingApi::class)
46+
Base64.encode(this)
4147

48+
@Deprecated(
49+
"Use `Base64` in the Kotlin Standard Library directly.",
50+
ReplaceWith("Base64.decode(this)", "kotlin.io.encoding.Base64")
51+
)
4252
fun String.base64ToBytes(): ByteArray =
43-
Base64.getDecoder().decode(this)
53+
@OptIn(ExperimentalEncodingApi::class)
54+
Base64.decode(this)

0 commit comments

Comments
 (0)