Fridrich Strba 2024-02-19 17:41:19 +00:00 committed by Git OBS Bridge
parent d27e3bd102
commit 6fdc4604f9
2 changed files with 7 additions and 131 deletions

View File

@ -22,7 +22,8 @@ collection of phonetic encoding utilities."/>
<property name="bundle.version" value="${project.version}.0"/>
<property name="bundle.symbolicName" value="org.apache.commons.codec"/>
<property name="compiler.source" value="1.6"/>
<property name="compiler.release" value="8"/>
<property name="compiler.source" value="1.${compiler.release}"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
@ -31,11 +32,7 @@ collection of phonetic encoding utilities."/>
<property name="build.srcDir" value="src/main/java"/>
<property name="build.resourceDir.0" value="src/main/resources"/>
<property name="build.resourceDir.1" value="."/>
<property name="build.testOutputDir" value="${build.dir}/test-classes"/>
<property name="build.testDir" value="src/test/java"/>
<property name="build.testResourceDir.0" value="src/test/resources"/>
<property name="build.testResourceDir.1" value="."/>
<property name="test.reports" value="${build.dir}/test-reports"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<!-- ====================================================================== -->
@ -43,8 +40,6 @@ collection of phonetic encoding utilities."/>
<!-- ====================================================================== -->
<path id="build.classpath"/>
<path id="build.test.classpath">
<!-- junit-4.12 hamcrest-core-1.3 commons-lang3-3.5 -->
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
@ -71,6 +66,7 @@ collection of phonetic encoding utilities."/>
optimize="false"
deprecation="true"
target="${compiler.target}"
release="${compiler.release}"
verbose="false"
fork="false"
source="${compiler.source}">
@ -91,110 +87,6 @@ collection of phonetic encoding utilities."/>
</copy>
</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}"
encoding="UTF-8"
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.0}"/>
</copy>
<mkdir dir="${build.testOutputDir}/META-INF"/>
<copy todir="${build.testOutputDir}/META-INF">
<fileset dir="${build.testResourceDir.1}">
<include name="NOTICE.txt"/>
<include name="LICENSE.txt"/>
</fileset>
</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="**/*AbstractTest.java"/>
<exclude name="**/*PerformanceTest.java"/>
</fileset>
</batchtest>
<batchtest todir="${test.reports}" if="test">
<fileset dir="${build.testDir}">
<include name="**/${test}.java"/>
<exclude name="**/*AbstractTest.java"/>
<exclude name="**/*PerformanceTest.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 -->
<!-- ====================================================================== -->
@ -204,7 +96,6 @@ collection of phonetic encoding utilities."/>
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
old="false"
verbose="false"
encoding="UTF-8"
version="true"
@ -229,7 +120,7 @@ collection of phonetic encoding utilities."/>
<!-- 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"
compress="true"
index="false"

View File

@ -1,7 +1,7 @@
#
# spec file for package apache-commons-codec
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2000-2010, JPackage Project
#
# All modifications and additions to the file contributed by third parties
@ -19,7 +19,6 @@
%define base_name codec
%define short_name commons-%{base_name}
%bcond_with tests
Name: apache-commons-codec
Version: 1.16.0
Release: 0
@ -44,13 +43,6 @@ Obsoletes: jakarta-%{short_name} < %{version}
Provides: %{short_name} = %{version}
Obsoletes: %{short_name} < %{version}
BuildArch: noarch
%if %{with tests}
BuildRequires: ant-junit >= 1.7
BuildRequires: apache-commons-lang3
BuildRequires: hamcrest-core
BuildRequires: junit
BuildRequires: mozilla-nss
%endif
%description
Commons Codec is an attempt to provide definitive implementations of
@ -79,14 +71,7 @@ dos2unix RELEASE-NOTES*.txt LICENSE.txt NOTICE.txt
%build
mkdir -p lib
%if %{with tests}
build-jar-repository -s lib junit4 hamcrest/core commons-lang3
%endif
ant \
%if %{without tests}
-Dtest.skip=true \
%endif
-Dcompiler.source=1.8 -Dcompiler.target=1.8 \
%{ant} \
jar javadoc
%install