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

Add JPMS support via Multi-Release Jar #47

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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,24 +13,27 @@
* 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
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

fun KmpConfigurationExtension.configureShared(
java9ModuleName: String? = null,
publish: Boolean = false,
explicitApi: Boolean = true,
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
2 changes: 1 addition & 1 deletion library/hmac/hmac-md/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
}

kmpConfiguration {
configureShared(publish = true) {
configureShared(java9ModuleName = "org.kotlincrypto.macs.hmac.md", publish = true) {
common {
sourceSetMain {
dependencies {
Expand Down
7 changes: 7 additions & 0 deletions library/hmac/hmac-md/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module org.kotlincrypto.macs.hmac.md {
requires kotlin.stdlib;
requires org.kotlincrypto.hash.md;
requires transitive org.kotlincrypto.macs.hmac;

exports org.kotlincrypto.macs.hmac.md;
}
2 changes: 1 addition & 1 deletion library/hmac/hmac-sha1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
}

kmpConfiguration {
configureShared(publish = true) {
configureShared(java9ModuleName = "org.kotlincrypto.macs.hmac.sha1", publish = true) {
common {
sourceSetMain {
dependencies {
Expand Down
8 changes: 8 additions & 0 deletions library/hmac/hmac-sha1/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@SuppressWarnings("JavaModuleNaming")
module org.kotlincrypto.macs.hmac.sha1 {
requires kotlin.stdlib;
requires org.kotlincrypto.hash.sha1;
requires transitive org.kotlincrypto.macs.hmac;

exports org.kotlincrypto.macs.hmac.sha1;
}
2 changes: 1 addition & 1 deletion library/hmac/hmac-sha2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
}

kmpConfiguration {
configureShared(publish = true) {
configureShared(java9ModuleName = "org.kotlincrypto.macs.hmac.sha2", publish = true) {
common {
sourceSetMain {
dependencies {
Expand Down
8 changes: 8 additions & 0 deletions library/hmac/hmac-sha2/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@SuppressWarnings("JavaModuleNaming")
module org.kotlincrypto.macs.hmac.sha2 {
requires kotlin.stdlib;
requires org.kotlincrypto.hash.sha2;
requires transitive org.kotlincrypto.macs.hmac;

exports org.kotlincrypto.macs.hmac.sha2;
}
2 changes: 1 addition & 1 deletion library/hmac/hmac-sha3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
}

kmpConfiguration {
configureShared(publish = true) {
configureShared(java9ModuleName = "org.kotlincrypto.macs.hmac.sha3", publish = true) {
common {
sourceSetMain {
dependencies {
Expand Down
8 changes: 8 additions & 0 deletions library/hmac/hmac-sha3/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@SuppressWarnings("JavaModuleNaming")
module org.kotlincrypto.macs.hmac.sha3 {
requires kotlin.stdlib;
requires org.kotlincrypto.hash.sha3;
requires transitive org.kotlincrypto.macs.hmac;

exports org.kotlincrypto.macs.hmac.sha3;
}
2 changes: 1 addition & 1 deletion library/hmac/hmac/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
}

kmpConfiguration {
configureShared(publish = true) {
configureShared(java9ModuleName = "org.kotlincrypto.macs.hmac", publish = true) {
common {
sourceSetMain {
dependencies {
Expand Down
8 changes: 8 additions & 0 deletions library/hmac/hmac/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module org.kotlincrypto.macs.hmac {
requires kotlin.stdlib;
requires org.kotlincrypto.core;
requires org.kotlincrypto.core.digest;
requires transitive org.kotlincrypto.core.mac;

exports org.kotlincrypto.macs.hmac;
}
2 changes: 1 addition & 1 deletion library/kmac/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
}

kmpConfiguration {
configureShared(publish = true) {
configureShared(java9ModuleName = "org.kotlincrypto.macs.kmac", publish = true) {
common {
sourceSetMain {
dependencies {
Expand Down
8 changes: 8 additions & 0 deletions library/kmac/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module org.kotlincrypto.macs.kmac {
requires kotlin.stdlib;
requires org.kotlincrypto.hash.sha3;
requires transitive org.kotlincrypto.core.mac;
requires transitive org.kotlincrypto.core.xof;

exports org.kotlincrypto.macs.kmac;
}
Loading