Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
v0.6.1 release
  • Loading branch information
ShreckYe committed Dec 5, 2024
2 parents 4686194 + adec16f commit 81addbb
Show file tree
Hide file tree
Showing 17 changed files with 174 additions and 713 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Change log

## v0.6.0 / 2024-11-29

* add conversion functions to convert Vert.x `Buffer`s to kotlinx-io `RawSink`s and `Sink`s and Okio `Sink`s and `BufferedSink`s

The `Source` conversion functions are not provided because Vert.x `Buffer` doesn't provide reading methods with a reader index.

* adapt to the [Exposed SELECT DSL design changes](https://github.com/JetBrains/Exposed/pull/1916) and bump Exposed to v0.56.0

The old `deleteWhereStatement` that conflicts with the new one is removed, causing a source and binary incompatible change.

* add API documentation generated by Dokka hosted at <https://huanshankeji.github.io/kotlin-common/>
* add CODE_OF_CONDUCT.md and CONTRIBUTING.md
* use the Kotlin binary compatibility validator
* add some experimental plus operators for nullable functions/lambdas
* add some common functions for Exposed and Vert.x SQL Client such as `jdbcUrl`, `ClientBuilder<*>.withCoConnectHandler`, and `SqlConnectOptions.setUpConventionally`
* add a `CoroutineAutoCloseable` interface like `AutoCloseable` and its version of the `use` extension function

## v0.5.1 / 2024-10-19

* enable the iOS targets for the "coroutines" module, which was disabled due to a compiler bug
Expand Down
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ apiValidation {
klib {
enabled = true
}

ignoredProjects += "kotlin-common".let {
"$it-serialization-benchmark".let {
listOf(it, "$it-jvm-only")
} + "$it-vertx-with-context-receivers"
}
}
7 changes: 3 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ repositories {
}

dependencies {
// With Kotlin 2.0.20, a "Could not parse POM" build error occurs in the JVM projects of some dependent projects.
implementation(kotlin("gradle-plugin", "2.0.10"))
implementation("com.huanshankeji:common-gradle-dependencies:0.8.0-20241016") // don't use a snapshot version in a main branch
implementation("com.huanshankeji.team:gradle-plugins:0.6.0") // don't use a snapshot version in a main branch
implementation(kotlin("gradle-plugin", "2.1.0"))
implementation("com.huanshankeji:common-gradle-dependencies:0.9.0-20241203") // don't use a snapshot version in a main branch
implementation("com.huanshankeji.team:gradle-plugins:0.9.0") // don't use a snapshot version in a main branch
implementation("org.jetbrains.dokka:dokka-gradle-plugin:2.0.0-Beta")
}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/VersionsAndDependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import com.huanshankeji.CommonDependencies
import com.huanshankeji.CommonGradleClasspathDependencies
import com.huanshankeji.CommonVersions

val projectVersion = "0.6.0"
val projectVersion = "0.6.1"

val commonVersions = CommonVersions(arrow = "2.0.0-alpha.4" /* for Wasm JS*/, exposed = "0.56.0")
val commonVersions = CommonVersions()
val commonDependencies = CommonDependencies(commonVersions)
val commonGradleClasspathDependencies = CommonGradleClasspathDependencies(commonVersions)

Expand Down
3 changes: 1 addition & 2 deletions buildSrc/src/main/kotlin/common-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ plugins {
id("com.huanshankeji.team.with-group")
id("maven-central")
id("com.huanshankeji.team.default-github-packages-maven-publish")
id("version")
id("dokka-convention")
}

version = projectVersion

afterEvaluate {
publishing.publications.withType<MavenPublication> {
pomForTeamDefaultOpenSource(
Expand Down
13 changes: 1 addition & 12 deletions buildSrc/src/main/kotlin/dokka-convention.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
plugins {
id("org.jetbrains.dokka")
id("com.huanshankeji.team.dokka.github-dokka-convention")
}

dokka {
//moduleName.set("Huanshankeji Kotlin Common")
dokkaSourceSets.all {
//includes.from("README.md")
sourceLink {
//localDirectory.set(file("src/main/kotlin"))
remoteUrl(
"https://github.com/huanshankeji/kotlin-common/tree/v${version}/${
with(project) {
name.removePrefix(parent!!.name + '-')
}
}"
)
remoteLineSuffix.set("#L")
}
/*pluginsConfiguration.html {
footerMessage.set("(c) Yongshun Ye")
}*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
id("common-conventions")
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/version.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// extracted into a separate script so the version can be set before `dokka-convention`

version = projectVersion
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,31 @@ package com.huanshankeji.codec
import io.kotest.property.Arb
import io.kotest.property.Exhaustive
import io.kotest.property.arbitrary.byteArray
import io.kotest.property.arbitrary.default
import io.kotest.property.arbitrary.list
import io.kotest.property.checkAll
import io.kotest.property.exhaustive.of
import kotlinx.coroutines.ExperimentalCoroutinesApi
import io.kotest.property.resolution.default
import kotlinx.coroutines.test.TestResult
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertContentEquals
import kotlin.test.assertEquals

class BasicCodecsTest {
@OptIn(ExperimentalUnsignedTypes::class, ExperimentalCoroutinesApi::class)
@OptIn(ExperimentalUnsignedTypes::class)
@Test
fun testConversionBetweenLongAndBigEndianBytes(): TestResult {
val long = 0x0123456789ABCDEFU.toLong()
val bytes = ubyteArrayOf(0x01U, 0x23U, 0x45U, 0x67U, 0x89U, 0xABU, 0xCDU, 0xEFU).asByteArray()
assertContentEquals(bytes, long.toBigEndianBytes())
assertEquals(long, bytes.bigEndianToLong())

@OptIn(ExperimentalCoroutinesApi::class)
return runTest {
checkAll<Long> {
assertEquals(it, it.toBigEndianBytes().bigEndianToLong())
assertEquals(it, it.toBigEndianBytes().asList().bigEndianToLong())
}
checkAll<ByteArray>(Arb.byteArray(Exhaustive.of(8), Arb.default())) {
checkAll(Arb.byteArray(Exhaustive.of(8), Arb.default())) {
assertContentEquals(it, it.bigEndianToLong().toBigEndianBytes())
}
checkAll<List<Byte>>(Arb.list(Arb.default(), 8..8)) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading

0 comments on commit 81addbb

Please sign in to comment.