hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r431172 - in /jakarta/httpcomponents: httpasync/trunk/build.xml httpcore/trunk/build.xml
Date Sun, 13 Aug 2006 13:09:33 GMT
Author: rolandw
Date: Sun Aug 13 06:09:32 2006
New Revision: 431172

URL: http://svn.apache.org/viewvc?rev=431172&view=rev
Log:
new Ant based build process, HTTPASYNC-5

Modified:
    jakarta/httpcomponents/httpasync/trunk/build.xml
    jakarta/httpcomponents/httpcore/trunk/build.xml

Modified: jakarta/httpcomponents/httpasync/trunk/build.xml
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpasync/trunk/build.xml?rev=431172&r1=431171&r2=431172&view=diff
==============================================================================
--- jakarta/httpcomponents/httpasync/trunk/build.xml (original)
+++ jakarta/httpcomponents/httpasync/trunk/build.xml Sun Aug 13 06:09:32 2006
@@ -1,58 +1,507 @@
-<project name="Jakarta HttpCompomponents Asynchronous" default="compile" basedir=".">
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed 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="HttpAsync" basedir="." default="package-src">
+<description>
+HttpAsync: Jakarta HttpComponents Asynchronous
+</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:
+          httpcore.jar        - always
+          javadoc.j2sdk.link  - for javadoc
+          dist.core.api       - for javadoc
+
+        External dependencies for which there is no default location:
+          commons-logging.jar - (to be added to default dependencies)
+          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.async.name"
+         value="httpasync"/>
+<property name="comp.async.title"
+         value="Jakarta HttpComponents Asynchronous"/>
+<property name="comp.async.version"
+         value="SNAPSHOT"/>
+
+<!-- external dependencies
+        These are prime candidates for overriding in local.properties.
+        The defaults assume again that you are building from the full tree
+        of HTTP components, and that other components use the default
+        build settings.
+        The '.jar properties must be set to either to a JAR file in which
+        the classes are packaged, or to a directory tree holding them.
+  -->
+
+<property name="httpcore.home" location="../httpcore" />
+<property name="httpcore.jar"
+      location="${httpcore.home}/target/classes-main" />
+<property name="dist.core.api"
+      location="${httpcore.home}/dist/docs/api/" />
 
-  <property file="${basedir}/build.properties"/>
-  <property file="${basedir}/../project/build.properties"/>
-  <property file="${user.home}/build.properties"/>
-
-<!-- ========== Required component properties ============================= -->
-
-  <property name="component.name"          value="httpasync"/>
-  <property name="component.title"         value="Jakarta HttpComponents Asynchronous"/>
-  <property name="component.version"       value="1.0-alpha1-SNAPSHOT"/>
-  <property name="component.home"          value="${basedir}"/>
-  <property name="component.src"           value="${component.home}/src/java"/>
-  <property name="component.tests"         value="${component.home}/src/test"/>
-  <property name="component.xmpls"         value="${component.home}/src/examples"/>
-   
-<!-- ========== External dependencies ===================================== -->
-
-  <property name="http.core.home"         value="../httpcore"/>
-  <property name="http.core.classes"      value="${http.core.home}/target/classes"/>
-
-  <path id="component.depends">
-    <pathelement location="${component.classes}"/>
-    <pathelement location="${http.core.classes}"/>
+<path id="classpath.async.compile">
+  <pathelement location="${httpcore.jar}"/>
 <!--     <pathelement location="${commons-logging.jar}"/> -->
-  </path>
+</path>
 
