2019-04-05 08:39:20 +02:00
|
|
|
#
|
|
|
|
# spec file for package junit5
|
|
|
|
#
|
2023-09-11 12:41:52 +02:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2019-04-05 08:39:20 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2022-05-09 15:03:24 +02:00
|
|
|
%global platform_version 1.8.2
|
2019-04-05 08:39:20 +02:00
|
|
|
%global jupiter_version %{version}
|
|
|
|
%global vintage_version %{version}
|
2019-11-08 11:01:19 +01:00
|
|
|
%bcond_without console
|
2019-04-05 08:39:20 +02:00
|
|
|
Name: junit5
|
2022-05-09 15:03:24 +02:00
|
|
|
Version: 5.8.2
|
2019-04-05 08:39:20 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Java regression testing framework
|
2019-04-11 17:14:53 +02:00
|
|
|
License: EPL-2.0
|
2019-04-05 08:39:20 +02:00
|
|
|
Group: Development/Libraries/Java
|
2019-11-08 09:57:06 +01:00
|
|
|
URL: https://junit.org/junit5/
|
2019-04-11 17:14:53 +02:00
|
|
|
Source0: https://github.com/junit-team/junit5/archive/r%{version}/junit5-%{version}.tar.gz
|
2019-04-05 08:39:20 +02:00
|
|
|
# Aggregator POM (used for packaging only)
|
|
|
|
Source100: aggregator.pom
|
|
|
|
# Platform POMs
|
|
|
|
Source200: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-commons/%{platform_version}/junit-platform-commons-%{platform_version}.pom
|
|
|
|
Source201: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console/%{platform_version}/junit-platform-console-%{platform_version}.pom
|
|
|
|
Source202: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/%{platform_version}/junit-platform-console-standalone-%{platform_version}.pom
|
|
|
|
Source203: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-engine/%{platform_version}/junit-platform-engine-%{platform_version}.pom
|
|
|
|
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
|
2019-04-11 17:14:53 +02:00
|
|
|
Source208: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-reporting/%{platform_version}/junit-platform-reporting-%{platform_version}.pom
|
2022-05-09 15:03:24 +02:00
|
|
|
Source209: https://repo1.maven.org/maven2/org/junit/platform/junit-platform-suite-commons/%{platform_version}/junit-platform-suite-commons-%{platform_version}.pom
|
2019-04-05 08:39:20 +02:00
|
|
|
# Jupiter POMs
|
2022-05-09 15:03:24 +02:00
|
|
|
Source300: https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter/%{jupiter_version}/junit-jupiter-%{jupiter_version}.pom
|
2019-04-05 08:39:20 +02:00
|
|
|
Source301: https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-api/%{jupiter_version}/junit-jupiter-api-%{jupiter_version}.pom
|
|
|
|
Source302: https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/%{jupiter_version}/junit-jupiter-engine-%{jupiter_version}.pom
|
|
|
|
Source303: https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-migrationsupport/%{jupiter_version}/junit-jupiter-migrationsupport-%{jupiter_version}.pom
|
|
|
|
Source304: https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-params/%{jupiter_version}/junit-jupiter-params-%{jupiter_version}.pom
|
|
|
|
# Vintage POM
|
|
|
|
Source400: https://repo1.maven.org/maven2/org/junit/vintage/junit-vintage-engine/%{vintage_version}/junit-vintage-engine-%{vintage_version}.pom
|
2022-05-09 15:03:24 +02:00
|
|
|
# BOM POM
|
2022-03-03 15:04:13 +01:00
|
|
|
Source500: https://repo1.maven.org/maven2/org/junit/junit-bom/%{version}/junit-bom-%{version}.pom
|
2023-10-26 14:22:30 +02:00
|
|
|
Patch0: unreported-exception.patch
|
2019-04-05 08:39:20 +02:00
|
|
|
BuildRequires: asciidoc
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: maven-local
|
|
|
|
BuildRequires: mvn(com.univocity:univocity-parsers)
|
|
|
|
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
|
|
|
|
JUnit is a popular regression testing framework for Java platform.
|
|
|
|
|
2022-03-03 15:04:13 +01:00
|
|
|
%package bom
|
|
|
|
Summary: JUnit 5 (Bill of Materials)
|
|
|
|
Group: Development/Libraries/Java
|
|
|
|
|
|
|
|
%description bom
|
|
|
|
This Bill of Materials POM can be used to ease dependency management
|
|
|
|
when referencing multiple JUnit artifacts using Gradle or Maven.
|
|
|
|
|
2019-04-05 08:39:20 +02:00
|
|
|
%package javadoc
|
|
|
|
Summary: Javadoc for %{name}
|
|
|
|
Group: Documentation/HTML
|
|
|
|
|
|
|
|
%description javadoc
|
|
|
|
Junit5 API documentation.
|
|
|
|
|
|
|
|
%package guide
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
Group: Documentation/HTML
|
2019-04-11 17:16:36 +02:00
|
|
|
Requires: %{name}-javadoc = %{version}-%{release}
|
2019-04-05 08:39:20 +02:00
|
|
|
|
|
|
|
%description guide
|
|
|
|
JUnit 5 User Guide.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n %{name}-r%{version}
|
2023-10-26 14:22:30 +02:00
|
|
|
%patch0 -p1
|
2019-04-05 08:39:20 +02:00
|
|
|
find -name \*.jar -delete
|
|
|
|
|
|
|
|
cp -p %{SOURCE100} pom.xml
|
|
|
|
cp -p %{SOURCE200} junit-platform-commons/pom.xml
|
|
|
|
cp -p %{SOURCE201} junit-platform-console/pom.xml
|
|
|
|
cp -p %{SOURCE202} junit-platform-console-standalone/pom.xml
|
|
|
|
cp -p %{SOURCE203} junit-platform-engine/pom.xml
|
|
|
|
cp -p %{SOURCE205} junit-platform-launcher/pom.xml
|
|
|
|
cp -p %{SOURCE206} junit-platform-runner/pom.xml
|
|
|
|
cp -p %{SOURCE207} junit-platform-suite-api/pom.xml
|
2019-04-11 17:14:53 +02:00
|
|
|
cp -p %{SOURCE208} junit-platform-reporting/pom.xml
|
2022-05-09 15:03:24 +02:00
|
|
|
cp -p %{SOURCE209} junit-platform-suite-commons/pom.xml
|
|
|
|
cp -p %{SOURCE300} junit-jupiter/pom.xml
|
2019-04-05 08:39:20 +02:00
|
|
|
cp -p %{SOURCE301} junit-jupiter-api/pom.xml
|
|
|
|
cp -p %{SOURCE302} junit-jupiter-engine/pom.xml
|
|
|
|
cp -p %{SOURCE303} junit-jupiter-migrationsupport/pom.xml
|
|
|
|
cp -p %{SOURCE304} junit-jupiter-params/pom.xml
|
|
|
|
cp -p %{SOURCE400} junit-vintage-engine/pom.xml
|
2022-05-09 15:03:24 +02:00
|
|
|
cp -p %{SOURCE500} junit-bom/pom.xml
|
2019-04-05 08:39:20 +02:00
|
|
|
|
2022-05-09 15:03:24 +02:00
|
|
|
for pom in $(find -mindepth 2 -name pom.xml | grep -v tests/); do
|
2019-04-05 08:39:20 +02:00
|
|
|
# Set parent to aggregator
|
|
|
|
%pom_xpath_inject pom:project "<parent><groupId>org.fedoraproject.xmvn.junit5</groupId><artifactId>aggregator</artifactId><version>1.0.0</version></parent>" $pom
|
|
|
|
# OSGi BSN
|
|
|
|
bsn=$(sed 's|/pom.xml$||;s|.*/|org.|;s|-|.|g' <<<"$pom")
|
|
|
|
%pom_xpath_inject pom:project "<properties><osgi.bsn>${bsn}</osgi.bsn></properties>" $pom
|
|
|
|
# Incorrect scope - API guardian is just annotation, needed only during compilation
|
|
|
|
%pom_xpath_set -f "pom:dependency[pom:artifactId='apiguardian-api']/pom:scope" provided $pom
|
2022-05-09 15:03:24 +02:00
|
|
|
sed -i s/runtime/compile/ $pom
|
2019-04-05 08:39:20 +02:00
|
|
|
done
|
|
|
|
|
2022-05-09 15:03:24 +02:00
|
|
|
%pom_remove_parent junit-bom
|
|
|
|
|
2019-04-05 08:39:20 +02:00
|
|
|
# Add deps which are shaded by upstream and therefore not present in POMs.
|
2019-11-08 11:01:19 +01:00
|
|
|
%pom_add_dep info.picocli:picocli:4.0.4 junit-platform-console
|
2022-05-09 15:03:24 +02:00
|
|
|
%pom_add_dep com.univocity:univocity-parsers:2.9.1 junit-jupiter-params
|
2019-04-05 08:39:20 +02:00
|
|
|
|
|
|
|
%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
|
2022-03-03 15:04:13 +01:00
|
|
|
%{mvn_package} :junit-bom bom
|
|
|
|
|
2019-04-05 08:39:20 +02:00
|
|
|
%build
|
2023-09-11 12:41:52 +02:00
|
|
|
%{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
|
2019-04-05 08:39:20 +02:00
|
|
|
|
|
|
|
# Build docs. Ignore exit asciidoc -- it fails for some reason, but
|
|
|
|
# still produces readable docs.
|
2019-11-08 09:57:06 +01:00
|
|
|
asciidoc documentation/src/docs/asciidoc/index.adoc || :
|
2019-04-05 08:39:20 +02:00
|
|
|
ln -s ../../javadoc/junit5 documentation/src/docs/api
|
|
|
|
|
|
|
|
%install
|
|
|
|
%mvn_install
|
|
|
|
%fdupes -s %{buildroot}%{_javadocdir}
|
|
|
|
%fdupes -s documentation/src/docs/
|
|
|
|
|
|
|
|
%if %{with console}
|
2022-05-09 15:03:24 +02:00
|
|
|
%jpackage_script org/junit/platform/console/ConsoleLauncher "" "" junit5:junit:opentest4j:picocli %{name} true
|
2019-04-05 08:39:20 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%files -f .mfiles
|
|
|
|
%if %{with console}
|
|
|
|
%{_bindir}/%{name}
|
|
|
|
%endif
|
2019-04-11 17:14:53 +02:00
|
|
|
%license LICENSE.md LICENSE-notice.md
|
2019-04-05 08:39:20 +02:00
|
|
|
|
2022-03-03 15:04:13 +01:00
|
|
|
%files bom -f .mfiles-bom
|
|
|
|
%license LICENSE.md LICENSE-notice.md
|
|
|
|
|
2019-04-05 08:39:20 +02:00
|
|
|
%files javadoc -f .mfiles-javadoc
|
2019-04-11 17:14:53 +02:00
|
|
|
%license LICENSE.md LICENSE-notice.md
|
2019-04-05 08:39:20 +02:00
|
|
|
|
|
|
|
%files guide
|
|
|
|
%doc documentation/src/docs/*
|
|
|
|
|
|
|
|
%changelog
|