Skip to content

Commit

Permalink
Add module-info.java files for all publications
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm committed Mar 10, 2024
1 parent b14f0c2 commit 9897568
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 7 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,23 +13,26 @@
* 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,
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 gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
gradle-binary-compat = "0.14.0"
gradle-kmp-configuration = "0.2.0"
gradle-kmp-configuration = "0.2.1"
gradle-kotlin = "1.9.23"
gradle-publish-maven = "0.27.0"

Expand Down
2 changes: 1 addition & 1 deletion library/base16/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 = "io.matthewnelson.encoding.base16", publish = true) {
common {
sourceSetMain {
dependencies {
Expand Down
6 changes: 6 additions & 0 deletions library/base16/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module io.matthewnelson.encoding.base16 {
requires kotlin.stdlib;
requires io.matthewnelson.encoding.core;

exports io.matthewnelson.encoding.base16;
}
2 changes: 1 addition & 1 deletion library/base32/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 = "io.matthewnelson.encoding.base32", publish = true) {
common {
sourceSetMain {
dependencies {
Expand Down
6 changes: 6 additions & 0 deletions library/base32/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module io.matthewnelson.encoding.base32 {
requires kotlin.stdlib;
requires io.matthewnelson.encoding.core;

exports io.matthewnelson.encoding.base32;
}
2 changes: 1 addition & 1 deletion library/base64/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 = "io.matthewnelson.encoding.base64", publish = true) {
common {
sourceSetMain {
dependencies {
Expand Down
6 changes: 6 additions & 0 deletions library/base64/src/jvmMain/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module io.matthewnelson.encoding.base64 {
requires kotlin.stdlib;
requires io.matthewnelson.encoding.core;

exports io.matthewnelson.encoding.base64;
}
2 changes: 1 addition & 1 deletion library/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ plugins {
}

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

exports io.matthewnelson.encoding.core;
exports io.matthewnelson.encoding.core.util;
}

0 comments on commit 9897568

Please sign in to comment.