Skip to content

Commit

Permalink
Add JPMS support via Multi-Release jar (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm authored Mar 12, 2024
1 parent b17fe6e commit fc8f8a8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ dependencies {
[badge-license]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat

<!-- TAG_DEPENDENCIES -->
[badge-kotlin]: https://img.shields.io/badge/kotlin-1.9.22-blue.svg?logo=kotlin
[badge-kotlin]: https://img.shields.io/badge/kotlin-1.9.23-blue.svg?logo=kotlin

<!-- TAG_PLATFORMS -->
[badge-platform-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat
Expand Down
5 changes: 5 additions & 0 deletions build-logic/src/main/kotlin/-KmpConfigurationExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
import io.matthewnelson.kmp.configuration.ExperimentalKmpConfigurationApi
import io.matthewnelson.kmp.configuration.extension.KmpConfigurationExtension
import io.matthewnelson.kmp.configuration.extension.container.target.KmpConfigurationContainerDsl
import org.gradle.api.Action
import org.gradle.api.JavaVersion

fun KmpConfigurationExtension.configureShared(
java9ModuleName: String? = null,
publish: Boolean = false,
action: Action<KmpConfigurationContainerDsl>
) {
Expand All @@ -27,6 +29,9 @@ fun KmpConfigurationExtension.configureShared(
kotlinJvmTarget = JavaVersion.VERSION_1_8
compileSourceCompatibility = JavaVersion.VERSION_1_8
compileTargetCompatibility = JavaVersion.VERSION_1_8

@OptIn(ExperimentalKmpConfigurationApi::class)
java9MultiReleaseModuleInfo(java9ModuleName)
}

js {
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
androidx-test-core = "1.5.0"
androidx-test-runner = "1.5.2"

encoding = "2.1.0"
encoding = "2.2.0"

gradle-android = "8.1.4"
gradle-binary-compat = "0.14.0"
gradle-kmp-configuration = "0.2.0"
gradle-kotlin = "1.9.22"
gradle-kmp-configuration = "0.2.1"
gradle-kotlin = "1.9.23"
gradle-publish-maven = "0.27.0"

kotlincrypto-hash = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion library/file/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
private val testConfig = TestConfigInject()

kmpConfiguration {
configureShared(publish = true) {
configureShared(java9ModuleName = "io.matthewnelson.kmp.file", publish = true) {
common {
sourceSetTest {
kotlin.srcDir(testConfig.testConfigSrcDir)
Expand Down
5 changes: 5 additions & 0 deletions library/file/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module io.matthewnelson.kmp.file {
requires kotlin.stdlib;

exports io.matthewnelson.kmp.file;
}

0 comments on commit fc8f8a8

Please sign in to comment.