-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbuild_ng2.xml
312 lines (283 loc) · 11.6 KB
/
build_ng2.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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<?xml version="1.0"?>
<!--
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
-->
<project name="build_ng2" default="buildng2" xmlns:if="ant:if" xmlns:unless="ant:unless">
<import file="common.xml"/>
<property name="traverseTarget" value="buildPlugin"/>
<property name="antTarget" value="build"/>
<target name="buildng2" depends="getDesktopDir, platformBuild, bootstrapBuild, desktopBuild, traverse">
<antcall target="npmInstall">
<param name="packagejson.Location" value="${capstone}/zlux-shared/src/logging"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="${capstone}/zlux-shared/src/logging"/>
<param name="buildType" value="build"/>
</antcall>
<antcall target="npmInstall">
<param name="packagejson.Location" value="${capstone}/zlux-shared/src/obfuscator"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="${capstone}/zlux-shared/src/obfuscator"/>
<param name="buildType" value="build"/>
</antcall>
<!-- TODO: Update component's dependencies such that install passes with npmInstall -->
<antcall target="npmInstallLegacy">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/system-apps/admin-notification-app/webClient"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/system-apps/admin-notification-app/webClient"/>
<param name="buildType" value="build"/>
</antcall>
<antcall target="npmInstall">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/system-apps/web-browser-app/webClient"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/system-apps/web-browser-app/webClient"/>
<param name="buildType" value="build"/>
</antcall>
<antcall target="npmInstall">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/system-apps/web-browser-app/nodeServer"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/system-apps/web-browser-app/nodeServer"/>
<param name="buildType" value="build"/>
</antcall>
<copy file="${capstone}/zlux-app-manager/virtual-desktop/node_modules/requirejs/require.js" tofile="${capstone}/zlux-app-manager/virtual-desktop/web/require.js" unless:set="isZos"/>
<exec if:set="isZos" executable="sh">
<arg line="-c 'cp -p ${capstone}/zlux-app-manager/virtual-desktop/node_modules/requirejs/require.js ${capstone}/zlux-app-manager/virtual-desktop/web/require.js'"/>
</exec>
</target>
<target name="removeSource">
<!-- <delete><fileset .../>...</delete> is extremely slow -->
<for param="path">
<path>
<dirset dir="${capstone}" defaultexcludes="false">
<include name="**/.*"/>
<include name="**/node_modules"/>
<include name="**/dco-signoffs"/>
<exclude name="zlux-app-server/node_modules/**"/>
<exclude name="zlux-server-framework/node_modules/**"/>
</dirset>
<dirset dir="${capstone}" defaultexcludes="false">
<include name="zlux-app-manager/system-apps/app-generator/**"/>
</dirset>
<dirset dir="${capstone}" defaultexcludes="false">
<include name="**/src"/>
<include name="**/dts"/>
<include name="**/nodeServer"/>
<include name="**/webClient"/>
<exclude name="**/zssServer/**"/>
<exclude name="zlux-app-manager/virtual-desktop/**"/>
<exclude name="zlux-platform/interface/**"/>
<exclude name="zlux-app-server/node_modules/**"/>
<exclude name="zlux-server-framework/node_modules/**"/>
<exclude name="zlux-shared/**"/>
</dirset>
<fileset dir="${capstone}" defaultexcludes="false">
<include name="**/.*"/>
<include name="**/sonar-project.properties"/>
<exclude name="zlux-app-server/node_modules/**"/>
<exclude name="zlux-server-framework/node_modules/**"/>
</fileset>
<fileset dir="${capstone}" defaultexcludes="false">
<include name="**/*.ts"/>
<include name="**/tsconfig*.json"/>
<include name="**/tslint.json"/>
<include name="**/webpack.config.js"/>
<exclude name="zlux-app-server/**"/>
<exclude name="zlux-build/**"/>
<exclude name="**/node_modules/**"/>
<exclude name="zlux-app-manager/virtual-desktop/**"/>
<exclude name="zlux-platform/interface/**"/>
<exclude name="zlux-shared/src/**"/>
</fileset>
</path>
<sequential>
<delete dir="@{path}"/>
<delete file="@{path}"/>
</sequential>
</for>
</target>
<target name="removeZssSource">
<!-- <delete><fileset .../>...</delete> is extremely slow -->
<for param="path">
<path>
<dirset dir="${capstone}" defaultexcludes="false">
<include name="**/zssServer"/>
</dirset>
</path>
<sequential>
<delete dir="@{path}"/>
<delete file="@{path}"/>
</sequential>
</for>
</target>
<target name="getDesktopDir">
<dirname file="${capstone}/zlux-app-manager/virtual-desktop/package.json" property="MVD_DESKTOP_DIR"/>
<echo message="MVD_DESKTOP_DIR is ${MVD_DESKTOP_DIR}"/>
<echo message="Plugin directory is ${pluginDir}"/>
</target>
<target name="buildPlugin" depends="antPlugin" unless="build.xmlRan">
<property name="absolutePlugin" location="${capstone}/zlux-app-server/lib/${plugin}"/>
<if>
<not>
<or>
<equals arg1="${plugin}" arg2="../../zlux-app-manager/bootstrap"/>
<equals arg1="${plugin}" arg2="../../zlux-app-manager/virtual-desktop"/>
</or>
</not>
<then>
<antcall target="npmInstall" unless:set="noInstall">
<param name="packagejson.Location" value="${capstone}/zlux-app-server/lib/${plugin}"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="${capstone}/zlux-app-server/lib/${plugin}"/>
<param name="buildType" value="build"/>
</antcall>
</then>
</if>
<for param="subfolder">
<path>
<dirset dir="${capstone}/zlux-app-server/lib/${plugin}" includes="*"/>
</path>
<sequential>
<antcall target="npmInstall" unless:set="noInstall">
<param name="packagejson.Location" value="@{subfolder}"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="@{subfolder}"/>
<param name="buildType" value="build"/>
</antcall>
</sequential>
</for>
</target>
<target name="platformBuild">
<antcall target="npmInstall" unless:set="noInstall">
<param name="packagejson.Location" value="${capstone}/zlux-platform"/>
</antcall>
</target>
<target name="bootstrapBuild"><!--We could pass different args for bootstrap if we wanted-->
<antcall target="npmInstall" unless:set="noInstall">
<param name="packagejson.Location" value="${capstone}/zlux-server-framework"/>
</antcall>
<antcall target="npmInstall" unless:set="noInstall">
<param name="packagejson.Location" value="${capstone}/zlux-app-server"/>
</antcall>
<antcall target="npmInstall" unless:set="noInstall">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/bootstrap"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/bootstrap"/>
<param name="buildType" value="build"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="${capstone}/zlux-server-framework"/>
<param name="buildType" value="build"/>
</antcall>
</target>
<target name="desktopBuild"><!--We could pass different args for virtual-desktop if we wanted-->
<antcall target="npmInstall" unless:set="noInstall">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/virtual-desktop"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/virtual-desktop"/>
<param name="buildType" value="build:externals"/>
</antcall>
<antcall target="npmBuild">
<param name="packagejson.Location" value="${capstone}/zlux-app-manager/virtual-desktop"/>
<param name="buildType" value="build"/>
</antcall>
</target>
<target name="npmInstall" depends="package.jsonExists" if="package.jsonPresent">
<exec executable="cmd"
dir="${packagejson.Location}"
osfamily="windows"
resultproperty="rc"
searchpath="true">
<arg line="/c npm install"/>
</exec>
<exec executable="npm"
dir="${packagejson.Location}"
osfamily="unix"
resultproperty="rc"
searchpath="true">
<arg line="install"/>
</exec>
<echo message="Result of install in ${packagejson.Location} is: ${rc}"/>
<if>
<not>
<equals arg1="${rc}" arg2="0"/>
</not>
<then>
<fail message="Error with npm install in ${packagejson.Location}" />
</then>
</if>
</target>
<target name="npmInstallLegacy" depends="package.jsonExists" if="package.jsonPresent">
<exec executable="cmd"
dir="${packagejson.Location}"
osfamily="windows"
resultproperty="rc"
searchpath="true">
<arg line="/c npm install --legacy-peer-deps"/>
</exec>
<exec executable="npm"
dir="${packagejson.Location}"
osfamily="unix"
resultproperty="rc"
searchpath="true">
<arg line="install"/>
</exec>
<echo message="Result of install in ${packagejson.Location} is: ${rc}"/>
<if>
<not>
<equals arg1="${rc}" arg2="0"/>
</not>
<then>
<fail message="Error with npm install in ${packagejson.Location}" />
</then>
</if>
</target>
<target name="npmBuild" depends="package.jsonExists" if="package.jsonPresent">
<exec executable="cmd"
dir="${packagejson.Location}"
osfamily="windows"
resultproperty="rc"
searchpath="true">
<arg line="/c npm run ${buildType}"/>
<env key="MVD_DESKTOP_DIR" value="${MVD_DESKTOP_DIR}"/>
</exec>
<exec executable="npm"
dir="${packagejson.Location}"
osfamily="unix"
resultproperty="rc"
searchpath="true">
<arg line="run ${buildType}"/>
<env key="MVD_DESKTOP_DIR" value="${MVD_DESKTOP_DIR}"/>
</exec>
<echo message="Result of build in ${packagejson.Location} is: ${rc}"/>
<if>
<not>
<equals arg1="${rc}" arg2="0"/>
</not>
<then>
<fail message="Error with npm run ${buildType} in ${packagejson.Location}" />
</then>
</if>
</target>
<target name="package.jsonExists">
<available file="${packagejson.Location}/package.json" property="package.jsonPresent"/>
</target>
</project>
<!--
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
-->