This commit is contained in:
parent
b96632691f
commit
de29a3d9d2
@ -20,10 +20,7 @@
|
|||||||
<property name="build.outputDir" value="${build.dir}/classes"/>
|
<property name="build.outputDir" value="${build.dir}/classes"/>
|
||||||
<property name="build.srcDir" value="src/main/java"/>
|
<property name="build.srcDir" value="src/main/java"/>
|
||||||
<property name="build.resourceDir" value="src/main/resources"/>
|
<property name="build.resourceDir" value="src/main/resources"/>
|
||||||
<property name="build.testOutputDir" value="${build.dir}/test-classes"/>
|
|
||||||
<property name="build.testDir" value="src/test/java"/>
|
|
||||||
<property name="build.testResourceDir" value="src/test/resources"/>
|
|
||||||
<property name="test.reports" value="${build.dir}/test-reports"/>
|
|
||||||
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
|
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
|
||||||
|
|
||||||
<!-- ====================================================================== -->
|
<!-- ====================================================================== -->
|
||||||
@ -82,104 +79,6 @@
|
|||||||
</copy>
|
</copy>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- ====================================================================== -->
|
|
||||||
<!-- Test-compilation target -->
|
|
||||||
<!-- ====================================================================== -->
|
|
||||||
|
|
||||||
<target name="compile-tests"
|
|
||||||
depends="compile"
|
|
||||||
description="Compile the test code"
|
|
||||||
unless="test.skip">
|
|
||||||
<mkdir dir="${build.testOutputDir}"/>
|
|
||||||
<javac destdir="${build.testOutputDir}"
|
|
||||||
nowarn="false"
|
|
||||||
debug="true"
|
|
||||||
optimize="false"
|
|
||||||
deprecation="true"
|
|
||||||
target="${compiler.target}"
|
|
||||||
verbose="false"
|
|
||||||
fork="false"
|
|
||||||
source="${compiler.source}">
|
|
||||||
<src>
|
|
||||||
<pathelement location="${build.testDir}"/>
|
|
||||||
</src>
|
|
||||||
<classpath>
|
|
||||||
<path refid="build.test.classpath"/>
|
|
||||||
<pathelement location="${build.outputDir}"/>
|
|
||||||
</classpath>
|
|
||||||
</javac>
|
|
||||||
<copy todir="${build.testOutputDir}">
|
|
||||||
<fileset dir="${build.testResourceDir}"/>
|
|
||||||
</copy>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- ====================================================================== -->
|
|
||||||
<!-- Run all tests -->
|
|
||||||
<!-- ====================================================================== -->
|
|
||||||
|
|
||||||
<target name="test"
|
|
||||||
depends="compile-tests, junit-missing"
|
|
||||||
unless="junit.skipped"
|
|
||||||
description="Run the test cases">
|
|
||||||
<mkdir dir="${test.reports}"/>
|
|
||||||
<junit printSummary="yes" haltonerror="true" haltonfailure="true" fork="true" dir=".">
|
|
||||||
<sysproperty key="basedir" value="."/>
|
|
||||||
<formatter type="xml"/>
|
|
||||||
<formatter type="plain" usefile="false"/>
|
|
||||||
<classpath>
|
|
||||||
<path refid="build.test.classpath"/>
|
|
||||||
<pathelement location="${build.outputDir}"/>
|
|
||||||
<pathelement location="${build.testOutputDir}"/>
|
|
||||||
</classpath>
|
|
||||||
<batchtest todir="${test.reports}" unless="test">
|
|
||||||
<fileset dir="${build.testDir}">
|
|
||||||
<include name="**/Test*.java"/>
|
|
||||||
<include name="**/*Test.java"/>
|
|
||||||
<include name="**/*TestCase.java"/>
|
|
||||||
<exclude name="**/*Abstract*Test.java"/>
|
|
||||||
</fileset>
|
|
||||||
</batchtest>
|
|
||||||
<batchtest todir="${test.reports}" if="test">
|
|
||||||
<fileset dir="${build.testDir}">
|
|
||||||
<include name="**/${test}.java"/>
|
|
||||||
<exclude name="**/*Abstract*Test.java"/>
|
|
||||||
</fileset>
|
|
||||||
</batchtest>
|
|
||||||
</junit>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="test-junit-present">
|
|
||||||
<available classname="junit.framework.Test" property="junit.present" classpathref="build.test.classpath"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="test-junit-status"
|
|
||||||
depends="test-junit-present">
|
|
||||||
<condition property="junit.missing">
|
|
||||||
<and>
|
|
||||||
<isfalse value="${junit.present}"/>
|
|
||||||
<isfalse value="${test.skip}"/>
|
|
||||||
</and>
|
|
||||||
</condition>
|
|
||||||
<condition property="junit.skipped">
|
|
||||||
<or>
|
|
||||||
<isfalse value="${junit.present}"/>
|
|
||||||
<istrue value="${test.skip}"/>
|
|
||||||
</or>
|
|
||||||
</condition>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="junit-missing"
|
|
||||||
depends="test-junit-status"
|
|
||||||
if="junit.missing">
|
|
||||||
<echo>=================================== WARNING ===================================</echo>
|
|
||||||
<echo> JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed.</echo>
|
|
||||||
<echo>===============================================================================</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- ====================================================================== -->
|
|
||||||
<!-- Javadoc target -->
|
|
||||||
<!-- ====================================================================== -->
|
|
||||||
|
|
||||||
<target name="javadoc" description="Generates the Javadoc of the application">
|
<target name="javadoc" description="Generates the Javadoc of the application">
|
||||||
<javadoc sourcepath="${build.srcDir}"
|
<javadoc sourcepath="${build.srcDir}"
|
||||||
packagenames="*"
|
packagenames="*"
|
||||||
@ -207,7 +106,7 @@
|
|||||||
<!-- Package target -->
|
<!-- Package target -->
|
||||||
<!-- ====================================================================== -->
|
<!-- ====================================================================== -->
|
||||||
|
|
||||||
<target name="package" depends="compile,test" description="Package the application">
|
<target name="package" depends="compile" description="Package the application">
|
||||||
<jar jarfile="${build.dir}/${build.finalName}.jar"
|
<jar jarfile="${build.dir}/${build.finalName}.jar"
|
||||||
compress="true"
|
compress="true"
|
||||||
index="false"
|
index="false"
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
%bcond_with tests
|
|
||||||
Name: plexus-velocity
|
Name: plexus-velocity
|
||||||
Version: 1.2
|
Version: 1.2
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -38,14 +37,6 @@ Requires: mvn(commons-collections:commons-collections)
|
|||||||
Requires: mvn(org.codehaus.plexus:plexus-container-default)
|
Requires: mvn(org.codehaus.plexus:plexus-container-default)
|
||||||
Requires: mvn(velocity:velocity)
|
Requires: mvn(velocity:velocity)
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%if %{with tests}
|
|
||||||
BuildRequires: ant-junit
|
|
||||||
BuildRequires: apache-commons-lang
|
|
||||||
BuildRequires: guava
|
|
||||||
BuildRequires: plexus-classworlds
|
|
||||||
BuildRequires: plexus-utils
|
|
||||||
BuildRequires: xbean
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package provides Plexus Velocity component - a wrapper for
|
This package provides Plexus Velocity component - a wrapper for
|
||||||
@ -72,16 +63,9 @@ cp -p %{SOURCE2} LICENSE
|
|||||||
|
|
||||||
mkdir -p lib
|
mkdir -p lib
|
||||||
build-jar-repository -s lib commons-collections plexus-containers/plexus-container-default velocity
|
build-jar-repository -s lib commons-collections plexus-containers/plexus-container-default velocity
|
||||||
%if %{with tests}
|
|
||||||
build-jar-repository -s lib commons-lang guava/guava plexus/classworlds plexus/utils xbean/xbean-reflect
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
ant \
|
ant jar javadoc
|
||||||
%if %{without tests}
|
|
||||||
-Dtest.skip=true \
|
|
||||||
%endif
|
|
||||||
jar javadoc
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
# jar
|
# jar
|
||||||
|
Loading…
Reference in New Issue
Block a user