-<!-- ========== Import common targets and macrdefs ======================== -->
+<path id="classpath.async.javadoc">
+  <path refid="classpath.async.compile" />
+  <!-- add dependencies for contrib classes for which to JavaDoc -->
+</path>
+
+
+<!-- directory structure of the source tree -->
+<property name="comp.async.home"  value="${basedir}"/>
+<property name="comp.async.src"   value="${comp.async.home}/src/java"/>
+<property name="comp.async.tests" value="${comp.async.home}/src/test/java"/>
+<property name="comp.async.xmpls" value="${comp.async.home}/src/examples"/>
+<property name="comp.async.contr" value="${comp.async.home}/src/contrib"/>
+
+
+<!-- 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.async.home"    value="${comp.async.home}/target"/>
+<property name="build.async.classes" value="${build.async.home}/classes"/>
+<property name="build.async.tests"   value="${build.async.home}/tests"/>
+<property name="build.async.xmpls"   value="${build.async.home}/examples"/>
+<property name="build.async.contr"   value="${build.async.home}/contrib"/>
+<property name="build.async.clover"  value="${build.async.home}/clover"/>
+
+<property name="dist.async.home"     value="${comp.async.home}/dist"/>
+<property name="dist.async.docs"     value="${dist.async.home}/docs"/>
+<property name="dist.async.api"      value="${dist.async.docs}/api"/>
+
+<property name="jar.async.src.name"
+         value="jakarta-${comp.async.name}-${comp.async.version}.jar" />
+<property name="jar.async.addon.name"
+         value="jakarta-${comp.async.name}-addon-${comp.async.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.async.name}
+  component title   ${comp.async.title}
+  component version ${comp.async.version}
+  base directory    ${basedir}
+  local properties  ${local.properties}
+
+Dependencies
+  HttpCore        ${httpcore.jar}
+  Commons Logging ${commons-logging.jar}
+  JUnit           ${junit.jar}
+  Clover          ${clover.jar}
+
+Source Tree
+  base     ${comp.async.home}
+  main     ${comp.async.src}
+  tests    ${comp.async.tests}
+  examples ${comp.async.xmpls}
+  contrib  ${comp.async.contr}
+
+Output
+  temp    ${build.async.home}
+  final   ${dist.async.home}
+  javadoc ${dist.async.api}
+</echo>
+</target>
+
+
+<!-- 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,compile-contrib"
+        description="compiles everything, not from scratch"
+/>
+<target name="clean-compile"
+        depends="clean-src,clean-tests,
+                 clean-examples,clean-contrib"
+        description="cleans intermediate files from compilation"
+/>
+<target name="compile-all-fs"
+        depends="clean-compile,compile-all"
+        description="compiles everything from scratch"
+/>
+
+
+<!-- compile and clean targets ================================================
+        For compiling and recompiling specific parts of HttpAsync code.
+        These targets do NOT define dependencies between eachother.
+        Direct invocation of these targets is for those who know what they do!
+  -->
+
+<target name="compile-src" depends="build-init">
+
+	<mkdir dir="${build.async.classes}" />
+        <javac destdir     ="${build.async.classes}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+        >
+          <src>
+            <pathelement location="${comp.async.src}"/>
+          </src>
+          <classpath>
+            <path refid="classpath.async.compile"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-src">
+	<delete dir="${build.async.classes}" quiet="true" />
+</target>
+
+
+<target name="compile-tests" depends="build-init">
+	<mkdir dir="${build.async.tests}" />
+        <javac destdir     ="${build.async.tests}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+        >
+          <src>
+            <pathelement path="${comp.async.tests}"/>
+          </src>
+          <classpath>
+            <path refid="classpath.async.compile"/>
+            <pathelement location="${build.async.classes}"/>
+            <pathelement location="${junit.jar}"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-tests">
+	<delete dir="${build.async.tests}" quiet="true" />
+</target>
+
+
+<target name="compile-examples" depends="build-init">
+	<mkdir dir="${build.async.xmpls}" />
+        <javac destdir     ="${build.async.xmpls}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+        >
+          <src>
+            <pathelement path="${comp.async.xmpls}"/>
+          </src>
+          <classpath>
+            <path refid="classpath.async.compile"/>
+            <pathelement location="${build.async.classes}"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-examples">
+	<delete dir="${build.async.xmpls}" quiet="true" />
+</target>
+
+
+<target name="compile-contrib" depends="build-init">
+	<mkdir dir="${build.async.contr}" />
+        <javac destdir     ="${build.async.contr}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+        >
+          <src>
+            <pathelement path="${comp.async.contr}"/>
+          </src>
+          <classpath>
+            <path refid="classpath.async.compile"/>
+            <pathelement location="${build.async.classes}"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-contrib">
+	<delete dir="${build.async.contr}" quiet="true" />
+</target>
+
+
+<!-- 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 HttpAsync classes"
+>
+        <jar destfile="${dist.async.home}/${jar.async.src.name}">
+          <!-- manifest? -->
+          <!-- timestamp in meta-inf? -->
+          <fileset dir="${build.async.classes}" includes="**" />
+        </jar>    
+</target>
+<target name="package-src-fs"
+     depends="clean-src,package-src"
+ description="builds the JAR with HttpAsync classes, compiling from scratch"
+/>
+
+
+<target name="package-addon"
+     depends="dist-init,compile-src,
+              compile-examples,compile-contrib"
+ description="builds the JAR with HttpAsync examples and contributions"
+>
+        <jar destfile="${dist.async.home}/${jar.async.addon.name}">
+          <!-- manifest? -->
+          <!-- timestamp in meta-inf? -->
+          <fileset dir="${build.async.xmpls}" includes="**" />
+          <fileset dir="${build.async.contr}" includes="**" />
+        </jar>    
+</target>
+<target name="package-addon-fs"
+     depends="clean-examples,clean-contrib,package-addon"
+ description="builds the JAR with HttpAsync examples and contributions, compiling them from scratch"
+/>
+
+
+<target name="run-tests"
+     depends="build-init,compile-tests"
+ description="runs unit tests on HttpAsync classes"
+>
+        <copy todir="${build.async.tests}" filtering="on">
+          <fileset dir="${comp.async.tests}" excludes="**/*.java" />
+        </copy>
+        <!-- don't use Ant optional JUnit tasks here -->
+        <java classname="junit.textui.TestRunner"
+              fork="yes" failonerror="yes"
+        >
+          <arg value="org.apache.http.async.TestAll"/>
+          <classpath>
+            <path refid="classpath.async.compile"/>
+            <pathelement location="${junit.jar}"/>
+            <pathelement location="${clover.jar}"/>
+            <pathelement location="${build.async.classes}"/>
+            <pathelement location="${build.async.tests}"/>
+          </classpath>
+      </java>
+</target>
+<target name="run-tests-fs"
+     depends="clean-build,compile-src,run-tests"
+/>
+
+
+<!-- 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 HttpAsync, recompiling everything from scratch"
+>
+    <echoproperties prefix="clover"/>
+    <mkdir dir="${build.async.clover}"/>
+    <clover-report>
+       <current outfile="${build.async.clover}/coverage-report">
+          <format type="html"/>
+       </current>
+    </clover-report>
+</target>
+
+
+<target name="javadoc-src"
+        description="generates JavaDoc for the HttpAsync classes"
+>
+        <mkdir dir="${dist.async.api}" />
+        <javadoc destdir="${dist.async.api}"
+                  access="${javadoc.access}"
+                 version="true"
+                  author="true"
+             windowtitle="${comp.async.title} (Version ${comp.async.version})"
+        >
+          <packageset dir="${comp.async.src}">
+            <include name="org/apache/http/**" />
+          </packageset>
+
+          <group title="API">
+            <package name="org.apache.http.async" />
+          </group>
+          <group title="Implementation">
+            <package name="*.impl.*" />
+          </group>
+    
+          <classpath refid="classpath.async.javadoc"/>
+          <link href="${javadoc.j2sdk.link}"/>
+          <link href="${dist.core.api}"/>
+
+          <doctitle>${comp.async.title}</doctitle>
+          <bottom>Copyright (c) 2005-2006 - Apache Software Foundation</bottom>
+        </javadoc>
+</target>
+
+
+<target name="javadoc-addon"
+        description="generates JavaDoc including examples and contributions"
+>
+        <mkdir dir="${dist.async.api}" />
+        <javadoc destdir="${dist.async.api}"
+                  access="${javadoc.access}"
+                 version="true"
+                  author="true"
+             windowtitle="${comp.async.title} (Version ${comp.async.version})"
+        >
+          <packageset dir="${comp.async.src}">
+            <include name="org/apache/http/**" />
+          </packageset>
+          <packageset dir="${comp.async.xmpls}">
+            <include name="org/apache/http/**" />
+          </packageset>
+          <packageset dir="${comp.async.contr}">
+            <include name="org/apache/http/**" />
+          </packageset>
+
+          <group title="API">
+            <package name="org.apache.http.async" />
+          </group>
+          <group title="Implementation">
+            <package name="org.apache.http.async.impl*" />
+          </group>
+          <group title="Examples">
+            <package name="org.apache.http.examples*" />
+          </group>
+          <group title="Contributions (unsupported)">
+            <package name="org.apache.http.async.contrib*" />
+          </group>
+    
+          <classpath refid="classpath.async.javadoc"/>
+          <link href="${javadoc.j2sdk.link}"/>
+          <link href="${dist.core.api}"/>
+
+          <doctitle>${comp.async.title}</doctitle>
+          <bottom>Copyright (c) 2005-2006 - Apache Software Foundation</bottom>
+        </javadoc>
+</target>
+
+
+<!-- generic and helper targets =========================================== -->
+
+<target name="build-init">
+        <mkdir dir="${build.async.home}" />
+</target>
+<target name="clean-build"
+        description="cleans all intermediate files, including test reports"
+>
+        <delete dir="${build.async.home}" quiet="true" />
+</target>
+
+<target name="dist-init">
+        <mkdir dir="${dist.async.home}" />
+        <!-- timestamp? (in build directory!) -->
+        <!-- manifest? (in build directory!) -->
+</target>
+<target name="clean-dist"
+        description="cleans all final build results"
+>
+        <!-- By default, dist.async.docs and dist.async.api are located
+             below dist.async.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.async.home}" quiet="true" />
+        <!-- delete timestamps and manifests from build.async.home? -->
+</target>
+<target name="dist-docs-clean">
+        <delete dir="${dist.async.docs}" quiet="true" />
+</target>
+<target name="dist-api-clean">
+        <delete dir="${dist.async.api}" quiet="true" />
+</target>
+
+
+<target name="clover-init">
+        <taskdef resource="clovertasks" />
+        <property name="build.async.clover.db"
+              location="${build.async.clover}/database" />
+        <mkdir dir="${build.async.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.async.clover.db}/coverage.db" >
+           <fileset dir="${comp.async.src}" includes="**" />
+        </clover-setup>
+</target>
 
