Group :: Development/Other
RPM: ant-antunit
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Group: Development/Other
BuildRequires: /proc rpm-build-java
BuildRequires: jpackage-default
# see https://bugzilla.altlinux.org/show_bug.cgi?id=10382
%define _localstatedir %{_var}
Name: ant-antunit
Version: 1.4.1
Release: alt1_3jpp11
Summary: Unit Test Framework for Ant Tasks
License: ASL 2.0
URL: https://ant.apache.org/antlibs/antunit
BuildArch: noarch
Source0: https://archive.apache.org/dist/ant/antlibs/antunit/source/apache-%{name}-%{version}-src.tar.bz2
Source1: https://archive.apache.org/dist/ant/antlibs/antunit/source/apache-%{name}-%{version}-src.tar.bz2.asc
Source2: https://archive.apache.org/dist/ant/KEYS
BuildRequires: gnupg2
BuildRequires: maven-local
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.ant:ant)
BuildRequires: mvn(org.apache.ant:ant-testutil)
Source44: import.info
%description
This library contains tasks that enables Ant task developers to test their tasks
with Ant and without JUnit. It contains a few assertion tasks and an antunit
task that runs build files instead of test classes and is modelled after the
JUnit task.
%{?javadoc_package}
%prep
%setup -q -n apache-%{name}-%{version}
find -type f '(' -iname '*.jar' -o -iname '*.class' ')' -print -delete
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 -Dmaven.compiler.release=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_install
%files -f .mfiles
%doc --no-dereference common/LICENSE NOTICE
%changelog
…
Full changelog you can see here
BuildRequires: /proc rpm-build-java
BuildRequires: jpackage-default
# see https://bugzilla.altlinux.org/show_bug.cgi?id=10382
%define _localstatedir %{_var}
Name: ant-antunit
Version: 1.4.1
Release: alt1_3jpp11
Summary: Unit Test Framework for Ant Tasks
License: ASL 2.0
URL: https://ant.apache.org/antlibs/antunit
BuildArch: noarch
Source0: https://archive.apache.org/dist/ant/antlibs/antunit/source/apache-%{name}-%{version}-src.tar.bz2
Source1: https://archive.apache.org/dist/ant/antlibs/antunit/source/apache-%{name}-%{version}-src.tar.bz2.asc
Source2: https://archive.apache.org/dist/ant/KEYS
BuildRequires: gnupg2
BuildRequires: maven-local
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.ant:ant)
BuildRequires: mvn(org.apache.ant:ant-testutil)
Source44: import.info
%description
This library contains tasks that enables Ant task developers to test their tasks
with Ant and without JUnit. It contains a few assertion tasks and an antunit
task that runs build files instead of test classes and is modelled after the
JUnit task.
%{?javadoc_package}
%prep
%setup -q -n apache-%{name}-%{version}
find -type f '(' -iname '*.jar' -o -iname '*.class' ')' -print -delete
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 -Dmaven.compiler.release=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_install
%files -f .mfiles
%doc --no-dereference common/LICENSE NOTICE
%changelog
…
Full changelog you can see here