dmitri 2002/12/13 18:37:43
Modified: clazz build.xml
Log:
Fixed up the build script
Revision Changes Path
1.2 +163 -66 jakarta-commons-sandbox/clazz/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/clazz/build.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- build.xml 24 Oct 2002 23:05:34 -0000 1.1
+++ build.xml 14 Dec 2002 02:37:43 -0000 1.2
@@ -1,54 +1,35 @@
-<project name="clazz" default="compile" basedir=".">
+<project name="Clazz" default="jar" basedir=".">
<!--
- "clazz" component of the Jakarta Commons Subproject
+ "Clazz" component of the Jakarta Commons Subproject
$Id$
-->
<!-- ========== Initialize Properties ===================================== -->
-
+ <property file="${user.home}/build.properties"/> <!-- User local -->
<property file="build.properties"/> <!-- Component local -->
<property file="../build.properties"/> <!-- Commons local -->
- <property file="${user.home}/build.properties"/> <!-- User local -->
-
-
-<!-- ========== External Dependencies ===================================== -->
-
-
- <!-- The directory containing your binary distribution of JUnit,
- version 3.7 or later -->
- <property name="junit.home" value="/usr/local/junit3.7"/>
-
- <!-- The home directory for the Commons collection classes distribution -->
- <property name="commons-logging.home" value="../../jakarta-commons/logging/dist"/>
-
-
-<!-- ========== Derived Values ============================================ -->
-
-
- <!-- The pathname of the "junit.jar" JAR file -->
- <property name="junit.jar" value="${junit.home}/junit.jar"/>
-
- <!-- The pathname of the logging classes JAR file -->
- <property name="commons-logging.jar"
value="${commons-logging.home}/commons-logging.jar"/>
<!-- ========== Component Declarations ==================================== -->
-
<!-- The name of this component -->
<property name="component.name" value="clazz"/>
+ <!-- The title of this component -->
+ <property name="component.title" value="New generation of Introspection"/>
+
<!-- The primary package name of this component -->
<property name="component.package" value="org.apache.commons.clazz"/>
- <!-- The title of this component -->
- <property name="component.title" value="clazz Utilities"/>
-
<!-- The current version number of this component -->
- <property name="component.version" value="1.0-dev"/>
+ <property name="component.version" value="0.1"/>
+
+ <!-- The jar name of this component -->
+ <property name="jar.name"
+ value="commons-${component.name}.jar"/>
<!-- The base directory for compilation targets -->
<property name="build.home" value="target"/>
@@ -65,6 +46,10 @@
<!-- The base directory for unit test sources -->
<property name="test.home" value="src/test"/>
+ <!-- Anakia props -->
+ <property name="docs.src" value="./xdocs"/>
+ <property name="docs.dest" value="${dist.home}/docs"/>
+
<!-- ========== Compiler Defaults ========================================= -->
@@ -81,6 +66,8 @@
<!-- Construct compile classpath -->
<path id="compile.classpath">
<pathelement location="${build.home}/classes"/>
+ <pathelement location="${junit.jar}"/>
+ <pathelement location="${commons-collections.jar}"/>
<pathelement location="${commons-logging.jar}"/>
</path>
@@ -92,8 +79,9 @@
<path id="test.classpath">
<pathelement location="${build.home}/classes"/>
<pathelement location="${build.home}/tests"/>
- <pathelement location="${commons.logging.jar}"/>
<pathelement location="${junit.jar}"/>
+ <pathelement location="${commons-collections.jar}"/>
+ <pathelement location="${commons-logging.jar}"/>
</path>
<!-- Should all tests fail if one does? -->
@@ -105,17 +93,54 @@
<!-- ========== Executable Targets ======================================== -->
+ <target name="check_available">
+ <available
+ classname="junit.framework.Test"
+ property="junit.present"
+ classpathref="compile.classpath"
+ />
+
+ </target>
<target name="init"
- description="Initialize and evaluate conditionals">
+ description="Initialize and evaluate conditionals"
+ depends="check_available">
<echo message="-------- ${component.name} ${component.version} --------"/>
<filter token="name" value="${component.name}"/>
<filter token="package" value="${component.package}"/>
<filter token="version" value="${component.version}"/>
- </target>
+ <echo message="junit.jar = ${junit.jar}"/>
+ <echo message="commons-collections.jar = ${commons-collections.jar}"/>
+ <echo message="commons-logging.jar = ${commons-logging.jar}"/>
+ </target>
+
+ <target name="check.junit" unless="junit.present">
+ <antcall target="property-warning">
+ <param name="name" value="junit.jar"/>
+ <param name="value" value="${junit.jar}"/>
+ </antcall>
+ </target>
+
+ <target name="property-warning">
+ <echo>
+ +----------------------------------------------------------------+
+ + F A I L E D R E Q U I R E M E N T |
+ +----------------------------------------------------------------+
+ | You must define the following property in order |
+ | to build ${component.name}:
+ | |
+ | ${name} = ${value}
+ | |
+ | You can set this property in the provided build.properties |
+ | file, or you may set this property in your |
+ | ${user.home}/build.properties file.
+ +----------------------------------------------------------------+
+ </echo>
+ <fail message="Failed Requirement"/>
+ </target>
- <target name="prepare" depends="init"
+ <target name="prepare" depends="init,check.junit"
description="Prepare build directory">
<mkdir dir="${build.home}"/>
<mkdir dir="${build.home}/classes"/>
@@ -123,7 +148,6 @@
<mkdir dir="${build.home}/tests"/>
</target>
-
<target name="static" depends="prepare"
description="Copy static files to build directory">
<tstamp/>
@@ -180,68 +204,141 @@
<mkdir dir="${dist.home}/docs"/>
<mkdir dir="${dist.home}/docs/api"/>
<javadoc sourcepath="${source.home}"
+ classpathref="compile.classpath"
destdir="${dist.home}/docs/api"
packagenames="org.apache.commons.*"
author="true"
- private="true"
+ private="false"
version="true"
doctitle="<h1>${component.title}</h1>"
windowtitle="${component.title} (Version ${component.version})"
- bottom="Copyright (c) 2001-2002 - Apache Software Foundation">
- <classpath refid="compile.classpath"/>
- </javadoc>
+ bottom="Copyright (c) 2001 - Apache Software Foundation"/>
</target>
-
- <target name="dist" depends="compile,javadoc"
- description="Create binary distribution">
+ <!-- ================================================================== -->
+ <!-- J A R -->
+ <!-- ================================================================== -->
+ <target name="jar" depends="compile" description="Build jar">
<mkdir dir="${dist.home}"/>
- <copy file="../LICENSE"
- todir="${dist.home}"/>
- <copy file="RELEASE-NOTES.txt"
- todir="${dist.home}"/>
- <antcall target="jar"/>
- </target>
-
-
- <target name="jar" depends="compile"
- description="Create jar">
- <mkdir dir="${dist.home}"/>
- <mkdir dir="${build.home}/classes/META-INF"/>
- <copy file="../LICENSE"
+ <copy file="LICENSE.txt"
tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
- <jar jarfile="${dist.home}/commons-${component.name}.jar"
+ <jar jarfile="${dist.home}/${jar.name}"
basedir="${build.home}/classes"
manifest="${build.home}/conf/MANIFEST.MF"/>
</target>
+
+ <!-- ================================================================== -->
+ <!-- I N S T A L L J A R -->
+ <!-- ================================================================== -->
-
- <target name="install-jar" depends="jar"
- description="--> Installs jar file in ${lib.repo}">
+ <target name="install-jar" depends="jar"
+ description="==> Installs .jar file in ${lib.repo}">
<copy todir="${lib.repo}" filtering="no">
<fileset dir="${dist.home}">
- <include name="commons-${component.name}.jar"/>
+ <include name="${jar.name}"/>
</fileset>
</copy>
</target>
+ <!-- ================================================================== -->
+ <!-- D I S T -->
+ <!-- ================================================================== -->
-<!-- ========== Unit Test Targets ========================================= -->
+ <target name="dist" depends="compile,jar,xdoc,javadoc"
+ description="Create binary distribution">
+ <mkdir dir="${dist.home}"/>
+ <copy file="LICENSE.txt"
+ todir="${dist.home}"/>
+ </target>
+<!-- ========== Unit Test Targets ========================================= -->
<target name="test" depends="compile.tests,
test.clazz"
description="Run all unit test cases">
</target>
-
- <target name="test.clazz" depends="compile.tests">
- <echo message="Running clazz tests ..."/>
+ <target name="test.clazz">
+ <echo message="Running Clazz tests ..."/>
<java classname="${test.runner}" fork="yes"
failonerror="${test.failonerror}">
- <arg value="org.apache.commons.clazz.SomeTestCase"/>
+ <arg value="org.apache.commons.clazz.ClazzTest"/>
<classpath refid="test.classpath"/>
</java>
</target>
+
+<!-- ========== Documentation ========================================= -->
+
+ <target name="xdoc.fetch-stylesheet" unless="localstylesheet">
+ <echo>
+ ####################################################################
+ #
+ # Fetching the latest stylesheet from jakarta-site2
+ #
+ # NOTE : As this build target is meant for developers, this requires
+ # a properly setup CVS. But you are encouraged to use this to
+ # experiment with Anakia - if the fetch fails, it may be because
+ # you haven't yet logged into CVS. The way to do it, assuming you
+ # have a resonable CVS client setup is
+ #
+ # $ cvs -d :pserver:[EMAIL PROTECTED]:/home/cvspublic login
+ # password: anoncvs
+ #
+ # and that should solve it.
+ #
+ # See http://jakarta.apache.org/site/cvsindex.html for more
+ # information, or http://www.cvshome.org/
+ #
+ # Ant really is the bee's knees. http://jakarta.apache.org/ant/
+ #
+ ######################################################################
+ </echo>
+
+<!-- <cvs cvsRoot=":pserver:[EMAIL PROTECTED]:/home/cvspublic"
+ command="checkout -p jakarta-site2/xdocs/stylesheets/site.vsl"
+ output="${docs.src}/stylesheets/site.vsl"
+ />
+-->
+ </target>
+
+ <target name="xdoc" depends="xdoc.fetch-stylesheet"
+ description="Generates HTML documentation from XML source">
+ <mkdir dir="${dist.home}"/>
+ <mkdir dir="${dist.home}/docs"/>
+
+ <taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask">
+ <classpath location="${velocity.jar}"/>
+ <classpath location="${jdom.jar}"/>
+ <classpath location="${xerces.jar}"/>
+ <classpath location="${commons-collections.jar}"/>
+ <classpath location="${logkit.jar}"/>
+ </taskdef>
+
+ <echo>
+ #######################################################
+ #
+ # Now using Anakia to transform our XML documentation
+ # to HTML.
+ #
+ #######################################################
+ </echo>
+
+ <anakia basedir="${docs.src}" destdir="${docs.dest}/"
+ extension=".html" style="./site.vsl"
+ projectFile="stylesheets/project.xml"
+ excludes="**/stylesheets/** empty.xml"
+ includes="**/*.xml"
+ lastModifiedCheck="true"
+ templatePath="xdocs/stylesheets">
+ </anakia>
+
+ <copy todir="${docs.dest}/images" filtering="no">
+ <fileset dir="${docs.src}/images">
+ <include name="**/*.gif"/>
+ <include name="**/*.jpeg"/>
+ <include name="**/*.jpg"/>
+ </fileset>
+ </copy>
+ </target>
</project>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>