forked from unicode-org/icu-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
183 lines (160 loc) · 7.55 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
*******************************************************************************
* Copyright (C) 2008-2016, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
* This is the ant build file for ICU Meta.
*/
-->
<project name="meta" default="hello" basedir=".">
<target name="init" depends="initBase"/>
<target name="initBase"
description="Initialized meta build environment">
<tstamp />
<property name="project" value="icumeta" />
<property name="src.dir" value="src" />
<property name="dtdcache.dir" location="./dtdcache" />
<property name="dtd.dir" location="./dtd" />
<property name="build.dir" value="classes" />
<property name="doc.dir" value="doc" />
<property name="merger.class" value="com.ibm.icu.dev.meta.Merger" />
<property name="validate.class" value="org.unicode.cldr.util.XMLValidator" />
<property name="xml.dir" value="xml" />
<property name="xml-base.file" value="icumeta.xml" />
<property name="xml.file" value="${xml.dir}/${xml-base.file}" />
<property name="json.file" value="${xml.dir}/icumeta.json" />
<property name="input.dir" value="input" />
<property name="lib.dir" value="lib" />
<property name="jar.file" value="icumeta.jar" />
<property file="build.properties" />
<property name="icumeta.javac.source" value="1.7" />
<property name="icumeta.javac.target" value="1.7" />
<!-- snag all jars in lib/*.jar -->
<fileset id="libjars" dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset id="srcxml" dir="${input.dir}">
<include name="**/*.xml"/>
</fileset>
<path id="build.classpath">
<fileset refid="libjars" />
<pathelement path="${build.dir}" />
</path>
<!-- Load environment variables -->
<property environment="env" />
<!-- Capture the computer name in a cross-platform manner -->
<property name="env.COMPUTERNAME" value="${env.HOSTNAME}" />
<mkdir dir="${build.dir}" />
<mkdir dir="${dtdcache.dir}" />
<echo message="java home: ${java.home}" />
<echo message="java version: ${java.version}" />
<echo message="ant java version: ${ant.java.version}" />
<echo message="${ant.version}" />
<echo message="${env.COMPUTERNAME} with ${os.name} ${os.version} on ${os.arch}" />
<tstamp>
<format property="date.time" pattern="yyyy-MM-dd 'at' hh:mm:ss z" locale="en,US" />
</tstamp>
<echo message="Initialized at ${date.time}" />
</target>
<target name="clean" depends="initBase" description="remove all build targets">
<delete dir="${build.dir}" />
<delete dir="${doc.dir}" />
<delete dir="${dtdcache.dir}" />
<delete file="${jar.file}" />
</target>
<target name="core" depends="init">
<javac sourcepath=""
srcdir="${src.dir}"
destdir="${build.dir}"
classpathref="build.classpath"
source="${icumeta.javac.source}"
target="${icumeta.javac.source}"
debug="on"
deprecation="on"
includeantruntime="false"
encoding="ascii">
<include name="com/ibm/icu/dev/meta/**/*.java" />
</javac>
<copy todir="${build.dir}/com/ibm/icu/dev/meta/">
<fileset dir="${dtd.dir}" includes="icumeta.*" />
</copy>
</target>
<target name="check-xml" depends="init">
<dependset>
<srcfileset refid="srcxml"/>
<targetfilelist dir="${xml.dir}" files="${xml-base.file}"/>
</dependset>
<available file="${xml.file}" property="xml-ok"/>
</target>
<target name="rebuild-xml" depends="init,core" unless="xml-ok">
<echo message="DTD Cache: ${dtdcache.dir}" />
<echo message="DTD Override: ${dtd.dir}" />
<java classname="${merger.class}" classpathref="build.classpath">
<arg value="-v"/>
<arg value="-o:${xml.file}"/>
<arg value="-j:${json.file}"/>
<arg value="${input.dir}/"/> <!-- load all .xml files from there -->
<sysproperty key="CLDR_DTD_CACHE" value="${dtdcache.dir}"/>
<sysproperty key="CLDR_DTD_OVERRIDE" value="${dtd.dir}"/>
<!-- sysproperty key="CLDR_DTD_CACHE_DEBUG" value="y"/>
<sysproperty key="CLDR_DTD_CACHE_ADEBUG" value="y"/>
<sysproperty key="ICU_DTD_CACHE_DEBUG" value="y"/>
<sysproperty key="ICU_DTD_CACHE_ADEBUG" value="y" -->
<sysproperty key="ICU_DTD_CACHE" value="${dtdcache.dir}"/>
<sysproperty key="ICU_DTD_OVERRIDE" value="${dtd.dir}"/>
</java>
</target>
<target name="validate-xml" depends="init">
<java classname="${validate.class}" classpathref="build.classpath">
<arg value="${xml.file}"/>
<sysproperty key="CLDR_DTD_CACHE" value="${dtdcache.dir}"/>
<sysproperty key="CLDR_DTD_OVERRIDE" value="${dtd.dir}"/>
<!-- sysproperty key="CLDR_DTD_CACHE_DEBUG" value="y"/>
<sysproperty key="CLDR_DTD_CACHE_ADEBUG" value="y"/>
<sysproperty key="ICU_DTD_CACHE_DEBUG" value="y"/>
<sysproperty key="ICU_DTD_CACHE_ADEBUG" value="y" -->
<sysproperty key="ICU_DTD_CACHE" value="${dtdcache.dir}"/>
<sysproperty key="ICU_DTD_OVERRIDE" value="${dtd.dir}"/>
</java>
<echo message="(No errors here means ${xml.file} is OK.)"/>
</target>
<target name="xml" depends="init,core,check-xml,rebuild-xml,validate-xml">
</target>
<target name="hello" depends="init">
<echo message="This is ${project}." />
<echo message="Interesting targets:" />
<echo message=" core - build base class(es)"/>
<echo message=" clean - cleanup stuff"/>
<echo message=" xml - regenerate ${xml.file} if needed"/>
<echo message=" rebuild-xml - regenerate ${xml.file} irregardless"/>
<echo message=" (the 'dtd' subdirectory has its own makefile, which see.)"/>
<!-- echo message=" dtd - rebuild dtd (may require download)" / -->
<echo message=""/>
<echo message="Don't forget to put into ${lib.dir} the usual fun jars: cldr.jar icu4j.jar utilities.jar xalan.jar xerces.jar" />
</target>
<target name="jar"
depends="core"
description="build 'icumeta.jar' jar file">
<jar jarfile="${jar.file}" compress="true">
<!-- fileset dir="${basedir}" includes="license.html,unicode-license.txt" -->
<!-- fileset dir="${src.dir}" includes="com/ibm/icu/ICUConfig.properties" -->
<fileset dir="${build.dir}" includes="com/ibm/icu/dev/meta/**/*" excludes="META-INF/services/**/*,com/ibm/icu/charset/**/*,${icu4j.data.path}/*.cnv,${icu4j.data.path}/cnvalias.icu" />
<manifest>
<attribute name="Built-By" value="${corp}" />
<section name="common">
<attribute name="Specification-Title" value="${manifest.specification.title}" />
<attribute name="Specification-Version" value="${icu4j.spec.version.string}" />
<attribute name="Specification-Vendor" value="ICU" />
<attribute name="Implementation-Title" value=" ICU Metadata Processing" />
<attribute name="Implementation-Version" value="?" />
<attribute name="Implementation-Vendor" value="${corp}" />
<attribute name="Implementation-Vendor-Id" value="com.ibm.icu" />
<attribute name="Copyright-Info" value="${copyright}" />
<attribute name="Sealed" value="false" />
</section>
</manifest>
</jar>
</target>
</project>