Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a dependency on kotlinx.serialization.core in JPMS for it to be truly optional #507

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/jvm/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module kotlinx.datetime {
requires transitive kotlin.stdlib;
requires transitive static kotlinx.serialization.core;
requires static kotlinx.serialization.core;

exports kotlinx.datetime;
exports kotlinx.datetime.serializers;
Expand Down
11 changes: 11 additions & 0 deletions integration-testing/jpms-test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugins {
kotlin("jvm")
}

java {
toolchain { languageVersion.set(JavaLanguageVersion.of(11)) }
}

dependencies {
api(project(":kotlinx-datetime"))
}
4 changes: 4 additions & 0 deletions integration-testing/jpms-test/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module my.jpms.test {
requires transitive kotlin.stdlib;
requires transitive kotlinx.datetime;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright 2019-2025 JetBrains s.r.o. and contributors.
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
*/

package my.jpms.test;

import kotlinx.datetime.*;

public class InitLocalDate {
LocalDate newLocalDate() {
return new LocalDate(2025, 3, 31);
}
}
10 changes: 6 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ include(":core")
project(":core").name = "kotlinx-datetime"
include(":timezones/full")
project(":timezones/full").name = "kotlinx-datetime-zoneinfo"
include(":serialization")
project(":serialization").name = "kotlinx-datetime-serialization"
include(":js-without-timezones")
project(":js-without-timezones").name = "kotlinx-datetime-js-test-without-timezones"
include(":integration-testing/serialization")
project(":integration-testing/serialization").name = "kotlinx-datetime-serialization"
include(":integration-testing/js-without-timezones")
project(":integration-testing/js-without-timezones").name = "kotlinx-datetime-js-test-without-timezones"
include(":integration-testing/jpms-test")
project(":integration-testing/jpms-test").name = "kotlinx-datetime-test-with-jpms"
include(":benchmarks")