Skip to content

Commit cd4eb82

Browse files
committed
Refactoring wire-runtime to proper Hierarchical Multi-Platform Project.
1 parent ce13a51 commit cd4eb82

28 files changed

Lines changed: 107 additions & 1224 deletions

File tree

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ kotlin-test-annotations = { module = "org.jetbrains.kotlin:kotlin-test-annotatio
6262
kotlin-test-common = { module = "org.jetbrains.kotlin:kotlin-test-common" }
6363
kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js" }
6464
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit" }
65+
kotlin-test-wasm-js = { module = "org.jetbrains.kotlin:kotlin-test-wasm-js" }
6566
kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" }
6667
misk = { module = "com.squareup.misk:misk", version = "2025.02.21.143120-9967585" }
6768
moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }

wire-runtime/build.gradle.kts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ kotlin {
4242
}
4343

4444
if (System.getProperty("kwasm", "true").toBoolean()) {
45+
wasmJs {
46+
browser()
47+
}
4548
@OptIn(ExperimentalWasmDsl::class)
4649
wasmWasi {
4750
nodejs()
@@ -71,15 +74,46 @@ kotlin {
7174
implementation(libs.kotlin.test.junit)
7275
}
7376
}
77+
val nonJvmMain by creating {
78+
dependsOn(commonMain)
79+
}
80+
val nonJvmTest by creating {
81+
dependsOn(commonTest)
82+
}
83+
if (System.getProperty("knative", "true").toBoolean()) {
84+
val nativeMain by getting {
85+
dependsOn(nonJvmMain)
86+
}
87+
val nativeTest by getting {
88+
dependsOn(nonJvmTest)
89+
}
90+
}
7491
if (System.getProperty("kjs", "true").toBoolean()) {
92+
val jsMain by getting {
93+
dependsOn(nonJvmMain)
94+
}
7595
val jsTest by getting {
96+
dependsOn(nonJvmTest)
7697
dependencies {
7798
implementation(libs.kotlin.test.js)
7899
}
79100
}
80101
}
81102
if (System.getProperty("kwasm", "true").toBoolean()) {
103+
val wasmJsMain by getting {
104+
dependsOn(nonJvmMain)
105+
}
106+
val wasmJsTest by getting {
107+
dependsOn(nonJvmTest)
108+
dependencies {
109+
implementation(libs.kotlin.test.wasm.js)
110+
}
111+
}
112+
val wasmWasiMain by getting {
113+
dependsOn(nonJvmMain)
114+
}
82115
val wasmWasiTest by getting {
116+
dependsOn(nonJvmTest)
83117
dependencies {
84118
implementation(libs.kotlin.test)
85119
}

wire-runtime/src/jsMain/kotlin/com/squareup/wire/MessageSink.kt

Lines changed: 0 additions & 24 deletions
This file was deleted.

wire-runtime/src/jsMain/kotlin/com/squareup/wire/MessageSource.kt

Lines changed: 0 additions & 22 deletions
This file was deleted.

wire-runtime/src/jsMain/kotlin/com/squareup/wire/ProtoAdapter.kt

Lines changed: 0 additions & 225 deletions
This file was deleted.

0 commit comments

Comments
 (0)