-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.xml
274 lines (223 loc) · 11.5 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
<project name="coldfire" default="make-dist-zip" basedir=".">
<description>coldfire build file</description>
<property file="branch.properties" />
<xmlproperty file="src/firefox/install.rdf.tpl.xml" />
<!-- project directories -->
<property name="src.dir" location="src" />
<property name="src.cf.dir" location ="src/coldfusion" />
<property name="src.ff.dir" location ="src/firefox" />
<property name="src.railo.dir" location ="src/railo" />
<property name="incremental.dir" location="incremental" />
<property name="install.dir" value="${incremental.dir}/firefox"/>
<property name="build.dir" location="build" />
<property name="build.cf.dir" location ="build/coldfusion" />
<property name="build.railo.dir" location ="build/railo" />
<property name="build.ff.dir" location ="build/firefox" />
<property name="dist.dir" location="dist" />
<property name="excludes" value="**/.*, **/*.jar, **/*.db" />
<property name="name" value="${ant.project.name}" />
<property name="extension.id" value="${RDF.Description.em:id}" />
<target name="version" depends="properties-local, no-properties-local">
<property name="version" value="${major.version}.${minor.version}.${cfml.version}.${firefox.version}"/>
<property name="cf.revision" value="${cfml.version}" />
<echo message="Version ${version}" />
</target>
<target name="local-check" description="check to see if a local.properties file exists">
<available file="${basedir}/local.properties" property="local.properties.available"/>
</target>
<target name="properties-local" if="local.properties.available" depends="local-check">
<echo message="Loading local properties file."/>
<property file="local.properties"/>
</target>
<target name="no-properties-local" unless="local.properties.available" depends="local-check">
<echo message="No local properties file, setting defaults."/>
<!-- set these values -->
<property name="cfserver.debug.dir" value="/opt/coldfusion9/wwwroot/WEB-INF/debug" />
<property name="cfserver.cftags.dir" value="/opt/coldfusion9/wwwroot/WEB-INF/cftags" />
<property name="railoserver.debug.dir" value="/opt/railo/webroot/WEB-INF/railo/context/templates/debugging" />
</target>
<!-- expand templates -->
<target name="install-dependency" description="check template or branch properties changes">
<uptodate property="install.expansion.notRequired" targetfile="${src.ff.dir}/install.rdf">
<srcfiles dir="." includes="src/firefox/install.rdf.tpl.xml,*.properties"/>
</uptodate>
<echo message="${install.expansion.notRequired}" />
</target>
<target name="expand-install-template" depends="install-dependency, version" unless="install.expansion.notRequired" description="update install.rdf based on template and branch.properties">
<copy file="${src.ff.dir}/install.rdf.tpl.xml" tofile="${src.ff.dir}/install.rdf" overwrite="true">
<filterchain>
<replacetokens>
<token key="VERSION" value="${version}"/>
</replacetokens>
</filterchain>
</copy>
</target>
<target name="expand-templates" depends="expand-install-template" description="fill in version info" />
<!-- targets for incremental builds -->
<target name="copy-to-extensions" depends="clean-reg" description="copies extension files to profle">
<copy todir="${install.dir}/extensions/${extension.id}" >
<fileset dir="${src.ff.dir}" excludes="**/*.tpl.xml, **/*.gif, **/*.png" />
<filterchain>
<replacetokens>
<token key="VERSION" value="${version}"/>
</replacetokens>
</filterchain>
</copy>
<copy todir="${install.dir}/extensions/${extension.id}" >
<fileset dir="${src.ff.dir}" includes="**/*.gif, **/*.png" />
</copy>
</target>
<target name="check-trace" description="checks that a backup of trace.cfm exists as trace_adobe.cfm">
<available file="${cfserver.cftags.dir}/trace_adobe.cfm" property="trace_adobe.present" />
</target>
<target name="backup-trace" description="backup trace.cfm as trace_adobe.cfm" unless="trace_adobe.present">
<copy file="${cfserver.cftags.dir}/trace.cfm" tofile="${cfserver.cftags.dir}/trace_adobe.cfm" />
</target>
<target name="copy-to-cfserver" depends="version,check-trace,backup-trace" description="copies coldfusion debug template to server">
<copy file="${src.cf.dir}/debug/coldfire.cfm" tofile="${cfserver.debug.dir}/coldfire.cfm" overwrite="true">
<filterchain>
<replacetokens>
<token key="CF_REVISION" value="${cf.revision}"/>
</replacetokens>
</filterchain>
</copy>
<copy file="${src.cf.dir}/cftags/trace.cfm" tofile="${cfserver.cftags.dir}/trace.cfm" overwrite="true" />
</target>
<target name="copy-to-railoserver" depends="version,check-trace,backup-trace" description="copies railo debug template to server">
<copy file="${src.railo.dir}/debug/debugging-coldfire.cfm" tofile="${railoserver.debug.dir}/debugging-coldfire.cfm" overwrite="true">
<filterchain>
<replacetokens>
<token key="CF_REVISION" value="${cf.revision}"/>
</replacetokens>
</filterchain>
</copy>
</target>
<target name="copy-to-tests" depends="version" description="copies coldspring advice to tests directory">
<copy file="${src.cf.dir}/coldspring/ColdFireAdvice.cfc" tofile="${basedir}/tests/ajax/ColdFireAdvice.cfc" overwrite="true">
<filterchain>
<replacetokens>
<token key="CF_REVISION" value="${cf.revision}"/>
</replacetokens>
</filterchain>
</copy>
</target>
<target name="incremental-ff" depends="version, expand-templates, copy-to-extensions" description="builds a development version of the firefox extension and copies to profile" />
<target name="incremental-cf" depends="version, copy-to-cfserver" description="builds a development version of the coldfusion debug template and copies to server" />
<target name="incremental-railo" depends="version, copy-to-railoserver" description="builds a development version of the railo debug template and copies to server" />
<target name="incremental-ff-cf" depends="version, expand-templates, copy-to-extensions, copy-to-cfserver" />
<target name="incremental-ff-railo" depends="version, expand-templates, copy-to-extensions, copy-to-railoserver" />
<target name="incremental-all" depends="version, expand-templates, copy-to-extensions, copy-to-cfserver, copy-to-railoserver" />
<target name="clean-reg" description="delete compreg.dat to reload service" >
<delete file="${install.dir}/compreg.dat"/>
</target>
<!-- targets used for creating a distribution -->
<target name="set-up-build" depends="clean, version, expand-templates" description="sets up build directory">
<mkdir dir="${build.dir}" />
</target>
<target name="build-coldfusion" depends="set-up-build" description="prepares coldfusion debug template for distribution">
<mkdir dir="${build.cf.dir}" />
<copy file="${src.cf.dir}/debug/coldfire.cfm" tofile="${build.cf.dir}/debug/coldfire.cfm" overwrite="true">
<filterchain>
<replacetokens>
<token key="CF_REVISION" value="${cf.revision}"/>
</replacetokens>
</filterchain>
</copy>
<copy file="${src.cf.dir}/coldspring/ColdFireAdvice.cfc" tofile="${build.cf.dir}/coldspring/ColdFireAdvice.cfc" overwrite="true">
<filterchain>
<replacetokens>
<token key="CF_REVISION" value="${cf.revision}"/>
</replacetokens>
</filterchain>
</copy>
<copy file="${src.cf.dir}/cftags/trace.cfm" tofile="${build.cf.dir}/cftags/trace.cfm" overwrite="true" />
<copy file="${src.cf.dir}/appcfc/cf7/Application.cfc" tofile="${build.cf.dir}/appcfc/cf7/Application.cfc" overwrite="true" />
<copy file="${src.cf.dir}/appcfc/cf8/Application.cfc" tofile="${build.cf.dir}/appcfc/cf8/Application.cfc" overwrite="true" />
</target>
<target name="build-railo" depends="set-up-build" description="prepares railo debug template for distribution">
<mkdir dir="${build.railo.dir}" />
<copy file="${src.railo.dir}/debug/debugging-coldfire.cfm" tofile="${build.railo.dir}/debug/debugging-coldfire.cfm" overwrite="true">
<filterchain>
<replacetokens>
<token key="CF_REVISION" value="${cf.revision}"/>
</replacetokens>
</filterchain>
</copy>
</target>
<target name="build-xpi-chrome" depends="build-coldfusion,build-railo" description="create the xpi chrome contents">
<mkdir dir="${build.ff.dir}" />
<mkdir dir="${build.ff.dir}/chrome" />
<copy todir="${build.ff.dir}/chrome">
<fileset dir="${src.ff.dir}/chrome" includes="content/**, icons/**, locale/**, skin/**" excludes="${excludes}, **/*.gif, **/*.png, **/*.ico"/>
<filterchain>
<replacetokens>
<token key="VERSION" value="${version}"/>
</replacetokens>
</filterchain>
</copy>
<copy todir="${build.ff.dir}/chrome">
<fileset dir="${src.ff.dir}/chrome" includes="**/*.gif, **/*.png, **/*.ico" />
</copy>
</target>
<target name="build-xpi-defaults" depends="build-xpi-chrome" description="create the xpi defaults contents">
<mkdir dir="${build.ff.dir}/defaults" />
<copy todir="${build.ff.dir}/defaults">
<fileset dir="${src.ff.dir}/defaults" />
</copy>
</target>
<target name="build-xpi-platform" depends="build-xpi-defaults" description="create the xpi platform contents">
<mkdir dir="${build.ff.dir}/platform" />
<copy todir="${build.ff.dir}/platform">
<fileset dir="${src.ff.dir}/platform" includes="**" excludes="${excludes}, **/skin/**" />
</copy>
</target>
<target name="build-xpi" depends="build-xpi-defaults" description="create root xpi contents">
<copy file="${src.ff.dir}/install.rdf" toDir="${build.ff.dir}" />
<copy file="${src.ff.dir}/chrome.manifest" toDir="${build.ff.dir}" />
</target>
<target name="set-up-dist" depends="build-xpi" description="sets up dist directory">
<mkdir dir="${dist.dir}" />
<mkdir dir="${dist.dir}/coldfusion" />
<mkdir dir="${dist.dir}/firefox" />
</target>
<target name="make-xpi-dist" depends="set-up-dist" description="generate the xpi for distribution">
<zip destfile="${dist.dir}/firefox/${name}_v${version}.xpi">
<zipfileset dir="${build.ff.dir}" includes="**" />
</zip>
</target>
<target name="make-coldfuion-dist" depends="make-xpi-dist" description="copy the coldfusion template for distribution">
<copy todir="${dist.dir}/coldfusion">
<fileset dir="${build.cf.dir}" />
</copy>
</target>
<target name="make-railo-dist" depends="make-coldfuion-dist" description="copy the railo template for distribution">
<copy todir="${dist.dir}/railo">
<fileset dir="${build.railo.dir}" />
</copy>
</target>
<target name="make-docs-dist" depends="make-railo-dist" description="copy the docs for distribution">
<copy todir="${dist.dir}">
<fileset dir="${src.dir}/docs" includes="*.txt" />
<filterchain>
<replacetokens>
<token key="VERSION" value="${version}"/>
</replacetokens>
</filterchain>
</copy>
<copy todir="${dist.dir}">
<fileset dir="${src.dir}/docs" excludes="*.txt" />
</copy>
</target>
<target name="make-dist-zip" depends="make-docs-dist" description="zip up the distribution">
<mkdir dir="${dist.dir}/zip" />
<zip destfile="${dist.dir}/zip/${name}_v${version}.zip">
<zipfileset dir="${dist.dir}" includes="**" excludes="zip/**" />
</zip>
</target>
<target name="clean" description="clean up">
<!-- Delete the ${incremental.dir}, ${build.dir} and ${dist.dir} directory trees -->
<delete dir="${incremental.dir}" />
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
</project>