Jskad/build.xml

1291 lines
48 KiB
XML
Raw Normal View History

<!-- @author David Chandler, dchandler@users.sourceforge.net
FIXME
Right now, the web-start-releases and self-contained-dist
targets hard-code the paths of the JARs/ZIPs they need. Be
sure you have yours in the right place.
FIXME
We have a document,
http://thdltools.sourceforge.net/BuildSystems.html, that
describes how to use this file to build Savant, Jskad,
QuillDriver, and the translation tool.
This build file is the main one, and it uses jwsbuild.xml for
building Java Web Start (JWS) releases. See the comments in that
file to learn why.
Quick start for the impatient: This buildfile looks for the
following, which are not in the CVS repository:
extensions/jdom.jar
extensions/xalan.jar
extensions/xercesImpl.jar
extensions/xml-apis.jar
extensions/jmf.jar
See the developers site, linked to from http://thdltools.sf.net/,
for info on where to find these.
-->
<project name="THDLTools" default="dist" basedir=".">
<description>
This Jakarta Ant buildfile is used to build Jskad, Savant,
QuillDriver, and the Translation Tool. The docs at
http://thdltools.sf.net/api are created using this buildfile, for
example. Read the comments of this buildfile to learn more, or
see http://thdltools.sourceforge.net/BuildSystems.html.
</description>
<!-- set global properties for this build -->
<property name="my.jar.suffix" value=""/>
<property name="javacdashg" value="yes"/>
<property name="source" location="source"/>
<property name="license" location="license"/>
<property name="bin" location="bin"/>
<property name="jskadbin" location="bin/jskad"/>
<property name="qdbin" location="bin/qd"/>
<property name="ttstandalonebin" location="bin/tt-standalone"/>
<property name="ttappletjwsbin" location="bin/tt-applet-and-java-web-start"/>
<property name="tthandheldbin" location="bin/tt-handheld"/>
<property name="ttservletbin" location="bin/tt-servlet"/>
<property name="savantbin" location="bin/savant"/>
<property name="docs" location="docs"/>
<property name="dist" location="dist"/>
<property name="vanillalib" location="${dist}/lib-vanilla"/>
<property name="jwslib" location="${dist}/lib-jws"/>
<property name="lib" location="${vanillalib}"/>
<property name="ext" location="extensions"/>
<property name="publicjavadocs" location="${docs}/public-javadocs"/>
<property name="privatejavadocs" location="${docs}/private-javadocs"/>
<!-- If you wish to have your Javadocs link to someplace other than
Sun's web site, maybe just changing these two, link.offline and
java.api.loc.url, will do the trick: -->
<property name="link.offline" value="false"/>
<property name="java.api.loc.url"
value="http://java.sun.com/j2se/1.4/docs/api/"/>
<property name="jnlp.codebase"
value="http://iris.lib.virginia.edu/tibet/tools"/>
<property name="key.alias" value="David Germano"/>
<property name="keystore" value="file:///f:/thdl/Jskad/thawte/keystore"/>
<!-- If you have installed the J2EE SDK, then you can compile servlets.
Set this property to the directory containing j2ee.jar:
-->
<property name="j2ee.sdk.home" location="F:\Program Files\j2sdkee1.3.1\lib"/>
<property name="tomcat.servlet.jar"
location="d:\lenguaje\jakarta-tomcat-3.2.1\lib\servlet.jar"/>
<!-- Set to true for more output when running the tools and if you
want the code to abort when it reaches poorly thought-out
control flow paths (i.e., iffy code).
-->
<property name="thdl.debug" value="true"/>
<!-- Set to the name of the dictionary used by the Translation Tool: -->
<property name="arch.dict" value="architecture_dictionary"/>
<!-- Set this to 1.2 if you want J2SDK 1.4's default. 1.1 gives us
more compatibility, but maybe there will be a performance hit
or something. -->
<property name="target.jvm" value="1.1"/>
<!-- Only the tt-servlet-compile target changes this. Humans
shouldn't mess with this. -->
<property name="our.javac.classpathref" value="entire.class.path"/>
<!-- Javadoc needs to find all classes, so you have to give it a megaclasspath: -->
<property name="javadocs.class.path.ref" value="all.extras.class.path"/>
<!-- To easily add a jar to the CLASSPATH, just drop it into
'extensions/drop-ins/'. -->
<path id="entire.class.path">
<pathelement location="${ext}/"/> <!-- for netscape.javascript -->
<!-- Developers: although these JARs are not yet in CVS, you're
responsible for finding them and putting them into
'extensions/': -->
<pathelement location="${ext}/jdom.jar"/>
<pathelement location="${ext}/xalan.jar"/>
<pathelement location="${ext}/xercesImpl.jar"/>
<pathelement location="${ext}/xml-apis.jar"/>
<pathelement location="${ext}/jmf.jar"/>
<!-- this gets Ant's jars, so leave it out:
<pathelement path="${java.class.path}/"/> -->
<fileset dir="${ext}/drop-ins">
<include name="*.jar"/>
<include name="*.JAR"/>
<include name="*.zip"/>
<include name="*.ZIP"/>
</fileset>
<!-- Developers: set this on the ant command line if you need to
with 'ant -Dadditional.class.path="c:\foo"': -->
<pathelement path="${additional.class.path}"/>
</path>
<path id="all.extras.class.path">
<pathelement location="${j2ee.sdk.home}/j2ee.jar"/>
<pathelement location="${tomcat.servlet.jar}"/>
<path refid="entire.class.path"/>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${dist}/releases"/>
<mkdir dir="${dist}/docs"/>
<mkdir dir="${vanillalib}"/>
<mkdir dir="${jwslib}"/>
<mkdir dir="${lib}"/>
<mkdir dir="${dist}/java-web-start"/>
<mkdir dir="${dist}/source"/>
<mkdir dir="${bin}"/>
<mkdir dir="${jskadbin}"/>
<mkdir dir="${qdbin}"/>
<mkdir dir="${ttstandalonebin}"/>
<mkdir dir="${tthandheldbin}"/>
<mkdir dir="${ttservletbin}"/>
<mkdir dir="${ttappletjwsbin}"/>
<mkdir dir="${savantbin}"/>
<mkdir dir="${publicjavadocs}"/>
<mkdir dir="${privatejavadocs}"/>
</target>
<target name="test-all"
depends="clean,distclean,compile,dist,src-dist,self-contained-dist,public-javadocs-dist,private-javadocs-dist,releases,web-start-releases,nightly-build"
description="runs every target in this buildfile in a smart order; useful for testing the buildfile and your build environment" />
<target name="nightly-build"
depends="distclean"
description="Creates ${dist}/nightlyBuild.zip" >
<!-- I believe that this order might actually matter, because some
targets execute 'ant clean' (though they only do so because I
am lazy). -->
<antcall target="web-start-releases"/>
<antcall target="self-contained-dist"/>
<antcall target="dist"/>
<antcall target="public-javadocs-dist"/>
<antcall target="private-javadocs-dist"/>
<antcall target="src-dist"/>
<zip destfile="${dist}/nightlyBuild.zip">
<zipfileset dir="${dist}"
excludes="nightlyBuild.zip,lib-jws/**,*.jnlp,README.txt"
prefix="."/>
</zip>
</target>
<target name="self-contained-dist"
depends="jskad-all-in-one-dist,savant-all-in-one-dist,qd-all-in-one-dist"
description="JARs up everything into self-contained JARs for double-click, classpath-worry-free joy" />
<target name="dist"
depends="jskad-dist,savant-dist,qd-dist,tt-handheld-dist,tt-standalone-dist,tt-applet-plus-jws-dist,tt-servlet-dist"
description="JARs up everything" />
<target name="compile"
depends="jskad-compile,savant-compile,qd-compile,tt-standalone-compile,tt-handheld-compile,tt-applet-plus-jws-compile,tt-servlet-compile"
description="compiles all programs" />
<target name="jskad-compile" depends="init"
description="compiles Jskad" >
<antcall target="copy-tmw-fonts-to-bin-dir">
<param name="my.bin" value="${jskadbin}"/>
</antcall>
<antcall target="create-timestamp-source-code"/> <!-- DLC NOW! The -run targets are mucking with this! It isn't fatal, but it should be fixed. -->
<antcall target="our-internal-javac-task">
<param name="mybin" value="${jskadbin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/input/Jskad.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${jskadbin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/text/TibetanHTML.java"/>
</antcall>
<antcall target="copy-ini-files-to-bin-dir-for-jarring">
<param name="mybin" value="${jskadbin}"/>
</antcall>
<antcall target="copy-license-etc-to-bin-dir-for-jarring">
<param name="mybin" value="${jskadbin}"/>
</antcall>
<copy todir="${jskadbin}">
<fileset dir="${source}">
<include name="org/thdl/tib/input/jskad_doc.html"/>
</fileset>
</copy>
<copy todir="${jskadbin}/org/thdl/tib/input">
<fileset dir="${source}">
<include name="Sambhota_keymap_one.rtf"/>
<include name="TCC_keyboard_1.rtf"/>
<include name="TCC_keyboard_2.rtf"/>
<include name="Wylie_keyboard.rtf"/>
<!-- We don't have ACIP_keyboard.rtf yet, but creating such a
thing manually is just one option. We could easily
generate all the keyboard descriptions
programmatically. -->
</fileset>
</copy>
</target>
<target name="savant-compile" depends="init"
description="compiles Savant" >
<antcall target="copy-tmw-fonts-to-bin-dir">
<param name="my.bin" value="${savantbin}"/>
</antcall>
<antcall target="create-timestamp-source-code"/>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${savantbin}"/>
<param name="my.included.source.file"
value="org/thdl/savant/SavantShell.java"/>
</antcall>
<antcall target="compile-classes-accessed-by-reflection">
<param name="mybin" value="${savantbin}"/>
</antcall>
<!-- Copy over Savant-specific resources: -->
<copy todir="${savantbin}/org/thdl/savant">
<fileset dir="${source}">
<include name="*savant*"/>
</fileset>
</copy>
<!-- Copy over Savant-specific resources: -->
<copy todir="${savantbin}">
<fileset dir="${source}">
<include name="MessageBundle*"/>
</fileset>
</copy>
<antcall target="copy-ini-files-to-bin-dir-for-jarring">
<param name="mybin" value="${savantbin}"/>
</antcall>
<antcall target="copy-license-etc-to-bin-dir-for-jarring">
<param name="mybin" value="${savantbin}"/>
</antcall>
</target>
<!-- Builds the standalone translation tool: -->
<target name="tt-standalone-compile" depends="init"
description="compiles the standalone Translation Tool" >
<antcall target="copy-tmw-fonts-to-bin-dir">
<param name="my.bin" value="${ttstandalonebin}"/>
</antcall>
<antcall target="create-timestamp-source-code"/>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${ttstandalonebin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/BinaryFileGenerator.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${ttstandalonebin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/WindowScannerFilter.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${ttstandalonebin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/ConsoleScannerFilter.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${ttstandalonebin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/AcipToWylie.java"/>
</antcall>
<antcall target="copy-ini-files-to-bin-dir-for-jarring">
<param name="mybin" value="${ttstandalonebin}"/>
</antcall>
<antcall target="copy-license-etc-to-bin-dir-for-jarring">
<param name="mybin" value="${ttstandalonebin}"/>
</antcall>
</target>
<!-- Builds the translation tool for handhelds. This tells J2SDK
1.4 to compile for handhelds (-target 1.1 does the trick).
Compiling with J2SDK 1.3 does so by default, by the way. -->
<target name="tt-handheld-compile" depends="init"
description="compiles the handheld Translation Tool" >
<antcall target="copy-tmw-fonts-to-bin-dir">
<param name="my.bin" value="${tthandheldbin}"/>
</antcall>
<antcall target="create-timestamp-source-code"/>
<antcall target="our-internal-javac-task">
<param name="target.jvm" value="1.1"/>
<param name="mybin" value="${tthandheldbin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/WindowScannerFilter.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<param name="target.jvm" value="1.1"/>
<param name="mybin" value="${tthandheldbin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/ConsoleScannerFilter.java"/>
</antcall>
<antcall target="copy-license-etc-to-bin-dir-for-jarring">
<param name="mybin" value="${tthandheldbin}"/>
</antcall>
</target>
<!-- Builds the applet + the Java Web Start translation tool: -->
<target name="tt-applet-plus-jws-compile" depends="init"
description="compiles the applet + Java Web Start forms of the Translation Tool" >
<antcall target="copy-tmw-fonts-to-bin-dir">
<param name="my.bin" value="${ttappletjwsbin}"/>
</antcall>
<antcall target="create-timestamp-source-code"/>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${ttappletjwsbin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/AppletScannerFilter.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${ttappletjwsbin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/WindowScannerFilter.java"/>
</antcall>
<antcall target="copy-ini-files-to-bin-dir-for-jarring">
<param name="mybin" value="${ttappletjwsbin}"/>
</antcall>
<antcall target="copy-license-etc-to-bin-dir-for-jarring">
<param name="mybin" value="${ttappletjwsbin}"/>
</antcall>
</target>
<target name="tt-servlet-compile"
depends="ttsc-init"
if="found.servlet.classes"
description="compiles the servlet form of the Translation Tool if you've set the j2ee.sdk.home property correctly" >
<antcall target="copy-tmw-fonts-to-bin-dir">
<param name="my.bin" value="${ttservletbin}"/>
</antcall>
<antcall target="create-timestamp-source-code"/>
<!-- For now, these two paths are identical: -->
<path id="ttsc.class.path">
<path refid="all.extras.class.path"/>
</path>
<antcall target="our-internal-javac-task">
<reference torefid="ttsc.class.path" refid="ttsc.class.path"/>
<param name="our.javac.classpathref" value="ttsc.class.path"/>
<param name="mybin" value="${ttservletbin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/ConsoleScannerFilter.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<reference torefid="ttsc.class.path" refid="ttsc.class.path"/>
<param name="our.javac.classpathref" value="ttsc.class.path"/>
<param name="mybin" value="${ttservletbin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/OnLineScannerFilter.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<reference torefid="ttsc.class.path" refid="ttsc.class.path"/>
<param name="our.javac.classpathref" value="ttsc.class.path"/>
<param name="mybin" value="${ttservletbin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/scanner/RemoteScannerFilter.java"/>
</antcall>
<antcall target="copy-ini-files-to-bin-dir-for-jarring">
<param name="mybin" value="${ttservletbin}"/>
</antcall>
<antcall target="copy-license-etc-to-bin-dir-for-jarring">
<param name="mybin" value="${ttservletbin}"/>
</antcall>
</target>
<target name="qd-compile" depends="init"
description="compiles QuillDriver" >
<!-- Compile the java code from ${source} into ${qdbin} -->
<antcall target="copy-tmw-fonts-to-bin-dir">
<param name="my.bin" value="${qdbin}"/>
</antcall>
<antcall target="create-timestamp-source-code"/>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${qdbin}"/>
<param name="my.included.source.file"
value="org/thdl/quilldriver/QDShell.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${qdbin}"/>
<param name="my.included.source.file"
value="org/thdl/tib/text/TibetanHTML.java"/>
</antcall>
<antcall target="compile-classes-accessed-by-reflection">
<param name="mybin" value="${qdbin}"/>
</antcall>
<!-- Copy over QuillDriver-specific resources: -->
<copy todir="${qdbin}">
<fileset dir="${source}">
<include name="MessageBundle*"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
<include name="**/QDtoHTML.xsl"/>
</fileset>
</copy>
<antcall target="copy-ini-files-to-bin-dir-for-jarring">
<param name="mybin" value="${qdbin}"/>
</antcall>
<antcall target="copy-license-etc-to-bin-dir-for-jarring">
<param name="mybin" value="${qdbin}"/>
</antcall>
</target>
<target name="web-start-releases"
depends="jskad-jws,savant-jws,qd-jws,tt-jws"
description="Builds the Java Web Start versions of all applications"/>
<target name="jskad-jws"
depends="init"
description="Builds the Java Web Start version of Jskad">
<antcall target="compile-from-scratch-and-call-jws-subbuild">
<param name="my.app" value="Jskad"/>
<param name="jwsjarsuffix" value="-self-contained"/>
<param name="my.prereq" value="jskad-all-in-one-dist"/>
<param name="lib" value="${jwslib}"/>
</antcall>
</target>
<target name="savant-jws"
depends="init"
description="Builds the Java Web Start version of Savant">
<antcall target="compile-from-scratch-and-call-jws-subbuild">
<param name="my.app" value="Savant"/>
<param name="jwsjarsuffix" value="-self-contained"/>
<param name="my.prereq" value="savant-all-in-one-dist"/>
<param name="lib" value="${jwslib}"/>
</antcall>
</target>
<target name="qd-jws"
depends="init"
description="Builds the Java Web Start version of QuillDriver">
<antcall target="compile-from-scratch-and-call-jws-subbuild">
<param name="my.app" value="QuillDriver"/>
<param name="jwsjarsuffix" value="-self-contained"/>
<param name="my.prereq" value="qd-all-in-one-dist"/>
<param name="lib" value="${jwslib}"/>
</antcall>
</target>
<target name="tt-jws"
depends="init"
description="Builds the Java Web Start version of the translation tool">
<antcall target="compile-from-scratch-and-call-jws-subbuild">
<param name="my.app" value="DictionarySearchAppletAndJavaWebStart"/>
<param name="jwsjarsuffix" value=""/>
<param name="my.prereq" value="tt-applet-plus-jws-dist"/>
<param name="lib" value="${jwslib}"/>
</antcall>
</target>
<target name="src-dist" depends="init"
description="generates the full Jskad+Savant+QuillDriver+Translation Tool source distribution" >
<!-- Put everything necessary into the zip file -->
<zip destfile="${dist}/source/THDL-Tools-src-${DSTAMP}.zip">
<zipfileset dir="${source}"
includes="**"
prefix="source"/>
<zipfileset dir="${license}"
includes="*"
prefix="."/>
<zipfileset dir="."
includes="build.xml"
prefix="."/>
<zipfileset dir="."
includes="docs/*package-list/**"
prefix="."/>
</zip>
</target>
<target name="jskad-dist" depends="jskad-compile"
description="generates the bare Jskad binary distribution" >
<!-- Put everything in ${jskadbin} into the JAR file -->
<jar jarfile="${lib}/Jskad${my.jar.suffix}.jar"
basedir="${jskadbin}">
<manifest>
<attribute name="Main-Class" value="org.thdl.tib.input.Jskad"/>
</manifest>
</jar>
</target>
<!-- FIXME: generate translation tool servlet distribution -->
<target name="tt-standalone-dist" depends="tt-standalone-compile"
description="generates the standalone translation tool's binary distribution." >
<!-- Put everything in ${ttstandalonebin} into the JAR file -->
<jar jarfile="${lib}/DictionarySearchStandalone${my.jar.suffix}.jar"
basedir="${ttstandalonebin}">
<manifest>
<attribute name="Main-Class"
value="org.thdl.tib.scanner.WindowScannerFilter"/>
</manifest>
</jar>
</target>
<target name="tt-handheld-dist" depends="tt-handheld-compile"
description="generates the handheld translation tool's binary distribution." >
<!-- Put everything in ${tthandheldbin} into the JAR file -->
<jar jarfile="${lib}/DictionarySearchHandheld${my.jar.suffix}.jar"
basedir="${tthandheldbin}">
<manifest>
<attribute name="Main-Class"
value="org.thdl.tib.scanner.WindowScannerFilter"/>
</manifest>
</jar>
</target>
<target name="tt-applet-plus-jws-dist" depends="tt-applet-plus-jws-compile"
description="generates the applet-plus-jws translation tool's binary distribution." >
<!-- Put everything in ${ttappletjwsbin} into the JAR file -->
<jar jarfile="${lib}/DictionarySearchAppletAndJavaWebStart${my.jar.suffix}.jar"
basedir="${ttappletjwsbin}">
<!-- We have two choices here, but the web page will call for
AppletScannerFilter, so the double-click should open the
standalone version, WindowScannerFilter: -->
<manifest>
<attribute name="Main-Class"
value="org.thdl.tib.scanner.WindowScannerFilter"/>
</manifest>
</jar>
</target>
<target name="tt-servlet-dist" depends="tt-servlet-compile"
if="found.servlet.classes"
description="generates the servlet translation tool's binary distribution." >
<!-- Put everything in ${ttservletbin} into the JAR file -->
<jar jarfile="${lib}/DictionarySearchServlet${my.jar.suffix}.jar"
basedir="${ttservletbin}">
<!-- I don't think this'll work (I don't know servlets, mind
you), but the main class is the following, so why not: -->
<manifest>
<attribute name="Main-Class"
value="org.thdl.tib.scanner.ConsoleScannerFilter"/>
</manifest>
</jar>
</target>
<target name="savant-dist" depends="savant-compile"
description="generates the bare Savant binary distribution" >
<!-- Put everything in ${savantbin} into the JAR file -->
<jar jarfile="${lib}/Savant${my.jar.suffix}.jar"
basedir="${savantbin}">
<manifest>
<attribute name="Main-Class" value="org.thdl.savant.SavantShell"/>
</manifest>
</jar>
</target>
<target name="qd-dist" depends="qd-compile"
description="generates the bare QuillDriver binary distribution" >
<!-- Put everything in ${qdbin} into the JAR file -->
<jar jarfile="${lib}/QuillDriver${my.jar.suffix}.jar"
basedir="${qdbin}">
<manifest>
<attribute name="Main-Class" value="org.thdl.quilldriver.QDShell"/>
</manifest>
</jar>
</target>
<!-- DLC FIXME: This used to inlude Jskad2Javascript.class, etc. But it no longer does. Compile those extra files, if Edward hasn't removed them! -->
<target name="jskad-all-in-one-dist" depends="jskad-compile"
description="generates the self-contained binary distribution for Jskad" >
<!-- Now put everything in ${bin} and ${ext}/netscape, plus
the .ini files, into the JAR file
-->
<copy todir="${jskadbin}/netscape">
<fileset dir="${ext}/netscape"/>
</copy>
<jar jarfile="${lib}/Jskad-self-contained${my.jar.suffix}.jar"
basedir="${jskadbin}"
includes="org/thdl/tib/**,org/thdl/util/**,netscape/**"
index="true"
update="no">
<manifest>
<attribute name="Main-Class" value="org.thdl.tib.input.Jskad"/>
</manifest>
</jar>
</target>
<target name="savant-all-in-one-dist" depends="savant-compile"
description="generates the self-contained binary distribution for Savant" >
<!-- Put everything in ${savantbin} into the JAR file after unpacking the
JARs/ZIPs we need to ${savantbin}. -->
<antcall target="copy-SQD-jars">
<param name="unjardest" value="${savantbin}"/>
</antcall>
<jar jarfile="${lib}/Savant-self-contained${my.jar.suffix}.jar"
basedir="${savantbin}">
<manifest>
<attribute name="Main-Class" value="org.thdl.savant.SavantShell"/>
</manifest>
</jar>
<delete dir="${savantbin}"/>
</target>
<target name="qd-all-in-one-dist" depends="qd-compile"
description="generates the self-contained QuillDriver binary distribution" >
<!-- Put everything in ${savantbin} into the JAR file after unpacking the
JARs/ZIPs we need to ${savantbin}. -->
<antcall target="copy-SQD-jars">
<param name="unjardest" value="${qdbin}"/>
</antcall>
<jar jarfile="${lib}/QuillDriver-self-contained${my.jar.suffix}.jar"
basedir="${qdbin}">
<manifest>
<attribute name="Main-Class" value="org.thdl.quilldriver.QDShell"/>
</manifest>
</jar>
<delete dir="${qdbin}"/>
</target>
<target name="clean"
description="cleans up a few things, but not all (not the Javadocs or the JWS releases, e.g.)" >
<!-- Delete the ${bin} and ${dist} directory trees -->
<delete dir="${bin}"/>
<delete dir="${dist}/docs"/>
<delete dir="${vanillalib}"/>
<delete dir="${jwslib}"/>
<delete dir="${lib}"/>
<delete dir="${dist}/releases"/>
<delete dir="${dist}/source"/>
<delete file="${dist}/DictionarySearchAppletAndJavaWebStart.jnlp"/>
<delete file="${dist}/Savant.jnlp"/>
<delete file="${dist}/QuillDriver.jnlp"/>
<delete file="${dist}/Jskad.jnlp"/>
<delete file="${source}/org/thdl/util/ThdlVersion.java"/>
</target>
<!-- Automake build systems use a 'make distclean' target, hence the
admittedly rather confusing name. Trust the description. -->
<target name="distclean"
description="cleans up so your directory once again looks like the source distribution"
depends="clean" >
<!-- Delete the API docs -->
<delete dir="${publicjavadocs}"/>
<delete dir="${privatejavadocs}"/>
<delete dir="${dist}/java-web-start"/>
<!-- 'ant clean' may be run during the nightly-build target, so
'ant clean' cannot delete the following: -->
<delete file="${dist}/nightlyBuild.zip"/>
</target>
<!--
HEY PROJECT MANAGER:
http://thdltools.sf.net/api lives at
/home/groups/t/th/thdltools/htdocs/api. To update it, follow the instructions
at 'http://thdltools.sf.net/BuildSystems.html#wwwmodule'.
-->
<target name="public-javadocs-dist" depends="public-javadocs"
description="makes zip file of Javadoc documentation for public/protected classes, methods, and fields" >
<tstamp/>
<zip destfile="${dist}/docs/public-javadocs-${DSTAMP}.zip"
basedir="${publicjavadocs}"/>
</target>
<target name="private-javadocs-dist" depends="private-javadocs"
description="makes zip file of Javadoc documentation for ALL classes, methods, and fields" >
<tstamp/>
<zip destfile="${dist}/docs/private-javadocs-${DSTAMP}.zip"
basedir="${privatejavadocs}"/>
</target>
<target name="public-javadocs"
description="makes Javadoc documentation for public/protected classes, methods, and fields"
depends="init,create-timestamp-source-code" >
<antcall target="our-javadocs">
<param name="access" value="protected"/>
<param name="our-javadocs-destdir" value="${publicjavadocs}"/>
</antcall>
</target>
<target name="private-javadocs"
description="makes Javadoc documentation for all classes, methods, and fields, regardless of their protection level (public, private, etc.)"
depends="init,create-timestamp-source-code" >
<antcall target="our-javadocs">
<param name="access" value="private"/>
<param name="our-javadocs-destdir" value="${privatejavadocs}"/>
</antcall>
</target>
<target name="qd-run" depends="qd-dist" description="runs QuillDriver">
<java classname="org.thdl.quilldriver.QDShell" fork="yes">
<classpath>
<pathelement location="${lib}/QuillDriver${my.jar.suffix}.jar"/>
<path refid="entire.class.path"/>
</classpath>
<jvmarg value="-Dthdl.debug=${thdl.debug}"/>
</java>
</target>
<target name="savant-run" depends="savant-dist" description="runs Savant">
<java classname="org.thdl.savant.SavantShell" fork="yes">
<classpath>
<pathelement location="${lib}/Savant${my.jar.suffix}.jar"/>
<path refid="entire.class.path"/>
</classpath>
<jvmarg value="-Dthdl.debug=${thdl.debug}"/>
</java>
</target>
<target name="jskad-run" depends="jskad-dist" description="runs Jskad">
<java classname="org.thdl.tib.input.Jskad" fork="yes">
<classpath>
<pathelement location="${lib}/Jskad${my.jar.suffix}.jar"/>
<path refid="entire.class.path"/>
</classpath>
<jvmarg value="-Dthdl.debug=${thdl.debug}"/>
</java>
</target>
<target name="tt-run" depends="tt-standalone-dist" description="runs the standalone translation tool">
<java classname="org.thdl.tib.scanner.WindowScannerFilter" fork="yes">
<classpath>
<pathelement
location="${lib}/DictionarySearchStandalone${my.jar.suffix}.jar"/>
<path refid="entire.class.path"/>
</classpath>
<jvmarg value="-Dthdl.debug=${thdl.debug}"/>
<!-- For non-swing version: <arg value="-simple"/> -->
<arg value="${arch.dict}"/>
</java>
</target>
<!-- DLC FIXME: build the tt-servlet release if the J2EE SDK is present. UPDATE: doesn't it do this? -->
<!-- See http://thdltools.sf.net/BuildSystems.html for info on
how to use this target. Note that we must do a distclean
because Ant doesn't always recompile when it should unless you use a
special task. -->
<target name="releases"
description="builds the releases under 'dist/releases/' after doing a distclean"
depends="distclean,init">
<antcall target="dist">
<param name="javacdashg" value="no"/>
<param name="dist" value="${dist}/releases"/>
</antcall>
<antcall target="src-dist">
<param name="dist" value="${dist}/releases"/>
</antcall>
<antcall target="public-javadocs-dist">
<param name="dist" value="${dist}/releases"/>
</antcall>
<antcall target="private-javadocs-dist">
<param name="dist" value="${dist}/releases"/>
</antcall>
</target>
<target name="ttsc-init" depends="init"
description="used internally to set a property when the J2EE SDK or Tomcat's servlet.jar is installed in a place where we can find it. In that case, we can build servlets.">
<condition property="found.servlet.classes">
<or>
<available file="${j2ee.sdk.home}/j2ee.jar"/>
<available file="${tomcat.servlet.jar}"/>
</or>
</condition>
</target>
<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
<!-- UTILITY TARGETS - targets of antcalls, targets not usually
directly called. -->
<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
<!-- Utility target called by private-javadocs and public-javadocs -->
<target name="our-javadocs" depends="init"
description="INTERNAL TASK: makes Javadoc documentation; usually not called directly" >
<!-- See http://jakarta.apache.org/ant/manual/CoreTasks/javadoc.html
to learn more about the Javadoc task.
-->
<tstamp>
<format property="javadoc.creation.time" pattern="MM/dd/yyyy hh:mm aa"/>
</tstamp>
<!-- We don't really use @version correctly, do we? So version="false". -->
<javadoc destdir="${our-javadocs-destdir}"
author="true"
access="${access}"
version="false"
use="true"
classpathref="${javadocs.class.path.ref}"
windowtitle="THDL Tools APIs"
Overview="${source}/overview.html">
<fileset dir="${source}" defaultexcludes="yes">
<include name="org/thdl/**/*.java" />
<!-- Exclude JUnit tests: -->
<exclude name="**/*Test.java"/>
<exclude name="**/*AllTests.java"/>
</fileset>
<doctitle><![CDATA[<h1>THDL Tools</h1>]]></doctitle>
<!-- Note: We must show the SF.net logo in order to get hit counts. -->
<bottom>These API docs were created ${javadoc.creation.time}.<![CDATA[<br><i>Copyright &#169; 2001-2002 Tibetan and Himalayan Digital Library. All Rights Reserved.</i><br>Hosted by <a href="http://sourceforge.net/"><img src="http://sourceforge.net/sflogo.php?group_id=61934&amp;type=1" width="88" height="31" border="0" alt="SourceForge_Logo"></a>]]></bottom>
<group title="Tibetan Text Packages" packages="org.thdl.tib.text.**"/>
<group title="Tibetan Input Packages" packages="org.thdl.tib.input.**"/>
<!-- Have our API docs link to Sun's, JDOM's, etc. -->
<link offline="${link.offline}"
href="${java.api.loc.url}"
packagelistLoc="${docs}/j2sdk1.4-package-list"/>
<link offline="${link.offline}"
href="http://www.jdom.org/docs/apidocs/"
packagelistLoc="${docs}/jdom-package-list"/>
</javadoc>
</target>
<target name="copy-license-etc-to-bin-dir-for-jarring"
depends="init"
description="INTERNAL TASK: Copies the license documents and the default properties file (hence the et cetera) to the bin directory. Usually not called directly.">
<copy todir="${mybin}">
<fileset dir="${license}"/>
</copy>
<!-- The default properties file, shared by all our tools: -->
<copy todir="${mybin}">
<fileset dir="${source}">
<include name="options.txt"/>
</fileset>
</copy>
</target>
<target name="copy-ini-files-to-bin-dir-for-jarring"
depends="init"
description="INTERNAL TASK: Copies the *.ini files to the bin directory. Usually not called directly.">
<copy todir="${mybin}">
<fileset dir="${source}">
<include name="org/thdl/tib/**/*.ini"/>
</fileset>
</copy>
</target>
<!-- To avoid duplicating very similar compilation tasks, we antcall
this task. We do this once per class we want, and javac is
smart enough to find dependent classes and compile them. -->
<target name="our-internal-javac-task"
depends="init"
description="INTERNAL TASK: Compiles according to Ant properties. Usually not called directly.">
<!-- Be sure we're going to be able to compile something: -->
<available file="${source}/${my.included.source.file}"
property="found.file.to.compile"/>
<fail message="Can't find the file '${source}/${my.included.source.file}' to compile it! Don't worry about forward vs. backward slashes, by the way--Ant is smart about those."
unless="found.file.to.compile"/>
<javac destdir="${mybin}" debug="${javacdashg}" target="${target.jvm}">
<classpath refid="${our.javac.classpathref}"/>
<src path="${source}"/>
<include name="${my.included.source.file}" />
<!-- Exclude JUnit tests: -->
<exclude name="**/*Test.java" />
<exclude name="**/*AllTests.java" />
<!-- Don't compile these resources (we could leave this out, but
Ant's debugging output would confuse us, and having this
explicit is a Good Thing: -->
<exclude name="**/*.properties" />
<exclude name="**/*.rtf" />
<exclude name="**/*.xsl" />
<exclude name="**/*.txt" />
<exclude name="**/*.ini" />
<exclude name="**/*.html" />
<exclude name="**/*.gif" />
<exclude name="**/*.jpg" />
</javac>
</target>
<target name="compile-from-scratch-and-call-jws-subbuild"
depends="init"
description="Cleans, compiles, and packages the Java Web Start version of ${my.app}">
<!-- First, you must give the passwords so that we can sign the JARs. -->
<fail message="Use 'ant -Dkeystore.password=psst' to sign a Java Web Start WAR file."
unless="keystore.password"/>
<fail message="Use 'ant -Ddgkey.password=psst' to sign a Java Web Start WAR file."
unless="dgkey.password"/>
<!-- Clean: (FIXME: clean only what you must clean, the appropriate bin dir.) -->
<antcall target="clean"/>
<!-- Now, having cleaned, we create ${my.app}.jar: -->
<antcall target="${my.prereq}">
<param name="my.jar.suffix" value=""/>
<param name="javacdashg" value="no"/>
</antcall>
<!-- Now create the .jnlp file: -->
<antcall target="create-${my.app}-jnlp-file"/>
<!-- And save it: -->
<copy todir="${dist}/java-web-start">
<fileset dir="${dist}">
<include name="${my.app}.jnlp"/>
</fileset>
</copy>
<!-- Finally, call jwsbuild.xml appropriately: -->
<ant antfile="jwsbuild.xml" target="package-for-java-web-start"
inheritAll="false" inheritRefs="false">
<property name="dist" value="${dist}"/>
<property name="lib" value="${jwslib}"/>
<property name="dgkey.password" value="${dgkey.password}"/>
<property name="keystore.password" value="${keystore.password}"/>
<property name="keystore" value="${keystore}"/>
<property name="key.alias" value="${key.alias}"/>
</ant>
</target>
<target name="create-Jskad-jnlp-file"
depends="init"
description="Creates Jskad's JNLP file based on a template hard-coded into this build file and your choice of the jnlp.codebase property.">
<!-- Write the head of the .jnlp file: -->
<echo file="${dist}/Jskad.jnlp"
append="false"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"]]></echo>
<!-- Write the middle of the .jnlp file: -->
<echo file="${dist}/Jskad.jnlp"
append="true">
<![CDATA[ codebase="]]>${jnlp.codebase}<![CDATA["]]></echo>
<!-- Write the tail of the .jnlp file: -->
<echo file="${dist}/Jskad.jnlp"
append="true">
<![CDATA[ href="Jskad.jnlp">
<information>
<title>Jskad</title>
<vendor>THDL</vendor>
<homepage href="http://iris.lib.virginia.edu/tibet/tools/jskad.html" />
<description>
Jskad is a simple text editor for the Tibetan language, using the
Wylie transliteration and supporting several virtual keyboards.
You must install the Tibetan Machine Web fonts before using
Jskad.
</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.2+"/>
<jar href="Jskad-self-contained.jar" />
</resources>
<application-desc />
</jnlp>
]]></echo>
</target>
<target name="create-Savant-jnlp-file"
depends="init"
description="Creates Savant's JNLP file based on a template hard-coded into this build file and your choice of the jnlp.codebase property.">
<!-- Write the head of the .jnlp file: -->
<echo file="${dist}/Savant.jnlp"
append="false"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"]]></echo>
<!-- Write the middle of the .jnlp file: -->
<echo file="${dist}/Savant.jnlp"
append="true">
<![CDATA[ codebase="]]>${jnlp.codebase}<![CDATA["]]></echo>
<!-- Write the tail of the .jnlp file: -->
<echo file="${dist}/Savant.jnlp"
append="true">
<![CDATA[ href="Savant.jnlp">
<information>
<title>Savant</title>
<vendor>THDL</vendor>
<homepage href="http://iris.lib.virginia.edu/tibet/tools/savant/" />
<description>
Savant displays foreign-language text, audio, and video
side-by-side to help you learn foreign languages or just study.
</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.2+"/>
<jar href="Savant-self-contained.jar" />
</resources>
<application-desc />
</jnlp>
]]></echo>
</target>
<target name="create-QuillDriver-jnlp-file"
depends="init"
description="Creates QuillDriver's JNLP file based on a template hard-coded into this build file and your choice of the jnlp.codebase property.">
<!-- Write the head of the .jnlp file: -->
<echo file="${dist}/QuillDriver.jnlp"
append="false"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"]]></echo>
<!-- Write the middle of the .jnlp file: -->
<echo file="${dist}/QuillDriver.jnlp"
append="true">
<![CDATA[ codebase="]]>${jnlp.codebase}<![CDATA["]]></echo>
<!-- Write the tail of the .jnlp file: -->
<echo file="${dist}/QuillDriver.jnlp"
append="true">
<![CDATA[ href="QuillDriver.jnlp">
<information>
<title>QuillDriver</title>
<vendor>THDL</vendor>
<homepage href="http://iris.lib.virginia.edu/tibet/tools/quilldriver/" />
<description>
QuillDriver helps you develop content for Savant, another THDL tool.
</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.2+"/>
<jar href="QuillDriver-self-contained.jar" />
</resources>
<application-desc />
</jnlp>
]]></echo>
</target>
<target name="create-DictionarySearchAppletAndJavaWebStart-jnlp-file"
depends="init"
description="Creates the translation tool's JNLP file based on a template hard-coded into this build file and your choice of the jnlp.codebase property.">
<!-- Write the head of the .jnlp file: -->
<echo file="${dist}/DictionarySearchAppletAndJavaWebStart.jnlp"
append="false"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"]]></echo>
<!-- Write the middle of the .jnlp file: -->
<echo file="${dist}/DictionarySearchAppletAndJavaWebStart.jnlp"
append="true">
<![CDATA[ codebase="]]>${jnlp.codebase}<![CDATA["]]></echo>
<!-- Write the tail of the .jnlp file: -->
<echo file="${dist}/DictionarySearchAppletAndJavaWebStart.jnlp"
append="true">
<![CDATA[ href="DictionarySearchAppletAndJavaWebStart.jnlp">
<information>
<title>DictionarySearchAppletAndJavaWebStart</title>
<vendor>THDL</vendor>
<homepage href="http://iris.lib.virginia.edu/tibet/reference/translation-tool.html" />
<description>
The translation tool provides a Tibetan-to-English dictionary.
You must have the Tibetan Machine Web fonts installed on your
computer to take full advantage of this dictionary.
</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.2+"/>
<jar href="DictionarySearchAppletAndJavaWebStart.jar" />
</resources>
<application-desc />
</jnlp>
]]></echo>
</target>
<target name="compile-QT4J-classes-accessed-by-reflection"
if="found.QT4J"
description="If QT4J is available, this compiles QT4J integration.">
<antcall target="our-internal-javac-task">
<param name="mybin" value="${qdbin}"/>
<param name="my.included.source.file"
value="org/thdl/media/SmartQT4JPlayer.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${savantbin}"/>
<param name="my.included.source.file"
value="org/thdl/media/SmartQT4JPlayer.java"/>
</antcall>
</target>
<target name="compile-JMF-classes-accessed-by-reflection"
if="found.JMF"
description="If JMF is available, this compiles JMF integration.">
<antcall target="our-internal-javac-task">
<param name="mybin" value="${qdbin}"/>
<param name="my.included.source.file"
value="org/thdl/media/SmartJMFPlayer.java"/>
</antcall>
<antcall target="our-internal-javac-task">
<param name="mybin" value="${savantbin}"/>
<param name="my.included.source.file"
value="org/thdl/media/SmartJMFPlayer.java"/>
</antcall>
</target>
<!-- If JMF is not available, we don't compile SmartJMFPlayer.
Similarly for QT4J. -->
<target name="compile-classes-accessed-by-reflection"
description="Compiles classes that we access these via reflection (thus, compiling SavantShell and QDShell will not include them)">
<available classname="javax.media.NoPlayerException"
classpathref="${our.javac.classpathref}"
property="found.JMF"/>
<available classname="quicktime.std.clocks.TimeCallBack"
classpathref="${our.javac.classpathref}"
property="found.QT4J"/>
<antcall target="compile-JMF-classes-accessed-by-reflection"/>
<antcall target="compile-QT4J-classes-accessed-by-reflection"/>
</target>
<target name="create-timestamp-source-code"
description="writes out a Java source file that contains the time of compilation">
<tstamp>
<format property="compilation.time" pattern="d-MMMM-yyyy hh:mm aa"
offset="0" unit="hour"/>
</tstamp>
<delete file="${source}/org/thdl/util/ThdlVersion.java"/>
<echo file="${source}/org/thdl/util/ThdlVersion.java"
append="false"><![CDATA[// This file was automatically generated by the Ant build process.
// Your edits will be lost when you run Ant again.
package org.thdl.util;
/** Contains methods for determining the time at which this class
was compiled. This is useful for filling out bug reports about
nightly builds. This class is not instantiable. */
public class ThdlVersion {
/** Do not instantiate this class. */
private ThdlVersion() { }
/** Returns a string indicating the time this program was compiled. */
public static String getTimeOfCompilation() {
return "]]></echo>
<echo file="${source}/org/thdl/util/ThdlVersion.java"
append="true">${compilation.time}</echo>
<echo file="${source}/org/thdl/util/ThdlVersion.java"
append="true"><![CDATA[";
}
}
]]></echo>
</target>
<!-- DLC TODO: jardiffs for the JWS stuff. -->
<target name="copy-SQD-jars"
description="Unpacks the JARs/WARs/ZIP files that Savant and QuillDriver use to the chosen bin/ directory">
<unjar src="${ext}/jdom.jar" dest="${unjardest}"/>
<unjar src="${ext}/xml-apis.jar" dest="${unjardest}"/>
<unjar src="${ext}/xalan.jar" dest="${unjardest}"/> <!-- DLC FIXME: this isn't needed for Savant. -->
<unjar src="${ext}/xercesImpl.jar" dest="${unjardest}"/>
<!-- One or more of the above may have a META-INF directory. We don't
want theirs to overwrite our own, so we delete it. -->
<delete dir="${unjardest}/META-INF"/>
</target>
<target name="copy-tmw-fonts-to-bin-dir"
description="Unpacks the JARs/WARs/ZIP files that Savant and QuillDriver use to the chosen bin/ directory">
<copy todir="${my.bin}/Fonts/TibetanMachineWeb">
<fileset dir="Fonts/TibetanMachineWeb"/>
</copy>
</target>
</project>
<!-- My TO-DO list: -->
<!-- DLC FIXME: If we use bootclasspath and -target 1.1, do we need a
separate tt-handheld and tt-standalone? -->
<!-- DLC FIXME: Allow for signing the vanilla JARs. -->