-  <import file="../project/build-common.xml"/>
 
-<!-- ========== Targets: "External" Targets: Compilation ================== -->
-
-  <target name="compile" depends="prepare">
-    <do-compile>
-	<more-src>
-	  <pathelement path="${component.xmpls}" />
-	</more-src>
-    </do-compile>
-  </target>
-
-  <target name="test" depends="compile">
-    <do-test testentry="org.apache.http.TestAll"/>
-  </target>
-
-  <target name="javadoc" depends="compile">
-    <do-javadoc packagenames ="org.apache.http.*"/>
-  </target>
-
-  <target name="clover" depends="clover-db, test">
-    <do-clover/>
-  </target>
-
-  <target name="package" depends="compile">
-    <do-package/>
-  </target>
-
-</project>
+</project><!-- HttpAsync -->

Modified: jakarta/httpcomponents/httpcore/trunk/build.xml
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/build.xml?rev=431172&r1=431171&r2=431172&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/build.xml (original)
+++ jakarta/httpcomponents/httpcore/trunk/build.xml Sun Aug 13 06:09:32 2006
@@ -1,50 +1,687 @@
-<project name="Jakarta HttpCompomponents Core" default="compile" basedir=".">
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * Licensed 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="HttpCore" basedir="." default="package-src">
+<description>
+HttpAsync: 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
+          commons.cli.jar     - for contrib-bench
+          spring.jar          - for contrib-spring
+  -->
+<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"/>
+
+<!-- external dependencies
+        These are prime candidates for overriding in local.properties.
+        The defaults assume again that you are building from the full tree
+        of HTTP components, and that other components use the default
+        build settings.
+        The '.jar properties must be set to either to a JAR file in which
+        the classes are packaged, or to a directory tree holding them.
+  -->
+
+<!-- no external dependencies at this time -->
+<!-- @@@ Spring, for contrib code? -->
+
+
+<!-- directory structure of the source tree -->
+<property name="comp.core.home" value="${basedir}"/>
+
+<property name="comp.core.main.home"
+         value="${basedir}/module-main"/>
+<property name="comp.core.main.src"
+         value="${comp.core.main.home}/src/main/java"/>
+<property name="comp.core.main.tests"
+         value="${comp.core.main.home}/src/test/java"/>
+<property name="comp.core.main.xmpls"
+         value="${comp.core.main.home}/src/examples"/>
+
+<property name="comp.core.nio.home"
+         value="${basedir}/module-nio"/>
+<property name="comp.core.nio.src"
+         value="${comp.core.nio.home}/src/main/java"/>
+<property name="comp.core.nio.tests"
+         value="${comp.core.nio.home}/src/test/java"/>
+
+<property name="comp.core.contr"
+         value="${comp.core.home}/src/contrib"/>
+
+
+<!-- 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/".
+        To simplify this build file, the locations are different from Maven.
+  -->
+<property name="build.core.home"
+         value="${comp.core.home}/target"/>
+<property name="build.core.main.classes"
+         value="${build.core.home}/classes-main"/>
+<property name="build.core.nio.classes"
+         value="${build.core.home}/classes-nio"/>
+<property name="build.core.main.tests"
+         value="${build.core.home}/tests-main"/>
+<property name="build.core.nio.tests"
+         value="${build.core.home}/tests-nio"/>
+<property name="build.core.main.xmpls"
+         value="${build.core.home}/examples-main"/>
+<property name="build.core.contr"
+         value="${build.core.home}/contrib"/>
+<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}
+
+Source Tree
+  main base       ${comp.core.main.home}
+  main src        ${comp.core.main.src}
+  main tests      ${comp.core.main.tests}
+  main examples   ${comp.core.main.xmpls}
+  NIO  base       ${comp.core.nio.home}
+  NIO  src        ${comp.core.nio.src}
+  NIO  tests      ${comp.core.nio.tests}
+  shared contrib  ${comp.core.contr}
+
+Output
+  temp    ${build.core.home}
+  final   ${dist.core.home}
+  javadoc ${dist.core.api}
+</echo>
+</target>
+
+
+<!-- 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-main,compile-src-nio" />
+<target name="package" depends="package-src" />
+<target name="javadoc" depends="javadoc-src" />
+<target name="test"    depends="compile-src-main,compile-src-nio,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-main,compile-src-nio,
+                 compile-tests-main,compile-tests-nio,
+                 compile-examples-main,
+                 compile-contrib,compile-contrib-bench,compile-contrib-spring"
+        description="compiles everything, not from scratch"
+/>
+<target name="clean-compile"
+        depends="clean-src-main,clean-src-nio,
+                 clean-tests-main,clean-tests-nio,
+                 clean-examples-main,
+                 clean-contrib,clean-contrib-bench,clean-contrib-spring"
+        description="cleans intermediate files from compilation"
+/>
+<target name="compile-all-fs"
+        depends="clean-compile,compile-all"
+        description="compiles everything from scratch"
+/>
+
+
+<!-- compile and clean targets ================================================
+        For compiling and recompiling specific parts of HttpCore code.
+        These targets do NOT define dependencies between eachother.
+        Direct invocation of these targets is for those who know what they do!
+  -->
+
+<target name="compile-src-main" depends="build-init">
+
+	<mkdir dir="${build.core.main.classes}" />
+        <javac destdir     ="${build.core.main.classes}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+               sourcepath  =""
+        >
+          <src>
+            <pathelement location="${comp.core.main.src}"/>
+          </src>
+        </javac>
+</target>
+<target name="clean-src-main">
+	<delete dir="${build.core.classes}" quiet="true" />
+</target>
+
+
+<target name="compile-src-nio" depends="build-init">
+
+	<mkdir dir="${build.core.nio.classes}" />
+        <javac destdir     ="${build.core.nio.classes}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+               sourcepath  =""
+        >
+          <src>
+            <pathelement location="${comp.core.nio.src}"/>
+          </src>
+          <classpath>
+            <pathelement location="${build.core.main.classes}"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-src-nio">
+	<delete dir="${build.core.nio.classes}" quiet="true" />
+</target>
+
+
+<target name="compile-tests-main" depends="build-init">
+
+	<mkdir dir="${build.core.main.tests}" />
+        <javac destdir     ="${build.core.main.tests}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+               sourcepath  =""
+        >
+          <src>
+            <pathelement path="${comp.core.main.tests}"/>
+          </src>
+          <classpath>
+            <pathelement location="${build.core.main.classes}"/>
+            <pathelement location="${junit.jar}"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-tests-main">
+	<delete dir="${build.core.main.tests}" quiet="true" />
+</target>
+
+
+<target name="compile-tests-nio" depends="build-init">
+
+	<mkdir dir="${build.core.nio.tests}" />
+        <javac destdir     ="${build.core.nio.tests}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+               sourcepath  =""
+        >
+          <src>
+            <pathelement path="${comp.core.nio.tests}"/>
+          </src>
+          <classpath>
+            <pathelement location="${build.core.main.classes}"/>
+            <pathelement location="${build.core.nio.classes}"/>
+            <pathelement location="${junit.jar}"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-tests-nio">
+	<delete dir="${build.core.nio.tests}" quiet="true" />
+</target>
+
+
+<target name="compile-examples-main" depends="build-init">
+	<mkdir dir="${build.core.main.xmpls}" />
+        <javac destdir     ="${build.core.main.xmpls}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+               sourcepath  =""
+        >
+          <src>
+            <pathelement path="${comp.core.main.xmpls}"/>
+          </src>
+          <classpath>
+            <pathelement location="${build.core.main.classes}"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-examples-main">
+	<delete dir="${build.core.main.xmpls}" quiet="true" />
+</target>
+
+
+<target name="compile-contrib" depends="build-init">
+	<mkdir dir="${build.core.contr}" />
+        <javac destdir     ="${build.core.contr}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+               sourcepath  =""
+        >
+          <src>
+            <pathelement path="${comp.core.contr}" />
+          </src>
+
+          <include name="org/apache/http/contrib/**" />
+          <exclude name="org/apache/http/contrib/spring/**" />
+          <exclude name="org/apache/http/contrib/benchmark/**" />
+
+          <classpath>
+            <pathelement location="${build.core.main.classes}"/>
+            <pathelement location="${build.core.nio.classes}"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-contrib">
+	<delete dir="${build.core.contr}" quiet="true" />
+</target>
+
+
+<target name="warn-no-bench" unless="commons.cli.jar">
+<echo level="warning"
+    message="Can not compile benchmark, ${commons.cli.jar} not defined."
+/>
+</target>
+<target name="compile-contrib-bench" depends="build-init,warn-no-bench"
+        if="commons.cli.jar"
+>
+	<mkdir dir="${build.core.contr}" />
+        <javac destdir     ="${build.core.contr}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+               sourcepath  =""
+        >
+          <src>
+            <pathelement path="${comp.core.contr}" />
+          </src>
+
+          <include name="org/apache/http/contrib/benchmark/**" />
+
+          <classpath>
+            <pathelement location="${build.core.main.classes}"/>
+            <pathelement location="${build.core.nio.classes}"/>
+            <pathelement location="${commons.cli.jar}"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-contrib-bench">
+	<delete dir="${build.core.contr}/org/apache/http/contrib/benchmark"
+              quiet="true" />
+</target>
+
+
+<target name="warn-no-spring" unless="spring.jar">
+<echo level="warning"
+    message="Can not compile Spring demo, ${spring.jar} not defined."
+/>
+</target>
+<target name="compile-contrib-spring" depends="build-init,warn-no-spring"
+        if="spring.jar"
+>
+	<mkdir dir="${build.core.contr}" />
+        <javac destdir     ="${build.core.contr}"
+               debug       ="${compile.debug}"
+               deprecation ="${compile.deprecation}"
+               optimize    ="${compile.optimize}"
+               source      ="${compile.source}"
+               target      ="${compile.target}"
+               sourcepath  =""
+        >
+          <src>
+            <pathelement path="${comp.core.contr}" />
+          </src>
+
+          <include name="org/apache/http/contrib/spring/**" />
+
+          <classpath>
+            <pathelement location="${build.core.main.classes}"/>
+            <pathelement location="${build.core.nio.classes}"/>
+            <pathelement location="${spring.jar}"/>
+          </classpath>
+        </javac>
+</target>
+<target name="clean-contrib-spring">
+	<delete dir="${build.core.contr}org/apache/http/contrib/spring"
+              quiet="true" />
+</target>
+
+
+<!-- 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-main,compile-src-nio"
+ description="builds the JAR with HttpCore classes"
+>
+        <jar destfile="${dist.core.home}/${jar.core.src.name}">
+          <!-- manifest? -->
+          <!-- timestamp in meta-inf? -->
+          <fileset dir="${build.core.main.classes}" includes="**" />
+          <fileset dir="${build.core.nio.classes}"  includes="**" />
+        </jar>
+</target>
+<target name="package-src-fs"
+     depends="clean-src-main,clean-src-nio,package-src"
+ description="builds the JAR with HttpCore classes, compiling from scratch"
+/>
+
+
+<target name="package-addon"
+     depends="dist-init,compile-src-main,compile-src-nio,
+              compile-examples-main,compile-contrib,
+              compile-contrib-bench,compile-contrib-spring"
+ description="builds the JAR with HttpCore examples and contributions"
+>
+        <jar destfile="${dist.core.home}/${jar.core.addon.name}">
+          <!-- manifest? -->
+          <!-- timestamp in meta-inf? -->
+          <fileset dir="${build.core.main.xmpls}" includes="**" />
+          <fileset dir="${build.core.contr}" includes="**" />
+        </jar>    
+</target>
+<target name="package-addon-fs"
+     depends="clean-examples-main,clean-contrib,package-addon"
+ description="builds the JAR with HttpCore examples and contributions, compiling them from scratch"
+/>
+
+
+<target name="run-tests"
+     depends="build-init,compile-tests-main,compile-tests-nio"
+ description="runs unit tests on HttpCore classes"
+>
+        <copy todir="${build.core.tests}" filtering="on">
+          <fileset dir="${comp.core.main.tests}" excludes="**/*.java" />
+          <fileset dir="${comp.core.nio.tests}" excludes="**/*.java" />
+        </copy>
+        <!-- don't use Ant optional JUnit tasks here -->
+
+        <java classname="junit.textui.TestRunner"
+              fork="yes" failonerror="yes"
+        >
+          <arg value="org.apache.http.TestAll"/>
+          <classpath>
+            <pathelement location="${junit.jar}"/>
+            <pathelement location="${clover.jar}"/>
+            <pathelement location="${build.core.main.classes}"/>
+            <pathelement location="${build.core.main.tests}"/>
+          </classpath>
+        </java>
+
+        <java classname="junit.textui.TestRunner"
+              fork="yes" failonerror="yes"
+        >
+          <arg value="org.apache.http.nio.TestNIOHttpTransmitterAndReceiver"/>
+          <classpath>
+            <pathelement location="${junit.jar}"/>
+            <pathelement location="${clover.jar}"/>
+            <pathelement location="${build.core.main.classes}"/>
+            <pathelement location="${build.core.nio.classes}"/>
+            <pathelement location="${build.core.main.tests}"/>
+            <pathelement location="${build.core.nio.tests}"/>
+          </classpath>
+      </java>
+</target>
+<target name="run-tests-fs"
+     depends="clean-build,compile-src-main,compile-src-nio,run-tests"
+/>
+
+
+<!-- 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-main,compile-src-nio,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" />
+          </group>
+          <group title="Implementation">
+            <package name="org.apache.http.impl*" />
+            <package name="org.apache.http.nio*" />
+          </group>
+
+          <link href="${javadoc.j2sdk.link}"/>
+
+          <doctitle>${comp.core.title}</doctitle>
+          <bottom>Copyright (c) 2005-2006 - Apache Software Foundation</bottom>
+        </javadoc>
+</target>
+
+
+<target name="javadoc-addon"
+        description="generates JavaDoc including examples and contributions"
+>
+        <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>
+          <packageset dir="${comp.core.main.xmpls}">
+            <include name="org/apache/http/**" />
+          </packageset>
+          <packageset dir="${comp.core.contr}">
+            <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" />
+          </group>
+          <group title="Implementation">
+            <package name="org.apache.http.impl*" />
+            <package name="org.apache.http.nio*" />
+          </group>
+          <group title="Examples">
+            <package name="org.apache.http.examples*" />
+          </group>
+          <group title="Contributions (unsupported)">
+            <package name="org.apache.http.contrib*" />
+          </group>
+    
+          <classpath>
+            <pathelement location="${commons.cli.jar}" />
+            <pathelement location="${spring.jar}" />
+          </classpath>
+          <link href="${javadoc.j2sdk.link}"/>
+
+          <doctitle>${comp.core.title}</doctitle>
+          <bottom>Copyright (c) 2005-2006 - Apache Software Foundation</bottom>
+        </javadoc>
+</target>
+
+
+<!-- generic and helper targets =========================================== -->
+
+<target name="build-init">
+        <mkdir dir="${build.core.home}" />
+</target>
+<target name="clean-build"
+        description="cleans all intermediate files, including test reports"
+>
+        <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>
 
