You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by me...@locus.apache.org on 2000/11/14 18:21:20 UTC
cvs commit: jakarta-ant/src/antidote build.xml
metasim 00/11/14 09:21:20
Modified: src/antidote build.xml
Log:
Added scripts for launching Antidote, and updated the build file to make better
use of the Ant build directory for libraries, etc.
Revision Changes Path
1.4 +108 -29 jakarta-ant/src/antidote/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-ant/src/antidote/build.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- build.xml 2000/11/09 23:14:06 1.3
+++ build.xml 2000/11/14 17:21:20 1.4
@@ -1,11 +1,7 @@
<?xml version="1.0"?>
-<!-- ======================================================================= -->
-<!-- Ant GUI build file -->
-<!-- ======================================================================= -->
+<project name="Antidote" default="main" basedir=".">
-<project name="Antidote" default="compile" basedir=".">
-
<!-- Give user a chance to override without editing this file
(and without typing -D each time it compiles it) -->
<property file="${user.home}/.ant.properties" />
@@ -14,20 +10,23 @@
<property name="name" value="antidote"/>
<property name="version" value="0.1"/>
+ <property name="ant.home" value="../../"/>
+ <property name="src.bin.dir" value="bin"/>
+ <property name="src.etc.dir" value="etc"/>
<property name="src.dir" value="."/>
- <!-- XXX Yuck. Need to fix this with something better -->
- <property name="build.dir" value="../../../build/antidote"/>
+ <property name="docs.dir" value="docs"/>
+ <property name="build.dir" value="../../../build/ant"/>
<property name="lib.dir" value="${build.dir}/lib"/>
+ <property name="bin.dir" value="${build.dir}/bin"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.javadocs" value="${build.dir}/javadocs"/>
- <property name="manifest" value="${src.dir}/etc/manifest"/>
- <!-- XXX Yuck. Need to fix this with something better -->
- <property name="ant.jar" value="${build.dir}/../ant/lib/ant.jar"/>
+ <property name="build.tests" value="${build.dir}/testcases"/>
+ <property name="ant.dist.dir" value="../../../dist/ant"/>
<path id="classpath">
</path>
- <property name="packages" value="org.apache.tools.*"/>
-
+ <property name="packages" value="org.apache.tools.ant.gui.*"/>
+ <property name="manifest" value="etc/manifest"/>
<!-- =================================================================== -->
<!-- Set some the defaults the user can override in .ant.properties -->
@@ -37,6 +36,14 @@
<property name="junit.fork" value="false" />
<!-- =================================================================== -->
+ <!-- Define a global set of patterns that can be referenced by -->
+ <!-- its id attribute -->
+ <!-- =================================================================== -->
+ <patternset id="chmod.patterns">
+ <include name="**/antidote" />
+ </patternset>
+
+ <!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare">
@@ -53,8 +60,8 @@
<javac srcdir="${src.dir}"
destdir="${build.classes}"
debug="on"
- deprecation="on"
- optimize="off" >
+ deprecation="off"
+ optimize="on" >
<classpath refid="classpath" />
</javac>
@@ -85,41 +92,100 @@
<jar jarfile="${lib.dir}/${name}.jar"
basedir="${build.classes}"
includes="org/**"
- manifest="${manifest}"/>
+ manifest="${manifest}"
+ />
</target>
<!-- =================================================================== -->
+ <!-- Creates the binary structure -->
+ <!-- =================================================================== -->
+ <target name="main" depends="jar" description="Creates the binary structure">
+ <mkdir dir="${bin.dir}"/>
+ <copy todir="${bin.dir}">
+ <fileset dir="${src.bin.dir}"/>
+ </copy>
+ <chmod perm="+x">
+ <fileset dir="${bin.dir}">
+ <patternset refid="chmod.patterns"/>
+ </fileset>
+ </chmod>
+ <fixcrlf srcdir="${bin.dir}" includes="antidote" cr="remove"/>
+ <fixcrlf srcdir="${bin.dir}" includes="*.bat" cr="add"/>
+ </target>
+
+ <!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
- <target name="javadocs" depends="prepare"
- description="Creates the API documentation">
+ <target name="javadocs" depends="prepare" description="Creates the API documentation">
<mkdir dir="${build.javadocs}"/>
<javadoc packagenames="${packages}"
sourcepath="${basedir}/${src.dir}"
destdir="${build.javadocs}"
author="true"
+ private="true"
version="true"
windowtitle="${Name} API"
doctitle="${Name}"
bottom="Copyright © 2000 Apache Software Foundation. All Rights Reserved.">
- <group title="Ant Gui" packages="org.apache.tools.ant.gui*" />
+ <group title="Antidote" packages="org.apache.tools.ant.gui*" />
</javadoc>
</target>
+ <!-- =================================================================== -->
+ <!-- Creates the distribution -->
+ <!-- =================================================================== -->
+ <target name="dist" depends="main,jar,javadocs" description="Creates the distribution">
+ <mkdir dir="${ant.dist.dir}"/>
+ <mkdir dir="${ant.dist.dir}/bin"/>
+ <mkdir dir="${ant.dist.dir}/lib"/>
+ <mkdir dir="${ant.dist.dir}/docs"/>
+ <mkdir dir="${ant.dist.dir}/docs/api"/>
+ <mkdir dir="${ant.dist.dir}/src"/>
+
+ <copy todir="${ant.dist.dir}/src">
+ <fileset dir="${src.dir}"/>
+ </copy>
+ <copy todir="${ant.dist.dir}/lib">
+ <fileset dir="${lib.dir}"/>
+ </copy>
+
+ <copy todir="${ant.dist.dir}/bin">
+ <fileset dir="bin"/>
+ </copy>
+ <copy todir="${ant.dist.dir}/docs">
+ <fileset dir="${docs.dir}"/>
+ </copy>
+ <copy todir="${ant.dist.dir}/docs/api">
+ <fileset dir="${build.javadocs}"/>
+ </copy>
+
+ <fixcrlf srcdir="${ant.dist.dir}/bin" includes="antidote" cr="remove"/>
+ <fixcrlf srcdir="${ant.dist.dir}/bin" includes="*.bat" cr="add"/>
+ <chmod perm="+x">
+ <fileset dir="${ant.dist.dir}/bin">
+ <patternset refid="chmod.patterns"/>
+ </fileset>
+ </chmod>
+
+ <copy file="README" tofile="${ant.dist.dir}/README"/>
+ <copy file="WHATSNEW" tofile="${ant.dist.dir}/WHATSNEW"/>
+ <copy file="TODO" tofile="${ant.dist.dir}/TODO"/>
+ <copy file="LICENSE" tofile="${ant.dist.dir}/LICENSE"/>
+ </target>
<!-- =================================================================== -->
- <!-- Run the GUI -->
+ <!-- Packages the distribution with ZIP -->
+ <!-- =================================================================== -->
+ <target name="dist-zip" depends="dist">
+ <zip zipfile="${Name}-${version}.zip" basedir="${ant.dist.dir}" includes="**"/>
+ </target>
+
<!-- =================================================================== -->
- <target name="run" depends="compile" description="Run Antidote">
- <java classname="org.apache.tools.ant.gui.Main"
- fork="yes"
- dir="${user.home}">
- <jvmarg value="-Djava.compiler=NONE"/>
- <classpath>
- <pathelement location="${build.classes}"/>
- <pathelement location="${ant.jar}"/>
- </classpath>
- </java>
+ <!-- Packages the distribution with TAR-GZIP -->
+ <!-- =================================================================== -->
+ <target name="dist-tgz" depends="dist">
+ <tar tarfile="${Name}-${version}.tar" basedir="${ant.dist.dir}" includes="**"/>
+ <gzip zipfile="${Name}-${version}.tar.gz" src="${Name}-${version}.tar"/>
</target>
<!-- =================================================================== -->
@@ -127,7 +193,20 @@
<!-- =================================================================== -->
<target name="clean">
<delete dir="${build.dir}"/>
+ <delete dir="${ant.dist.dir}"/>
</target>
+
+ <!-- =================================================================== -->
+ <!-- Total cleanup -->
+ <!-- =================================================================== -->
+ <target name="total-clean" depends="clean">
+ <delete dir="${bin.dir}"/>
+ <delete file="${lib.dir}/${name}.jar"/>
+ <delete file="${Name}-${version}.zip"/>
+ <delete file="${Name}-${version}.tar"/>
+ <delete file="${Name}-${version}.tar.gz"/>
+ </target>
+
</project>