Expand conditionals

This commit is contained in:
Mikolaj Izdebski 2018-11-29 12:42:46 +00:00
parent bf1d3be955
commit 548e2390fc

View File

@ -1,5 +1,3 @@
%bcond_without groovy
%bcond_without snakeyaml
Name: testng
Version: 6.14.3
@ -30,15 +28,6 @@ BuildRequires: mvn(org.apache.ant:ant)
BuildRequires: mvn(org.apache-extras.beanshell:bsh)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
%if %{with groovy}
BuildRequires: mvn(org.assertj:assertj-core) >= 3.8.0
BuildRequires: mvn(org.codehaus.gmavenplus:gmavenplus-plugin)
BuildRequires: mvn(org.codehaus.groovy:groovy-all)
BuildRequires: mvn(org.spockframework:spock-core)
%endif
%if %{with snakeyaml}
BuildRequires: mvn(org.yaml:snakeyaml)
%endif
%description
TestNG is a testing framework inspired from JUnit and NUnit but introducing
@ -69,23 +58,11 @@ find -name *.class -delete
%pom_remove_plugin :maven-source-plugin
%pom_remove_plugin :maven-javadoc-plugin
%if %{without snakeyaml}
%pom_remove_dep org.yaml:snakeyaml
rm src/main/java/org/testng/internal/Yaml*.java
rm src/main/java/org/testng/Converter.java
%endif
# missing test deps
%if %{with groovy}
%pom_add_plugin "org.codehaus.gmavenplus:gmavenplus-plugin" pom.xml \
"<executions><execution><goals><goal>addTestSources</goal><goal>testGenerateStubs</goal><goal>testCompile</goal><goal>removeTestStubs</goal></goals></execution></executions>"
%pom_add_dep "org.assertj:assertj-core::test"
%pom_add_dep "org.spockframework:spock-core::test"
%pom_add_dep "org.codehaus.groovy:groovy-all::test"
# remove failing test
sed -i -e '/parallelDataProviderSample/,+12d' ./src/test/java/test/dataprovider/DataProviderTest.java
%endif
sed -i -e 's/DEV-SNAPSHOT/%{version}/' src/main/java/org/testng/internal/Version.java
@ -96,11 +73,7 @@ cp -p ./src/main/java/*.dtd.html ./src/main/resources/.
%mvn_alias : :::jdk15:
%build
%if %{with groovy} && %{with snakeyaml}
%mvn_build
%else
%mvn_build -f
%endif
%install
%mvn_install