|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
2 |
| -<project default="xar" name="hsg-shell"> |
| 2 | +<project default="xar" name="hsg-shell" basedir="."> |
3 | 3 | <xmlproperty file="build.properties.local.xml" semanticAttributes="true" keepRoot="false"/>
|
4 | 4 | <xmlproperty file="build.properties.xml" semanticAttributes="true" keepRoot="false"/>
|
5 | 5 | <xmlproperty file="expath-pkg.xml"/>
|
6 | 6 | <property name="build.dir" value="build"/>
|
| 7 | + <property name="git.repo.path" value="${basedir}/.git"/> |
| 8 | + <available file="${git.repo.path}" type="dir" property="git.present"/> |
| 9 | + |
7 | 10 | <property environment="env"/>
|
8 | 11 | <property name="files-to-be-excluded" value="${build.dir}/**,**/*.tmpl,node_modules/**,package.json,package-lock.json,gulpfile.js,.idea/**,.* example.local.build.properties,npm-shrinkwrap.json,tests/reports/**"/>
|
9 | 12 |
|
|
32 | 35 | <delete dir="${build.dir}"/>
|
33 | 36 | </target>
|
34 | 37 |
|
35 |
| - <target name="prepare"> |
36 |
| - <echo message="Creating build folder..."/> |
37 |
| - <mkdir dir="${build.dir}"/> |
38 |
| - </target> |
39 | 38 |
|
40 | 39 | <target name="run-npm">
|
41 | 40 | <echo message="Calling npm start... (Production? ${node-env-is-set-for-production})"/>
|
|
47 | 46 | <echo message="${npm.output}"/>
|
48 | 47 | </target>
|
49 | 48 |
|
50 |
| - <target name="copy" depends="run-npm"> |
51 |
| - <echo message="Copying the files to the build folder..."/> |
52 |
| - <copy todir="${build.dir}/${app.name}-${app.version}"> |
53 |
| - <fileset dir="${basedir}"> |
54 |
| - <exclude name="${build.dir}/**"/> |
55 |
| - <exclude name="node_modules/**"/> |
56 |
| - <exclude name="tests/pageobjects/**"/> |
57 |
| - <exclude name="tests/reports/**"/> |
58 |
| - <exclude name="tests/specs/**"/> |
59 |
| - <exclude name="wdio*"/> |
60 |
| - </fileset> |
61 |
| - </copy> |
62 |
| - </target> |
63 |
| - |
64 |
| - <target name="apply-filters-to-expath-pkg"> |
65 |
| - <echo message="Apply values to expath-pkg.xml..."/> |
66 |
| - <copy todir="${build.dir}/${app.name}-${app.version}" overwrite="true" verbose="true"> |
67 |
| - <fileset file="expath-pkg.xml.tmpl"/> |
68 |
| - <filterset> |
69 |
| - <filter token="name" value="${app.name}"/> |
70 |
| - <filter token="version" value="${app.version}"/> |
71 |
| - <filter token="url" value="${app.url}"/> |
72 |
| - <filter token="title" value="${app.title}"/> |
73 |
| - </filterset> |
74 |
| - <globmapper from="*.tmpl" to="*"/> |
75 |
| - </copy> |
76 |
| - </target> |
77 |
| - |
78 |
| - <target name="apply-filters-to-producer-dev"> |
79 |
| - <echo message="Apply DEV values to collection.xconf..."/> |
80 |
| - <copy todir="${build.dir}/${app.name}-${app.version}" overwrite="true" verbose="true"> |
81 |
| - <fileset file="collection.xconf.tmpl"/> |
82 |
| - <fileset file="expath-pkg.xml.tmpl"/> |
83 |
| - <filterset> |
84 |
| - <filter token="provider-url" value="${trigger.provider-url.dev}"/> |
85 |
| - <filter token="destination" value="${trigger.destination.dev}"/> |
86 |
| - <filter token="name" value="${app.name}"/> |
87 |
| - <filter token="version" value="${app.version}"/> |
88 |
| - <filter token="url" value="${app.url}"/> |
89 |
| - <filter token="title" value="${app.title}"/> |
90 |
| - </filterset> |
91 |
| - <globmapper from="*.tmpl" to="*"/> |
92 |
| - </copy> |
93 |
| - </target> |
94 |
| - |
95 |
| - <target name="apply-filters-to-producer-prod"> |
96 |
| - <echo message="Apply PROD values to collection.xconf..."/> |
97 |
| - <copy todir="${build.dir}/${app.name}-${app.version}" overwrite="true" verbose="true"> |
98 |
| - <fileset file="collection.xconf.tmpl"/> |
99 |
| - <fileset file="expath-pkg.xml.tmpl"/> |
| 49 | + |
| 50 | + <target name="xar" depends="clean,run-npm" description="create xar file"> |
| 51 | + <echo message="Creating build folder..."/> |
| 52 | + <mkdir dir="${build.dir}"/> |
| 53 | + <copy todir="${basedir}" overwrite="true" verbose="true"> |
| 54 | + <fileset file="*.xml.tmpl"/> |
100 | 55 | <filterset>
|
101 |
| - <filter token="provider-url" value="${trigger.provider-url.prod}"/> |
102 |
| - <filter token="destination" value="${trigger.destination.prod}"/> |
103 | 56 | <filter token="name" value="${app.name}"/>
|
104 | 57 | <filter token="version" value="${app.version}"/>
|
105 | 58 | <filter token="url" value="${app.url}"/>
|
106 | 59 | <filter token="title" value="${app.title}"/>
|
| 60 | + <filter token="commit-id" value="${git.revision}"/> |
| 61 | + <filter token="commit-time" value="${git.time}"/> |
107 | 62 | </filterset>
|
108 | 63 | <globmapper from="*.tmpl" to="*"/>
|
109 | 64 | </copy>
|
110 |
| - </target> |
111 |
| - |
112 |
| - |
113 |
| - <target name="xar-dev" depends="clean,prepare" description="create xar files for DEV environment"> |
114 |
| - <antcall target="copy"/> |
115 |
| - <antcall target="apply-filters-to-expath-pkg"/> |
116 |
| - <echo message="------------------------------------------------------------"/> |
117 |
| - <echo message="Creating DEV 'consumer' xar file..."/> |
118 |
| - <echo message="------------------------------------------------------------"/> |
119 |
| - |
120 |
| - <zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-consumer-dev.xar"> |
121 |
| - <exclude name="${build.dir}/**"/> |
122 |
| - <exclude name="**/*.tmpl"/> |
123 |
| - <exclude name="node_modules/**"/> |
124 |
| - <exclude name="package.json"/> |
125 |
| - <exclude name="package-lock.json"/> |
126 |
| - <exclude name="bower.json"/> |
127 |
| - <exclude name=".idea/**"/> |
128 |
| - <exclude name="tests/reports/**"/> |
129 |
| - <exclude name="npm-shrinkwrap.json"/> |
130 |
| - <exclude name="build.properties.local.xml"/> |
131 |
| - <exclude name="local.node-exist.json"/> |
132 |
| - <exclude name="collection.xconf"/> |
133 |
| - <exclude name="wdio*"/> |
134 |
| - </zip> |
135 |
| - |
136 |
| - <antcall target="apply-filters-to-producer-dev"/> |
137 |
| - |
138 |
| - <echo message="------------------------------------------------------------"/> |
139 |
| - <echo message="Creating DEV 'producer' xar file containing triggers..."/> |
140 |
| - <echo message="------------------------------------------------------------"/> |
141 |
| - |
142 |
| - <zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-producer-dev.xar"> |
143 |
| - <exclude name="**/*.tmpl"/> |
144 |
| - <exclude name="node_modules/**"/> |
145 |
| - <exclude name="package.json"/> |
146 |
| - <exclude name="package-lock.json"/> |
147 |
| - <exclude name="bower.json"/> |
148 |
| - <exclude name=".idea/**"/> |
149 |
| - <exclude name="tests/reports/**"/> |
150 |
| - <exclude name="npm-shrinkwrap.json"/> |
151 |
| - <exclude name="build.properties.local.xml"/> |
152 |
| - <exclude name="local.node-exist.json"/> |
153 |
| - <exclude name="wdio*"/> |
154 |
| - </zip> |
155 |
| - <delete dir="${build.dir}/${app.name}-${app.version}"/> |
156 |
| - </target> |
157 |
| - |
158 |
| - <target name="xar-prod" depends="clean,prepare" description="create xar files for PROD environment"> |
159 |
| - <antcall target="copy"/> |
160 |
| - <antcall target="apply-filters-to-expath-pkg"/> |
161 |
| - |
162 |
| - <echo message="------------------------------------------------------------"/> |
163 |
| - <echo message="Creating PROD 'consumer' xar file..."/> |
164 |
| - <echo message="------------------------------------------------------------"/> |
165 |
| - |
166 |
| - <zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-consumer.xar"> |
167 |
| - <exclude name="${build.dir}/**"/> |
168 |
| - <exclude name="**/*.tmpl"/> |
169 |
| - <exclude name="node_modules/**"/> |
170 |
| - <exclude name="package.json"/> |
171 |
| - <exclude name="package-lock.json"/> |
172 |
| - <exclude name="bower.json"/> |
173 |
| - <exclude name=".idea/**"/> |
174 |
| - <exclude name="tests/reports/**"/> |
175 |
| - <exclude name="npm-shrinkwrap.json"/> |
176 |
| - <exclude name="build.properties.local.xml"/> |
177 |
| - <exclude name="local.node-exist.json"/> |
178 |
| - <exclude name="collection.xconf"/> |
179 |
| - </zip> |
180 |
| - |
181 |
| - <antcall target="apply-filters-to-producer-prod"/> |
182 |
| - |
183 |
| - <echo message="------------------------------------------------------------"/> |
184 |
| - <echo message="Creating PROD 'producer' xar file containing triggers..."/> |
185 |
| - <echo message="------------------------------------------------------------"/> |
186 |
| - |
187 |
| - <zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-producer.xar"> |
188 |
| - <exclude name="${build.dir}/**"/> |
189 |
| - <exclude name="**/*.tmpl"/> |
190 |
| - <exclude name="node_modules/**"/> |
191 |
| - <exclude name="package.json"/> |
192 |
| - <exclude name="package-lock.json"/> |
193 |
| - <exclude name="bower.json"/> |
194 |
| - <exclude name=".idea/**"/> |
195 |
| - <exclude name="tests/reports/**"/> |
196 |
| - <exclude name="npm-shrinkwrap.json"/> |
197 |
| - <exclude name="build.properties.local.xml"/> |
198 |
| - <exclude name="local.node-exist.json"/> |
199 |
| - </zip> |
200 |
| - <delete dir="${build.dir}/${app.name}-${app.version}"/> |
201 |
| - </target> |
202 |
| - |
203 |
| - <target name="xar" depends="clean,prepare" description="create xar file"> |
204 |
| - <antcall target="copy"/> |
205 |
| - <antcall target="apply-filters-to-expath-pkg"/> |
| 65 | + |
| 66 | + |
206 | 67 | <echo message="------------------------------------------------------------"/>
|
207 | 68 | <echo message="Creating xar file..."/>
|
208 | 69 | <echo message="------------------------------------------------------------"/>
|
209 | 70 |
|
210 |
| - <zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}.xar"> |
211 |
| - <exclude name="**/*.tmpl"/> |
| 71 | + <zip basedir="${basedir}" destfile="${build.dir}/${app.name}-${app.version}.xar"> |
| 72 | + <exclude name="${build.dir}/**"/> |
| 73 | + <exclude name="*.tmpl"/> |
| 74 | + <exclude name="hsg-shell.xpr"/> |
| 75 | + <exclude name="build.properties.local.example.xml"/> |
| 76 | + <exclude name="build.properties.xml"/> |
| 77 | + <exclude name="build.xml"/> |
212 | 78 | <exclude name="node_modules/**"/>
|
213 | 79 | <exclude name="package.json"/>
|
214 | 80 | <exclude name="package-lock.json"/>
|
|
217 | 83 | <exclude name="tests/reports/**"/>
|
218 | 84 | <exclude name="npm-shrinkwrap.json"/>
|
219 | 85 | <exclude name="build.properties.local.xml"/>
|
220 |
| - <exclude name="local.node-exist.json"/> |
221 |
| - <exclude name="collection.xconf"/> |
222 |
| - </zip> |
223 |
| - <delete dir="${build.dir}/${app.name}-${app.version}"/> |
| 86 | + <exclude name="local.node-exist.json"/> |
| 87 | + <exclude name="wdio*"/> |
| 88 | + </zip> |
224 | 89 | </target>
|
225 | 90 | </project>
|
0 commit comments