-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathframework.xml
297 lines (254 loc) · 11.2 KB
/
framework.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
<project name="common">
<!-- ==============================================================
Common Web-CAT framework build.xml file
==============================================================
This ANT build file is the master template for use by all
Web-CAT subsystems. Those subsystems import this common
file and then specialize some targets as necessary.
-->
<echo
message="----------------- project ${ant.project.name} -----------------"/>
<!-- ============================================================== -->
<!-- main targets -->
<!-- ============================================================== -->
<!-- install ......................................................
Build the framework (using the build target) and then install
the result to the desired location (usually WOLOCALROOT). Also
builds a jar suitable for updating a Web-CAT server, and installs
it in a specified pending updates dir, if desired."
-->
<target name="install"
depends="setProps, init.install, build.woframework, export.jar,
install.pending.updates"
description="Build and install the framework, then export a jar."/>
<!-- ...............................................................
Build a local copy of the framework. Note that this step does not
yet include compiling the Java source, which is done automatically
by Eclipse. It just combines all the necessary elements into a
complete framework stored locally inside the workspace."
-->
<target name="build"
depends="setProps, init.build, build.woframework"
description="Build an uninstalled copy of the framework."/>
<!-- ...............................................................
Compile and build a local copy of the framework. This is exactly
the same as "build", but with the compile directive added.
-->
<target name="compileAndBuild"
depends="setProps,init.build,compile,build.woframework"
description="Compile and build an uninstalled copy of the framework."/>
<!-- ............................................................... -->
<target name="clean" depends="setProps"
description="Delete the framework built by build or install.">
<delete dir="${framework.name}.framework"/>
</target>
<!-- ============================================================== -->
<!-- initialization/setup targets -->
<!-- ============================================================== -->
<!-- ...............................................................
A macro to compose the ${project.version} property from its
component properties.
-->
<property name="project.name.for.version" value="${ant.project.name}"/>
<macrodef name="compose.project.version">
<attribute name="project" default="${project.name.for.version}"/>
<sequential>
<property name="project.version"
value="${@{project}.version.major}.${@{project}.version.minor}.${@{project}.version.revision}"/>
</sequential>
</macrodef>
<!-- ...............................................................
A macro to derive the ${external.resource.dir} property from the project
name, or use a default.
-->
<macrodef name="compose.external.resource.dir">
<attribute name="project" default="${ant.project.name}"/>
<sequential>
<condition property="external.resource.dir"
value="${@{project}.Resources}">
<isset property="@{project}.Resources"/>
</condition>
<property name="external.resource.dir" value="."/>
</sequential>
</macrodef>
<!-- property determination ........................................ -->
<target name="setProps">
<property file="build.properties"/>
<property file="${user.home}/Library/wobuild.properties"/>
<condition property="wo.properties.check.failed">
<not><and>
<isset property="wo.wosystemroot"/>
<isset property="wo.wolocalroot"/>
</and></not>
</condition>
<fail message="Could not find ${user.home}/Library/wobuild.properties."
if="wo.properties.check.failed"/>
<property name="install.dir"
value="${wo.wolocalroot}/Library/Frameworks"/>
<tstamp/>
<copy file="Properties.master" tofile="Properties"/>
<propertyfile
file="Properties"
comment="This file is automatically rewritten by ANT, so all formatting will be trashed.">
<entry key="${framework.name}.version.date" value="${DSTAMP}"/>
</propertyfile>
<property file="Properties"/>
<compose.project.version/>
<compose.external.resource.dir/>
<condition property="external.resource.msg"
value="Including external resources from: ${external.resource.dir}"
else="">
<isset property="external.resource.includes"/>
</condition>
<property name="external.resource.includes"
value="nothing-included-by-default"/>
<property name="external.resource.excludes" value=""/>
<echo message="${external.resource.msg}"/>
<available property="has.internal.resources.dir"
file="Resources" type="dir"/>
<available property="has.internal.wsresources.dir"
file="WebServerResources" type="dir"/>
<available property="has.internal.libraries.dir"
file="Libraries" type="dir"/>
</target>
<!-- basic initializations ........................................ -->
<target name="init.install" depends="setProps">
<property name="dest.dir" value="${install.dir}"/>
</target>
<!-- basic initializations ........................................ -->
<target name="init.build" depends="setProps">
<property name="dest.dir" value="."/>
</target>
<!-- ============================================================== -->
<!-- Lower-level targets -->
<!-- ============================================================== -->
<!-- compile ....................................................... -->
<target name="compile" depends="setProps,init.build">
<mkdir dir="bin"/>
<javac srcdir="src" destdir="bin">
<classpath>
<fileset dir="${wo.dir.user.home.library.frameworks}"
includesfile="woproject/ant.frameworks.user.home">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${wo.wolocalroot}"
includesfile="woproject/ant.frameworks.wo.wolocalroot">
<include name = "**/*.jar"/>
</fileset>
<fileset dir="${wo.wosystemroot}"
includesfile="woproject/ant.frameworks.wo.wosystemroot">
<include name = "**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<!-- ............................................................... -->
<target name="build.woframework"
depends="build.basic.woframework, copy.woframework.resources,
copy.woframework.wsresources, copy.woframework.libraries">
</target>
<!-- ............................................................... -->
<target name="build.basic.woframework">
<fail unless="dest.dir"/>
<taskdef name="woframework"
classname="org.objectstyle.woproject.ant.WOFramework"/>
<woframework name="${framework.name}"
destDir="${dest.dir}"
customInfoPListContent="${customInfoPListContent}"
principalClass="${principalClass}"
eoAdaptorClassName="${eoAdaptorClassName}"
version="${project.version}">
<classes dir="${classes.dir}"><patternset>
<includesfile name="woproject/classes.include.patternset"/>
<excludesfile name="woproject/classes.exclude.patternset"/>
</patternset></classes>
<wsresources dir="."><patternset>
<includesfile name="woproject/wsresources.include.patternset"/>
<excludesfile name="woproject/wsresources.exclude.patternset"/>
</patternset></wsresources>
<resources dir="."><patternset>
<includesfile name="woproject/resources.include.patternset"/>
<excludesfile name="woproject/resources.exclude.patternset"/>
</patternset></resources>
<resources dir="${external.resource.dir}">
<patternset
includes="${external.resource.includes}"
excludes="${external.resource.excludes}"/>
</resources>
<lib dir=".">
<include
name="Add .jar's that should be copied in the framework."/>
<exclude name="**/*.framework/**"/>
</lib>
</woframework>
</target>
<!-- copy (unflattened) Resources into framework ................... -->
<target name="copy.woframework.resources" if="has.internal.resources.dir">
<fail unless="dest.dir"/>
<copy todir="${dest.dir}/${framework.name}.framework">
<fileset dir=".">
<include name="Resources/"/>
<exclude name="**/CVS/"/>
<exclude name="**/*~"/>
<exclude name=".svn"/>
<excludesfile name="woproject/resources.exclude.patternset"/>
</fileset>
</copy>
</target>
<!-- copy (unflattened) WebServerResources into framework .......... -->
<target name="copy.woframework.wsresources" if="has.internal.wsresources.dir">
<fail unless="dest.dir"/>
<copy todir="${dest.dir}/${framework.name}.framework">
<fileset dir=".">
<include name="WebServerResources/"/>
<exclude name="**/CVS/"/>
<exclude name="**/*~"/>
<exclude name=".svn"/>
<excludesfile name="woproject/wsresources.exclude.patternset"/>
</fileset>
</copy>
</target>
<!-- copy Libraries/*.jar into framework ........................... -->
<target name="copy.woframework.libraries" if="has.internal.libraries.dir">
<fail unless="dest.dir"/>
<copy todir="${dest.dir}/${framework.name}.framework/Resources/Java">
<fileset dir="Libraries">
<include name="**/*.jar"/>
<exclude name="**/CVS/"/>
<exclude name=".svn"/>
</fileset>
</copy>
</target>
<!-- copy strings files ............................................ -->
<target name="copy.strings">
<copy todir="${dest.dir}/${framework.name}.framework/Resources">
<fileset dir="." casesensitive="yes">
<include name="*.strings"/>
<include name="**/*.strings"/>
</fileset>
<mapper type="flatten"/>
</copy>
</target>
<!-- ...............................................................
Jars up the framework that was built in a form that can be used
for Web-CAT server updates.
-->
<target name="export.jar" depends="build.woframework">
<!-- need to jar framework up somewhere, based on version number -->
<property name="export.jar.name"
value="../${framework.name}_${project.version}.jar"/>
<jar destfile="${export.jar.name}"
basedir="${install.dir}"
includes="${framework.name}.framework/**"/>
</target>
<!-- ...............................................................
Copies the exported jar file to a servlet's pending updates
directory. Set the pending.updates.dir property in your
~/Library/wobuild.properties file to enable this action.
-->
<target name="install.pending.updates"
depends="export.jar"
if="pending.updates.dir">
<copy todir="${pending.updates.dir}" file="${export.jar.name}"/>
</target>
</project>