diff --git a/ant-antunit.spec b/ant-antunit.spec index 04a1f71..d56e7cc 100644 --- a/ant-antunit.spec +++ b/ant-antunit.spec @@ -1,13 +1,13 @@ %global base_name antunit Name: ant-%{base_name} -Version: 1.3 -Release: 2 +Version: 1.4.1 +Release: 1 Summary: Provide antunit ant task -License: ASL 2.0 +License: Apache-2.0 URL: http://ant.apache.org/antlibs/antunit/ Source0: https://archive.apache.org/dist/ant/antlibs/%{base_name}/source/apache-%{name}-%{version}-src.tar.bz2 BuildArch: noarch -BuildRequires: javapackages-local ant ant-junit ant-testutil +BuildRequires: maven-local ant ant-junit ant-testutil %description The task drives the tests much like does for JUnit tests. @@ -31,25 +31,57 @@ mv CONTRIBUTORS CONTRIBUTORS.orig iconv -f ISO-8859-1 -t UTF-8 CONTRIBUTORS.orig > CONTRIBUTORS touch -r CONTRIBUTORS.orig CONTRIBUTORS +mv %{name}-%{version}.pom pom.xml + +%pom_xpath_inject pom:project/pom:build ' + + + ${project.basedir}/src/main + + **/antlib.xml + + + ' + +# EatYourOwnDogFoodTest +sed -i 's|build/test-classes|target/test-classes|g' src/etc/testcases/antunit/java-io.xml + +# AssertTest +sed -i 's|build/classes|target/classes|g' src/etc/testcases/assert.xml src/tests/junit/org/apache/ant/antunit/AssertTest.java + %build -ant package +%mvn_build -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8 + +%check +# enable tests +%pom_xpath_set pom:maven.test.skip false + +# compile tests +xmvn test-compile -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8 + +# run tests +java -cp target/classes:target/test-classes:$(build-classpath junit hamcrest ant/ant-testutil ant ant/ant-launcher) \ + org.junit.runner.JUnitCore \ + $(find src/tests/junit/ -name '*.java' -printf '%%P\n' | cut -f 1 -d '.' | tr / .) %install -%mvn_artifact %{name}-%{version}.pom build/lib/%{name}-%{version}.jar %mvn_file ":ant-antunit" ant/ant-antunit -%mvn_install -J docs/ +%mvn_install mkdir -p %{buildroot}%{_sysconfdir}/ant.d echo "ant/%{name}" > %{buildroot}%{_sysconfdir}/ant.d/%{base_name} %files -f .mfiles -%license LICENSE NOTICE +%license NOTICE %doc CONTRIBUTORS README README.html WHATSNEW %config(noreplace) %{_sysconfdir}/ant.d/%{base_name} %files javadoc -f .mfiles-javadoc -%license LICENSE NOTICE +%license NOTICE %changelog +* Wed May 18 2022 Ge Wang - 1.4.1-1 +- Upgrade to version 1.4.1 + * Mon Sep 14 2020 chengzihan - 1.3-2 - Replace invalid url of Source0 diff --git a/apache-ant-antunit-1.3-src.tar.bz2 b/apache-ant-antunit-1.3-src.tar.bz2 deleted file mode 100644 index 6373b7f..0000000 Binary files a/apache-ant-antunit-1.3-src.tar.bz2 and /dev/null differ diff --git a/apache-ant-antunit-1.4.1-src.tar.bz2 b/apache-ant-antunit-1.4.1-src.tar.bz2 new file mode 100644 index 0000000..659ed2b Binary files /dev/null and b/apache-ant-antunit-1.4.1-src.tar.bz2 differ