Skip to content

Commit

Permalink
Add support for JPMS via Multi-Release Jar (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm authored Mar 11, 2024
1 parent fc8204d commit 647b1bc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
7 changes: 5 additions & 2 deletions build-logic/src/main/kotlin/-KmpConfigurationExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,25 @@
* 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>
) {
configure {
jvm {
target { withJava() }

kotlinJvmTarget = JavaVersion.VERSION_1_8
compileSourceCompatibility = JavaVersion.VERSION_1_8
compileTargetCompatibility = JavaVersion.VERSION_1_8

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

js()
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[versions]
gradle-binary-compat = "0.13.2"
gradle-kmp-configuration = "0.1.7"
gradle-kotlin = "1.9.21"
gradle-publish-maven = "0.25.3"
gradle-binary-compat = "0.14.0"
gradle-kmp-configuration = "0.2.1"
gradle-kotlin = "1.9.23"
gradle-publish-maven = "0.27.0"

[libraries]
gradle-kmp-configuration = { module = "io.matthewnelson:gradle-kmp-configuration-plugin", version.ref = "gradle-kmp-configuration" }
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

# https://gradle.org/release-checksums/
distributionSha256Sum=f2b9ed0faf8472cbe469255ae6c86eddb77076c75191741b4a462f33128dd419
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionSha256Sum=85719317abd2112f021d4f41f09ec370534ba288432065f4b477b6a3b652910d
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
2 changes: 1 addition & 1 deletion library/collections/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ plugins {
}

kmpConfiguration {
configureShared(publish = true) {}
configureShared(java9ModuleName = "io.matthewnelson.immutable.collections", publish = true) {}
}
5 changes: 5 additions & 0 deletions library/collections/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module io.matthewnelson.immutable.collections {
requires kotlin.stdlib;

exports io.matthewnelson.immutable.collections;
}

0 comments on commit 647b1bc

Please sign in to comment.