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+
}

0 commit comments

Comments
 (0)