blob: 2c95558d501114fa50ba42ac9bae5db973a81c3d [file] [log] [blame]
<project name="cldr-import" default="build" basedir=".">
<property name="gwt.root" location="../.." />
<property name="project.tail" value="tools/cldr-import" />
<import file="${gwt.root}/common.ant.xml" />
<property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev.jar" />
<property.ensure name="gwt.user.jar" location="${gwt.build.lib}/gwt-user.jar" />
<property.ensure name="gwt.servlet.jar" location="${gwt.build.lib}/gwt-servlet.jar" />
<condition property="CLDR_TOOLS" value="${env.CLDR_ROOT}/tools/java"
else="${gwt.tools}/lib/cldr/25">
<isset property="env.CLDR_ROOT" />
</condition>
<condition property="ICU" value="${env.CLDR_ROOT}/tools/java/libs"
else="${gwt.tools}/lib/cldr/25">
<isset property="env.CLDR_ROOT" />
</condition>
<property.ensure name="ICU_CORE_PATH" location="${ICU}/icu4j.jar" />
<condition property="cldr.root" value="${env.CLDR_ROOT}"
else="${gwt.root}/../CLDR">
<isset property="env.CLDR_ROOT" />
</condition>
<condition property="cldr.locales" value="--restrictLocales ${env.LOCALES}"
else="">
<isset property="env.LOCALES" />
</condition>
<condition property="tmpdir" value="${env.CLDR_TEMP}"
else="/tmp/cldr-import">
<isset property="env.CLDR_TEMP" />
</condition>
<path id="project.class.path">
<pathelement location="${CLDR_TOOLS}/cldr.jar"/>
<pathelement location="${ICU}/icu4j.jar"/>
<pathelement location="${ICU}/utilities.jar"/>
<pathelement location="${gwt.user.jar}"/>
<pathelement location="${gwt.dev.jar}"/>
</path>
<target name="compile" description="Compile java source">
<mkdir dir="${javac.out}" />
<gwt.javac>
<classpath refid="project.class.path"/>
</gwt.javac>
<copy todir="${javac.out}">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
<target name="compile.tests" description="Compile java source">
<mkdir dir="${javac.junit.out}" />
<gwt.javac srcdir="test" destdir="${javac.junit.out}">
<classpath>
<pathelement location="${javac.out}"/>
<path refid="project.class.path"/>
<pathelement location="${gwt.tools.lib}/junit/junit-4.8.2.jar" />
</classpath>
</gwt.javac>
<copy todir="${javac.junit.out}">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
<target name="build" depends="compile" description="Build this project" />
<target name="clean" description="Cleans this project">
<delete dir="${javac.out}" failonerror="false" />
<delete dir="${javac.junit.out}" failonerror="false" />
</target>
<target name="checkstyle" description="Static analysis of source">
<gwt.checkstyle>
<fileset dir="src"/>
</gwt.checkstyle>
</target>
<target name="test" depends="build, compile.tests" description="Run tests">
<mkdir dir="${junit.out}/tools-cldr-import" />
<fileset id="tests" dir="${javac.junit.out}"
includes="**/*Test.class" />
<gwt.junit test.name="test"
test.args=""
test.jvmargs="-ea"
test.out="${junit.out}/tools-cldr-import"
test.cases="tests">
<extraclasspaths>
<pathelement location="${gwt.dev.jar}" />
<pathelement location="${gwt.user.jar}" />
</extraclasspaths>
</gwt.junit>
</target>
<target name="cldrdata" description="Verifies CLDR data is present">
<property.ensure name="cldr.data" location="${cldr.root}/common/main"
message="common/main missing under ${cldr.root} (set using CLDR_ROOT)" />
</target>
<target name="cldrjar" description="Verifies CLDR has been compiled">
<property.ensure name="cldr.jar" location="${CLDR_TOOLS}/cldr.jar"
message="${CLDR_TOOLS}/cldr.jar missing (maybe you should run 'ant jar' on ${CLDR_TOOLS})" />
</target>
<target name="gen.temp" depends="cldrjar, cldrdata, clean, build"
description="Generate GWT classes/property files in a temporary directory">
<delete dir="${tmpdir}" quiet="true"/>
<mkdir dir="${tmpdir}"/>
<java classname="com.google.gwt.tools.cldr.GenerateGwtCldrData"
fork="true" maxmemory="2048m" failonerror="true">
<arg line="--sourcedir ${cldr.data} --outdir ${tmpdir} ${cldr.locales}"/>
<sysproperty key="CLDR_DIR" value="${cldr.root}"/>
<classpath>
<pathelement location="${javac.out}"/>
<path refid="project.class.path"/>
</classpath>
</java>
</target>
<target name="gen" depends="cldrjar, cldrdata, clean, build"
description="Generate GWT classes/property files">
<java classname="com.google.gwt.tools.cldr.GenerateGwtCldrData"
fork="true" maxmemory="2048m" failonerror="true">
<arg line="--sourcedir ${cldr.data} --outdir ${gwt.root} ${cldr.locales}"/>
<sysproperty key="CLDR_DIR" value="${cldr.root}"/>
<classpath>
<pathelement location="${javac.out}"/>
<path refid="project.class.path"/>
</classpath>
</java>
</target>
</project>