Skip to content

Commit 5345506

Browse files
committed
build(model-sync-lib): made model-sync-lib a multiplatform project
1 parent 00d8536 commit 5345506

File tree

9 files changed

+36
-15
lines changed

9 files changed

+36
-15
lines changed

model-sync-lib/build.gradle.kts

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
11
plugins {
2-
kotlin("jvm")
2+
alias(libs.plugins.kotlin.multiplatform)
33
}
44

55
repositories {
66
mavenCentral()
77
}
88

9-
dependencies {
10-
implementation(project(":model-api"))
11-
testImplementation(project(":model-client", configuration = "jvmRuntimeElements"))
12-
implementation(libs.kotlin.serialization.json)
13-
testImplementation(kotlin("test"))
14-
}
15-
169
kotlin {
17-
jvmToolchain(11)
18-
}
10+
jvm {
11+
jvmToolchain(11)
12+
testRuns["test"].executionTask.configure {
13+
useJUnitPlatform()
14+
}
15+
}
16+
sourceSets {
17+
val commonMain by getting {
18+
dependencies {
19+
implementation(project(":model-api"))
20+
implementation(libs.kotlin.serialization.json)
21+
}
22+
}
1923

20-
tasks.test {
21-
useJUnitPlatform()
24+
val commonTest by getting {
25+
dependencies {
26+
implementation(project(":model-api"))
27+
implementation(libs.kotlin.serialization.json)
28+
implementation(project(":model-client"))
29+
implementation(kotlin("test"))
30+
}
31+
}
32+
33+
val jvmMain by getting
34+
35+
val jvmTest by getting {
36+
dependencies {
37+
dependencies {
38+
implementation(project(":model-client", configuration = "jvmRuntimeElements"))
39+
}
40+
}
41+
}
42+
}
2243
}
2344

2445
publishing {
File renamed without changes.
File renamed without changes.
File renamed without changes.

model-sync-lib/src/test/kotlin/org/modelix/model/sync/ModelExporterTest.kt renamed to model-sync-lib/src/jvmTest/kotlin/org/modelix/model/sync/ModelExporterTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ModelExporterTest {
2323
@JvmStatic
2424
@BeforeAll
2525
fun `initialize model and branch`() {
26-
model = ModelData.fromJson(File("src/test/resources/newmodel.json").readText())
26+
model = ModelData.fromJson(File("src/jvmTest/resources/newmodel.json").readText())
2727

2828
val tree = CLTree(ObjectStoreCache(MapBaseStore()))
2929
branch = PBranch(tree, IdGenerator.getInstance(1))

model-sync-lib/src/test/kotlin/org/modelix/model/sync/ModelImporterTest.kt renamed to model-sync-lib/src/jvmTest/kotlin/org/modelix/model/sync/ModelImporterTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class ModelImporterTest {
3030
@JvmStatic
3131
@BeforeAll
3232
fun `load and import model`() {
33-
model = ModelData.fromJson(File("src/test/resources/model.json").readText())
34-
val newModelFile = File("src/test/resources/newmodel.json")
33+
model = ModelData.fromJson(File("src/jvmTest/resources/model.json").readText())
34+
val newModelFile = File("src/jvmTest/resources/newmodel.json")
3535
newModel = ModelData.fromJson(newModelFile.readText())
3636

3737
val tree = CLTree(ObjectStoreCache(MapBaseStore()))
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)