2009-01-24 13:44:58 -05:00
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
2009-01-24 14:51:09 -05:00
|
|
|
<project name="Commons Math" default="jar" basedir=".">
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
"Math" component of the Apache Commons Project
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ========== Initialize Properties ===================================== -->
|
|
|
|
|
|
|
|
<property file="build.properties"/> <!-- Component local -->
|
|
|
|
<property file="${user.home}/build.properties"/> <!-- User local -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ========== External Dependencies ===================================== -->
|
|
|
|
|
2016-01-02 12:25:49 -05:00
|
|
|
<property name="repository" value = "${user.home}/.m2/repository"/>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
<!-- Junit -->
|
2016-01-02 12:25:49 -05:00
|
|
|
<property name="junit.version" value="4.11"/>
|
|
|
|
<property name="junit.jar" value="$junit-{junit.version}.jar"/>
|
|
|
|
<property name="hamcrest.jar" value="hamcrest-core-1.3.jar"/>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
<!-- ========== Component Declarations ==================================== -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- The name of this component -->
|
|
|
|
<property name="component.name" value="commons-math"/>
|
|
|
|
|
|
|
|
<!-- The primary package name of this component -->
|
2012-02-14 11:17:55 -05:00
|
|
|
<property name="component.package" value="org.apache.commons.math3"/>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
<!-- The title of this component -->
|
|
|
|
<property name="component.title" value="Commons MATH"/>
|
|
|
|
|
|
|
|
<!-- The current version number of this component -->
|
2016-01-02 12:25:49 -05:00
|
|
|
<property name="component.version" value="3.6"/>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
<!-- The base directory for component sources -->
|
2009-08-01 10:54:20 -04:00
|
|
|
<property name="source.home" value="src/main/java"/>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
2011-09-04 22:09:14 -04:00
|
|
|
<!-- The base directory for component resources -->
|
|
|
|
<property name="source.resources" value="src/main/resources"/>
|
|
|
|
|
2009-01-24 13:44:58 -05:00
|
|
|
<!-- The base directory for unit test sources -->
|
2009-08-01 10:54:20 -04:00
|
|
|
<property name="test.home" value="src/test/java"/>
|
|
|
|
|
|
|
|
<!-- The base directory for unit test resources -->
|
|
|
|
<property name="test.resources" value="src/test/resources"/>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
<!-- Download lib dir -->
|
|
|
|
<property name="download.lib.dir" value="lib"/>
|
|
|
|
|
|
|
|
<!-- The base directory for compilation targets -->
|
|
|
|
<property name="build.home" value="target"/>
|
|
|
|
|
|
|
|
<!-- The base directory for distribution targets -->
|
|
|
|
<property name="dist.home" value="${build.home}/dist"/>
|
|
|
|
|
2011-02-21 09:26:08 -05:00
|
|
|
<!-- The base directory for test reports -->
|
|
|
|
<property name="test.reports" value="${build.home}/test-reports"/>
|
|
|
|
|
2009-01-24 13:44:58 -05:00
|
|
|
<!-- Base file name for dist files -->
|
2011-02-21 09:26:08 -05:00
|
|
|
<property name="final.name" value="${component.name}-${component.version}"/>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
<!-- Directory where binary release files are staged -->
|
|
|
|
<property name="stage.bin.dir" value="${dist.home}/stage-bin"/>
|
|
|
|
|
|
|
|
<!-- Directory where source release files are staged -->
|
|
|
|
<property name="stage.src.dir" value="${dist.home}/stage-src"/>
|
|
|
|
|
|
|
|
<!-- ========== Compiler Defaults ========================================= -->
|
|
|
|
|
|
|
|
<!-- Should Java compilations set the 'debug' compiler option? -->
|
|
|
|
<property name="compile.debug" value="true"/>
|
|
|
|
|
|
|
|
<!-- Should Java compilations set the 'deprecation' compiler option? -->
|
|
|
|
<property name="compile.deprecation" value="false"/>
|
|
|
|
|
|
|
|
<!-- Should Java compilations set the 'optimize' compiler option? -->
|
|
|
|
<property name="compile.optimize" value="true"/>
|
2013-07-04 13:24:47 -04:00
|
|
|
|
2012-11-23 15:58:28 -05:00
|
|
|
<!-- File encoding -->
|
2012-11-23 23:01:50 -05:00
|
|
|
<property name="source.encoding" value="UTF-8"/>
|
2009-04-19 14:05:48 -04:00
|
|
|
|
2009-01-24 13:44:58 -05:00
|
|
|
<!-- JDK level -->
|
|
|
|
<property name="compile.source" value="1.5"/>
|
|
|
|
<property name="compile.target" value="1.5"/>
|
|
|
|
|
|
|
|
<!-- Base compile classpath -->
|
|
|
|
<path id="compile.classpath">
|
|
|
|
<pathelement location="${build.home}/classes"/>
|
2004-08-15 16:23:33 -04:00
|
|
|
</path>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
<!-- External dependency classpath -->
|
|
|
|
<path id="downloaded.lib.classpath">
|
|
|
|
<pathelement location="${download.lib.dir}/junit-${junit.version}.jar"/>
|
2016-01-02 12:25:49 -05:00
|
|
|
<pathelement location="${download.lib.dir}/${hamcrest.jar}"/>
|
2009-01-24 13:44:58 -05:00
|
|
|
</path>
|
|
|
|
|
|
|
|
<!-- ========== Test Execution Defaults =================================== -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Construct unit test classpath -->
|
|
|
|
<path id="test.classpath">
|
|
|
|
<pathelement location="${build.home}/classes"/>
|
|
|
|
<pathelement location="${build.home}/test-classes"/>
|
|
|
|
<pathelement location="${junit.jar}"/>
|
2016-01-02 12:25:49 -05:00
|
|
|
<pathelement location="${hamcrest.jar}"/>
|
2009-01-24 13:44:58 -05:00
|
|
|
<path refid="downloaded.lib.classpath"/>
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<!-- Should the build fail if there are test failures? -->
|
|
|
|
<property name="test.failonerror" value="true"/>
|
|
|
|
|
|
|
|
<!-- ========== Executable Targets ======================================== -->
|
|
|
|
|
|
|
|
<target name="clean" description="Clean build and distribution directories">
|
|
|
|
<delete dir="${build.home}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
<target name="init"
|
|
|
|
description="Initialize and evaluate conditionals">
|
|
|
|
<echo message="-------- ${component.title} ${component.version} --------"/>
|
|
|
|
<filter token="name" value="${component.name}"/>
|
|
|
|
<filter token="package" value="${component.package}"/>
|
|
|
|
<filter token="version" value="${component.version}"/>
|
|
|
|
<filter token="compilesource" value="${compile.source}"/>
|
|
|
|
<filter token="compiletarget" value="${compile.target}"/>
|
|
|
|
<tstamp/>
|
|
|
|
<mkdir dir="${build.home}"/>
|
|
|
|
<mkdir dir="${build.home}/classes"/>
|
|
|
|
<mkdir dir="${build.home}/test-classes"/>
|
2011-09-04 22:09:14 -04:00
|
|
|
<copy todir="${build.home}/classes/">
|
|
|
|
<fileset dir="${source.resources}" />
|
2010-06-16 22:11:21 -04:00
|
|
|
</copy>
|
2011-09-04 22:09:14 -04:00
|
|
|
|
2003-11-14 16:46:30 -05:00
|
|
|
</target>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
<!-- ========== Compile Targets =========================================== -->
|
|
|
|
|
|
|
|
<target name="compile" depends="init" description="Compile">
|
|
|
|
|
|
|
|
<javac srcdir="${source.home}"
|
|
|
|
destdir="${build.home}/classes"
|
|
|
|
source="${compile.source}"
|
|
|
|
target="${compile.target}"
|
|
|
|
debug="${compile.debug}"
|
|
|
|
deprecation="${compile.deprecation}"
|
2011-02-21 09:26:08 -05:00
|
|
|
includeantruntime="false"
|
2012-11-23 15:58:28 -05:00
|
|
|
encoding="${source.encoding}"
|
2009-01-24 13:44:58 -05:00
|
|
|
optimize="${compile.optimize}">
|
|
|
|
<classpath refid="compile.classpath"/>
|
2003-11-14 16:46:30 -05:00
|
|
|
</javac>
|
|
|
|
</target>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ========== Unit Test Targets ========================================= -->
|
|
|
|
|
|
|
|
<target name="compile.tests" depends="compile, download-dependencies" description="Compile unit tests.">
|
|
|
|
|
|
|
|
<javac srcdir="${test.home}"
|
|
|
|
destdir="${build.home}/test-classes"
|
|
|
|
debug="${compile.debug}"
|
|
|
|
deprecation="${compile.deprecation}"
|
2012-11-23 15:58:28 -05:00
|
|
|
encoding="${source.encoding}"
|
2011-02-21 09:26:08 -05:00
|
|
|
includeantruntime="false"
|
2009-01-24 13:44:58 -05:00
|
|
|
optimize="${compile.optimize}">
|
|
|
|
<classpath refid="test.classpath"/>
|
|
|
|
</javac>
|
|
|
|
|
|
|
|
<copy todir="${build.home}/test-classes">
|
2009-08-01 10:54:20 -04:00
|
|
|
<fileset dir="${test.resources}">
|
2009-04-19 14:05:48 -04:00
|
|
|
</fileset>
|
2009-01-24 13:44:58 -05:00
|
|
|
</copy>
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="test" depends="compile.tests"
|
|
|
|
description="Run unit tests">
|
2011-02-21 09:26:08 -05:00
|
|
|
<mkdir dir="${test.reports}"/>
|
2009-04-19 14:05:48 -04:00
|
|
|
<junit printsummary="true"
|
|
|
|
errorProperty="test.failed"
|
|
|
|
failureProperty="test.failed"
|
|
|
|
fork="true"
|
|
|
|
showOutput="true">
|
2011-02-21 09:26:08 -05:00
|
|
|
<formatter type="brief"/>
|
2009-04-19 14:05:48 -04:00
|
|
|
<classpath refid="test.classpath"/>
|
2011-01-25 13:36:52 -05:00
|
|
|
<!-- If test.entry is defined, run a single test, otherwise run all valid tests -->
|
|
|
|
<!-- N.B. test.entry must be the full path to the test class, for example:
|
2012-02-14 11:17:55 -05:00
|
|
|
ant test -Dtest.entry=org.apache.commons.math3.util.FastMathTestPerformance
|
2011-01-25 13:36:52 -05:00
|
|
|
-->
|
2011-02-21 09:26:08 -05:00
|
|
|
<test name="${test.entry}" todir="${test.reports}" if="test.entry"/>
|
|
|
|
<batchtest todir="${test.reports}" unless="test.entry">
|
2010-01-22 09:06:57 -05:00
|
|
|
<fileset dir="${test.home}">
|
|
|
|
<include name="**/*Test.java"/>
|
|
|
|
<include name="**/*TestBinary.java"/>
|
|
|
|
<include name="**/*TestPermutations.java"/>
|
|
|
|
<exclude name="**/*AbstractTest.java"/>
|
|
|
|
</fileset>
|
2009-04-19 14:05:48 -04:00
|
|
|
</batchtest>
|
|
|
|
</junit>
|
|
|
|
<fail message="There were test failures.">
|
|
|
|
<condition>
|
|
|
|
<and>
|
|
|
|
<istrue value="${test.failonerror}"/>
|
|
|
|
<isset property="test.failed"/>
|
|
|
|
</and>
|
|
|
|
</condition>
|
2009-01-24 13:44:58 -05:00
|
|
|
</fail>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ========== Produce JavaDocs ========================================== -->
|
|
|
|
|
|
|
|
<target name="javadoc" depends="compile" description="Create component Javadoc documentation">
|
|
|
|
<mkdir dir="${build.home}/apidocs"/>
|
|
|
|
<tstamp>
|
|
|
|
<format property="current.year" pattern="yyyy"/>
|
|
|
|
</tstamp>
|
|
|
|
<javadoc sourcepath="${source.home}"
|
|
|
|
destdir="${build.home}/apidocs"
|
|
|
|
packagenames="org.apache.commons.*"
|
|
|
|
author="true"
|
|
|
|
private="true"
|
|
|
|
version="true"
|
2013-07-04 13:24:47 -04:00
|
|
|
encoding="${source.encoding}"
|
|
|
|
charset="${source.encoding}"
|
|
|
|
docencoding="${source.encoding}"
|
2009-01-24 13:44:58 -05:00
|
|
|
doctitle="<h1>${component.title} ${component.version}</h1>"
|
|
|
|
windowtitle="${component.title} ${component.version}"
|
|
|
|
bottom="Copyright (c) 2003-${current.year} Apache Software Foundation"
|
2015-01-12 13:54:16 -05:00
|
|
|
additionalparam="-header '<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>'"
|
2009-01-24 13:44:58 -05:00
|
|
|
classpathref="compile.classpath">
|
2016-01-01 07:17:21 -05:00
|
|
|
<link href="http://docs.oracle.com/javase/1.5.0/docs/api/"/>
|
2009-01-24 13:44:58 -05:00
|
|
|
</javadoc>
|
2003-11-14 16:46:30 -05:00
|
|
|
</target>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ========== Create Jar ================================================ -->
|
|
|
|
|
|
|
|
<target name="jar" depends="test" description="Create jar file">
|
|
|
|
|
|
|
|
<copy file="LICENSE.txt" tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
|
|
|
|
<copy file="NOTICE.txt" tofile="${build.home}/classes/META-INF/NOTICE.txt"/>
|
|
|
|
|
|
|
|
<manifest file="${build.home}/MANIFEST.MF">
|
|
|
|
<attribute name="Specification-Title" value="${component.title}"/>
|
|
|
|
<attribute name="Specification-Version" value="${component.version}"/>
|
|
|
|
<attribute name="Specification-Vendor" value="Apache Software Foundation"/>
|
|
|
|
<attribute name="Implementation-Title" value="${component.title}"/>
|
|
|
|
<attribute name="Implementation-Version" value="${component.version}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
|
|
|
|
<attribute name="Implementation-Vendor-Id" value="org.apache"/>
|
|
|
|
<attribute name="X-Compile-Source-JDK" value="${compile.source}"/>
|
|
|
|
<attribute name="X-Compile-Target-JDK" value="${compile.target}"/>
|
|
|
|
</manifest>
|
|
|
|
|
|
|
|
<jar jarfile="${build.home}/${final.name}.jar"
|
|
|
|
basedir="${build.home}/classes"
|
|
|
|
manifest="${build.home}/MANIFEST.MF"/>
|
2003-11-14 16:46:30 -05:00
|
|
|
</target>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ========== Distribution Target =========================================== -->
|
|
|
|
|
|
|
|
<target name="dist" depends="clean,jar,javadoc" description="Create distribution artifacts">
|
|
|
|
|
|
|
|
<mkdir dir="${dist.home}"/>
|
|
|
|
|
|
|
|
<!-- jar(s) -->
|
|
|
|
<copy todir="${dist.home}">
|
|
|
|
<fileset dir=".">
|
|
|
|
<include name="RELEASE-NOTES.txt"/>
|
2004-06-01 19:55:31 -04:00
|
|
|
</fileset>
|
2009-01-24 13:44:58 -05:00
|
|
|
<fileset dir="${build.home}">
|
|
|
|
<include name="*.jar"/>
|
2004-06-01 19:55:31 -04:00
|
|
|
</fileset>
|
2003-11-14 16:46:30 -05:00
|
|
|
</copy>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
<!-- Binary Distro -->
|
|
|
|
<mkdir dir="${stage.bin.dir}/${final.name}"/>
|
|
|
|
<copy todir="${stage.bin.dir}/${final.name}">
|
|
|
|
<fileset dir=".">
|
|
|
|
<include name="LICENSE.txt"/>
|
|
|
|
<include name="NOTICE.txt"/>
|
|
|
|
<include name="RELEASE-NOTES.txt"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir="${build.home}">
|
|
|
|
<include name="*.jar"/>
|
2004-06-23 09:43:23 -04:00
|
|
|
</fileset>
|
|
|
|
</copy>
|
2009-01-24 13:44:58 -05:00
|
|
|
<copy todir="${stage.bin.dir}/${final.name}/apidocs">
|
|
|
|
<fileset dir="${build.home}/apidocs" />
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<!-- Source Distro -->
|
|
|
|
<mkdir dir="${stage.src.dir}/${final.name}-src"/>
|
|
|
|
<copy todir="${stage.src.dir}/${final.name}-src">
|
|
|
|
<fileset dir=".">
|
|
|
|
<include name="*.xml"/>
|
|
|
|
<include name="*.txt"/>
|
|
|
|
<include name="*.html"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
<copy todir="${stage.src.dir}/${final.name}-src/src">
|
|
|
|
<fileset dir="src" excludes="mantissa/**,experimental/**" />
|
|
|
|
</copy>
|
|
|
|
<zip zipfile="${dist.home}/${final.name}.zip" basedir="${stage.bin.dir}"/>
|
|
|
|
<zip zipfile="${dist.home}/${final.name}-src.zip" basedir="${stage.src.dir}"/>
|
|
|
|
<tar tarfile="${dist.home}/${final.name}.tar" basedir="${stage.bin.dir}" longfile="gnu"/>
|
|
|
|
<tar tarfile="${dist.home}/${final.name}-src.tar" basedir="${stage.src.dir}" longfile="gnu"/>
|
|
|
|
<gzip src="${dist.home}/${final.name}.tar" zipfile="${dist.home}/${final.name}.tar.gz"/>
|
|
|
|
<gzip src="${dist.home}/${final.name}-src.tar" zipfile="${dist.home}/${final.name}-src.tar.gz"/>
|
|
|
|
|
|
|
|
<!-- clean up staging directories -->
|
|
|
|
<delete dir="${stage.bin.dir}"/>
|
|
|
|
<delete dir="${stage.src.dir}"/>
|
|
|
|
|
2003-11-14 16:46:30 -05:00
|
|
|
</target>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ========== Gump Target ===================================================== -->
|
|
|
|
|
|
|
|
<target name="gump" depends="clean,test,javadoc,jar" description="Gump Target - clean,test,javadoc,jar"/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ========== Download Dependencies =========================================== -->
|
|
|
|
|
|
|
|
<target name="download-dependencies"
|
2016-01-02 12:25:49 -05:00
|
|
|
depends="check-availability" unless="skip.download">
|
2009-01-24 13:44:58 -05:00
|
|
|
<echo message="doing download-dependencies..." />
|
|
|
|
<antcall target="download-junit" />
|
2016-01-02 12:25:49 -05:00
|
|
|
<antcall target="download-hamcrest" />
|
2009-01-24 13:44:58 -05:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="check-availability">
|
|
|
|
<echo message="doing check-availability..." />
|
|
|
|
<available file="${junit.jar}" property="junit.found"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="download-junit" unless="junit.found">
|
|
|
|
<echo message="Downloading junit..."/>
|
|
|
|
<mkdir dir="${download.lib.dir}" />
|
|
|
|
<get dest="${download.lib.dir}/junit-${junit.version}.jar"
|
|
|
|
usetimestamp="true" ignoreerrors="true"
|
|
|
|
src="http://repo1.maven.org/maven2/junit/junit/${junit.version}/junit-${junit.version}.jar"/>
|
|
|
|
</target>
|
2016-01-02 12:25:49 -05:00
|
|
|
|
|
|
|
<target name="download-hamcrest" unless="hamcrest.found">
|
|
|
|
<echo message="Downloading hamcrest..."/>
|
|
|
|
<mkdir dir="${download.lib.dir}" />
|
|
|
|
<get dest="${download.lib.dir}/${hamcrest.jar}"
|
|
|
|
usetimestamp="true" ignoreerrors="true"
|
|
|
|
src="http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
|
|
|
|
</target>
|
2009-01-24 13:44:58 -05:00
|
|
|
|
|
|
|
</project>
|
|
|
|
|