Skip to content

Commit

Permalink
Update Kotlin to 1.7.0 and ktor-io to 2.0.3
Browse files Browse the repository at this point in the history
Fix Gradle task dependency in `buildSrc` and remove unused Gradle
properties.
  • Loading branch information
saschpe committed Jun 29, 2022
1 parent 1044058 commit 8fb863d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 21 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

- Dependency update:
- [Kotlin-1.7.0](https://github.com/JetBrains/kotlin/releases/tag/v1.7.0)
- [Ktor-2.0.3](https://ktor.io/changelog/2.0#version-2-0-3)

## [1.0.6] - 2022-05-04
### Changed
- Dependency update:
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
kotlin("jvm") version "1.6.21"
kotlin("jvm") version "1.7.0" apply false
id("com.android.library") version "7.0.4" apply false
id("com.diffplug.spotless") version "6.6.1"
id("com.diffplug.spotless") version "6.7.2"
id("com.github.ben-manes.versions") version "0.42.0"
}

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ object Secrets {
}
}
}
named("assemble") { dependsOn(ensureSecretsExist) }
compileKotlin { dependsOn(ensureSecretsExist) }
}
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ org.gradle.vfs.watch=true
# Kotlin
kotlin.code.style=official
kotlin.mpp.stability.nowarn=true
kotlin.native.ignoreDisabledTargets=true

# Android
android.enableJetifier=true
Expand Down
8 changes: 1 addition & 7 deletions kex/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kotlin {
jvm { testRuns["test"].executionTask.configure { useJUnitPlatform() } }

sourceSets["commonMain"].dependencies {
implementation("io.ktor:ktor-io:2.0.1")
implementation("io.ktor:ktor-io:2.0.3")
}
sourceSets["commonTest"].dependencies {
implementation(kotlin("test"))
Expand Down Expand Up @@ -51,14 +51,8 @@ android {
group = "de.peilicke.sascha"
version = "1.0.6"

val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}

publishing {
publications.withType<MavenPublication> {
artifact(javadocJar.get())

pom {
name.set("Kex")
description.set("Hex string encoder/decoder for Kotlin/Multiplatform. Supports Android, iOS, JavaScript and plain JVM environments.")
Expand Down
16 changes: 8 additions & 8 deletions kex/src/commonMain/kotlin/saschpe/kex/Hex.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,21 @@ object Hex {
return outPos - outOff
}

private fun encodeInternal(buf: ByteArray, out: Output): Int {
private fun encodeInternal(buf: ByteArray, output: Output): Int {
var offM = 0
var lenM = buf.size
val tmp = ByteArray(72)
while (lenM > 0) {
val inLen = min(36, lenM)
val outLen = encodeInternal(buf, offM, inLen, tmp, 0)
out.writeFully(tmp, 0, outLen)
output.writeFully(tmp, 0, outLen)
offM += inLen
lenM -= inLen
}
return lenM * 2
}

private fun decodeInternal(data: ByteArray, out: Output): Int {
private fun decodeInternal(data: ByteArray, output: Output): Int {
val off = 0
val length = data.size
var b1: Byte
Expand Down Expand Up @@ -143,18 +143,18 @@ object Hex {
}
buf[bufOff++] = (b1.toInt() shl 4 or b2.toInt()).toByte()
if (bufOff == buf.size) {
out.writeFully(buf, 0, buf.size)
output.writeFully(buf, 0, buf.size)
bufOff = 0
}
outLen++
}
if (bufOff > 0) {
out.writeFully(buf, 0, bufOff)
output.writeFully(buf, 0, bufOff)
}
return outLen
}

private fun decodeInternal(data: String, out: Output): Int {
private fun decodeInternal(data: String, output: Output): Int {
var b1: Byte
var b2: Byte
var length = 0
Expand Down Expand Up @@ -182,13 +182,13 @@ object Hex {
}
buf[bufOff++] = (b1.toInt() shl 4 or b2.toInt()).toByte()
if (bufOff == buf.size) {
out.writeFully(buf, 0, buf.size)
output.writeFully(buf, 0, buf.size)
bufOff = 0
}
length++
}
if (bufOff > 0) {
out.writeFully(buf, 0, bufOff)
output.writeFully(buf, 0, bufOff)
}
return length
}
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
google()
}
}

dependencyResolutionManagement {
repositories {
mavenCentral()
Expand Down

0 comments on commit 8fb863d

Please sign in to comment.