From b7002d380f1d99c9739db77b1a8ea8cc67e5a0bd2c29ad55c39b69a7c863fc52 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 10 Apr 2024 04:57:56 +0000 Subject: [PATCH] Accepting request 1166542 from Java:packages:test split OBS-URL: https://build.opensuse.org/request/show/1166542 OBS-URL: https://build.opensuse.org/package/show/Java:packages/junit5?expand=0&rev=20 --- _multibuild | 3 ++ aggregator.pom | 2 -- junit5-build.tar.xz | 3 ++ junit5.changes | 7 ++++ junit5.spec | 86 ++++++++++++++++++++++++++++++++------------- 5 files changed, 74 insertions(+), 27 deletions(-) create mode 100644 _multibuild create mode 100644 junit5-build.tar.xz diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..93032d2 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + bootstrap + diff --git a/aggregator.pom b/aggregator.pom index 9100cae..8e7b69b 100644 --- a/aggregator.pom +++ b/aggregator.pom @@ -6,7 +6,6 @@ pom junit-bom - junit-platform-commons junit-platform-console junit-platform-console-standalone junit-platform-engine @@ -16,7 +15,6 @@ junit-platform-suite-api junit-platform-suite-commons junit-jupiter - junit-jupiter-api junit-jupiter-engine junit-jupiter-migrationsupport junit-jupiter-params diff --git a/junit5-build.tar.xz b/junit5-build.tar.xz new file mode 100644 index 0000000..a645891 --- /dev/null +++ b/junit5-build.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:134531cc022eda9ccf4a73f7aad47ea7468e78cd1a09e8fd3e9b80072001c3ac +size 2056 diff --git a/junit5.changes b/junit5.changes index 098ba99..03e4f7a 100644 --- a/junit5.changes +++ b/junit5.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Apr 9 20:21:54 UTC 2024 - Fridrich Strba + +- Split into two _multibuild packages so that we can use the + junit-jupiter-api pretty early in the build without creating + build cycles. + ------------------------------------------------------------------- Wed Feb 21 10:48:09 UTC 2024 - Gus Kenion diff --git a/junit5.spec b/junit5.spec index 1980d64..deee112 100644 --- a/junit5.spec +++ b/junit5.spec @@ -16,18 +16,23 @@ # +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "bootstrap" +%bcond_without bootstrap +%else +%bcond_with bootstrap +%endif %global platform_version 1.8.2 %global jupiter_version %{version} %global vintage_version %{version} -%bcond_without console -Name: junit5 +%global base_name junit5 Version: 5.8.2 Release: 0 -Summary: Java regression testing framework License: EPL-2.0 Group: Development/Libraries/Java URL: https://junit.org/junit5/ -Source0: https://github.com/junit-team/junit5/archive/r%{version}/junit5-%{version}.tar.gz +Source0: https://github.com/junit-team/%{base_name}/archive/r%{version}/%{base_name}-%{version}.tar.gz +Source1: %{base_name}-build.tar.xz # Aggregator POM (used for packaging only) Source100: aggregator.pom # Platform POMs @@ -51,18 +56,26 @@ Source400: https://repo1.maven.org/maven2/org/junit/vintage/junit-vintage-e # BOM POM Source500: https://repo1.maven.org/maven2/org/junit/junit-bom/%{version}/junit-bom-%{version}.pom Patch0: unreported-exception.patch -BuildRequires: asciidoc +BuildRequires: apiguardian BuildRequires: fdupes +BuildRequires: opentest4j +Requires: javapackages-tools +BuildArch: noarch +%if %{with bootstrap} +Name: %{base_name}-minimal +Summary: Java regression testing framework (minimal) +BuildRequires: ant +BuildRequires: javapackages-local >= 6 +%else +Name: %{base_name} +Summary: Java regression testing framework +BuildRequires: %{base_name}-minimal +BuildRequires: asciidoc BuildRequires: maven-local BuildRequires: mvn(com.univocity:univocity-parsers) +BuildRequires: mvn(info.picocli:picocli) BuildRequires: mvn(junit:junit) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) -BuildRequires: mvn(org.apiguardian:apiguardian-api) -BuildRequires: mvn(org.opentest4j:opentest4j) -BuildArch: noarch -%if %{with console} -BuildRequires: mvn(info.picocli:picocli) -Requires: javapackages-tools %endif %description @@ -92,7 +105,7 @@ Requires: %{name}-javadoc = %{version}-%{release} JUnit 5 User Guide. %prep -%setup -q -n %{name}-r%{version} +%setup -q -n %{base_name}-r%{version} -a1 %patch -P 0 -p1 find -name \*.jar -delete @@ -131,16 +144,15 @@ done %pom_add_dep info.picocli:picocli:4.0.4 junit-platform-console %pom_add_dep com.univocity:univocity-parsers:2.9.1 junit-jupiter-params -%if %{without console} -# Disable the console modules -%pom_disable_module junit-platform-console -%pom_disable_module junit-platform-console-standalone -%endif - -%{mvn_package} :aggregator __noinstall %{mvn_package} :junit-bom bom +%{mvn_package} :aggregator __noinstall %build +%if %{with bootstrap} +mkdir -p lib +build-jar-repository -s lib opentest4j/opentest4j apiguardian/apiguardian-api +%{ant} package javadoc +%else %{mvn_build} -f -- \ -Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) \ -Dencoding=utf-8 -Dsource=8 @@ -149,22 +161,38 @@ done # still produces readable docs. asciidoc documentation/src/docs/asciidoc/index.adoc || : ln -s ../../javadoc/junit5 documentation/src/docs/api +%endif %install +%if %{with bootstrap} + +install -dm 0755 %{buildroot}%{_javadir}/%{base_name} +install -dm 0755 %{buildroot}%{_mavenpomdir}/%{base_name} +install -dm 0755 %{buildroot}%{_javadocdir}/%{name} +for i in junit-platform-commons junit-jupiter-api; do + install -pm 0644 ${i}/target/${i}*.jar %{buildroot}%{_javadir}/%{base_name}/${i}.jar + %{mvn_install_pom} ${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{base_name}/${i}.pom + %add_maven_depmap %{base_name}/${i}.pom %{base_name}/${i}.jar + cp -r ${i}/target/site/apidocs %{buildroot}%{_javadocdir}/%{name}/${i} +done + +%else + %mvn_install -%fdupes -s %{buildroot}%{_javadocdir} +%jpackage_script org/junit/platform/console/ConsoleLauncher "" "" junit5:junit:opentest4j:picocli %{name} true %fdupes -s documentation/src/docs/ -%if %{with console} -%jpackage_script org/junit/platform/console/ConsoleLauncher "" "" junit5:junit:opentest4j:picocli %{name} true %endif +%fdupes -s %{buildroot}%{_javadocdir} + %files -f .mfiles -%if %{with console} -%{_bindir}/%{name} -%endif %license LICENSE.md LICENSE-notice.md +%if %{without bootstrap} + +%{_bindir}/%{name} + %files bom -f .mfiles-bom %license LICENSE.md LICENSE-notice.md @@ -174,4 +202,12 @@ ln -s ../../javadoc/junit5 documentation/src/docs/api %files guide %doc documentation/src/docs/* +%else + +%files javadoc +%{_javadocdir}/%{name} +%license LICENSE.md LICENSE-notice.md + +%endif + %changelog