Skip to content

Commit

Permalink
Fix Kotlin Multiplatform support
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierSegoviaCordoba committed Aug 29, 2024
1 parent c6c7a2e commit feb3d79
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Fixed

- type mismatch errors inside the `copy` function are not shown
- Kotlin Multiplatform support

### Removed

Expand Down
35 changes: 34 additions & 1 deletion kopy-args/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,39 @@ hubdle {
}
}
kotlin {
jvm() //
multiplatform {
common()
androidNative()
apple {
ios {
iosArm64()
iosSimulatorArm64()
iosX64()
}
macos {
macosArm64()
macosX64()
}
tvos {
tvosArm64()
tvosSimulatorArm64()
tvosX64()
}
}
jvm()
js {
browser()
nodejs()
}
linux {
linuxArm64()
linuxX64()
}
mingw {
mingwX64()
}
native()
wasmJs()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.javiersc.kotlin.kopy.args

public expect interface KopyArgument
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.javiersc.kotlin.kopy.args

import java.io.Serializable

public enum class KopyFunctions(public val value: String) : Serializable {
public enum class KopyFunctions(public val value: String) : KopyArgument {
All(value = "all"),
Copy(value = "copy"),
Invoke(value = "invoke"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.javiersc.kotlin.kopy.args

import java.io.Serializable

public enum class KopyVisibility(
public val value: String,
public val restrictive: Int,
) : Serializable {
) : KopyArgument {
Auto(value = "auto", restrictive = 0),
Public(value = "public", restrictive = 1),
Internal(value = "internal", restrictive = 2),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlin.test.Test
class KopyFunctionsTest {

@Test
fun `kopy functions`() {
fun kopy_functions() {
KopyFunctions.from("all") shouldBe KopyFunctions.All
KopyFunctions.from("All") shouldBe KopyFunctions.All
KopyFunctions.from("copy") shouldBe KopyFunctions.Copy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlin.test.Test
class KopyVisibilityTest {

@Test
fun `kopy visibility`() {
fun kopy_visibility() {
KopyVisibility.from("auto") shouldBe KopyVisibility.Auto
KopyVisibility.from("Auto") shouldBe KopyVisibility.Auto
KopyVisibility.from("public") shouldBe KopyVisibility.Public
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.javiersc.kotlin.kopy.args

public actual interface KopyArgument
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.javiersc.kotlin.kopy.args

import java.io.Serializable

public actual interface KopyArgument : Serializable
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.javiersc.kotlin.kopy.args

public actual interface KopyArgument
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.javiersc.kotlin.kopy.args

public actual interface KopyArgument

0 comments on commit feb3d79

Please sign in to comment.