-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
314 lines (271 loc) · 12 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
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
313
314
<project name="PSODynamicCodeReorganizer" default="dist" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
PSO Dynamic Code Reorganizer Project
This custom velocity assembler allows for the formatting of code.
This build file depends on Ivy 2.0
</description>
<!-- =================================
Download and install Ivy2 from http://ant.apache.org/ivy
Modify your Ant runtime preferences in Eclipse to include the Ivy JARs
Setup your ivy-local.properties for your user / environment (see the sample file)
If you want to use the testbuild target, you will need Environment
variables for RHYTHMYX_HOME and RHYTHMYX_SERVICE.
To build for the first time:
1) Run the ivy-retrieve target
2) In Project Properties, add all JARs in the ivylib folder to
the build path.
3) Build (using the testbuild and dist targets)
4) If your project produces JARs to be re-used by other
projects, run the ivy-publish target
You should occasionally refresh the (with ivy-retrieve) and
do ivy-publish each time a new build is released.
-->
<!-- set global properties for this build -->
<property environment="env"/>
<!-- these variables are used for deploying to the local test instance
of Rhythmyx -->
<!-- base directory of Rhythmyx installation -->
<property name="rhythmyx.home" location="${env.RHYTHMYX_HOME}"/>
<!-- name of Rhythmyx Service -->
<property name="rhythmyx.service" value="${env.RHYTHMYX_SERVICE}"/>
<!-- name of our output jar -->
<property name="jarname" value="dynreorg-server.jar" />
<property name="jarnametest" value="dynreorg-server-test.jar" />
<!-- name of our distribution zip -->
<property name="distfile" value="PSODynamicCodeReorganizer.zip" />
<!-- this zip file is generated by the remotetest target -->
<property name="testdistfile" value="PSODynamicCodeReorganizerTest.zip" />
<!-- some directories for deployment to the local test Rhythmyx -->
<property name="rhythmyx.deploy" value="${rhythmyx.home}/AppServer/server/rx/deploy" />
<property name="rhythmyx.rxapp" value="${rhythmyx.deploy}/rxapp.ear/rxapp.war" />
<property name="rhythmyx.rxpub" value="${rhythmyx.deploy}/RxServices.war"/>
<property name="rhythmyx.rxapp.lib" value="${rhythmyx.rxapp}/WEB-INF/lib"/>
<property name="rhythmyx.server.lib" value="${rhythmyx.home}/AppServer/server/rx/lib" />
<property name="rhythmyx.rxapp.spring-config"
value="${rhythmyx.rxapp}/WEB-INF/config/user/spring" />
<property name="rhythmyx.rxapp.WEB-INF" value="${rhythmyx.rxapp}/WEB-INF" />
<property name="rhythmyx.WEB-INF" value="${rhythmyx.rxapp}/WEB-INF"/>
<property name="rhythmyx.lib" value="${rhythmyx.WEB-INF}/lib"/>
<property name="rhythmyx.spring" value="${rhythmyx.WEB-INF}/config/user/spring" />
<!-- relative paths for local folders -->
<property name="src" location="src"/>
<property name="test" location="test" />
<property name="lib" location="lib"/>
<!-- more relative paths. Make sure these are not in Subversion -->
<property name="bin" location="bin"/>
<property name="ivylib" location="ivylib" />
<property name="apidoc" location="apidoc" />
<!-- used for running Windows commands -->
<property name="comspec" location="${env.ComSpec}"/>
<property name="cdrive" location="${env.USERPROFILE}"/>
<property name="stylesheet" location="addProp.xslt" />
<!-- Rhythmyx classpath -->
<path id="rx.class.path">
<fileset dir="${ivylib}">
<include name="**.jar"/>
</fileset>
</path>
<target name="init">
<!-- Create the time stamp for build.properties -->
<tstamp/>
</target>
<!--
clean the ivy cache and throw away any local copies of downloaded JARs
-->
<target name="ivy-clean" depends="ivy-configure">
<ivy:cleancache />
<delete dir="${ivylib}" />
<mkdir dir="${ivylib}" />
</target>
<!--
Clean up the local build folders
-->
<target name="clean" description="clean up">
<delete dir="${bin}"/>
<mkdir dir="${bin}"/>
</target>
<!--
load the ivy configuration. See ivysettings.xml
-->
<target name="ivy-configure">
<ivy:settings />
</target>
<!-- resolve dependencies -->
<target name="ivy-resolve" depends="ivy-configure" >
<!-- if you have more configurations, you may need to change this line -->
<ivy:resolve conf="test"/>
</target>
<!-- retrieve all dependency JARs to the local ivylib folder -->
<target name="ivy-retrieve" depends="ivy-resolve">
<ivy:retrieve pattern="${ivylib}/[artifact].[ext]" type="jar" conf="test" />
</target>
<!-- report on dependencies -->
<target name="ivy-report" depends="ivy-resolve">
<ivy:report conf="test" graph="false" />
</target>
<!--
You should only publish this project to Ivy if it produces
JARs that will be used by other projects.
-->
<!-- Uncomment this target to enable publishing
<target name="ivy-publish" depends="ivy-resolve" >
<ivy:publish resolver="foo-shared-sftp" forcedeliver="true"
pubrevision="1.0" overwrite="true"
conf="default" status="integration" >
<artifacts pattern="${lib}/[artifact]-[revision].[ext]" />
</ivy:publish>
</target>
-->
<target name="compile" description="compile the source ">
<!-- Compile the java code from ${src} into ${bin} -->
<javac srcdir="${src}" destdir="${bin}" debug="true" source="1.5" classpathref="rx.class.path" />
<javac srcdir="${test}" destdir="${bin}" debug="true" source="1.5" classpathref="rx.class.path" />
<copy todir="${bin}" verbose="true" >
<fileset dir="${src}">
<include name="**/*.xml"/>
<include name="**/*.properties" />
</fileset>
<fileset dir="${test}">
<include name="**/*.properties" />
<include name="**/*.xml"/>
<include name="**/*.jpg"/>
</fileset>
</copy>
</target>
<target name="unittest" depends="compile" description="run unit tests">
<property name="build-test-results" location="${bin}/test-results" />
<delete dir="${build-test-results}" />
<mkdir dir="${build-test-results}" />
<junit printsummary="yes" haltonerror="yes">
<classpath>
<path location="${bin}" />
<path refid="rx.class.path" />
</classpath>
<formatter type="plain" />
<batchtest fork="yes" todir="${build-test-results}">
<fileset dir="${test}">
<include name="test/percussion/**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<!-- adds javadoc to the apidoc folder -->
<target name="javadoc" depends="compile">
<mkdir dir="apidoc"/>
<javadoc destdir="apidoc" private="true" use="yes"
windowtitle="${ant.project.name}">
<packageset dir="${src}" defaultexcludes="yes">
<include name="com/percussion/**"/>
<exclude name="test/percussion/**"/>
</packageset>
<classpath refid="rx.class.path"/>
</javadoc>
</target>
<target name="jarbuilder" depends="compile" description="just build the jar ">
<!--delete file="${bin}/log4j.properties" / -->
<propertyfile file="${bin}/build.properties">
<entry key="build.number" value="${build.number}"/>
<entry key="build.date" type="date" pattern="EEEE MMM dd yyyy" value="now"/>
</propertyfile>
<jar jarfile="${lib}/${jarname}" basedir="${bin}">
<include name="com/percussion/pso/**"/>
<exclude name="log4j.properties" />
<include name="build.properties" />
<include name="image*.properties" />
<include name="readme.txt" />
</jar>
</target>
<!-- installs any extensions on the local Rhythmyx instance -->
<target name="installExtensions">
<java classname="com.percussion.util.PSExtensionInstallTool" fork="true">
<arg value="${rhythmyx.home}" />
<arg value="${basedir}" />
<classpath>
<fileset dir="${rhythmyx.rxapp.lib}">
<include name="rxserver.jar"/>
<include name="rxclient.jar"/>
<include name="rxutils.jar" />
<include name="rxservices.jar" />
<include name="commons-lang*.jar"/>
<include name="jcr*.jar" />
<include name="commons-logging*.jar" />
<include name="commons-collections*.jar" />
<include name="commons-httpclient*.jar" />
</fileset>
<fileset dir="${rhythmyx.home}/AppServer/lib/endorsed" >
<include name="xml-apis.jar" />
</fileset>
<fileset dir="${rhythmyx.home}/AppServer/server/rx/lib">
<include name="javax.servlet.jar" />
</fileset>
</classpath>
</java>
</target>
<!-- runs the test build on the local machine.
You must have RHYTHMYX_HOME and RHYTHMYX_SERVICE defined -->
<target name="testbuild" description="build for local test">
<fail unless="rhythmyx.home" message="You must set the RHYTHMYX_HOME environment variable"/>
<fail unless="rhythmyx.service" message="You must set the RHYTHMYX_SERVICE environment variable"/>
<echo>Stopping ${rhythmyx.service}</echo>
<exec executable="net.exe" failonerror="false">
<arg line="stop ${rhythmyx.service}"/>
<env key="COMSPEC" path="${comspec}"/>
</exec>
<property name="build.number" value="test build" />
<antcall target="jarbuilder"/>
<delete file="${rhythmyx.home}/AppServer/server/rx/log/server.log" verbose="true" failonerror="false" />
<delete file="${rhythmyx.home}/console.log" verbose="true" failonerror="false" />
<!--<copy file="${lib}/${jarname}" todir="${rhythmyx.rxapp.lib}" verbose="true" />-->
<copy file="${lib}/${jarname}" todir="${rhythmyx.rxapp.lib}" verbose="true" overwrite="true" />
<copy todir="${rhythmyx.rxapp.lib}" verbose="true" >
<fileset dir="${lib}" excludes="**/pso-image-editor*"/>
</copy>
<copy todir="${rhythmyx.rxapp.WEB-INF}" verbose="true" >
<fileset dir="WEB-INF" />
</copy>
<echo>Transforming web.xml</echo>
<copy file="${rhythmyx.WEB-INF}/web.xml" todir=""/>
<xslt in="web.xml" style="${stylesheet}" out="Output.xml" force="yes" />
<!-- echo>Deleted extraneous files</echo -->
<!-- delete file="${stylesheet}"/ -->
<!-- delete file="UserDispatcher-servlet.xml"/ -->
<copy file="Output.xml" tofile="web.xml" />
<copy file="web.xml" todir="${rhythmyx.WEB-INF}"/>
<echo>Updated web.xml</echo>
<echo>waiting for shutdown...</echo>
<sleep seconds="5" />
<echo>Restarting ${rhythmyx.service}</echo>
<exec executable="net.exe" failonerror="true">
<arg line="start ${rhythmyx.service}"/>
<env key="COMSPEC" path="${comspec}"/>
</exec>
</target>
<!-- build a zip file for deployment on a remote test server -->
<target name="remotetest" description="Build for remote test">
<property name="build.number" value="test build" />
<antcall target="jarbuilder"/>
<zip destfile="${testdistfile}">
<zipfileset dir="${lib}" includes="${jarname}" prefix="lib" />
<zipfileset dir="${ivylib}" includes="ehcache*.jar backport-util-concurrent.jar jsr107*.jar " prefix="lib" />
<fileset dir="." includes="readme.txt, deploy.xml, addProp.xslt" />
<fileset dir="." includes="license.txt, Extensions.xml" />
<zipfileset dir="WEB-INF" prefix="WEB-INF">
<exclude name="**/*.jar"/>
</zipfileset>
<zipfileset dir="rx_resources" prefix="rx_resources">
<exclude name="**/landscape.jpg" />
</zipfileset>
</zip>
</target>
<!-- build the production distribution zip file -->
<target name="dist" depends="init, clean, javadoc, unittest" description="generate the distribution">
<buildnumber/>
<antcall target="jarbuilder"/>
<zip destfile="${distfile}">
<zipfileset dir="${lib}" includes="${jarname}" prefix="lib" />
<zipfileset dir="${ivylib}" includes="ehcache*.jar backport-util-concurrent.jar jsr107*.jar " prefix="lib" />
<fileset dir="." includes="readme.txt, Extensions.xml, build.number, deploy.xml, install.bat, install.sh, addProp.xslt" />
<zipfileset dir="${apidoc}" prefix="javadoc"/>
</zip>
</target>
</project>