From d5a2804393f352c7c8ebbde8091bd0942453fa08 Mon Sep 17 00:00:00 2001 From: Andres Almiray Date: Fri, 31 May 2024 20:09:17 +0200 Subject: [PATCH] build: Configure explicit Java module descriptor --- gradle.properties | 1 + settings.gradle | 2 ++ subprojects/ezmorph-core/ezmorph-core.gradle | 10 ++++++ .../src/main/java11/module-info.java | 36 +++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 subprojects/ezmorph-core/src/main/java11/module-info.java diff --git a/gradle.properties b/gradle.properties index ecab986..a806248 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,6 +26,7 @@ kordampPluginVersion = 0.54.0 kordampBuildVersion = 3.4.0 gitPluginVersion = 3.0.0 cyclonedxPluginVersion = 1.8.2 +moditectPluginVersion = 1.0.0-rc3 jacocoVersion = 0.8.12 org.gradle.daemon = true diff --git a/settings.gradle b/settings.gradle index 0599d0b..af92dc6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -37,6 +37,7 @@ buildscript { dependencies { classpath "org.kordamp.gradle:kordamp-parentbuild:$kordampBuildVersion" classpath "org.cyclonedx:cyclonedx-gradle-plugin:$cyclonedxPluginVersion" + classpath "org.moditect:moditect-gradle-plugin:$moditectPluginVersion" } } apply plugin: 'org.kordamp.gradle.kordamp-parentbuild' @@ -57,6 +58,7 @@ projects { dirs(['subprojects']) { id 'java-library' id 'org.cyclonedx.bom' + id 'org.moditect.gradleplugin' } } } \ No newline at end of file diff --git a/subprojects/ezmorph-core/ezmorph-core.gradle b/subprojects/ezmorph-core/ezmorph-core.gradle index 35a2a23..ff223e8 100644 --- a/subprojects/ezmorph-core/ezmorph-core.gradle +++ b/subprojects/ezmorph-core/ezmorph-core.gradle @@ -28,3 +28,13 @@ dependencies { testRuntimeOnly "org.slf4j:slf4j-simple:$slf4jVersion" } + +addMainModuleInfo { + version = project.version + jvmVersion = '11' + overwriteExistingFiles = true + jdepsExtraArgs = ['-q'] + module { + moduleInfoFile = file('src/main/java11/module-info.java') + } +} \ No newline at end of file diff --git a/subprojects/ezmorph-core/src/main/java11/module-info.java b/subprojects/ezmorph-core/src/main/java11/module-info.java new file mode 100644 index 0000000..7074ae2 --- /dev/null +++ b/subprojects/ezmorph-core/src/main/java11/module-info.java @@ -0,0 +1,36 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright 2006-2024 Andres Almiray. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Andres Almiray + */ +module org.kordamp.ezmorph { + requires java.desktop; + requires org.apache.commons.lang3; + requires org.slf4j; + + requires transitive commons.beanutils; + requires transitive junit; + + exports org.kordamp.ezmorph; + exports org.kordamp.ezmorph.array; + exports org.kordamp.ezmorph.bean; + exports org.kordamp.ezmorph.object; + exports org.kordamp.ezmorph.primitive; + exports org.kordamp.ezmorph.test; +} \ No newline at end of file