Skip to content

Commit c12ecd7

Browse files
committed
Merge branch 'master' into add-module-info
2 parents 8ae775b + 4e88847 commit c12ecd7

File tree

134 files changed

+3446
-1638
lines changed

Some content is hidden

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

134 files changed

+3446
-1638
lines changed

.github/renovate.json5

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
3+
extends: [
4+
'config:recommended',
5+
],
6+
ignorePresets: [
7+
// Ensure we get the latest version and are not pinned to old versions.
8+
'workarounds:javaLTSVersions',
9+
],
10+
customManagers: [
11+
// Update .java-version file with the latest JDK version.
12+
{
13+
customType: 'regex',
14+
fileMatch: [
15+
'\\.java-version$',
16+
],
17+
matchStrings: [
18+
'(?<currentValue>.*)\\n',
19+
],
20+
datasourceTemplate: 'java-version',
21+
depNameTemplate: 'java',
22+
// Only write the major version.
23+
extractVersionTemplate: '^(?<version>\\d+)',
24+
},
25+
]
26+
}

.github/workflows/.java-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

.github/workflows/build.yml

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,19 @@ jobs:
2323
- 8
2424
- 11
2525
- 17
26-
- 19
26+
- latest
2727

2828
steps:
2929
- name: Checkout
3030
uses: actions/checkout@v4
3131

3232
- name: Validate Gradle Wrapper
33-
uses: gradle/actions/wrapper-validation@v3
33+
uses: gradle/actions/wrapper-validation@v4
3434

35-
- name: Configure JDK
36-
uses: actions/setup-java@v4
35+
- uses: actions/setup-java@v4
3736
with:
3837
distribution: 'zulu'
39-
java-version: 19
38+
java-version-file: .github/workflows/.java-version
4039

4140
- name: Test
4241
run: |
@@ -56,9 +55,9 @@ jobs:
5655
- uses: actions/setup-java@v4
5756
with:
5857
distribution: 'zulu'
59-
java-version: 19
58+
java-version-file: .github/workflows/.java-version
6059

61-
- uses: gradle/actions/setup-gradle@v3
60+
- uses: gradle/actions/setup-gradle@v4
6261

6362
- uses: reactivecircus/android-emulator-runner@v2
6463
with:
@@ -76,13 +75,12 @@ jobs:
7675
uses: actions/checkout@v4
7776

7877
- name: Validate Gradle Wrapper
79-
uses: gradle/actions/wrapper-validation@v3
78+
uses: gradle/actions/wrapper-validation@v4
8079

81-
- name: Configure JDK
82-
uses: actions/setup-java@v4
80+
- uses: actions/setup-java@v4
8381
with:
8482
distribution: 'zulu'
85-
java-version: 19
83+
java-version-file: .github/workflows/.java-version
8684

8785
- name: Test
8886
run: |
@@ -101,13 +99,12 @@ jobs:
10199
uses: actions/checkout@v4
102100

103101
- name: Validate Gradle Wrapper
104-
uses: gradle/actions/wrapper-validation@v3
102+
uses: gradle/actions/wrapper-validation@v4
105103

106-
- name: Configure JDK
107-
uses: actions/setup-java@v4
104+
- uses: actions/setup-java@v4
108105
with:
109106
distribution: 'zulu'
110-
java-version: 19
107+
java-version-file: .github/workflows/.java-version
111108

112109
- name: Test
113110
if: matrix.os != 'windows-latest'
@@ -135,19 +132,19 @@ jobs:
135132
- name: Checkout
136133
uses: actions/checkout@v4
137134

138-
- name: Configure JDK
139-
uses: actions/setup-java@v4
135+
- uses: actions/setup-java@v4
140136
with:
141137
distribution: 'zulu'
142-
java-version: 19
138+
java-version-file: .github/workflows/.java-version
143139

144140
- name: Upload Artifacts
145141
run: |
146-
./gradlew clean publish --stacktrace
142+
./gradlew publish --stacktrace
147143
env:
148-
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
149-
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
150-
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
144+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
145+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
146+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
147+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}
151148

152149
publish-website:
153150
runs-on: ubuntu-latest
@@ -160,11 +157,10 @@ jobs:
160157
with:
161158
fetch-depth: 0
162159

