blob: 10ea3ea725c36f8315c94738d34211ef5ed51f34 [file] [log] [blame]
<!--
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.
-->
<project name="Chain" default="jar" basedir=".">
<!--
"Chain" component of the Apache Commons Subproject
$Id$
-->
<!-- ========== Initialize Properties ===================================== -->
<property file="build.properties"/> <!-- Component local -->
<property file="../build.properties"/> <!-- Commons local -->
<property file="${user.home}/build.properties"/> <!-- User local -->
<!-- ========== Component Declarations ==================================== -->
<!-- The name of this component -->
<property name="component.name" value="chain"/>
<!-- The title of this component -->
<property name="component.title" value="Commons Chain"/>
<!-- The current version number of this component -->
<property name="component.version" value="1.3-SNAPSHOT"/>
<!-- The base directory for compilation targets -->
<property name="build.home" value="target"/>
<!-- The base directory for component resources -->
<property name="resources.home" value="src/main/resources"/>
<!-- The base directory for component sources -->
<property name="source.home" value="src/main/java"/>
<!-- Artifact Name -->
<property name="final.name" value="commons-${component.name}-${component.version}"/>
<!-- The base directory for unit test sources -->
<property name="test.home" value="src/test"/>
<!-- Download lib dir -->
<property name="download.lib.dir" value="lib"/>
<!-- ========== External Dependencies ===================================== -->
<property name="beanutils.version" value="1.8.3"/>
<property name="digester.version" value="1.8"/>
<property name="logging.version" value="1.1.1"/>
<property name="servlet.version" value="2.3"/>
<property name="portlet.version" value="1.0"/>
<property name="myfaces.version" value="1.1.0"/>
<property name="junit.version" value="3.8.1"/>
<property name="beanutils.home" value="${user.home}/.m2/repository/commons-beanutils/commons-beanutils/${beanutils.version}"/>
<property name="digester.home" value="${user.home}/.m2/repository/commons-digester/commons-digester/${digester.version}"/>
<property name="logging.home" value="${user.home}/.m2/repository/commons-logging/commons-logging/${logging.version}"/>
<property name="servlet.home" value="${user.home}/.m2/repository/javax/servlet/servlet-api/${servlet.version}"/>
<property name="portlet.home" value="${user.home}/.m2/repository/javax/portlet/portlet-api/${portlet.version}"/>
<property name="myfaces.home" value="${user.home}/.m2/repository/myfaces/myfaces-api/${myfaces.version}"/>
<property name="junit.home" value="${user.home}/.m2/repository/junit/junit/${junit.version}"/>
<property name="beanutils.jar" value="${beanutils.home}/commons-beanutils-${beanutils.version}.jar"/>
<property name="digester.jar" value="${digester.home}/commons-digester-${digester.version}.jar"/>
<property name="logging.jar" value="${logging.home}/commons-logging-${logging.version}.jar"/>
<property name="servlet.jar" value="${servlet.home}/servlet-api-${servlet.version}.jar"/>
<property name="portlet.jar" value="${portlet.home}/portlet-api-${portlet.version}.jar"/>
<property name="myfaces.jar" value="${myfaces.home}/myfaces-api-${myfaces.version}.jar"/>
<property name="junit.jar" value="${junit.home}/junit-${junit.version}.jar"/>
<!-- ========== Compiler Defaults ========================================= -->
<!-- source JDK version (should be same as maven.compile.source) -->
<property name="compile.source" value="1.4"/>
<!-- target JDK version (should be same as maven.compile.target) -->
<property name="compile.target" value="1.4"/>
<!-- 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"/>
<!-- Construct compile classpath -->
<path id="compile.classpath">
<pathelement location="${build.home}/classes"/>
<pathelement location="${beanutils.jar}"/>
<pathelement location="${digester.jar}"/>
<pathelement location="${logging.jar}"/>
<pathelement location="${servlet.jar}"/>
<pathelement location="${portlet.jar}"/>
<pathelement location="${myfaces.jar}"/>
</path>
<!-- ========== Test Execution Defaults =================================== -->
<!-- Construct unit test classpath -->
<path id="test.classpath">
<path refid="compile.classpath"/>
<pathelement location="${build.home}/tests"/>
<pathelement location="${junit.jar}"/>
</path>
<!-- Should all tests fail if one does? -->
<property name="test.failonerror" value="true"/>
<!-- The test runner to execute -->
<property name="test.runner" value="junit.textui.TestRunner"/>
<!-- ========== Executable Targets ======================================== -->
<target name="all" depends="clean,test,jar,javadoc-jar,source-jar" description="Clean, test, compile and create Jars"/>
<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.name} ${component.version} --------"/>
<mkdir dir="${build.home}"/>
<mkdir dir="${build.home}/classes"/>
<mkdir dir="${build.home}/tests"/>
</target>
<!-- ========== Compile ========================================== -->
<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}"
optimize="${compile.optimize}">
<classpath refid="compile.classpath"/>
</javac>
</target>
<!-- ========== Unit Tests ========================================= -->
<target name="compile.tests" depends="compile" description="Compile unit test cases">
<javac srcdir="${test.home}/java"
destdir="${build.home}/tests"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
<classpath refid="test.classpath"/>
</javac>
<copy todir="${build.home}/tests" filtering="on">
<fileset dir="${test.home}/java">
<include name="**/*.xml"/>
</fileset>
</copy>
</target>
<target name="test" depends="compile.tests" description="Run all unit test cases">
<echo message="Running unit tests ..."/>
<mkdir dir="${build.home}/test-reports"/>
<junit printsummary="true" showoutput="true" fork="yes" haltonfailure="${test.failonerror}">
<classpath refid="test.classpath"/>
<formatter type="plain" usefile="true" />
<!-- If test.entry is defined, run a single test, otherwise run all valid tests -->
<test name="${test.entry}" todir="${build.home}/test-reports" if="test.entry"/>
<batchtest fork="yes" todir="${build.home}/test-reports" unless="test.entry">
<fileset dir="${test.home}/java">
<include name="**/*TestCase.java"/>
<!--exclude name="**/Abstract*Test.java"/-->
</fileset>
</batchtest>
</junit>
</target>
<!-- ========== JavaDocs ========================================= -->
<target name="javadoc" depends="compile" description="Create component Javadoc documentation">
<mkdir dir="${build.home}"/>
<mkdir dir="${build.home}/apidocs"/>
<tstamp>
<format property="current.year" pattern="yyyy"/>
</tstamp>
<javadoc sourcepath="${source.home}"
destdir="${build.home}/apidocs"
overview="${source.home}/org/apache/commons/${component.name}/overview.html"
packagenames="org.apache.commons.*"
excludepackagenames="${javadoc.excludepackagenames}"
author="false"
version="true"
doctitle="&lt;h1&gt;${component.title} ${component.version}&lt;/h1&gt;"
windowtitle="Lang ${component.version}"
bottom="${component.title} &amp;copy; 2001-${current.year} - Apache Software Foundation"
use="true"
link="${jdk.javadoc}"
source="${compile.source}">
<classpath refid="compile.classpath"/>
</javadoc>
</target>
<!-- ========== Jar Targets ========================================= -->
<target name="jar" depends="compile" description="Create jar">
<jar jarfile="${build.home}/${final.name}.jar">
<manifest>
<attribute name="Specification-Title" value="${component.title}"/>
<attribute name="Specification-Version" value="${component.version}"/>
<attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Title" value="${component.title}"/>
<attribute name="Implementation-Version" value="${component.version}"/>
<attribute name="Implementation-Vendor" value="The 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>
<fileset dir="${build.home}/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="${basedir}">
<include name="LICENSE.txt"/>
<include name="NOTICE.txt"/>
</fileset>
</jar>
</target>
<target name="javadoc-jar" depends="javadoc" description="Create JavaDoc jar">
<jar jarfile="${build.home}/${final.name}-javadoc.jar">
<manifest>
<attribute name="Specification-Title" value="${component.title} API"/>
<attribute name="Specification-Version" value="${component.version}"/>
<attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Title" value="${component.title} API"/>
<attribute name="Implementation-Version" value="${component.version}"/>
<attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Vendor-Id" value="org.apache"/>
</manifest>
<fileset dir="${build.home}/apidocs"/>
<fileset dir="${basedir}">
<include name="LICENSE.txt"/>
<include name="NOTICE.txt"/>
</fileset>
</jar>
</target>
<target name="source-jar" depends="init" description="Create JavaDoc jar">
<jar jarfile="${build.home}/${final.name}-sources.jar">
<manifest>
<attribute name="Specification-Title" value="${component.title} Source"/>
<attribute name="Specification-Version" value="${component.version}"/>
<attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Title" value="${component.title} Source"/>
<attribute name="Implementation-Version" value="${component.version}"/>
<attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Vendor-Id" value="org.apache"/>
</manifest>
<fileset dir="${source.home}">
<include name="**/*.java"/>
</fileset>
<fileset dir="${basedir}">
<include name="LICENSE.txt"/>
<include name="NOTICE.txt"/>
</fileset>
</jar>
</target>
</project>