Author: rjung
Date: Wed Sep 16 22:24:43 2009
New Revision: 815989
URL: http://svn.apache.org/viewvc?rev=815989&view=rev
Log:
Backport some build changes from trunk
(r815983+r815985+r815986)
- Add properties for javac settings
- Add properties for downloading Junit
- Add download tasks from Tomcat trunk
- Add task descriptions
- remove task compile-only
- remove task examples and keep only compile-examples
- rename the tasks for running examples in
order to make output of "ant -p" a little more ordered
Modified:
tomcat/native/branches/1.1.x/build.properties.default
tomcat/native/branches/1.1.x/build.xml
Modified: tomcat/native/branches/1.1.x/build.properties.default
URL:
http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/build.properties.default?rev=815989&r1=815988&r2=815989&view=diff
==============================================================================
--- tomcat/native/branches/1.1.x/build.properties.default (original)
+++ tomcat/native/branches/1.1.x/build.properties.default Wed Sep 16 22:24:43
2009
@@ -15,16 +15,38 @@
# limitations under the License.
#
-# ----- Vesion Control Flags -----
+# ----- Version Control Flags -----
version.major=1
version.minor=1
version.build=17
version.patch=0
version.suffix=-dev
-# The directory containing your binary distribution of JUnit,
-# version 3.8 or later
-junit.home = /usr/local/java/junit3.8.1
+# ----- Default Base Path for Dependent Packages -----
+# Please note this path must be absolute, not relative,
+# as it is referenced with different working directory
+# contexts by the various build scripts.
+base.path=/usr/share/java
+#base.path=C:/path/to/the/repository
+#base.path=/usr/local
+compile.source=1.4
+compile.target=1.4
+compile.debug=off
+compile.deprecation=on
+compile.optimize=on
+
+base-tomcat.loc=http://archive.apache.org/dist/tomcat
+base-sf.loc=http://downloads.sourceforge.net
+
+# ----- JUnit Unit Test Suite, version 3.8 or later -----
+# The JUnit version we will use
+junit.version=3.8.2
+# The directory containing your binary distribution of JUnit
+# It will be automatically downloaded if it doesn't exist
+junit.home=${base.path}/junit${junit.version}
+#junit.home = /usr/local/java/junit3.8.1
# The pathname of the "junit.jar" JAR file
-junit.jar = ${junit.home}/junit.jar
+junit.jar=${junit.home}/junit.jar
+# The URL used to download JUnit if needed
+junit.loc=${base-sf.loc}/junit/junit${junit.version}.zip
Modified: tomcat/native/branches/1.1.x/build.xml
URL:
http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/build.xml?rev=815989&r1=815988&r2=815989&view=diff
==============================================================================
--- tomcat/native/branches/1.1.x/build.xml (original)
+++ tomcat/native/branches/1.1.x/build.xml Wed Sep 16 22:24:43 2009
@@ -54,9 +54,11 @@
<property name="dist.root" value="./dist"/>
<property name="ant.home" value="."/>
- <property name="debug" value="off"/>
- <property name="optimize" value="on"/>
- <property name="deprecation" value="on"/>
+ <property name="compile.source" value="1.4"/>
+ <property name="compile.target" value="1.4"/>
+ <property name="compile.debug" value="off"/>
+ <property name="compile.optimize" value="on"/>
+ <property name="compile.deprecation" value="on"/>
<property name="docs.src" value="./xdocs"/>
<property name="docs.dest" value="${dist.root}/doc"/>
@@ -104,6 +106,61 @@
<mkdir dir="${build.dir}"/>
</target>
+ <!-- Download and dependency building -->
+ <target name="proxyflags">
+ <!-- check proxy parameters. -->
+ <condition property="useproxy">
+ <equals arg1="${proxy.use}" arg2="on" />
+ </condition>
+ </target>
+
+ <target name="setproxy" depends="proxyflags" if="useproxy">
+ <taskdef name="setproxy"
+ classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy"
/>
+ <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
+ proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
+ <echo message="Using ${proxy.host}:${proxy.port} to download
${sourcefile}"/>
+ </target>
+
+ <target name="testexist">
+ <echo message="Testing for ${destfile}"/>
+ <available file="${destfile}" property="exist"/>
+ </target>
+
+ <target name="downloadgz" unless="exist" depends="setproxy,testexist">
+ <!-- Download and extract the package -->
+ <get src="${sourcefile}" dest="${base.path}/file.tar.gz" />
+ <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
+ <untar src="${base.path}/file.tar" dest="${base.path}"/>
+ <delete file="${base.path}/file.tar"/>
+ <delete file="${base.path}/file.tar.gz"/>
+ </target>
+
+ <target name="downloadzip" unless="exist" depends="setproxy,testexist">
+ <!-- Download and extract the package -->
+ <get src="${sourcefile}" dest="${base.path}/file.zip" />
+ <mkdir dir="${destdir}" />
+ <unzip src="${base.path}/file.zip" dest="${destdir}"/>
+ <delete file="${base.path}/file.zip"/>
+ </target>
+
+ <target name="downloadfile" unless="exist" depends="setproxy,testexist">
+ <!-- Download extract the file -->
+ <mkdir dir="${destdir}" />
+ <get src="${sourcefile}" dest="${destfile}" />
+ </target>
+
+ <target name="download" description="Download needed dependencies">
+
+ <mkdir dir="${base.path}"/>
+
+ <antcall target="downloadzip">
+ <param name="sourcefile" value="${junit.loc}"/>
+ <param name="destfile" value="${junit.jar}"/>
+ <param name="destdir" value="${base.path}"/>
+ </antcall>
+ </target>
+
<!-- ===================================================================
-->
<!-- Creates the API documentation
-->
<!-- ===================================================================
-->
@@ -138,14 +195,14 @@
<!-- ===================================================================
-->
<!-- Cleans up the build directory
-->
<!-- ===================================================================
-->
- <target name="clean">
+ <target name="clean" description="Clean build directory">
<delete dir="${build.dir}"/>
</target>
<!-- ===================================================================
-->
<!-- Compiles the source directory
-->
<!-- ===================================================================
-->
- <target name="compile" depends="prepare">
+ <target name="compile" depends="prepare" description="Compile Java
sources">
<mkdir dir="${build.dest}"/>
<mkdir dir="${build.dest}/java"/>
<mkdir dir="${build.src}"/>
@@ -168,12 +225,15 @@
<javac srcdir="${build.src}/java"
destdir="${build.dest}/java"
- debug="${debug}"
- deprecation="${deprecation}"
- optimize="${optimize}"
+ source="${compile.source}"
+ target="${compile.target}"
+ debug="${compile.debug}"
+ deprecation="${compile.deprecation}"
+ optimize="${compile.optimize}"
encoding="ISO-8859-1">
<classpath refid="classpath"/>
</javac>
+
<copy todir="${build.dest}/java" filtering="yes" encoding="ISO-8859-1">
<fileset dir="${build.src}/java">
<include name="**/*.xml"/>
@@ -182,67 +242,10 @@
</copy>
</target>
- <target name="compile-only"
- description="Compile shareable components">
-
- <javac srcdir="${source.home}"
- destdir="${build.home}/classes"
- debug="${compile.debug}"
- deprecation="${compile.deprecation}"
- optimize="${compile.optimize}"
- encoding="ISO-8859-1">
- <classpath refid="classpath"/>
- </javac>
- <copy todir="${build.home}/classes" filtering="on"
encoding="ISO-8859-1">
- <fileset dir="${source.home}" excludes="**/*.java"/>
- </copy>
- </target>
-
- <!-- ===================================================================
-->
- <!-- Compiles the examples directory
-->
- <!-- ===================================================================
-->
- <target name="examples" depends="compile">
- <mkdir dir="${build.dest}"/>
- <mkdir dir="${build.dest}/examples"/>
- <mkdir dir="${build.src}"/>
- <mkdir dir="${build.src}/examples"/>
- <tstamp>
- <format property="TODAY" pattern="MMM d yyyy" locale="en"/>
- <format property="TSTAMP" pattern="hh:mm:ss"/>
- </tstamp>
- <!-- Copy static resource files -->
- <filter token="VERSION" value="${version}"/>
- <filter token="VERSION_NUMBER" value="${version.number}"/>
- <filter token="VERSION_BUILT" value="${TODAY} ${TSTAMP}"/>
- <copy todir="${build.src}/examples" filtering="yes"
encoding="ISO-8859-1">
- <fileset dir="${src.dir}/examples">
- <include name="**/*.java"/>
- <include name="**/*.xml"/>
- <include name="**/*.properties"/>
- </fileset>
- </copy>
-
- <javac srcdir="${build.src}/examples"
- destdir="${build.dest}/examples"
- debug="${debug}"
- deprecation="${deprecation}"
- optimize="${optimize}"
- encoding="ISO-8859-1">
- <classpath refid="examples.classpath"/>
- </javac>
- <copy todir="${build.dest}/examples" filtering="yes"
encoding="ISO-8859-1">
- <fileset dir="${build.src}/examples">
- <include name="**/*.xml"/>
- <include name="**/*.properties"/>
- </fileset>
- </copy>
- </target>
-
<!-- ================================================================== -->
<!-- Make Tomcat Native jar -->
<!-- ================================================================== -->
- <target name="jar" depends="compile"
- description="Generates the Jar file">
+ <target name="jar" depends="compile" description="Generates the Jar file">
<jar
destfile="${build.dir}/${final.name}.jar"
basedir="${build.dir}/classes/java"
@@ -264,9 +267,19 @@
<!-- ===================================================================
-->
<!-- Compiles the test directory
-->
<!-- ===================================================================
-->
- <target name="compile-tests" depends="compile">
+ <target name="compile-tests" depends="compile" description="Compile Java
test classes">
+ <mkdir dir="${build.dest}"/>
<mkdir dir="${build.dest}/test"/>
+ <mkdir dir="${build.src}"/>
<mkdir dir="${build.src}/test"/>
+ <tstamp>
+ <format property="TODAY" pattern="MMM d yyyy" locale="en"/>
+ <format property="TSTAMP" pattern="hh:mm:ss"/>
+ </tstamp>
+ <!-- Copy static resource files -->
+ <filter token="VERSION" value="${version}"/>
+ <filter token="VERSION_NUMBER" value="${version.number}"/>
+ <filter token="VERSION_BUILT" value="${TODAY} ${TSTAMP}"/>
<copy todir="${build.src}/test" filtering="yes" encoding="ISO-8859-1">
<fileset dir="${src.dir}/test">
<include name="**/*.java"/>
@@ -276,18 +289,26 @@
</copy>
<javac srcdir="${build.src}/test"
destdir="${build.dest}/test"
+ source="${compile.source}"
+ target="${compile.target}"
debug="on"
- deprecation="${deprecation}"
- optimize="${optimize}"
+ deprecation="${compile.deprecation}"
+ optimize="${compile.optimize}"
encoding="ISO-8859-1">
<classpath refid="test.classpath"/>
</javac>
+ <copy todir="${build.dest}/test" filtering="yes" encoding="ISO-8859-1">
+ <fileset dir="${build.src}/test">
+ <include name="**/*.xml"/>
+ <include name="**/*.properties"/>
+ </fileset>
+ </copy>
</target>
<!-- ===================================================================
-->
<!-- Junit tests
-->
<!-- ===================================================================
-->
- <target name="test" depends="compile-tests">
+ <target name="test" depends="compile-tests" description="Run the tests">
<echo message="Running Tomcat Native package tests ..."/>
<java dir="${test.dir}" classname="${test.runner}" fork="yes"
failonerror="${test.failonerror}">
<arg value="org.apache.tomcat.jni.FileTestSuite"/>
@@ -308,9 +329,19 @@
<!-- ===================================================================
-->
<!-- Compiles the examples directory
-->
<!-- ===================================================================
-->
- <target name="compile-examples" depends="compile">
+ <target name="compile-examples" depends="compile" description="Compile
example Java classes">
+ <mkdir dir="${build.dest}"/>
<mkdir dir="${build.dest}/examples"/>
+ <mkdir dir="${build.src}"/>
<mkdir dir="${build.src}/examples"/>
+ <tstamp>
+ <format property="TODAY" pattern="MMM d yyyy" locale="en"/>
+ <format property="TSTAMP" pattern="hh:mm:ss"/>
+ </tstamp>
+ <!-- Copy static resource files -->
+ <filter token="VERSION" value="${version}"/>
+ <filter token="VERSION_NUMBER" value="${version.number}"/>
+ <filter token="VERSION_BUILT" value="${TODAY} ${TSTAMP}"/>
<copy todir="${build.src}/examples" filtering="yes"
encoding="ISO-8859-1">
<fileset dir="${src.dir}/examples">
<include name="**/*.java"/>
@@ -320,18 +351,26 @@
</copy>
<javac srcdir="${build.src}/examples"
destdir="${build.dest}/examples"
- debug="${debug}"
- deprecation="${deprecation}"
- optimize="${optimize}"
+ source="${compile.source}"
+ target="${compile.target}"
+ debug="${compile.debug}"
+ deprecation="${compile.deprecation}"
+ optimize="${compile.optimize}"
encoding="ISO-8859-1">
<classpath refid="examples.classpath"/>
</javac>
+ <copy todir="${build.dest}/examples" filtering="yes"
encoding="ISO-8859-1">
+ <fileset dir="${build.src}/examples">
+ <include name="**/*.xml"/>
+ <include name="**/*.properties"/>
+ </fileset>
+ </copy>
</target>
<!-- ===================================================================
-->
- <!-- excutes the examples
-->
+ <!-- executes the examples
-->
<!-- ===================================================================
-->
- <target name="echo-example" depends="examples">
+ <target name="run-echo" depends="compile-examples" description="Run the
Echo example">
<echo message="Running Tomcat Native Echo example ..."/>
<java dir="${examples.dir}" classname="org.apache.tomcat.jni.Echo"
fork="yes" failonerror="${test.failonerror}">
@@ -341,7 +380,7 @@
<jvmarg value="-Djava.library.path=${tc.library.path}"/>
</java>
</target>
- <target name="server-example" depends="examples">
+ <target name="run-ssl-server" depends="compile-examples" description="Run
the SSL Server example">
<echo message="Running Tomcat Native SSL Server example ..."/>
<java dir="${examples.dir}" classname="org.apache.tomcat.jni.SSLServer"
fork="yes" failonerror="${test.failonerror}">
@@ -351,7 +390,7 @@
<jvmarg value="-Djava.library.path=${tc.library.path}"/>
</java>
</target>
- <target name="locals-example" depends="examples">
+ <target name="run-local-server" depends="compile-examples"
description="Run the Local Server example">
<echo message="Running Tomcat Native Local Server example ..."/>
<java dir="${examples.dir}"
classname="org.apache.tomcat.jni.LocalServer"
fork="yes" failonerror="${test.failonerror}">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]