Skip to content

Commit 00d5d84

Browse files
authored
Fix a dependency on kotlinx.serialization.core in JPMS for it to be truly optional (#507)
Do not mark the serialization JPMS dependency as transitive See <https://stackoverflow.com/questions/77644309/are-jpms-modifiers-static-and-transitive-incompatible> Additionally, move all integration tests into a separate directory. There are too many of them at this point to keep them in the root.
1 parent b8019a2 commit 00d5d84

25 files changed

+38
-7
lines changed

core/jvm/java9/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module kotlinx.datetime {
22
requires transitive kotlin.stdlib;
3-
requires transitive static kotlinx.serialization.core;
3+
requires static kotlinx.serialization.core;
44

55
exports kotlinx.datetime;
66
exports kotlinx.datetime.serializers;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
kotlin("jvm")
3+
}
4+
5+
java {
6+
toolchain { languageVersion.set(JavaLanguageVersion.of(11)) }
7+
}
8+
9+
dependencies {
10+
api(project(":kotlinx-datetime"))
11+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module my.jpms.test {
2+
requires transitive kotlin.stdlib;
3+
requires transitive kotlinx.datetime;
4+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright 2019-2025 JetBrains s.r.o. and contributors.
3+
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
4+
*/
5+
6+
package my.jpms.test;
7+
8+
import kotlinx.datetime.*;
9+
10+
public class InitLocalDate {
11+
LocalDate newLocalDate() {
12+
return new LocalDate(2025, 3, 31);
13+
}
14+
}

settings.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ include(":core")
2020
project(":core").name = "kotlinx-datetime"
2121
include(":timezones/full")
2222
project(":timezones/full").name = "kotlinx-datetime-zoneinfo"
23-
include(":serialization")
24-
project(":serialization").name = "kotlinx-datetime-serialization"
25-
include(":js-without-timezones")
26-
project(":js-without-timezones").name = "kotlinx-datetime-js-test-without-timezones"
27-
include(":js-with-timezones")
28-
project(":js-with-timezones").name = "kotlinx-datetime-js-test-with-timezones"
23+
include(":integration-testing/serialization")
24+
project(":integration-testing/serialization").name = "kotlinx-datetime-serialization"
25+
include(":integration-testing/js-without-timezones")
26+
project(":integration-testing/js-without-timezones").name = "kotlinx-datetime-js-test-without-timezones"
27+
include(":integration-testing/js-with-timezones")
28+
project(":integration-testing/js-with-timezones").name = "kotlinx-datetime-js-test-with-timezones"
29+
include(":integration-testing/jpms-test")
30+
project(":integration-testing/jpms-test").name = "kotlinx-datetime-test-with-jpms"
2931
include(":benchmarks")

0 commit comments

Comments
 (0)