-  <property file="${basedir}/build.properties"/>
-  <property file="${basedir}/../project/build.properties"/>
-  <property file="${user.home}/build.properties"/>
 
-<!-- ========== Required component properties ============================= -->
-
-  <property name="component.name"          value="httpcore"/>
-  <property name="component.title"         value="Jakarta HttpComponents HttpCore"/>
-  <property name="component.version"       value="4.0-alpha3-SNAPSHOT"/>
-  <property name="component.home"          value="${basedir}"/>
-  <property name="component.src"           value="${component.home}/src/java"/>
-  <property name="component.tests"         value="${component.home}/src/test"/>
-   
-<!-- ========== External dependencies ===================================== -->
-
-  <path id="component.depends" /> <!-- no dependencies -->
-
-<!-- ========== Import common targets and macrdefs ======================== -->
-
-  <import file="../project/build-common.xml"/>
-
-<!-- ========== Targets: "External" Targets: Compilation ================== -->
-
-  <target name="compile" depends="prepare">
-    <do-compile/>
-  </target>
-
-  <target name="test" depends="compile">
-    <do-test testentry="org.apache.http.TestAll"/>
-  </target>
-
-  <target name="javadoc" depends="compile">
-    <do-javadoc packagenames ="org.apache.http.*"/>
-  </target>
-
-  <target name="clover" depends="clover-db, test">
-    <do-clover/>
-  </target>
-
-  <target name="package" depends="compile">
-    <do-package/>
-  </target>
-
-  <target name="findbugs" depends="compile, findbugs-init">
-    <do-findbugs/>
-  </target>
-
-</project>
+</project><!-- HttpCore -->



Mime
View raw message