2 *******************************************************************************
3 * Copyright (C) 2009-2013, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
7 <project name="common-targets" basedir=".">
8 <dirname property="common-targets.dir" file="${ant.file.common-targets}"/>
9 <property file="${common-targets.dir}/locations.properties"/>
10 <property file="${common-targets.dir}/common.properties"/>
11 <property environment="env"/>
13 <!-- common targets -->
15 <target name="@clean">
16 <delete dir="${out.dir}"/>
19 <target name="@compile">
20 <echo message="--- java compiler arguments ------------------------"/>
21 <echo message="source dir: ${basedir}/${src.dir}"/>
22 <echo message="output dir: ${basedir}/${bin.dir}"/>
23 <echo message="classpath: ${toString:javac.classpathref}"/>
24 <echo message="source: ${javac.source}"/>
25 <echo message="target: ${javac.target}"/>
26 <echo message="debug: ${javac.debug}"/>
27 <echo message="encoding: ${java.src.encoding}"/>
28 <echo message="compiler arg: ${javac.compilerarg}"/>
29 <echo message="----------------------------------------------------"/>
31 <mkdir dir="${bin.dir}"/>
35 classpathref="javac.classpathref"
36 source="${javac.source}"
37 target="${javac.target}"
38 debug="${javac.debug}"
39 encoding="${java.src.encoding}"
40 includeAntRuntime="no">
41 <compilerarg value="${javac.compilerarg}"/>
46 <mkdir dir="${bin.dir}"/>
47 <copy todir="${bin.dir}">
48 <fileset dir="${src.dir}" defaultexcludes="yes">
49 <exclude name="**/*.java"/>
55 <mkdir dir="${jar.dir}"/>
57 <copy file="manifest.stub" todir="${out.dir}">
59 <filter token="SPECVERSION" value="${jar.spec.version}"/>
60 <filter token="IMPLVERSION" value="${jar.impl.version}"/>
61 <filter token="COPYRIGHT" value="${jar.copyright.info}"/>
62 <filter token="EXECENV" value="${jar.exec.env}"/>
66 <jar jarfile="${jar.dir}/${jar.name}" manifest="${out.dir}/manifest.stub" compress="true">
67 <fileset dir="${bin.dir}" includes="**/*"/>
68 <fileset dir="${shared.dir}/licenses">
69 <include name="license.html"/>
74 <target name="@src-jar">
75 <mkdir dir="${jar.dir}"/>
76 <jar jarfile="${jar.dir}/${src.jar.name}" compress="true">
77 <fileset dir="${src.dir}" includes="**/*.java"/>
78 <fileset dir="${shared.dir}/licenses">
79 <include name="license.html"/>
84 <target name="@build-all">
85 <antcall target="_all.${ant.project.name}"/>
88 <target name="@full-locale-names">
89 <echo message="Generating ${res.dir}/fullLocaleNames.lst"/>
90 <pathconvert pathsep="${line.separator}" property="full.locale.names">
91 <fileset dir="${res.dir}">
92 <include name="??.res"/>
93 <include name="??_*.res"/>
94 <include name="???.res"/>
95 <include name="???_*.res"/>
96 <include name="root.res"/>
97 <exclude name="res_index.res"/>
101 <globmapper from="*.res" to="*"/>
104 <echo message="${full.locale.names}" file="${res.dir}/fullLocaleNames.lst"/>
107 <!-- FindBugs targets -->
108 <target name="_findbugs_init">
109 <property name="findbugs.home" value="${env.FINDBUGS_HOME}"/>
110 <echo message="----------------------------------------------------"/>
111 <echo message="findbugs.home: ${findbugs.home}"/>
112 <echo message="----------------------------------------------------"/>
114 <fail message="FindBugs task not found. Set environment variable FINDBUGS_HOME properly.">
118 <available classname="edu.umd.cs.findbugs.anttask.FindBugsTask" property="_findbugs.task.available" />
119 <available file="${findbugs.home}/lib/findbugs-ant.jar" />
124 <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
125 classpath="${findbugs.home}/lib/findbugs-ant.jar"/>
127 <property name="aux.classpath" value="${toString:javac.classpathref}"/>
128 <condition property="empty.aux.classpath">
129 <length string="${aux.classpath}" when="eq" length="0"/>
133 <target name="_findbugs_empty_aux_classpath" if="empty.aux.classpath">
135 home="${findbugs.home}"
137 outputFile="${out.dir}/fb-${ant.project.name}.html"
138 excludeFilter="findbugs-exclude.xml">
140 <sourcePath path="${src.dir}"/>
141 <class location="${jar.dir}/${jar.name}"/>
145 <target name="_findbugs_non_empty_aux_classpath" unless="empty.aux.classpath">
147 home="${findbugs.home}"
149 outputFile="${out.dir}/fb-${ant.project.name}.html"
150 excludeFilter="findbugs-exclude.xml">
152 <sourcePath path="${src.dir}"/>
153 <class location="${jar.dir}/${jar.name}"/>
154 <auxClasspath path="${aux.classpath}"/>
158 <target name="@findbugs" depends="_findbugs_init, @build-all, _findbugs_empty_aux_classpath, _findbugs_non_empty_aux_classpath"/>
160 <!-- Dependencies -->
163 <path id="javac.classpathref.collate">
164 <pathelement location="${icu4j.core.jar}"/>
167 <target name="_all.collate" depends="_all.core">
168 <ant dir="${icu4j.collate.dir}" inheritAll="false"/>
172 <path id="javac.classpathref.core"/>
174 <target name="_all.core">
175 <ant dir="${icu4j.core.dir}" inheritAll="false"/>
179 <path id="javac.classpathref.charset">
180 <pathelement location="${icu4j.core.jar}"/>
183 <target name="_all.charset" depends="_all.core">
184 <ant dir="${icu4j.charset.dir}" inheritAll="false"/>
188 <path id="javac.classpathref.currdata">
189 <pathelement location="${icu4j.core.jar}"/>
192 <target name="_all.currdata" depends="_all.core">
193 <ant dir="${icu4j.currdata.dir}" inheritAll="false"/>
197 <path id="javac.classpathref.langdata">
198 <pathelement location="${icu4j.core.jar}"/>
201 <target name="_all.langdata" depends="_all.core">
202 <ant dir="${icu4j.langdata.dir}" inheritAll="false"/>
206 <path id="javac.classpathref.localespi">
207 <pathelement location="${icu4j.core.jar}"/>
208 <pathelement location="${icu4j.collate.jar}"/>
211 <target name="_all.localespi" depends="_all.core, _all.collate">
212 <ant dir="${icu4j.localespi.dir}" inheritAll="false"/>
216 <path id="javac.classpathref.regiondata">
217 <pathelement location="${icu4j.core.jar}"/>
220 <target name="_all.regiondata" depends="_all.core">
221 <ant dir="${icu4j.regiondata.dir}" inheritAll="false"/>
225 <path id="javac.classpathref.translit">
226 <pathelement location="${icu4j.core.jar}"/>
227 <pathelement location="${icu4j.translit.jar}"/>
230 <target name="_all.translit" depends="_all.core">
231 <ant dir="${icu4j.translit.dir}" inheritAll="false"/>
234 <!-- test-framework -->
235 <path id="javac.classpathref.test-framework">
236 <pathelement location="${icu4j.core.jar}"/>
239 <target name="_all.test-framework" depends="_all.core">
240 <ant dir="${icu4j.test-framework.dir}" inheritAll = "false"/>
244 <path id="javac.classpathref.core-tests">
245 <pathelement location="${icu4j.core.jar}"/>
246 <pathelement location="${icu4j.test-framework.jar}"/>
249 <target name="_all.core-tests" depends="_all.core, _all.test-framework">
250 <ant dir="${icu4j.core-tests.dir}" inheritAll="false"/>
253 <!-- collate-tests -->
254 <path id="javac.classpathref.collate-tests">
255 <pathelement location="${icu4j.core.jar}"/>
256 <pathelement location="${icu4j.collate.jar}"/>
257 <pathelement location="${icu4j.test-framework.jar}"/>
260 <target name="_all.collate-tests" depends="_all.core, _all.collate, _all.test-framework">
261 <ant dir="${icu4j.collate-tests.dir}" inheritAll="false"/>
264 <!-- charset-tests -->
265 <path id="javac.classpathref.charset-tests">
266 <pathelement location="${icu4j.core.jar}"/>
267 <pathelement location="${icu4j.charset.jar}"/>
268 <pathelement location="${icu4j.test-framework.jar}"/>
271 <target name="_all.charset-tests" depends="_all.core, _all.charset, _all.test-framework">
272 <ant dir="${icu4j.charset-tests.dir}" inheritAll="false"/>
275 <!-- localespi-tests -->
276 <path id="javac.classpathref.localespi-tests">
277 <pathelement location="${icu4j.core.jar}"/>
278 <pathelement location="${icu4j.collate.jar}"/>
279 <pathelement location="${icu4j.localespi.jar}"/>
280 <pathelement location="${icu4j.test-framework.jar}"/>
283 <target name="_all.localespi-tests" depends="_all.core, _all.collate, _all.localespi, _all.test-framework">
284 <ant dir="${icu4j.localespi-tests.dir}" inheritAll="false"/>
287 <!-- packaging-tests -->
288 <path id="javac.classpathref.packaging-tests">
289 <pathelement location="${icu4j.core.jar}"/>
290 <pathelement location="${icu4j.charset.jar}"/>
291 <pathelement location="${icu4j.test-framework.jar}"/>
294 <target name="_all.packaging-tests" depends="_all.core, _all.charset, _all.test-framework">
295 <ant dir="${icu4j.packaging-tests.dir}" inheritAll="false"/>
298 <!-- translit-tests -->
299 <path id="javac.classpathref.translit-tests">
300 <pathelement location="${icu4j.core.jar}"/>
301 <pathelement location="${icu4j.translit.jar}"/>
302 <pathelement location="${icu4j.test-framework.jar}"/>
305 <target name="_all.translit-tests" depends="_all.core, _all.translit, _all.test-framework">
306 <ant dir="${icu4j.translit-tests.dir}" inheritAll="false"/>
310 <path id="javac.classpathref.build-tools">
311 <pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
314 <target name="_all.build-tools">
315 <ant dir="${icu4j.build-tools.dir}" inheritAll="false"/>
319 <path id="javac.classpathref.tools">
320 <pathelement location="${icu4j.core.jar}"/>
321 <pathelement location="${icu4j.collate.jar}"/>
322 <pathelement location="${icu4j.translit.jar}"/>
323 <pathelement location="${icu4j.test-framework.jar}"/>
324 <pathelement location="${icu4j.core-tests.jar}"/>
325 <pathelement location="${icu4j.translit-tests.jar}"/>
328 <target name="_all.tools" depends="_all.core, _all.collate, _all.translit, _all.test-framework, _all.core-tests, _all.translit-tests">
329 <ant dir="${icu4j.tools.dir}" inheritAll="false"/>
333 <path id="javac.classpathref.demos">
334 <pathelement location="${icu4j.core.jar}"/>
335 <pathelement location="${icu4j.translit.jar}"/>
336 <pathelement location="${icu4j.charset.jar}"/>
339 <target name="_all.demos" depends="_all.core, _all.translit, _all.charset">
340 <ant dir="${icu4j.demos.dir}" inheritAll="false"/>
344 <path id="javac.classpathref.samples">
345 <pathelement location="${icu4j.core.jar}"/>
346 <pathelement location="${icu4j.collate.jar}"/>
347 <pathelement location="${icu4j.translit.jar}"/>
348 <pathelement location="${icu4j.charset.jar}"/>
351 <target name="_all.samples" depends="_all.core, _all.collate, _all.translit, _all.charset">
352 <ant dir="${icu4j.samples.dir}" inheritAll="false"/>
356 <path id="javac.classpathref.perf">
357 <pathelement location="${icu4j.core.jar}"/>
358 <pathelement location="${icu4j.charset.jar}"/>
359 <pathelement location="${icu4j.collate.jar}"/>
360 <pathelement location="${icu4j.tools.jar}"/>