blob: 4760b3fabf135a01622a5f4828cd09dae8b20242 [file] [log] [blame] [edit]
<project name="UnicodeJsps" default="all" basedir=".">
<target name="init">
<!-- copied from cldr/tools/java's build.xml -->
<tstamp/>
<property name="src.dir" value="src"/>
<property name="build.dir" value="build/classes"/>
<property name="jar.file" value="UnicodeJsps.jar"/>
<property name="jarSrc.file" value="cldr-apps-src.jar"/>
<property name="jarDocs.file" value="cldr-apps-docs.jar"/>
<property name="doc.dir" value="doc"/>
<property name="doc.params" value=""/>
<!-- Load local definitions from an optional build.properties file, if available.
build.properties is NOT checked into CVS. -->
<property file="build.properties" />
<!-- Load environment variables -->
<!--
<property environment="env"/>
-->
<!-- CLDR_TOOLS defaults to ../java, override if not correct. -->
<!-- <property name="CLDR_TOOLS" value="../java"/> -->
<property name="CLDR_JAR" value="WebContent/WEB-INF/lib/cldr.jar"/>
<property name="GUAVA_JAR" value="WebContent/WEB-INF/lib/guava.jar"/>
<property name="ICU4J_JAR" value="WebContent/WEB-INF/lib/icu4j.jar"/>
<property name="UTILITIES_JAR" value="WebContent/WEB-INF/lib/utilities.jar"/>
<path id="build.classpath">
<pathelement path="${build.dir}"/>
</path>
<condition property="is.icu4j.classes.set" >
<or>
<isset property="ICU4J_JAR" />
</or>
</condition>
<fail unless="is.icu4j.classes.set" message="Please set the ICU4J_JAR property in build.properties."/>
<condition property="is.utilities.classes.set" >
<or>
<isset property="UTILITIES_JAR" />
</or>
</condition>
<fail unless="is.utilities.classes.set" message="Please set the UTILITIES_JAR property in build.properties."/>
<mkdir dir="${build.dir}"/>
<path id="project.class.path">
<pathelement path="${java.class.path}/"/>
<pathelement path="${build.dir}"/>
<pathelement path="${CLDR_CLASSES}"/>
<pathelement location="${ICU4J_JAR}"/>
<pathelement location="${CLDR_JAR}"/>
<pathelement location="${GUAVA_JAR}"/>
<pathelement location="${UTILITIES_JAR}"/>
<pathelement location="${XML_APIS_JAR}"/>
<pathelement location="${DERBY_LIB}"/>
<pathelement location="${JDOM_LIB}"/>
<pathelement location="${SERVLET_JAR}"/>
<pathelement location="${MAIL_LIB}"/>
<pathelement location="${ROME_LIB}"/>
</path>
<!-- from webinit: -->
<property name="tomcat.home" value="${CATALINA_HOME}"/>
<condition property="is.tomcat.home.set" >
<isset property="tomcat.home" />
</condition>
<fail unless="is.tomcat.home.set" message="Please set the CATALINA_HOME property in build.properties to point at your Tomcat installation."/>
<!-- <property name="icu.home" value="${env.ICU4J_HOME}"/> -->
<property name="SERVLET_JAR" value="${tomcat.home}/lib/servlet-api.jar"/>
<property name="wardata" value="${src.dir}/org/unicode/cldr/web/data"/>
<path id="catalina-ant.classpath">
<fileset dir="${tomcat.home}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/bin">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- Configure the custom Ant tasks for the Manager application -->
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"><classpath refid="catalina-ant.classpath" /></taskdef>
<!-- <taskdef name="list" classname="org.apache.catalina.ant.ListTask"><classpath refid="catalina-ant.classpath" /></taskdef> -->
<!-- <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"><classpath refid="catalina-ant.classpath" /></taskdef> -->
<!-- <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"><classpath refid="catalina-ant.classpath" /></taskdef> -->
<!-- <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"><classpath refid="catalina-ant.classpath" /></taskdef> -->
<!-- <taskdef name="start" classname="org.apache.catalina.ant.StartTask"><classpath refid="catalina-ant.classpath" /></taskdef> -->
<!-- <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"><classpath refid="catalina-ant.classpath" /></taskdef> -->
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"><classpath refid="catalina-ant.classpath" /></taskdef>
<!-- Configure the context path for this application -->
<property name="path" value="/UnicodeJsps"/>
<!-- Configure properties to access the Manager application -->
<property name="hostport" value="http://localhost:8080"/>
<!-- Configure properties to access the Manager application -->
<property name="managerpath" value="/manager/text" />
<property name="url" value="${hostport}${managerpath}"/>
<property name="appurl" value="${hostport}${path}"/>
<property name="username" value="admin"/>
<!-- call ant with: -Dpassword=<adminpass> -->
<property name="warfile" location="UnicodeJsps.war"/>
<property name="WebContent" location="./WebContent"/>
<property name="WEB-INF" location="${WebContent}/WEB-INF"/>
<property name="webxml" location="${WEB-INF}/web.xml"/>
<!--
TODO: do the following for the other env variables above..
<condition property="is.icu4j.classes.set" >
<isset property="env.ICU4J_CLASSES" />
</condition >
<fail unless="is.icu4j.classes.set" message="Please set the ICU4J_CLASSES environment variable."/>
-->
<echo message="Java: ${java.version}. [For verbose list of properties, use the 'properties' target.]"/>
</target>
<target name="properties" description="dump out properties">
<echo message="java home: ${java.home}"/>
<echo message="java version: ${java.version} ant java version: ${ant.java.version}"/>
<echo message="java.class.path: ${java.class.path}/"/>
<echo message="project.class.path: ${project.class.path}"/>
<echo message="build.dir: ${build.dir}"/>
<echo message="${ant.version}"/>
<echo/>
<echo message="ICU properties:"/>
<echo message="env.ICU4J_CLASSES: ${env.ICU4J_CLASSES}"/>
<echo message="env.CLDR_CLASSES: ${env.CLDR_CLASSES}"/>
<echo message="env.ICU4J_JAR: ${env.ICU4J_JAR}"/>
<echo/>
<echo message="Properties from build.properties (see build-sample.properties)"/>
<echo message="CLDR_TOOLS: ${CLDR_TOOLS} ( usually just ../java )"/>
<echo message="JDOM_LIB: ${JDOM_LIB}"/>
<echo message="DERBY_LIB: ${DERBY_LIB}"/>
<echo message="DERBYTOOLS_LIB: ${DERBYTOOLS_LIB}"/>
<echo message="ROME_LIB: ${ROME_LIB}"/>
<echo message="MAIL_LIB: ${MAIL_LIB}"/>
<echo message="servlet.jar: ${servlet.jar}"/>
<echo/>
<echo message="Derived properties"/>
<echo message="CLDR_JAR: ${CLDR_JAR}"/>
<echo message="GUAVA_JAR: ${GUAVA_JAR}"/>
<echo message="CLDR_CLASSES: ${CLDR_CLASSES}"/>
<echo message="env.UTILITIES_JAR: ${env.UTILITIES_JAR}"/>
<echo message="env.XML_APIS_JAR: ${env.XML_APIS_JAR}"/>
</target>
<target name="clean" depends="init" description="remove all build targets">
<delete dir="${build.dir}"/>
<delete file="${jar.file}"/>
<delete file="${warfile}"/>
<delete file="${jarSrc.file}"/>
<delete file="${jarDocs.file}"/>
<delete dir="${doc.dir}"/>
</target>
<target name="jar" depends="web" description="build full 'cldr.jar' jar file">
<jar jarfile="${jar.file}"
compress="true"
includes="org/unicode/cldr/util/**/*,org/unicode/cldr/tool/**/*,org/unicode/cldr/test/**/*,org/unicode/cldr/posix/**/*,org/unicode/cldr/ooo/**/*,org/unicode/cldr/ant/**/*,org/unicode/cldr/icu/**/*"
basedir="${build.dir}"/>
</target>
<!-- Docs stuff -->
<!-- use excludefiles below when we move to ant 1.5 -->
<target name="docs-jar" depends="docs">
<jar jarfile="${jarDocs.file}"
compress="true"
includes="**/*"
basedir="${doc.dir}"/>
</target>
<target name="docs" depends="init" description="build user javadoc">
<tstamp>
<format property="current.year" pattern="yyyy"/>
</tstamp>
<echo message="doc params: ${doc.params}"/>
<mkdir dir="${doc.dir}"/>
<javadoc
packagenames="org.unicode.cldr.*"
sourcepath="${src.dir}"
destdir="${doc.dir}"
classpathref="project.class.path"
nodeprecatedlist="true"
windowtitle="CLDR | Java Tools"
doctitle="CLDR | Java Tools"
encoding="utf-8"
docencoding="utf-8"
additionalparam="${doc.params}"
link="http://java.sun.com/j2se/1.5/docs/api"
bottom="&lt;font size=-1>&lt;a target='_top' href='http://www.unicode.org/copyright.html'>Copyright &amp;copy; 2004-${current.year} Unicode, Inc. All Rights Reserved.&lt;/a>&lt;/font>"
source="1.6" />
</target>
<!-- bottom="&lt;font size=-1>Copyright (c) ${current.year} IBM Corporation and others.&lt;/font>" -->
<!-- SurveyTool (web) stuff follows ................. -->
<!-- build all web related things -->
<!--
// includes="${src.dir}/**/*.java"
excludes="**/.svn/**/*"
-->
<target name="web" depends="all" description="alias for old 'web' target"/>
<target name="all" depends="init" description="build web classes">
<javac
includeantruntime="false"
srcdir="${src.dir}"
destdir="${build.dir}"
classpathref="project.class.path"
source="1.6"
target="1.6"
debug="on" deprecation="off"
encoding="UTF-8"/>
<copy todir="${build.dir}/org/unicode/jsp/">
<fileset dir="${src.dir}/org/unicode/jsp" >
<exclude name="**/.svn/**" />
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<!-- build as a WAR file -->
<!-- TODO: include CLDR as a jar? Only include certain classes? -->
<target name="war" depends="web" description="Build war">
<war destfile="${warfile}" webxml="${webxml}">
<!-- classes (for now, may want to take cldr utils as a jar later) -->
<classes dir="${build.dir}" />
<!-- all other files in /root -->
<zipfileset dir="${WebContent}" excludes="**/.svn/**/*"/>
<!-- certain jars that we want -->
<!-- <lib file="${UTILITIES_JAR}"/> --> <!-- CLDR utilities -->
<!-- <lib file="${ICU4J_JAR}"/> --> <!-- CLDR jar -->
<lib file="${CLDR_JAR}"/> <!-- CLDR jar -->
<lib file="${GUAVA_JAR}"/> <!-- CLDR jar -->
<!-- May want this later. -->
<!-- <pathelement path="${jsp.jar}"/> -->
</war>
</target>
<!-- deploy to the server -->
<target name="deploy" depends="init,war">
<deploy url="${url}" username="${username}" password="${password}"
path="${path}" war="${warfile}"/>
</target>
<!-- reload on the server - doesn't require building -->
<target name="reload" description="Reload SurveyTool application"
depends="init">
<reload url="${url}" username="${username}" password="${password}"
path="${path}"/>
</target>
<!-- un-deploy from the server -->
<target name="undeploy" description="Remove SurveyTool application" depends="init">
<undeploy url="${url}" username="${username}" password="${password}"
path="${path}"/>
</target>
<!-- redeploy to the server. Builds first so we catch trouble early.
Note, this will fail if you haven't deployed the first time. -->
<target name="redeploy" description="Redeploy SurveyTool application"
depends="init,war,undeploy,deploy">
</target>
<!-- must use this to initialize the derby DB. -->
<target name="create-derby-db" description="Create empty Derby DB"
depends="init">
<java classname="org.apache.derby.tools.ij" inputstring="exit;">
<sysproperty key="derby.system.home" value="${tomcat.home}"/>
<sysproperty key="ij.database" value="jdbc:derby:cldr/cldrdb;create=true"/>
<classpath>
<pathelement location="${DERBY_LIB}"/>
<pathelement location="${DERBYTOOLS_LIB}"/>
</classpath>
</java>
</target>
</project>