-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
106 lines (94 loc) · 4.85 KB
/
build.xml
File metadata and controls
106 lines (94 loc) · 4.85 KB
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
<project name="ProjectBuildHelper" basedir=".">
<description>
Project Build Helper
</description>
<property name="webInf" location="src/main/webapp/WEB-INF"/>
<property name="uiOutputDirectory" location="target/ui-build/output-files"/>
<!-- Below are the default build values -->
<property name="cdn-url" value=""/>
<property name="optimizeUIBuild" value=""/>
<property name="build.ui.mode" value="wm"/>
<property name="app.pwa.enabled" value="false"/>
<condition property="wmBuild" value="true">
<equals arg1="${build.ui.mode}" arg2="wm" casesensitive="false" trim="true"/>
</condition>
<condition property="angularBuild" value="true">
<equals arg1="${build.ui.mode}" arg2="angular" casesensitive="false" trim="true"/>
</condition>
<target name="copy-libs-jar">
<mkdir dir="${webInf}/lib"/>
<echo>Copying jars from ${basedir}/lib to ${webInf}/lib</echo>
<copy todir="${webInf}/lib" overwrite="true">
<fileset dir="lib">
<exclude name="Readme.txt"/>
</fileset>
</copy>
</target>
<target name="copy-wm-project-properties">
<mkdir dir="target/classes"/>
<echo>Copying .wmproject.properties file to target/classes(classpath)</echo>
<copy file=".wmproject.properties" todir="target/classes" overwrite="true" failonerror="false"/>
</target>
<target name="copy-themes-config-json">
<mkdir dir="target/classes"/>
<echo>Copying themes-config.json file to target/classes(classpath)</echo>
<copy file="src/main/webapp/themes/themes-config.json" todir="target/classes" overwrite="true" failonerror="false"/>
</target>
<target name="cdnUrl-replace">
<replaceregexp file="src/main/webapp/index.html" byline="true">
<regexp pattern="//.*.cloudfront.net/app-runtime/.*/wmapp"/>
<substitution expression="_cdnUrl_/wmapp"/>
</replaceregexp>
<replaceregexp file="src/main/webapp/index.html" byline="true">
<regexp pattern="/app-runtime/.*/wmapp"/>
<substitution expression="_cdnUrl_/wmapp"/>
</replaceregexp>
<replaceregexp file="src/main/webapp/index.html" byline="true">
<regexp pattern="//.*.cloudfront.net/app-runtime/.*/wmmobile"/>
<substitution expression="_cdnUrl_/wmmobile"/>
</replaceregexp>
<replaceregexp file="src/main/webapp/index.html" byline="true">
<regexp pattern="/app-runtime/.*/wmmobile"/>
<substitution expression="_cdnUrl_/wmmobile"/>
</replaceregexp>
</target>
<target name="cmd-template">
<condition property="cmd.executable" value="cmd" else="${cmd.name}">
<os family="windows"/>
</condition>
<condition property="cmd.argline" value="/c ${cmd.name} ${cmd.arg}" else="${cmd.arg}">
<os family="windows"/>
</condition>
<echo>Executing command "${cmd.executable}" with args "${cmd.argline}" in directory ${cmd.executable.dir}</echo>
<exec executable="${cmd.executable}" dir="${cmd.executable.dir}" failonerror="true">
<arg line="${cmd.argline}"/>
</exec>
</target>
<target name="generate-ui-zip" if="angularBuild">
<echo>creating target/ui-artifact.zip from ${uiOutputDirectory}.</echo>
<zip destfile="target/ui-artifact.zip" basedir="${uiOutputDirectory}"/>
</target>
<target name="uiBuild">
<antcall target="cmd-template">
<param name="cmd.name" value="node"/>
<param name="cmd.arg"
value="ui-build.js --nodeVMArgs='${build.ui.node.args}' --ngBuildParams='${build.ui.ng.config}' --runtimeUIVersion=${wavemaker.app.runtime.ui.version} --appSrc=. --appTarget=./target/ui-build/generated-app --buildType=${build.ui.mode} --platformType=${wavemaker.artifactType} --cdnUrl=_cdnUrl_ --optimizeUIBuild=${optimizeUIBuild} --pwa=${app.pwa.enabled} --csp=${security.general.csp.enabled} --spa=${app.build.ui.spa.enabled}"/>
<param name="cmd.executable.dir" value="./"/>
</antcall>
<antcall target="generate-ui-zip"/>
</target>
<target name="generate-resources">
<delete dir="target/generated-resources"/>
<mkdir dir="target/generated-resources"/>
<copy todir="target/generated-resources" includeemptydirs="false">
<fileset dir="services" includes="**/src/**" defaultexcludes="no" casesensitive="yes" erroronmissingdir="false">
<patternset id="excluded.files">
<exclude name="**/*.java"/>
<exclude name="**/*.md"/>
</patternset>
</fileset>
<cutdirsmapper dirs="2"/>
</copy>
</target>
<target name="init" depends="copy-libs-jar,copy-wm-project-properties,copy-themes-config-json,cdnUrl-replace"></target>
</project>