• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!--
2* © 2016 and later: Unicode, Inc. and others.
3* License & terms of use: http://www.unicode.org/copyright.html
4*******************************************************************************
5* Copyright (C) 2012-2013, International Business Machines Corporation and    *
6* others. All Rights Reserved.                                                *
7*******************************************************************************
8-->
9<project name="currency-numeric" default="build" basedir=".">
10    <property name="out.dir" value="${basedir}/out"/>
11    <property name="src.dir" value="${basedir}/src"/>
12    <property name="classes.dir" value="${out.dir}/bin"/>
13    <property name="res.dir" value="${out.dir}/res"/>
14    <property name="xml.dir" value="${out.dir}/xml"/>
15
16    <property name="base.url" value="https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/"/>
17    <property name="current.xml" value="list-one.xml"/>
18    <property name="historic.xml" value="list-three.xml"/>
19
20<target name="build" depends="check, resource" description="Verify ICU's local data and generate ISO 4217 alpha-numeric code mapping data resource"/>
21
22<target name="classes" description="Build the Java tool">
23    <mkdir dir="${classes.dir}"/>
24    <javac srcdir="${src.dir}" destdir="${classes.dir}"
25            target="1.7" encoding="UTF-8" includeAntRuntime="false"/>
26</target>
27
28<target name="_checkLocalXml">
29    <condition property="isLocalXml">
30        <and>
31            <available file="${basedir}/${current.xml}"/>
32            <available file="${basedir}/${historic.xml}"/>
33        </and>
34    </condition>
35</target>
36
37<target name="_localXml" depends="_checkLocalXml" if="isLocalXml">
38    <echo message="Using local ISO 4217 XML data files"/>
39    <copy file="${current.xml}" todir="${xml.dir}"/>
40    <copy file="${historic.xml}" todir="${xml.dir}"/>
41</target>
42
43<target name="_downloadXml" unless="isLocalXml">
44    <echo message="Downloading ISO 4217 XML data files"/>
45    <mkdir dir="${xml.dir}"/>
46    <get src="${base.url}${current.xml}" dest="${xml.dir}"/>
47    <get src="${base.url}${historic.xml}" dest="${xml.dir}"/>
48</target>
49
50<target name="xmlData" depends="_localXml, _downloadXml" description="Prepare necessary ISO 4217 XML data files">
51</target>
52
53<target name="check" depends="classes, xmlData" description="Verify if ICU's local mapping data is synchronized with the XML data">
54    <java classname="com.ibm.icu.dev.tool.currency.Main"
55            classpath="${classes.dir}"
56            failonerror="true">
57        <arg value="check"/>
58        <arg value="${xml.dir}/${current.xml}"/>
59        <arg value="${xml.dir}/${historic.xml}"/>
60    </java>
61</target>
62
63<target name="resource" depends="classes" description="Build ISO 4217 alpha-numeric code mapping data resource">
64    <mkdir dir="${res.dir}"/>
65    <java classname="com.ibm.icu.dev.tool.currency.Main"
66            classpath="${classes.dir}"
67            failonerror="true">
68        <arg value="build"/>
69        <arg value="${res.dir}"/>
70    </java>
71    <echo message="ISO 4217 numeric code mapping data was successfully created in ${res.dir}"/>
72</target>
73
74<target name="clean" description="Delete build outputs">
75    <delete dir="${out.dir}"/>
76</target>
77
78</project>
79