blob: de9e93e0a92e5bf422f66d8d683c2b8d56143b2e [file] [log] [blame]
<!--
* © 2016 and later: Unicode, Inc. and others.
* License & terms of use: http://www.unicode.org/copyright.html
*******************************************************************************
* Copyright (C) 2012-2013, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
-->
<project name="currency-numeric" default="build" basedir=".">
<property name="out.dir" value="${basedir}/out"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="classes.dir" value="${out.dir}/bin"/>
<property name="res.dir" value="${out.dir}/res"/>
<property name="xml.dir" value="${out.dir}/xml"/>
<property name="base.url" value="https://www.currency-iso.org/dam/downloads/lists/"/>
<property name="current.xml" value="list_one.xml"/>
<property name="historic.xml" value="list_three.xml"/>
<target name="build" depends="check, resource" description="Verify ICU's local data and generate ISO 4217 alpha-numeric code mapping data resource"/>
<target name="classes" description="Build the Java tool">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}"
target="1.7" encoding="UTF-8" includeAntRuntime="false"/>
</target>
<target name="_checkLocalXml">
<condition property="isLocalXml">
<and>
<available file="${basedir}/${current.xml}"/>
<available file="${basedir}/${historic.xml}"/>
</and>
</condition>
</target>
<target name="_localXml" depends="_checkLocalXml" if="isLocalXml">
<echo message="Using local ISO 4217 XML data files"/>
<copy file="${current.xml}" todir="${xml.dir}"/>
<copy file="${historic.xml}" todir="${xml.dir}"/>
</target>
<target name="_downloadXml" unless="isLocalXml">
<echo message="Downloading ISO 4217 XML data files"/>
<mkdir dir="${xml.dir}"/>
<get src="${base.url}${current.xml}" dest="${xml.dir}"/>
<get src="${base.url}${historic.xml}" dest="${xml.dir}"/>
</target>
<target name="xmlData" depends="_localXml, _downloadXml" description="Prepare necessary ISO 4217 XML data files">
</target>
<target name="check" depends="classes, xmlData" description="Verify if ICU's local mapping data is synchronized with the XML data">
<java classname="com.ibm.icu.dev.tool.currency.Main"
classpath="${classes.dir}"
failonerror="true">
<arg value="check"/>
<arg value="${xml.dir}/${current.xml}"/>
<arg value="${xml.dir}/${historic.xml}"/>
</java>
</target>
<target name="resource" depends="classes" description="Build ISO 4217 alpha-numeric code mapping data resource">
<mkdir dir="${res.dir}"/>
<java classname="com.ibm.icu.dev.tool.currency.Main"
classpath="${classes.dir}"
failonerror="true">
<arg value="build"/>
<arg value="${res.dir}"/>
</java>
<echo message="ISO 4217 numeric code mapping data was successfully created in ${res.dir}"/>
</target>
<target name="clean" description="Delete build outputs">
<delete dir="${out.dir}"/>
</target>
</project>