From eeefdbfd36eed27954b4a80ccce91131dbf12ab0 Mon Sep 17 00:00:00 2001 From: Benoit Quenaudon Date: Thu, 22 Jun 2023 12:14:11 +0200 Subject: [PATCH 1/2] Dump internal public APIs Since they're public... they might be used! --- build.gradle.kts | 7 ------- okio/api/okio.api | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5453bec420..79c7a7b6da 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,6 @@ import com.vanniktech.maven.publish.MavenPublishBaseExtension import com.vanniktech.maven.publish.SonatypeHost import groovy.util.Node import groovy.util.NodeList -import kotlinx.validation.ApiValidationExtension import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED import org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED @@ -172,12 +171,6 @@ subprojects { } } - plugins.withId("binary-compatibility-validator") { - configure { - ignoredPackages += "okio.internal" - } - } - tasks.withType().configureEach { kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() diff --git a/okio/api/okio.api b/okio/api/okio.api index 4bc1718ae4..f7a80d22ef 100644 --- a/okio/api/okio.api +++ b/okio/api/okio.api @@ -800,3 +800,9 @@ public final class okio/Utf8 { public static synthetic fun size$default (Ljava/lang/String;IIILjava/lang/Object;)J } +public final class okio/internal/-Utf8 { + public static final fun commonAsUtf8ToByteArray (Ljava/lang/String;)[B + public static final fun commonToUtf8String ([BII)Ljava/lang/String; + public static synthetic fun commonToUtf8String$default ([BIIILjava/lang/Object;)Ljava/lang/String; +} + From c12a566ca300858b2e24268932c5eb78f35ef706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Quenaudon?= Date: Thu, 22 Jun 2023 14:04:39 +0200 Subject: [PATCH 2/2] Revert public API breaking change (#1279) --- okio/api/okio.api | 10 +++++----- .../kotlin/okio/internal/{Utf8.kt => -Utf8.kt} | 4 +--- .../kotlin/okio/{JvmPlatform.kt => -JvmPlatform.kt} | 3 +-- 3 files changed, 7 insertions(+), 10 deletions(-) rename okio/src/commonMain/kotlin/okio/internal/{Utf8.kt => -Utf8.kt} (95%) rename okio/src/jvmMain/kotlin/okio/{JvmPlatform.kt => -JvmPlatform.kt} (95%) diff --git a/okio/api/okio.api b/okio/api/okio.api index f7a80d22ef..b8c0e8d6de 100644 --- a/okio/api/okio.api +++ b/okio/api/okio.api @@ -43,10 +43,6 @@ public final class okio/-InflaterSourceExtensions { public static synthetic fun inflate$default (Lokio/Source;Ljava/util/zip/Inflater;ILjava/lang/Object;)Lokio/InflaterSource; } -public final class okio/-JvmPlatform { - public static final fun withLock (Ljava/util/concurrent/locks/ReentrantLock;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object; -} - public class okio/AsyncTimeout : okio/Timeout { public static final field Companion Lokio/AsyncTimeout$Companion; public fun ()V @@ -800,7 +796,11 @@ public final class okio/Utf8 { public static synthetic fun size$default (Ljava/lang/String;IIILjava/lang/Object;)J } -public final class okio/internal/-Utf8 { +public final class okio/_JvmPlatformKt { + public static final fun withLock (Ljava/util/concurrent/locks/ReentrantLock;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object; +} + +public final class okio/internal/_Utf8Kt { public static final fun commonAsUtf8ToByteArray (Ljava/lang/String;)[B public static final fun commonToUtf8String ([BII)Ljava/lang/String; public static synthetic fun commonToUtf8String$default ([BIIILjava/lang/Object;)Ljava/lang/String; diff --git a/okio/src/commonMain/kotlin/okio/internal/Utf8.kt b/okio/src/commonMain/kotlin/okio/internal/-Utf8.kt similarity index 95% rename from okio/src/commonMain/kotlin/okio/internal/Utf8.kt rename to okio/src/commonMain/kotlin/okio/internal/-Utf8.kt index 96e8c19ecc..865ff2c1f2 100644 --- a/okio/src/commonMain/kotlin/okio/internal/Utf8.kt +++ b/okio/src/commonMain/kotlin/okio/internal/-Utf8.kt @@ -1,3 +1,4 @@ +// ktlint-disable filename /* * Copyright (C) 2018 Square, Inc. * @@ -13,11 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@file:JvmName("-Utf8") // A leading '-' hides this class from Java. - package okio.internal -import kotlin.jvm.JvmName import okio.ArrayIndexOutOfBoundsException import okio.processUtf16Chars import okio.processUtf8Bytes diff --git a/okio/src/jvmMain/kotlin/okio/JvmPlatform.kt b/okio/src/jvmMain/kotlin/okio/-JvmPlatform.kt similarity index 95% rename from okio/src/jvmMain/kotlin/okio/JvmPlatform.kt rename to okio/src/jvmMain/kotlin/okio/-JvmPlatform.kt index 1a24275d9d..cf263c45ac 100644 --- a/okio/src/jvmMain/kotlin/okio/JvmPlatform.kt +++ b/okio/src/jvmMain/kotlin/okio/-JvmPlatform.kt @@ -1,3 +1,4 @@ +// ktlint-disable filename /* * Copyright (C) 2018 Square, Inc. * @@ -13,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@file:JvmName("-JvmPlatform") // A leading '-' hides this class from Java. - package okio import java.util.concurrent.locks.ReentrantLock