163-
- name: Configure JDK
164-
uses: actions/setup-java@v4
160+
- uses: actions/setup-java@v4
165161
with:
166162
distribution: 'zulu'
167-
java-version: 19
163+
java-version-file: .github/workflows/.java-version
168164

169165
- name: Set up Python
170166
uses: actions/setup-python@v5

.github/workflows/release.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
env:
9+
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
10+
11+
jobs:
12+
publish:
13+
runs-on: macos-14
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-java@v4
18+
with:
19+
distribution: 'zulu'
20+
java-version-file: .github/workflows/.java-version
21+
22+
- run: ./gradlew publish
23+
env:
24+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
25+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
26+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
27+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.classpath
22
.gradle
3+
.kotlin
34
.project
45
.settings
56
eclipsebin

CHANGELOG.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,98 @@
11
Change Log
22
==========
33

4+
## Unreleased
5+
6+
* None yet.
7+
8+
9+
## Version 3.15.0
10+
11+
_2025-07-01_
12+
13+
* Upgrade: [kotlinx-datetime 0.7.0-0.6.x-compat][datetime_0_7_0_compat]. The previous 3.14.0
14+
release, `FakeFileSystem` broke binary-compatibility for calls to `FakeFileSystem()`. This
15+
restores that compatibility.
16+
17+
* Breaking: Change `FakeFileSystem.clock` from a JVM field to a property. This avoids a crash
18+
running Okio in a Gradle 8.x plugin. This change is not binary-compatible.
19+
20+
21+
## Version 3.14.0
22+
23+
_2025-06-28_
24+
25+
* Upgrade: [kotlinx-datetime 0.7.0][datetime_0_7_0]. This impacts the `okio-fakefilesystem`
26+
artifact only. This is a binary-incompatible backwards-incompatible change that cannot co-exist
27+
with previous releases of `okio-fakefilesystem`! If you observe a `NoSuchMethodError` calling
28+
`FakeFileSystem.init`, update the calling code to this release (or newer) and recompile. We don't
29+
like imposing backwards-incompatible changes like this on you and do so regretfully.
30+
31+
32+
## Version 3.13.0
33+
34+
_2025-06-13_
35+
36+
* New: `okio.Socket` interface. This is a first step towards low-level streaming networking support
37+
for Kotlin/Multiplatform. This release provides two JVM-only implementations: `asOkioSocket()`
38+
adapts a `java.net.Socket` to our new interface, and `inMemorySocketPair()` returns a pair of
39+
mutually-connected sockets. We also anticipate that this interface will be a useful abstraction
40+
for proxies and tunnels.
41+
* New: In-development snapshots are now published to the [Central Portal Snapshots repository].
42+
43+
44+
## Version 3.12.0
45+
46+
_2025-05-27_
47+
48+
* New: Support an optional end index when searching with `BufferedSource.indexOf()`.
49+
* Fix: Don't do unnecessary work in `BufferedSource.rangeEquals()`.
50+
* Upgrade: [Kotlin 2.1.21][kotlin_2_1_21].
51+
52+
53+
## Version 3.11.0
54+
55+
_2025-04-09_
56+
57+
* Fix: Clear the deflater's byte array reference
58+
* New: Faster implementation of `String.decodeHex()` on Kotlin/JS.
59+
* New: Declare `EXACTLY_ONCE` execution for blocks like `Closeable.use {}` and `FileSystem.read {}`.
60+
* Upgrade: [Kotlin 2.1.20][kotlin_2_1_20].
61+
62+
63+
## Version 3.10.2
64+
65+
_2025-01-08_
66+
67+
* Fix: `okio-nodefilesystem` artifact is no longer empty.
68+
69+
70+
## Version 3.10.1
71+
72+
_2025-01-07_
73+
74+
* New: `FileSystem.close()` may prevent future access and/or clean up associated resources depending on the backing implementation. `FakeFileSystem` will prevent future operations once closed.
75+
* `InputStream`s created from `BufferedSource.inputStream()` now have a more efficient version of `InputStream.transferTo()` which reduces memory copies.
76+
* `okio-nodefilesystem` is no longer publised as a JS project, but a Kotlin multiplatform project with only a JS target. ~This change should not affect consumers in any way, and is motivated by the Kotlin Gradle plugin deprecating the JS-only plugin.~ Please use 3.10.2 to ensure this change actually does not affect your builds.
77+
78+
79+
## Version 3.10.0
80+
81+
_2025-01-06_
82+
83+
This version is equivalent to the subsequent 3.10.1, but it did not fully publish to Maven Central due to infrastructure problems.
84+
85+
86+
## Version 3.9.1
87+
88+
_2024-09-12_
89+
90+
* Fix: Support paths containing a single dot (".") in `Path.relativeTo`.
91+
* Fix: Do not read from the upstream source when a 0-byte read is requested.
92+
* Fix: Update kotlinx.datetime to 0.6.0 to correct a Gradle module metadata problem with 0.5.0.
93+
Note: this artifact is only used in 'okio-fakefilesystem' and 'okio-nodefilesystem' and not in the Okio core.
94+
95+
496
## Version 3.9.0
597

