forked from Esri/arcgis-viewer-flex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
259 lines (242 loc) · 10.7 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<?xml version="1.0" encoding="UTF-8"?>
<!--
///////////////////////////////////////////////////////////////////////////
// Copyright (c) 2008-2013 Esri. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
-->
<project name="ArcGIS Viewer for Flex" default="main" basedir=".">
<property file="env.properties"/>
<property environment="env"/>
<property file="local.properties"/>
<property file="build.properties"/>
<target name="main"
depends="clean,run-flash-builder,check-fb-result"
description="Runs Flash Builder"/>
<target name="full-build"
depends="clean,backup-actionScriptProperties,update-actionScriptProperties,run-flash-builder,restore-actionScriptProperties,check-fb-result,build-all-resoure-modules,update-index.html,copy-index.html,copy-version.xml"
description="Runs a full build"/>
<target name="clean" description="Deletes dist directory">
<delete dir="${dist.dir}"/>
</target>
<target name="backup-actionScriptProperties"
depends="check-backup-exists"
unless="backup.exists">
<copy file=".actionScriptProperties" tofile=".actionScriptProperties.bak"/>
</target>
<target name="check-backup-exists">
<available property="backup.exists" file=".actionScriptProperties.bak"/>
</target>
<target name="restore-actionScriptProperties">
<move file=".actionScriptProperties.bak" tofile=".actionScriptProperties"/>
</target>
<target name="update-actionScriptProperties">
<replace file=".actionScriptProperties"
token="-locale=${fb.locale}"
value="-locale= -resource-bundle-list=bundle-list.txt"/>
</target>
<target name="run-flash-builder" description="Compile a release build using Flash Builder">
<!-- mac -->
<exec executable="${basedir}/fbbuild.sh"
osfamily="mac"
resultproperty="fb.result">
<env key="FB_PATH" value="${fb.path}"/>
<env key="WORKSPACE" value="${fb.workspace.path}"/>
</exec>
<!-- windows -->
<exec executable="cmd"
osfamily="windows"
resultproperty="fb.result">
<arg value="/c"/>
<arg value="fbbuild.bat"/>
<env key="FB_PATH" value="${fb.path}"/>
<env key="WORKSPACE" value="${fb.workspace.path}"/>
</exec>
</target>
<target name="check-fb-result">
<fail message="Flash Builder failed">
<condition>
<isfailure code="${fb.result}"/>
</condition>
</fail>
</target>
<target name="build-all-resoure-modules" depends="get-bundles">
<antcall target="build-resoure-module">
<param name="LOCALE" value="ar"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="da_DK"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="de_DE"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="en_US"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="es_ES"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="et_EE"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="fr_FR"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="he_IL"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="it_IT"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="ja_JP"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="ko_KR"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="lt_LT"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="lv_LV"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="nb_NO"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="nl_NL"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="pl_PL"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="pt_BR"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="pt_PT"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="ro_RO"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="ru_RU"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="sv_SE"/>
</antcall>
<antcall target="build-resoure-module">
<param name="LOCALE" value="zh_CN"/>
</antcall>
</target>
<target name="build-resoure-module">
<java jar="${env.FLEX_HOME}/lib/mxmlc.jar"
failonerror="true"
maxmemory="1024m"
fork="true">
<jvmarg value="-Dsun.io.useCanonCaches=false"/>
<arg line="+flexlib='${env.FLEX_HOME}/frameworks'"/>
<arg line="-headless-server"/>
<arg line="-locale=${LOCALE}"/>
<arg line="-include-resource-bundles=${BUNDLES}"/>
<arg line="-source-path=locale/{locale}"/>
<arg line="-library-path+=libs"/>
<arg line="-output=${dist.dir}/assets/locale/${LOCALE}.swf"/>
</java>
</target>
<target name="get-bundles">
<loadfile property="bundleList" srcFile="${fb.debug.dir}/bundle-list.txt"/>
<script language="javascript">
<![CDATA[
if (bundleList.indexOf(" ViewerStrings ") == -1)
{
// add missing ViewerStrings
bundleList += "ViewerStrings ";
}
// change from: bundles = ESRIMessages SharedResources ViewerStrings ...
// to ESRIMessages,SharedResources,ViewerStrings,...
var bundles = bundleList.substring(10); // remove "bundles = "
bundles = bundles.split(" ") // create Array
bundles = bundles.join(); // create CSV
var property = project.createTask("property");
property.setName("BUNDLES");
property.setValue(bundles);
property.perform();
]]>
</script>
</target>
<target name="update-index.html">
<replace file="${dist.dir}/index.html" token="var flashvars = {};">
<replacevalue expandProperties="true"><![CDATA[var flashvars = {};
flashvars.localeChain = "${fb.locale}";
flashvars.resourceModuleURLs = "assets/locale/${fb.locale}.swf";
//flashvars.localeChain = "ar";
//flashvars.resourceModuleURLs = "assets/locale/ar.swf";
//flashvars.localeChain = "da_DK";
//flashvars.resourceModuleURLs = "assets/locale/da_DK.swf";
//flashvars.localeChain = "de_DE";
//flashvars.resourceModuleURLs = "assets/locale/de_DE.swf";
//flashvars.localeChain = "es_ES";
//flashvars.resourceModuleURLs = "assets/locale/es_ES.swf";
//flashvars.localeChain = "et_EE";
//flashvars.resourceModuleURLs = "assets/locale/et_EE.swf";
//flashvars.localeChain = "fr_FR";
//flashvars.resourceModuleURLs = "assets/locale/fr_FR.swf";
//flashvars.localeChain = "he_IL";
//flashvars.resourceModuleURLs = "assets/locale/he_IL.swf";
//flashvars.localeChain = "it_IT";
//flashvars.resourceModuleURLs = "assets/locale/it_IT.swf";
//flashvars.localeChain = "ja_JP";
//flashvars.resourceModuleURLs = "assets/locale/ja_JP.swf";
//flashvars.localeChain = "ko_KR";
//flashvars.resourceModuleURLs = "assets/locale/ko_KR.swf";
//flashvars.localeChain = "lt_LT";
//flashvars.resourceModuleURLs = "assets/locale/lt_LT.swf";
//flashvars.localeChain = "lv_LV";
//flashvars.resourceModuleURLs = "assets/locale/lv_LV.swf";
//flashvars.localeChain = "nb_NO";
//flashvars.resourceModuleURLs = "assets/locale/nb_NO.swf";
//flashvars.localeChain = "nl_NL";
//flashvars.resourceModuleURLs = "assets/locale/nl_NL.swf";
//flashvars.localeChain = "pl_PL";
//flashvars.resourceModuleURLs = "assets/locale/pl_PL.swf";
//flashvars.localeChain = "pt_BR";
//flashvars.resourceModuleURLs = "assets/locale/pt_BR.swf";
//flashvars.localeChain = "pt_PT";
//flashvars.resourceModuleURLs = "assets/locale/pt_PT.swf";
//flashvars.localeChain = "ro_RO";
//flashvars.resourceModuleURLs = "assets/locale/ro_RO.swf";
//flashvars.localeChain = "ru_RU";
//flashvars.resourceModuleURLs = "assets/locale/ru_RU.swf";
//flashvars.localeChain = "sv_SE";
//flashvars.resourceModuleURLs = "assets/locale/sv_SE.swf";
//flashvars.localeChain = "zh_CN";
//flashvars.resourceModuleURLs = "assets/locale/zh_CN.swf";]]></replacevalue>
</replace>
</target>
<target name="copy-index.html">
<copy file="${dist.dir}/index.html" tofile="${dist.dir}/default.htm"/>
</target>
<target name="copy-version.xml">
<tstamp>
<format property="today" pattern="yyyy-MM-dd"/>
</tstamp>
<copy file="src/version.xml"
todir="${dist.dir}"
overwrite="true">
<filterset>
<filter token="BUILD_DATE" value="${today}"/>
</filterset>
</copy>
</target>
</project>