-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathbuild.xml
285 lines (263 loc) · 12 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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<?xml version="1.0" encoding="utf-8"?>
<!-- This is the build script to build all the projects and their dependencies. To use these scripts, you must
first do the following
1) Setup FLEX_HOME as an operating system environment variable pointing to where you installed your Flex 3.6A SDK.
This Flex 3.6A SDK must be downloaded directly from Adobe-do not attempt to merge the SDK provided in FlashBuilder.
e.g.) C:\Flex 3.6A SDK
2) Add the Flex 3.6A SDK's bin folder to your operating system's PATH variable.
3) Add ANT's bin folder to your operating system's PATH variable.
e.g.) C:\ant\bin
Change FRAMEWORK_SWF property below to be the filename of the framework_*.swf file.
For example, if yours is
${FLEX_HOME}/frameworks/rsls/framework_3.6.0.21751.swf
then the FRAMEWORK_SWF would be framework_3.6.0.21751.swf
5) Restart Eclipse to let it register the updated PATH.
6) Change WEAVE_DOCROOT property located in this file. It should be the same as the WEAVE_DOCROOT
defined in your linked resources variable if you are using Eclipse.
7) From command prompt, change into the WeaveClient directory and perform this command
ant -f buildall.xml install
This will build all the files in order and push the necessary ones to WEAVE_DOCROOT.
-->
<project name="Weave" basedir="." default="build">
<property environment="env"/>
<property file="user.properties"/>
<property file="build.properties"/>
<target name="dist" depends="build">
<zip destfile="weave.zip">
<zipfileset dir="${WEAVE_DESTROOT}" prefix="ROOT" excludes="${DESKTOP}.swf ${DESKTOP}.air *.png defaults.xml"/>
<zipfileset file="${basedir}/WeaveServices.war"/>
</zip>
</target>
<target name="air" depends="build, desktop">
<copy todir="${WEAVE_DESTROOT}">
<fileset dir="${DESKTOP}/src/">
<include name="*.png"/>
</fileset>
<fileset dir="${CLIENT}/configurations">
<include name="defaults.xml"/>
</fileset>
</copy>
<path id="FILE-LIST">
<fileset dir="${WEAVE_DESTROOT}">
<include name="*" />
<exclude name="${CLIENT}.swf"/>
<exclude name="${DESKTOP}.air"/>
</fileset>
</path>
<pathconvert pathsep=" " property="FILE-LIST.csv"
refid="FILE-LIST"/>
<java
jar ="${ADT_JAR}"
fork = "true"
dir ="${WEAVE_DESTROOT}"
failonerror="true">
<arg value="-package"/>
<arg value="-storetype"/>
<arg value="pkcs12"/>
<arg value="-keystore"/>
<arg value="${AIR_CERT}"/>
<arg value="-storepass"/>
<arg value="${AIR_CERT_PASS}"/>
<arg value="${DESKTOP}"/>
<arg value="${basedir}/${DESKTOP}/src/WeaveDesktop-app.xml"/>
<arg line="${FILE-LIST.csv}"/>
<!-- <arg value="icons/*.png"/> -->
</java>
</target>
<target name="install" depends="build">
<!-- This target will install the files to WEAVE_DOCROOT. -->
<copy todir="${WEAVE_DOCROOT}">
<fileset dir="${WEAVE_DESTROOT}">
<include name="*.swf"/>
<include name="*.html"/>
<include name="*.js"/>
<include name="*.css"/>
<exclude name="${DESKTOP}.swf"/>
<exclude name="${DESKTOP}.air"/>
<exclude name="*.png"/>
<exclude name="defaults.xml"/>
</fileset>
</copy>
<copy todir="${WEAVE_DOCROOT}/../">
<fileset dir="${basedir}">
<include name="WeaveServices.war"/>
</fileset>
</copy>
</target>
<!-- This target will extract the swf files from the swc archives
and extract them to the WEAVE_DESTROOT -->
<target name="build" depends="client, admin, uispark, ui, data, core, api, services, exampleplugin">
<mkdir dir="${WEAVE_DESTROOT}"/>
<build-html-wrapper project="${CLIENT}" swf="weave" title="Weave"/>
<build-html-wrapper project="${ADMIN}" swf="AdminConsole" title="Weave Admin Console"/>
<extract_swc swc="${basedir}/${API}/bin/${API}.swc" rsl="${API}.swf"/>
<extract_swc swc="${basedir}/${CORE}/bin/${CORE}.swc" rsl="${CORE}.swf"/>
<extract_swc swc="${basedir}/${DATA}/bin/${DATA}.swc" rsl="${DATA}.swf"/>
<extract_swc swc="${basedir}/${UISPARK}/bin/${UISPARK}.swc" rsl="${UISPARK}.swf"/>
<extract_swc swc="${basedir}/${UI}/bin/${UI}.swc" rsl="${UI}.swf"/>
<copy file="${basedir}/${CLIENT}/swf/${FONTS}.swf" tofile="${WEAVE_DESTROOT}/${FONTS}.swf"/>
<copy file="${basedir}/${CLIENT}/bin/weave.swf" tofile="${WEAVE_DESTROOT}/weave.swf"/>
<copy file="${basedir}/${CLIENT}/src/weaveStyle.css" tofile="${WEAVE_DESTROOT}/weaveStyle.css"/>
<copy file="${basedir}/${CLIENT}/html-template/playerProductInstall.swf" tofile="${WEAVE_DESTROOT}/playerProductInstall.swf"/>
<copy file="${basedir}/${CLIENT}/html-template/swfobject.js" tofile="${WEAVE_DESTROOT}/swfobject.js"/>
<copy file="${basedir}/${ADMIN}/bin/AdminConsole.swf" tofile="${WEAVE_DESTROOT}/AdminConsole.swf"/>
<copy file="${basedir}/${UI}/src/weave/visualization/tools/CytoscapeWebPopout.html" tofile="${WEAVE_DESTROOT}/CytoscapeWebPopout.html"/>
<copy file="${basedir}/${SERVICES}/bin/${SERVICES}.war" tofile="${basedir}/${SERVICES}.war"/>
<copy failonerror="false" file="${basedir}/${EXAMPLEPLUGIN}/bin/${EXAMPLEPLUGIN}.swc" tofile="${WEAVE_DESTROOT}/${EXAMPLEPLUGIN}.swc"/>
<copy file="${FLEX_HOME}/frameworks/rsls/${FRAMEWORK_SWF}" tofile="${WEAVE_DESTROOT}/framework.swf"/>
<copy file="${FLEX_HOME}/frameworks/rsls/${RPC_SWF}" tofile="${WEAVE_DESTROOT}/rpc.swf"/>
<copy file="${FLEX_HOME}/frameworks/rsls/${SPARK_SWF}" tofile="${WEAVE_DESTROOT}/spark.swf"/>
<copy file="${FLEX_HOME}/frameworks/rsls/${MX_SWF}" tofile="${WEAVE_DESTROOT}/mx.swf"/>
<copy file="${FLEX_HOME}/frameworks/rsls/${TEXTLAYOUT_SWF}" tofile="${WEAVE_DESTROOT}/textLayout.swf"/>
</target>
<!-- These targets will build each project -->
<target name="api">
<buildproject targetproject="${API}" targetfileext="swc"/>
</target>
<target name="core" depends="api">
<buildproject targetproject="${CORE}" targetfileext="swc"/>
</target>
<target name="data" depends="core">
<buildproject targetproject="${DATA}" targetfileext="swc"/>
</target>
<target name="update_version" depends="is_git_version,is_custom_version" unless="VERSION"/>
<target name="write_version" depends="update_version">
<!-- echo message="${GIT_SHORT_VERSION} ${GIT_IS_MODIFIED} ${GIT_BUILD_TIME}"/ -->
<echo message="${VERSION}" file="${VERSION_FILE}"/>
</target>
<target name="prep_version_update">
<exec searchpath="true"
outputproperty="GIT_PORCELAIN_OUTPUT"
executable="git">
<arg value="status"/>
<arg value="--porcelain"/>
<arg value="-uno"/>
</exec>
<exec searchpath="true"
outputproperty="GIT_SHORT_VERSION"
executable="git">
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
</exec>
<condition property="GIT_IS_MODIFIED">
<not>
<equals arg1="${GIT_PORCELAIN_OUTPUT}" arg2=""/>
</not>
</condition>
<tstamp>
<format property="GIT_BUILD_TIME" pattern="EEE MMM d HH:mm:ss z yyyy"/>
</tstamp>
</target>
<target name="is_git_version" depends="prep_version_update" unless="GIT_IS_MODIFIED">
<echo>GIT_isn't_MODIFIED</echo>
<property name="VERSION" value="Automated Build ${GIT_SHORT_VERSION}, ${GIT_BUILD_TIME}"/>
</target>
<target name="is_custom_version" depends="prep_version_update" if="GIT_IS_MODIFIED">
<echo>GIT_IS_MODIFIED ${GIT_IS_MODIFIED}</echo>
<property name="VERSION" value="Custom"/>
</target>
<target name="uispark" depends="data,write_version">
<buildproject targetproject="${UISPARK}" targetfileext="swc"/>
</target>
<target name="ui" depends="uispark">
<buildproject targetproject="${UI}" targetfileext="swc"/>
</target>
<target name="client" depends="ui">
<buildproject targetproject="${CLIENT}" targetfileext="swf"/>
</target>
<target name="admin" depends="ui">
<buildproject targetproject="${ADMIN}" targetfileext="swf"/>
</target>
<target name="desktop" depends="ui">
<buildproject targetproject="${DESKTOP}" targetfileext="swf"/>
<copy file="${basedir}/${DESKTOP}/bin/${DESKTOP}.swf" tofile="${WEAVE_DESTROOT}/${DESKTOP}.swf"/>
</target>
<target name="servletutils">
<ant dir="${basedir}/${SERVLETUTILS}" target="build"/>
</target>
<target name="exampleplugin" depends="ui">
<ant dir="${basedir}/${EXAMPLEPLUGIN}" target="build"/>
</target>
<target name="copy_version_file" depends="write_version">
<copy file="${VERSION_FILE}" tofile="${basedir}/${SERVICES}/src/weave/weave_version.txt"/>
</target>
<target name="services" depends="servletutils,copy_version_file">
<ant dir="${basedir}/${SERVICES}" target="dist"/>
</target>
<target name="doc">
<ant dir="${basedir}/${CLIENT}" antfile="build-asdoc.xml" target="compile"/>
<ant dir="${basedir}/${CLIENT}" antfile="build-jsdoc.xml" target="compile"/>
<ant dir="${basedir}/${SERVICES}" target="doc"/>
</target>
<!-- This target calls the clean targets of each project's build file -->
<target name="clean">
<echo message="Cleaning all projects..."/>
<delete quiet="false" includeemptydirs="true" dir="${WEAVE_DESTROOT}">
<fileset file="${basedir}/${SERVICES}.war"/>
<fileset file="${basedir}/weave.zip"/>
</delete>
<ant dir="${basedir}/${CLIENT}" target="clean" />
<ant dir="${basedir}/${DESKTOP}" target="clean" />
<ant dir="${basedir}/${ADMIN}" target="clean" />
<ant dir="${basedir}/${API}" target="clean" />
<ant dir="${basedir}/${CORE}" target="clean" />
<ant dir="${basedir}/${DATA}" target="clean" />
<ant dir="${basedir}/${UISPARK}" target="clean" />
<ant dir="${basedir}/${UI}" target="clean" />
<ant dir="${basedir}/${SERVICES}" target="clean" />
<ant dir="${basedir}/${EXAMPLEPLUGIN}" target="clean" />
<ant dir="${basedir}/${SERVLETUTILS}" target="clean" />
</target>
<macrodef name="build-html-wrapper">
<attribute name="project"/>
<attribute name="swf"/>
<attribute name="title"/>
<sequential>
<copy file="${basedir}/@{project}/html-template/index.template.html"
tofile="${WEAVE_DESTROOT}/@{swf}.html" overwrite="true"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${title}" value="@{title}"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${swf}" value="@{swf}"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${width}" value="100%"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${height}" value="100%"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${bgcolor}" value="#FFFFFF"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${application}" value="@{swf}"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${version_major}" value="10"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${version_minor}" value="2"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${version_revision}" value="0"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${expressInstallSwf}" value="playerProductInstall.swf"/>
</sequential>
</macrodef>
<macrodef name="extract_swc">
<attribute name="swc"/>
<attribute name="rsl"/>
<sequential>
<unzip src="@{swc}" dest="${WEAVE_DESTROOT}/temp">
<patternset>
<include name="library.swf" />
</patternset>
</unzip>
<move file="${WEAVE_DESTROOT}/temp/library.swf" tofile="${WEAVE_DESTROOT}/@{rsl}"/>
<delete dir="${WEAVE_DESTROOT}/temp"/>
</sequential>
</macrodef>
<macrodef name="buildproject">
<attribute name="targetproject"/>
<attribute name="targetfileext"/>
<sequential>
<echo message="Checking @{targetproject}..."/>
<uptodate targetfile="${basedir}/@{targetproject}/bin/@{targetproject}.@{targetfileext}" property="@{targetproject}.uptodate">
<srcfiles dir="${basedir}/@{targetproject}" includes="**/*"/>
</uptodate>
<antcall target="conditional_build">
<param name="targetproject" value="@{targetproject}"/>
</antcall>
</sequential>
</macrodef>
<target name="conditional_build" unless="${targetproject}.uptodate">
<sequential>
<echo message="Building ${targetproject}..."/>
<ant dir="${basedir}/${targetproject}" target="build"/>
</sequential>
</target>
</project>