Move Utf8 and its Kotlin test to common.
diff --git a/okio/build.gradle b/okio/build.gradle
index 5d15548..8030850 100644
--- a/okio/build.gradle
+++ b/okio/build.gradle
@@ -2,4 +2,6 @@
dependencies {
implementation deps.kotlin.stdLib.common
+ testImplementation deps.kotlin.test.common
+ testImplementation deps.kotlin.test.annotations
}
diff --git a/okio/jvm/src/main/java/okio/Util.kt b/okio/jvm/src/main/java/okio/platform.kt
similarity index 88%
rename from okio/jvm/src/main/java/okio/Util.kt
rename to okio/jvm/src/main/java/okio/platform.kt
index 6a5eb7e..2dc3145 100644
--- a/okio/jvm/src/main/java/okio/Util.kt
+++ b/okio/jvm/src/main/java/okio/platform.kt
@@ -16,6 +16,9 @@
package okio
+actual typealias JvmOverloads = kotlin.jvm.JvmOverloads
+actual typealias JvmName = kotlin.jvm.JvmName
+
internal actual fun arraycopy(
src: ByteArray,
srcPos: Int,
diff --git a/okio/jvm/src/main/java/okio/Utf8.kt b/okio/src/main/kotlin/okio/Utf8.kt
similarity index 100%
rename from okio/jvm/src/main/java/okio/Utf8.kt
rename to okio/src/main/kotlin/okio/Utf8.kt
diff --git a/okio/src/main/kotlin/okio/Util.kt b/okio/src/main/kotlin/okio/Util.kt
deleted file mode 100644
index f89c8af..0000000
--- a/okio/src/main/kotlin/okio/Util.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2018 Square, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package okio
-
-internal expect fun arraycopy(
- src: ByteArray,
- srcPos: Int,
- dest: ByteArray,
- destPos: Int,
- length: Int
-)
diff --git a/okio/src/main/kotlin/okio/platform.kt b/okio/src/main/kotlin/okio/platform.kt
new file mode 100644
index 0000000..0f47414
--- /dev/null
+++ b/okio/src/main/kotlin/okio/platform.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 Square, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package okio
+
+import kotlin.annotation.AnnotationTarget.FILE
+import kotlin.annotation.AnnotationTarget.FUNCTION
+
+// TODO make internal https://youtrack.jetbrains.com/issue/KT-19664
+// TODO or remove after https://youtrack.jetbrains.com/issue/KT-18882
+@Target(FUNCTION)
+expect annotation class JvmOverloads()
+
+// TODO make internal https://youtrack.jetbrains.com/issue/KT-19664
+// TODO or remove after https://youtrack.jetbrains.com/issue/KT-18882
+@Target(FILE, FUNCTION)
+expect annotation class JvmName(val name: String)
+
+internal expect fun arraycopy(
+ src: ByteArray,
+ srcPos: Int,
+ dest: ByteArray,
+ destPos: Int,
+ length: Int
+)
diff --git a/okio/jvm/src/test/java/okio/Utf8KotlinTest.kt b/okio/src/test/kotlin/okio/Utf8KotlinTest.kt
similarity index 96%
rename from okio/jvm/src/test/java/okio/Utf8KotlinTest.kt
rename to okio/src/test/kotlin/okio/Utf8KotlinTest.kt
index 21cf56e..7502643 100644
--- a/okio/jvm/src/test/java/okio/Utf8KotlinTest.kt
+++ b/okio/src/test/kotlin/okio/Utf8KotlinTest.kt
@@ -16,7 +16,7 @@
package okio
-import org.junit.Test
+import kotlin.test.Test
import kotlin.test.assertEquals
class Utf8KotlinTest {