From a25cfd4b8f863c2d9208cd99e82a42806459cc67 Mon Sep 17 00:00:00 2001 From: Remko Popma Date: Sat, 31 Aug 2024 20:37:05 +0900 Subject: [PATCH] [#2335] Ensure module info is included in all release jars --- RELEASE-NOTES.md | 36 ++++++++++++++++++++++++ build.gradle | 28 +----------------- picocli-codegen/build.gradle | 12 ++++++++ picocli-groovy/build.gradle | 12 ++++++++ picocli-shell-jline2/build.gradle | 12 ++++++++ picocli-shell-jline3/build.gradle | 12 ++++++++ picocli-spring-boot-starter/build.gradle | 12 ++++++++ 7 files changed, 97 insertions(+), 27 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 54ef1d1a2..c9b7d1403 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,5 +1,41 @@ # picocli Release Notes +# Picocli 4.7.7 +The picocli community is pleased to announce picocli 4.7.7. + +This release includes bugfixes and enhancements. + +Many thanks to the picocli community for raising these issues and providing the pull requests to address them! + +This is the eighty-sixth public release. +Picocli follows [semantic versioning](https://semver.org/). +Artifacts in this release are signed by Remko Popma (6601 E5C0 8DCC BB96). + +## Table of Contents +* [New and noteworthy](#4.7.7-new) +* [Fixed issues](#4.7.7-fixes) +* [Deprecations](#4.7.7-deprecated) +* [Potential breaking changes](#4.7.7-breaking-changes) + +## New and Noteworthy + + + + +## Fixed issues + +* [#2335] Module info missing in all jars except the main picocli jar file. Thanks to [Oliver B. Fischer](https://github.com/obfischer) for raising this. + + + +## Deprecations +No features were deprecated in this release. + +## Potential breaking changes +This release has no breaking changes. + + + # Picocli 4.7.6 The picocli community is pleased to announce picocli 4.7.6. diff --git a/build.gradle b/build.gradle index d4667d211..72e4883ed 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,7 @@ buildscript { } } +apply plugin: 'org.beryx.jar' // for compiling module-info on Java 8 apply plugin: 'io.codearte.nexus-staging' if (System.getenv('MAVEN_OSS_USER')) { // on home system @@ -61,7 +62,6 @@ pluginManager.withPlugin('biz.aQute.bnd.builder') { // if plugin applied, execut allprojects { apply plugin: 'java' apply plugin: 'java-library' // to avoid https://github.com/gradle/gradle/issues/1118 - apply plugin: 'org.beryx.jar' // for compiling module-info on Java 8 // https://errorprone.info/docs/installation requires Java 11+ if (JavaVersion.current().isJava11Compatible()) { @@ -121,32 +121,6 @@ allprojects { // Workaround frpm https://bugs.openjdk.org/browse/JDK-4973681 javadoc.options.addStringOption('sourcepath', 'src/main/java') - if (!project.name in ['picocli-examples', 'picocli-annotation-processing-tests']) { - //sourceSets.main.java.srcDirs = ['src/main/java', 'src/main/java9'] - compileJava { - inputs.property("moduleName", moduleName) - // doFirst { - // logger.info("Java version is " + JavaVersion.current()) - // if (JavaVersion.current().isJava9Compatible()) { - // options.compilerArgs = [ - // '--module-path', classpath.asPath, - // ] - // } - // // classpath = files() - // classpath = sourceSets.main.runtimeClasspath - // logger.info("options.compilerArgs is " + options.compilerArgs) - // logger.info("classpath is " + classpath.files) - // } - } - moduleConfig { - // copy module-info.class to META-INF/versions/9 - multiReleaseVersion = 9 - moduleInfoPath = 'src/main/java9/module-info.java' - version = project.version - neverCompileModuleInfo = true - } - } - normalization { runtimeClasspath { metaInf { diff --git a/picocli-codegen/build.gradle b/picocli-codegen/build.gradle index df0fb1063..41fae4709 100644 --- a/picocli-codegen/build.gradle +++ b/picocli-codegen/build.gradle @@ -19,6 +19,18 @@ dependencies { api rootProject } +apply plugin: 'org.beryx.jar' // for compiling module-info on Java 8 +compileJava { + inputs.property("moduleName", moduleName) +} +moduleConfig { + // copy module-info.class to META-INF/versions/9 + multiReleaseVersion = 9 + moduleInfoPath = 'src/main/java9/module-info.java' + version = project.version + neverCompileModuleInfo = true +} + //task generateGraalReflectionConfig(type: JavaExec) { // mainClass = 'picocli.codegen.aot.graalvm.ReflectionConfigGenerator' // classpath = sourceSets.main.runtimeClasspath diff --git a/picocli-groovy/build.gradle b/picocli-groovy/build.gradle index 73642ada9..5a02f78ed 100644 --- a/picocli-groovy/build.gradle +++ b/picocli-groovy/build.gradle @@ -8,6 +8,18 @@ description 'Picocli Groovy - easily use picocli in Groovy scripts.' version "$projectVersion" ext.moduleName = 'info.picocli.groovy' +apply plugin: 'org.beryx.jar' // for compiling module-info on Java 8 +compileJava { + inputs.property("moduleName", moduleName) +} +moduleConfig { + // copy module-info.class to META-INF/versions/9 + multiReleaseVersion = 9 + moduleInfoPath = 'src/main/java9/module-info.java' + version = project.version + neverCompileModuleInfo = true +} + configurations { ivy } diff --git a/picocli-shell-jline2/build.gradle b/picocli-shell-jline2/build.gradle index 30d456010..1dde5d4b8 100644 --- a/picocli-shell-jline2/build.gradle +++ b/picocli-shell-jline2/build.gradle @@ -12,6 +12,18 @@ dependencies { api supportDependencies.jline2 } +apply plugin: 'org.beryx.jar' // for compiling module-info on Java 8 +compileJava { + inputs.property("moduleName", moduleName) +} +moduleConfig { + // copy module-info.class to META-INF/versions/9 + multiReleaseVersion = 9 + moduleInfoPath = 'src/main/java9/module-info.java' + version = project.version + neverCompileModuleInfo = true +} + jar { manifest { attributes 'Specification-Title' : 'Picocli Shell JLine2', diff --git a/picocli-shell-jline3/build.gradle b/picocli-shell-jline3/build.gradle index b4f7692b0..4d3634516 100644 --- a/picocli-shell-jline3/build.gradle +++ b/picocli-shell-jline3/build.gradle @@ -15,6 +15,18 @@ dependencies { api supportDependencies.jline3 } +apply plugin: 'org.beryx.jar' // for compiling module-info on Java 8 +compileJava { + inputs.property("moduleName", moduleName) +} +moduleConfig { + // copy module-info.class to META-INF/versions/9 + multiReleaseVersion = 9 + moduleInfoPath = 'src/main/java9/module-info.java' + version = project.version + neverCompileModuleInfo = true +} + jar { manifest { attributes 'Specification-Title' : 'Picocli Shell JLine3', diff --git a/picocli-spring-boot-starter/build.gradle b/picocli-spring-boot-starter/build.gradle index 4ca209a5e..1ff7ce974 100644 --- a/picocli-spring-boot-starter/build.gradle +++ b/picocli-spring-boot-starter/build.gradle @@ -24,6 +24,18 @@ if (useJava17) { targetCompatibility = 1.8 } +apply plugin: 'org.beryx.jar' // for compiling module-info on Java 8 +compileJava { + inputs.property("moduleName", moduleName) +} +moduleConfig { + // copy module-info.class to META-INF/versions/9 + multiReleaseVersion = 9 + moduleInfoPath = 'src/main/java9/module-info.java' + version = project.version + neverCompileModuleInfo = true +} + dependencies { api rootProject if (useJava17) {