From dcb50ee9885e235ea52e8d8be5f9566d37aa3dc3 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Thu, 23 Feb 2023 15:31:57 +0100 Subject: [PATCH] Enable module-info generation --- aggregator.pom | 38 +++++++++++++++++++++++++++++++++----- junit5.spec | 24 ++++++++++++++++-------- 2 files changed, 49 insertions(+), 13 deletions(-) diff --git a/aggregator.pom b/aggregator.pom index 589e7ce..78c1be2 100644 --- a/aggregator.pom +++ b/aggregator.pom @@ -21,7 +21,6 @@ junit-platform-console-standalone junit-platform-engine junit-platform-launcher - junit-platform-reporting junit-platform-runner junit-platform-suite-api junit-platform-suite-commons @@ -32,11 +31,40 @@ + org.apache.maven.plugins maven-compiler-plugin - - 1.8 - 1.8 - + + + default-compile + + compile + + + 8 + + false + + **/module-info.java + + + + + module-info + + compile + + + 9 + + **/module-info.java + + + + maven-jar-plugin diff --git a/junit5.spec b/junit5.spec index f9c21be..2b904b5 100644 --- a/junit5.spec +++ b/junit5.spec @@ -7,7 +7,7 @@ Name: junit5 Version: 5.9.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Java regression testing framework License: EPL-2.0 URL: https://junit.org/junit5/ @@ -26,7 +26,6 @@ Source203: https://repo1.maven.org/maven2/org/junit/platform/junit-platform Source205: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-launcher/%{platform_version}/junit-platform-launcher-%{platform_version}.pom Source206: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-runner/%{platform_version}/junit-platform-runner-%{platform_version}.pom Source207: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-suite-api/%{platform_version}/junit-platform-suite-api-%{platform_version}.pom -Source208: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-reporting/%{platform_version}/junit-platform-reporting-%{platform_version}.pom Source209: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-testkit/%{platform_version}/junit-platform-testkit-%{platform_version}.pom Source210: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-suite-commons/%{platform_version}/junit-platform-suite-commons-%{platform_version}.pom # Jupiter POMs @@ -56,11 +55,13 @@ BuildRequires: mvn(org.opentest4j:opentest4j) %description JUnit is a popular regression testing framework for Java platform. +%if 0 %package javadoc Summary: Javadoc for %{name} %description javadoc Junit5 API documentation. +%endif %package guide Summary: Documentation for %{name} @@ -71,17 +72,18 @@ JUnit 5 User Guide. %prep %setup -q -n %{name}-r%{version} -find -name \*.jar -delete +find -name '*.jar' -delete cp -p %{SOURCE100} pom.xml -# Module depends on open-test-reporting -rm -r junit-platform-reporting/src/main/java/org/junit/platform/reporting/open - for source in $(echo %{sources} | cut -d ' ' -f3-); do module=${source} module=${module##*/} module=${module%%-*} + if [ -d ${module}/src/module ]; then + mkdir -p ${module}/src/main/java + mv -t ${module}/src/main/java ${module}/src/module/*/module-info.java + fi cp -p ${source} ${module}/pom.xml %pom_add_parent org.fedoraproject.xmvn.junit5:aggregator:any ${module} # OSGi BSN @@ -89,7 +91,7 @@ for source in $(echo %{sources} | cut -d ' ' -f3-); do %pom_xpath_inject pom:project "${bsn}" ${module} # Incorrect scope - API guardian is just annotation, needed only during compilation %pom_xpath_set -f "pom:dependency[pom:artifactId='apiguardian-api']/pom:scope" provided ${module} - %pom_xpath_set -f "pom:dependency[pom:scope='runtime']/pom:scope" "compile" ${module} + %pom_xpath_set -f "pom:dependency[pom:scope='runtime']/pom:scope" compile ${module} done %pom_remove_parent junit-bom @@ -105,7 +107,8 @@ done %mvn_package :aggregator __noinstall %build -%mvn_build -f +# javadoc fails: https://github.com/fedora-java/xmvn/issues/223 +%mvn_build -f -j # Build docs. Ignore exit asciidoc -- it fails for some reason, but # still produces readable docs. @@ -118,13 +121,18 @@ ln -s ../../javadoc/junit5 documentation/src/docs/api %files -f .mfiles %license LICENSE.md LICENSE-notice.md +%if 0 %files javadoc -f .mfiles-javadoc %license LICENSE.md LICENSE-notice.md +%endif %files guide %doc documentation/src/docs/* %changelog +* Thu Feb 23 2023 Marian Koncek - 5.9.0-3 +- Enable module-info generation + * Thu Jan 19 2023 Fedora Release Engineering - 5.9.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild