8 Star 0 Fork 5

src-openEuler / ant-antunit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ant-antunit.spec 2.92 KB
一键复制 编辑 原始数据 按行查看 历史
王歌 提交于 2022-05-18 16:03 . upgrade to version 1.4.1
%global base_name antunit
Name: ant-%{base_name}
Version: 1.4.1
Release: 1
Summary: Provide antunit ant task
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: maven-local ant ant-junit ant-testutil
%description
The <antunit> task drives the tests much like <junit> does for JUnit tests.
When called on a build file, the task will start a new Ant project for that
build file and scan for targets with names that start with "test". For each
such target it then will:
1. Execute the target named setUp, if there is one.
2. Execute the target itself - if this target depends on other targets the
normal Ant rules apply and the dependent targets are executed first.
3. Execute the target names tearDown, if there is one.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n apache-%{name}-%{version}
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 '
<resources>
<resource>
<directory>${project.basedir}/src/main</directory>
<includes>
<include>**/antlib.xml</include>
</includes>
</resource>
</resources>'
# 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
%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_file ":ant-antunit" ant/ant-antunit
%mvn_install
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
echo "ant/%{name}" > %{buildroot}%{_sysconfdir}/ant.d/%{base_name}
%files -f .mfiles
%license NOTICE
%doc CONTRIBUTORS README README.html WHATSNEW
%config(noreplace) %{_sysconfdir}/ant.d/%{base_name}
%files javadoc -f .mfiles-javadoc
%license NOTICE
%changelog
* Wed May 18 2022 Ge Wang <wangge20@h-parters.com> - 1.4.1-1
- Upgrade to version 1.4.1
* Mon Sep 14 2020 chengzihan <chengzihan2@huawei.com> - 1.3-2
- Replace invalid url of Source0
* Fri Jul 24 2020 chengzihan <chengzihan2@huawei.com> - 1.3-1
- Package init
1
https://gitee.com/src-openeuler/ant-antunit.git
git@gitee.com:src-openeuler/ant-antunit.git
src-openeuler
ant-antunit
ant-antunit
master

搜索帮助