Commit 283f30c
authored
## Description
This PR adds support for the Java Platform Module System (JPMS) by introducing a `module-info.java` file.
This allows `kotlin-logging` to be used as a named module in modularized Java applications.
Resolves #365.
## Technical Details
- Added `src/jvmMain/java/module-info.java` defining the `io.github.oshai.kotlinlogging` module.
- Leveraged standard Kotlin Multiplatform (KMP) support for Java source sets (valid in Kotlin 2.1+).
- Updated `build.gradle.kts` to:
- Configure `compileJvmMainJava` with `--patch-module` to allow `module-info.java` to see Kotlin classes in the same module.
- Preserved `jvmTarget = 1.8` for Kotlin classes to maintain Android and Java 8 compatibility.
- Configured `gradle.properties` to allow mixed JVM targets (1.8 for Kotlin, 9+ for `module-info`).
- Added static requirements for optional dependencies:
- `ch.qos.logback.classic` & `core`
- `kotlinx.coroutines.slf4j`
- `org.graalvm.nativeimage`
## Verification
- Verified that `./gradlew jvmJar` builds successfully.
- Verified `module-info.class` is matching JDK 9+ (implicitly).
- Verified Kotlin classes target Java 1.8 (major version 52).
Fixes #365
1 parent e5366c2 commit 283f30c
File tree
4 files changed
+23
-0
lines changed- src/jvmMain/java
4 files changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments