%global namedreltag -M1 %global namedversion %{version}%{?namedreltag} %global platform_namedreltag -M1 %global platform_version 1.0.0 %global platform_namedversion %{platform_version}%{?platform_namedreltag} %global vintage_namedreltag -M1 %global vintage_version 4.12.0 %global vintage_namedversion %{vintage_version}%{?vintage_namedreltag} Name: junit5 Version: 5.0.0 Release: 0.1.M1%{?dist} Summary: The next generation of JUnit testing framework for Java License: EPL URL: http://junit.org/junit5/ Source0: https://github.com/junit-team/junit5/archive/r%{namedversion}/%{name}-%{namedversion}.tar.gz # Remove unavailable gradle plugins and releated tasks Patch0: junit5-r5.0.0-M1-build.patch BuildRequires: asciidoc BuildRequires: gradle-local BuildRequires: mvn(junit:junit) >= 4.12 # jopt-simple:5.0.2 BuildRequires: mvn(net.sf.jopt-simple:jopt-simple) BuildRequires: mvn(org.apache.maven.surefire:common-java5) BuildRequires: mvn(org.apache.maven.surefire:surefire-api) BuildRequires: mvn(org.opentest4j:opentest4j) %if 0 # test deps # NOT available de.schauderhaft.degraph:degraph-check:0.1.3 # assertj-core:3.4.1 BuildRequires: mvn(org.assertj:assertj-core) # mockito-core:1.10.19 BuildRequires: mvn(org.mockito:mockito-core) # spock-core:1.0-groovy-2.4 BuildRequires: mvn(org.spockframework:spock-core) # test runtime # org.apache.logging.log4j:2.6.1 BuildRequires: mvn(org.apache.logging.log4j:log4j-core) BuildRequires: mvn(org.apache.logging.log4j:log4j-jul) %endif BuildArch: noarch %description Unlike previous versions of JUnit, JUnit 5 is composed of several different modules from three different sub-projects. JUnit 5 = JUnit Platform + JUnit Jupiter + JUnit Vintage The JUnit Platform serves as a foundation for launching testing frameworks on the JVM. It also defines the TestEngine API for developing a testing framework that runs on the platform. Furthermore, the platform provides a Console Launcher to launch the platform from the command line and build plugins for Gradle and Maven as well as a JUnit 4 based Runner for running any TestEngine on the platform. JUnit Jupiter is the combination of the new programming model and extension model for writing tests and extensions in JUnit 5. The Jupiter sub-project provides a TestEngine for running Jupiter based tests on the platform. JUnit Vintage provides a TestEngine for running JUnit 3 and JUnit 4 based tests on the platform. %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains javadoc for %{name}. %prep %setup -q -n %{name}-r%{namedversion} # Cleanup find . -name "*.jar" -print -delete %patch0 -p1 # TODO sed -i '/addRows(new LinkedHashSet<>(options.values()));/d' \ junit-platform-console/src/main/java/org/junit/platform/console/options/JOptSimpleCommandLineOptionsParser.java sed -i 's/return formattedHelpOutput();/return null;/' \ junit-platform-console/src/main/java/org/junit/platform/console/options/JOptSimpleCommandLineOptionsParser.java # Fix javadoc task echo " apply plugin: 'java' task javadocAll(type: Javadoc) { destinationDir file('javadoc') options.encoding = 'UTF-8' if (JavaVersion.current().isJava8Compatible()) { options.addStringOption('Xdoclint:none', '-quiet') } source subprojects.collect { project -> project.sourceSets.main.allJava } classpath = files(subprojects.collect { project -> project.sourceSets.main.compileClasspath }) }" >> build.gradle %build gradle -s --offline javadocAll install cd documentation/src/docs/asciidoc asciidoc -n -b html5 -a toc2 -a toclevels=3 -o ../../../../index.html index.adoc %install for m in jupiter-api \ jupiter-engine do %mvn_artifact junit-${m}/build/poms/pom-default.xml junit-${m}/build/libs/junit-${m}-%{namedversion}.jar done for m in platform-commons \ platform-console \ platform-engine \ platform-gradle-plugin \ platform-launcher \ platform-runner \ platform-surefire-provider do %mvn_artifact junit-${m}/build/poms/pom-default.xml junit-${m}/build/libs/junit-${m}-%{platform_namedversion}.jar done %mvn_artifact junit-vintage-engine/build/poms/pom-default.xml junit-vintage-engine/build/libs/junit-vintage-engine-%{vintage_namedversion}.jar %mvn_install -J javadoc %files -f .mfiles %doc CONTRIBUTING.md README.md index.html %license LICENSE.md %files javadoc -f .mfiles-javadoc %license LICENSE.md %changelog * Sat Jul 16 2016 gil cattaneo 5.0.0-0.1.M1 - initial rpm