698
_2024-03-12_
@@ -905,8 +997,11 @@ _2014-04-08_
905997
* Imported from OkHttp.
906998

907999

1000+
[Central Portal Snapshots repository]: https://central.sonatype.org/publish/publish-portal-snapshots/
9081001
[bom]: https://docs.gradle.org/6.2/userguide/platforms.html#sub:bom_import
9091002
[datetime_0_3_0]: https://github.com/Kotlin/kotlinx-datetime/releases/tag/v0.3.0
1003+
[datetime_0_7_0]: https://github.com/Kotlin/kotlinx-datetime/releases/tag/v0.7.0
1004+
[datetime_0_7_0_compat]: https://github.com/Kotlin/kotlinx-datetime?tab=readme-ov-file#deprecation-of-instant
9101005
[gradle_metadata]: https://blog.gradle.org/gradle-metadata-1.0
9111006
[hierarchical_projects]: https://kotlinlang.org/docs/multiplatform-hierarchy.html
9121007
[kotlin_1_4_10]: https://github.com/JetBrains/kotlin/releases/tag/v1.4.10
@@ -918,6 +1013,8 @@ _2014-04-08_
9181013
[kotlin_1_9_0]: https://kotlinlang.org/docs/whatsnew19.html
9191014
[kotlin_1_9_10]: https://github.com/JetBrains/kotlin/releases/tag/v1.9.10
9201015
[kotlin_1_9_21]: https://github.com/JetBrains/kotlin/releases/tag/v1.9.21
1016+
[kotlin_2_1_20]: https://github.com/JetBrains/kotlin/releases/tag/v2.1.20
1017+
[kotlin_2_1_21]: https://github.com/JetBrains/kotlin/releases/tag/v2.1.21
9211018
[loom]: https://wiki.openjdk.org/display/loom/Getting+started
9221019
[maven_provided]: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
9231020
[preview1]: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md

android-test/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import com.android.build.gradle.internal.lint.AndroidLintAnalysisTask
2+
import com.android.build.gradle.internal.lint.AndroidLintTask
3+
14
plugins {
25
id("com.android.library")
36
id("org.jetbrains.kotlin.android")
@@ -16,6 +19,8 @@ val isIDE = properties.containsKey("android.injected.invoked.from.ide") ||
1619
System.getenv("IDEA_INITIAL_DIRECTORY") != null
1720

1821
android {
22+
namespace = "com.squareup.okio"
23+
1924
compileOptions {
2025
sourceCompatibility = JavaVersion.VERSION_1_8
2126
targetCompatibility = JavaVersion.VERSION_1_8
@@ -58,6 +63,11 @@ android {
5863
}
5964
}
6065

66+
// https://issuetracker.google.com/issues/325146674
67+
tasks.withType<AndroidLintAnalysisTask> {
68+
onlyIf { false }
69+
}
70+
6171
dependencies {
6272
coreLibraryDesugaring(libs.android.desugar.jdk.libs)
6373
androidTestImplementation(libs.androidx.test.ext.junit)

android-test/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
xmlns:tools="http://schemas.android.com/tools"
33
tools:ignore="MissingClass"
4-
package="com.squareup.okio">
4+
>
55

66
<uses-permission android:name="android.permission.INTERNET" />
77

build-support/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ gradlePlugin {
2222
}
2323

2424
dependencies {
25-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21")
25+
implementation(libs.kotlin.gradle.plugin)
2626
}

build-support/settings.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
// empty.
1+
dependencyResolutionManagement {
2+
versionCatalogs {
3+
create("libs") {
4+
from(files("../gradle/libs.versions.toml"))
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)