blob: f9c0f29db4e9a0fa536f759819bc1aa5e9dff3ce [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
$HeadURL$
$Revision$
$Date$
====================================================================
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.
====================================================================
This software consists of voluntary contributions made by many
individuals on behalf of the Apache Software Foundation. For more
information on the Apache Software Foundation, please see
<http://www.apache.org/>.
-->
<project name="HttpCore" basedir="." default="package-src">
<description>
Jakarta HttpComponents Core
</description>
<!-- Definition of the local environment.
The default location of the build.properties assumes that you are
building from the full tree of all HTTP components, and have a
single build.properties file located in ${root}/project/. If this is
not the case, override property local.properties when calling Ant.
Use this file to specify the location of external dependencies,
and to override other properties defined below if you have to.
External dependencies for which there is a default location:
javadoc.j2sdk.link - for javadoc
External dependencies for which there is no default location:
junit.jar - for test and clover targets
clover.jar - for clover target
-->
<property name="local.properties" location="../project/build.properties" />
<property file="${local.properties}" />
<!-- component and version information -->
<property name="comp.core.name"
value="httpcore"/>
<property name="comp.core.title"
value="Jakarta HttpComponents Core"/>
<property name="comp.core.version"
value="SNAPSHOT"/>
<!-- directory structure of the source tree
most of the definitions are in the modules
-->
<property name="comp.core.home" value="${basedir}"/>
<!-- modules - see there for external dependencies -->
<import file="module-main/build.xml" />
<import file="module-nio/build.xml" />
<!-- locations for intermediate and final build results
For consistency with other builds, the temporary files are
located by default below "target/", final results below "dist/".
-->
<property name="build.core.home"
value="${comp.core.home}/target"/>
<property name="build.core.clover"
value="${build.core.home}/clover"/>
<property name="dist.core.home" value="${comp.core.home}/dist"/>
<property name="dist.core.docs" value="${dist.core.home}/docs"/>
<property name="dist.core.api" value="${dist.core.docs}/api"/>
<property name="jar.core.src.name"
value="jakarta-${comp.core.name}-${comp.core.version}.jar" />
<property name="jar.core.addon.name"
value="jakarta-${comp.core.name}-addon-${comp.core.version}.jar" />
<!-- compiler and javadoc setup -->
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="true"/>
<property name="compile.optimize" value="true"/>
<property name="compile.source" value="1.4"/>
<property name="compile.target" value="1.4"/>
<property name="javadoc.access" value="protected"/>
<property name="javadoc.j2sdk.link"
value="http://java.sun.com/j2se/1.4.2/docs/api/" />
<!-- build targets ======================================================== -->
<target name="echo-properties"
description="echo properties to verify the build setup"
>
<echo>
General
component ${comp.core.name}
component title ${comp.core.title}
component version ${comp.core.version}
base directory ${basedir}
local properties ${local.properties}
Dependencies
JUnit ${junit.jar}
Clover ${clover.jar}
Output
temp ${build.core.home}
final ${dist.core.home}
javadoc ${dist.core.api}
</echo>
<antcall target="HttpCoreMain.echo-properties" />
<antcall target="HttpCoreNIO.echo-properties" />
</target>
<!-- imported build targets ==================================================
These targets are defined in one or more of the modules. They HAVE to
be overridden here, because otherwise the ModuleName.target-name alias
will not be created by Ant.
-->
<target name="compile-src"
depends="HttpCoreMain.compile-src,
HttpCoreNIO.compile-src"
/>
<target name="clean-src"
depends="HttpCoreMain.clean-src,
HttpCoreNIO.clean-src"
/>
<target name="compile-tests"
depends="HttpCoreMain.compile-tests,
HttpCoreNIO.compile-tests"
/>
<target name="clean-tests"
depends="HttpCoreMain.clean-tests,
HttpCoreNIO.clean-tests"
/>
<target name="compile-examples"
depends="HttpCoreMain.compile-examples,
HttpCoreNIO.compile-examples"
/>
<target name="clean-examples"
depends="HttpCoreMain.clean-examples,
HttpCoreNIO.clean-examples"
/>
<target name="run-tests"
depends="HttpCoreMain.run-tests,
HttpCoreNIO.run-tests"
/>
<target name="run-tests-fs"
depends="HttpCoreMain.clean-tests,
HttpCoreNIO.clean-tests,
run-tests"
/>
<!-- traditional targets ======================================================
These targets match the ones before the build restructuring, except:
- "javadoc" does not depend on "compile"
- "clover" will always recompile the source and tests
-->
<target name="compile" depends="compile-src" />
<target name="package" depends="package-src" />
<target name="javadoc" depends="javadoc-src" />
<target name="test" depends="compile-src,run-tests" />
<target name="clover" depends="run-clover" />
<target name="clean" depends="clean-build,clean-dist" />
<!-- combined compilation targets =============================================
For external invocation.
See also the packaging and test/verification targets below
-->
<target name="compile-all"
depends="compile-src,compile-tests,compile-examples"
description="compiles everything, not from scratch"
/>
<target name="clean-compile"
depends="clean-src,clean-tests,clean-examples"
description="cleans intermediate files from compilation"
/>
<target name="compile-all-fs"
depends="clean-compile,compile-all"
description="compiles everything from scratch"
/>
<!-- packaging and verification targets =======================================
For building JARs and running tests.
Targets for building JARs define dependencies on compilation targets.
Unlike with Maven, running tests is not a dependency for packaging.
The plain test target defines dependencies on the test classes, but
not on the classes to be tested. It should be possible to run a test
target without affecting the subject of the test. The "from scratch"
test target defines transitive dependencies on the subject classes.
-->
<target name="package-src"
depends="dist-init,compile-src"
description="builds the JAR with HttpCore classes"
>
<jar destfile="${dist.core.home}/${jar.core.src.name}">
<!-- manifest? -->
<fileset dir="${build.core.main.classes}" includes="**" />
<fileset dir="${build.core.nio.classes}" includes="**" />
</jar>
</target>
<target name="package-src-fs"
depends="clean-src,package-src"
description="builds the JAR with HttpCore classes, compiling from scratch"
/>
<!-- Clover always needs a recompile to instrument the source code.
clean-build enforces the recompilation, clover-init prepares
the Ant environment for Clover instrumentation.
-->
<target name="run-clover"
depends="clean-build,clover-init,compile-src,run-tests"
description="runs Clover on HttpCore, recompiling everything from scratch"
>
<echoproperties prefix="clover"/>
<mkdir dir="${build.core.clover}"/>
<clover-report>
<current outfile="${build.core.clover}/coverage-report">
<format type="html"/>
</current>
</clover-report>
</target>
<target name="javadoc-src"
description="generates JavaDoc for the HttpCore classes"
>
<mkdir dir="${dist.core.api}" />
<javadoc destdir="${dist.core.api}"
access="${javadoc.access}"
version="true"
author="true"
windowtitle="${comp.core.title} (Version ${comp.core.version})"
>
<packageset dir="${comp.core.main.src}">
<include name="org/apache/http/**" />
</packageset>
<packageset dir="${comp.core.nio.src}">
<include name="org/apache/http/**" />
</packageset>
<group title="API">
<package name="org.apache.http" />
<package name="org.apache.http.entity" />
<package name="org.apache.http.io" />
<package name="org.apache.http.message" />
<package name="org.apache.http.params" />
<package name="org.apache.http.protocol" />
<package name="org.apache.http.util*" />
<package name="org.apache.http.nio*" />
</group>
<group title="Implementation">
<package name="org.apache.http.impl*" />
</group>
<link href="${javadoc.j2sdk.link}"/>
<doctitle>${comp.core.title}</doctitle>
<bottom>Copyright (c) 2005-2007 - Apache Software Foundation</bottom>
</javadoc>
</target>
<!-- generic and helper targets =========================================== -->
<target name="build-init">
<mkdir dir="${build.core.home}" />
<antcall target="HttpCoreMain.build-init" />
<antcall target="HttpCoreNIO.build-init" />
</target>
<target name="clean-build"
description="cleans all intermediate files, including test reports"
>
<antcall target="HttpCoreMain.clean-build" />
<antcall target="HttpCoreNIO.clean-build" />
<delete dir="${build.core.home}" quiet="true" />
</target>
<target name="dist-init">
<mkdir dir="${dist.core.home}" />
</target>
<target name="clean-dist"
description="cleans all final build results"
>
<!-- By default, dist.core.docs and dist.core.api are located
below dist.core.home and will be cleaned here. If their
location is redefined to be somewhere else, they will not
be cleaned here. Use the targets dist-docs-clean or
dist-api-clean to achieve that.
-->
<delete dir="${dist.core.home}" quiet="true" />
<!-- delete timestamps and manifests from build.core.home? -->
</target>
<target name="dist-docs-clean">
<delete dir="${dist.core.docs}" quiet="true" />
</target>
<target name="dist-api-clean">
<delete dir="${dist.core.api}" quiet="true" />
</target>
<target name="clover-init">
<taskdef resource="clovertasks" />
<property name="build.core.clover.db"
location="${build.core.clover}/database" />
<mkdir dir="${build.core.clover.db}"/>
<!-- This task prepares the Ant environment for Clover instrumentation.
Everything compiled afterwards will be instrumented if it matches
the fileset(s) defined here.
-->
<clover-setup initString="${build.core.clover.db}/coverage.db" >
<fileset dir="${comp.core.main.src}" includes="**" />
<fileset dir="${comp.core.nio.src}" includes="**" />
</clover-setup>
</target>
</project><!-- HttpCore -->