Skip to content

Commit 768fdb8

Browse files
committed
Merge branch 'develop'
2 parents 8950a88 + 15c33ae commit 768fdb8

File tree

30 files changed

+80
-109
lines changed

30 files changed

+80
-109
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# CHANGELOG
22

3+
## 0.8.0
4+
> Published 24 June 2025
5+
6+
### Features
7+
- Updated Kotlin version to 2.2, Dokka to 2.0.0 and also updated few other dependencies [#455](https://github.com/Kotlin/kotlinx-io/pull/455), [#432](https://github.com/Kotlin/kotlinx-io/pull/432), [#442](https://github.com/Kotlin/kotlinx-io/pull/442), [#456](https://github.com/Kotlin/kotlinx-io/pull/456)
8+
- Increased deprecation level for `kotlinx.io.files.Path.source` and `kotlinx.io.files.Path.sink` to `ERROR` [#457](https://github.com/Kotlin/kotlinx-io/pull/457)
9+
### Bugfixes
10+
- Fixed `ArrayIndexOutOfBoundsException` thrown from `okio.Sink.asKotlinxIoRawSink` [#453](https://github.com/Kotlin/kotlinx-io/pull/453)
11+
312
## 0.7.0
413
> Published 26 February 2025
514

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ repositories {
4949
Add the library to dependencies:
5050
```kotlin
5151
dependencies {
52-
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.7.0")
52+
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.8.0")
5353
}
5454
```
5555

@@ -59,7 +59,7 @@ kotlin {
5959
sourceSets {
6060
commonMain {
6161
dependencies {
62-
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.7.0")
62+
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.8.0")
6363
}
6464
}
6565
}
@@ -73,7 +73,7 @@ Add the library to dependencies:
7373
<dependency>
7474
<groupId>org.jetbrains.kotlinx</groupId>
7575
<artifactId>kotlinx-io-core-jvm</artifactId>
76-
<version>0.7.0</version>
76+
<version>0.8.0</version>
7777
</dependency>
7878
```
7979

build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-android-compat.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pluginManager.withPlugin("org.gradle.java-base") {
99
apply(plugin = "ru.vyarus.animalsniffer")
1010

1111
configure<AnimalSnifferExtension> {
12-
sourceSets = listOf((project.extensions.getByName("sourceSets") as SourceSetContainer).getByName("main"))
12+
defaultTargets = setOf("jvmMain")
1313
}
1414
val signature: Configuration by configurations
1515
dependencies {
Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,19 @@
11
/*
2-
* Copyright 2017-2024 JetBrains s.r.o. and respective authors and developers.
2+
* Copyright 2017-2025 JetBrains s.r.o. and respective authors and developers.
33
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file.
44
*/
55

6-
import org.jetbrains.dokka.gradle.*
7-
import java.net.URL
8-
96
plugins {
107
id("org.jetbrains.dokka")
118
}
129

13-
// shared configuration for all dokka tasks (both partial and multi-module)
14-
tasks.withType<AbstractDokkaTask>().configureEach {
15-
pluginsMapConfiguration.set(
16-
mapOf(
17-
"org.jetbrains.dokka.base.DokkaBase" to """{ "templatesDir" : "${
18-
rootDir.resolve("dokka-templates")
19-
}" }"""
20-
)
21-
)
22-
}
23-
24-
tasks.withType<DokkaTaskPartial>().configureEach {
10+
dokka {
2511
dokkaSourceSets.configureEach {
2612
includes.from("Module.md")
2713

2814
sourceLink {
2915
localDirectory = rootDir
30-
remoteUrl = URL("https://github.com/kotlin/kotlinx-io/tree/master")
16+
remoteUrl("https://github.com/kotlin/kotlinx-io/tree/master")
3117
remoteLineSuffix = "#L"
3218
}
3319

@@ -40,5 +26,9 @@ tasks.withType<DokkaTaskPartial>().configureEach {
4026
// as in kotlinx-io-multiplatform.gradle.kts:configureSourceSet
4127
val platform = name.dropLast(4)
4228
samples.from("$platform/test/samples")
29+
30+
}
31+
pluginsConfiguration.html {
32+
templatesDir = rootDir.resolve("dokka-templates")
4333
}
4434
}

build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-multiplatform.gradle.kts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import kotlinx.io.build.configureJava9ModuleInfoCompilation
77
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
88
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
9+
import org.jetbrains.kotlin.gradle.dsl.JvmDefaultMode
910
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
1011
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
1112
import kotlin.jvm.optionals.getOrNull
@@ -30,17 +31,11 @@ kotlin {
3031
}
3132

3233
jvm {
33-
withJava()
3434
testRuns["test"].executionTask.configure {
3535
useJUnitPlatform()
3636
}
37-
// can be replaced with just `compilerOptions { }` in Kotlin 2.0
38-
compilations.configureEach {
39-
compileTaskProvider.configure {
40-
compilerOptions {
41-
freeCompilerArgs.add("-Xjvm-default=all")
42-
}
43-
}
37+
compilerOptions {
38+
jvmDefault = JvmDefaultMode.NO_COMPATIBILITY
4439
}
4540

4641
val mrjToolchain = versionCatalog.findVersion("multi.release.toolchain").getOrNull()?.requiredVersion

build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ dependencies {
3434
kover(project(":kotlinx-io-core"))
3535
kover(project(":kotlinx-io-bytestring"))
3636
kover(project(":kotlinx-io-okio"))
37+
38+
dokka(project(":kotlinx-io-bytestring"))
39+
dokka(project(":kotlinx-io-core"))
40+
dokka(project(":kotlinx-io-okio"))
3741
}
3842

3943
kover {

bytestring/apple/test/ByteStringAppleTest.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import platform.Foundation.NSData
1212
import platform.Foundation.create
1313
import platform.posix.memset
1414
import kotlin.io.encoding.Base64
15-
import kotlin.io.encoding.ExperimentalEncodingApi
1615
import kotlin.test.*
1716

1817
@OptIn(UnsafeNumber::class)
@@ -27,12 +26,12 @@ class ByteStringAppleTest {
2726
assertContentEquals(byteArrayOf(0, 1, 2, 3, 4, 5), copy.bytes!!.readBytes(copy.length.convert()))
2827
}
2928

30-
@OptIn(BetaInteropApi::class, ExperimentalEncodingApi::class)
29+
@OptIn(BetaInteropApi::class)
3130
@Test
3231
fun fromNSData() {
3332
assertTrue(NSData().toByteString().isEmpty())
3433
val src = NSData.create(
35-
base64EncodedString = Base64.Default.encode(byteArrayOf(0, 1, 2, 3, 4, 5)),
34+
base64EncodedString = Base64.encode(byteArrayOf(0, 1, 2, 3, 4, 5)),
3635
options = 0u
3736
)!!
3837
val copy = src.toByteString()

bytestring/apple/test/samples/samplesApple.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import platform.Foundation.*
1212
import kotlin.test.*
1313

1414
class ByteStringSamplesApple {
15-
@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class, ExperimentalStdlibApi::class)
15+
@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class)
1616
@Test
1717
fun nsDataConversion() {
1818
val originalByteString: ByteString = "Compress me, please!".encodeToByteString()

bytestring/common/src/Base64.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
package kotlinx.io.bytestring
77

88
import kotlin.io.encoding.Base64
9-
import kotlin.io.encoding.Base64.Default.encode
10-
import kotlin.io.encoding.Base64.Default.encodeToByteArray
11-
import kotlin.io.encoding.ExperimentalEncodingApi
129

1310
/**
1411
* Encodes bytes from the specified [source] byte string or its subrange.
@@ -30,7 +27,6 @@ import kotlin.io.encoding.ExperimentalEncodingApi
3027
*
3128
* @return a [ByteArray] with the resulting symbols.
3229
*/
33-
@ExperimentalEncodingApi
3430
public fun Base64.encodeToByteArray(source: ByteString, startIndex: Int = 0, endIndex: Int = source.size): ByteArray {
3531
return encodeToByteArray(source.getBackingArrayReference(), startIndex, endIndex)
3632
}
@@ -55,7 +51,6 @@ public fun Base64.encodeToByteArray(source: ByteString, startIndex: Int = 0, end
5551
*
5652
* @return the number of symbols written into [destination] array.
5753
*/
58-
@ExperimentalEncodingApi
5954
public fun Base64.encodeIntoByteArray(
6055
source: ByteString,
6156
destination: ByteArray,
@@ -84,7 +79,6 @@ public fun Base64.encodeIntoByteArray(
8479
*
8580
* @return a string with the resulting symbols.
8681
*/
87-
@ExperimentalEncodingApi
8882
public fun Base64.encode(
8983
source: ByteString,
9084
startIndex: Int = 0,
@@ -110,7 +104,6 @@ public fun Base64.encode(
110104
*
111105
* @return the destination appendable.
112106
*/
113-
@ExperimentalEncodingApi
114107
public fun <A : Appendable> Base64.encodeToAppendable(
115108
source: ByteString,
116109
destination: A,
@@ -139,7 +132,6 @@ public fun <A : Appendable> Base64.encodeToAppendable(
139132
*
140133
* @return a [ByteArray] with the resulting bytes.
141134
*/
142-
@ExperimentalEncodingApi
143135
public fun Base64.decode(source: ByteString, startIndex: Int = 0, endIndex: Int = source.size): ByteArray {
144136
return decode(source.getBackingArrayReference(), startIndex, endIndex)
145137
}
@@ -162,7 +154,6 @@ public fun Base64.decode(source: ByteString, startIndex: Int = 0, endIndex: Int
162154
*
163155
* @return a [ByteArray] with the resulting bytes.
164156
*/
165-
@ExperimentalEncodingApi
166157
public fun Base64.decodeToByteString(source: CharSequence, startIndex: Int = 0, endIndex: Int = source.length): ByteString {
167158
return ByteString.wrap(decode(source, startIndex, endIndex))
168159
}
@@ -189,7 +180,6 @@ public fun Base64.decodeToByteString(source: CharSequence, startIndex: Int = 0,
189180
*
190181
* @return the number of bytes written into [destination] array.
191182
*/
192-
@ExperimentalEncodingApi
193183
public fun Base64.decodeIntoByteArray(
194184
source: ByteString,
195185
destination: ByteArray,
@@ -218,7 +208,6 @@ public fun Base64.decodeIntoByteArray(
218208
*
219209
* @return a [ByteString] with the resulting bytes.
220210
*/
221-
@ExperimentalEncodingApi
222211
public fun Base64.decodeToByteString(source: ByteArray, startIndex: Int = 0, endIndex: Int = source.size): ByteString {
223212
return ByteString.wrap(decode(source, startIndex, endIndex))
224213
}
@@ -241,7 +230,6 @@ public fun Base64.decodeToByteString(source: ByteArray, startIndex: Int = 0, end
241230
*
242231
* @return a [ByteString] with the resulting bytes.
243232
*/
244-
@ExperimentalEncodingApi
245233
public fun Base64.decodeToByteString(source: ByteString, startIndex: Int = 0, endIndex: Int = source.size): ByteString {
246234
return ByteString.wrap(decode(source.getBackingArrayReference(), startIndex, endIndex))
247235
}

bytestring/common/src/Hex.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ package kotlinx.io.bytestring
1414
*
1515
* @throws IllegalArgumentException if the result length is more than [String] maximum capacity.
1616
*/
17-
@ExperimentalStdlibApi
1817
public fun ByteString.toHexString(format: HexFormat = HexFormat.Default): String {
1918
return getBackingArrayReference().toHexString(0, getBackingArrayReference().size, format)
2019
}
@@ -32,7 +31,6 @@ public fun ByteString.toHexString(format: HexFormat = HexFormat.Default): String
3231
* @throws IllegalArgumentException when `startIndex > endIndex`.
3332
* @throws IllegalArgumentException if the result length is more than [String] maximum capacity.
3433
*/
35-
@ExperimentalStdlibApi
3634
public fun ByteString.toHexString(
3735
startIndex: Int = 0,
3836
endIndex: Int = size,
@@ -52,7 +50,6 @@ public fun ByteString.toHexString(
5250
*
5351
* @throws IllegalArgumentException if this string does not comply with the specified [format].
5452
*/
55-
@ExperimentalStdlibApi
5653
public fun String.hexToByteString(format: HexFormat = HexFormat.Default): ByteString {
5754
return ByteString.wrap(hexToByteArray(format))
5855
}

0 commit comments

Comments
 (0)