-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.xml
More file actions
371 lines (304 loc) · 16.6 KB
/
Copy pathbuild.xml
File metadata and controls
371 lines (304 loc) · 16.6 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
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
<?xml version="1.0" encoding="UTF-8"?>
<!-- ================================================ -->
<!-- Sample buildfile for jar components -->
<!-- -->
<!-- ================================================ -->
<project name="dbxtune" default="dist" basedir=".">
<description>Build file for DbxTune</description>
<!-- - - - - - - - - - - - - - - - - - - - -->
<!-- set global properties for this build -->
<!-- - - - - - - - - - - - - - - - - - - - -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="launch4j.dir" location="c:/Program Files/Launch4j" />
<property name="scpPrivateFile" value="ant_push_private.properties"/>
<property file="${scpPrivateFile}"/>
<path id="project.class.path">
<fileset dir="lib" includes="*.jar"/>
<fileset dir="lib/jetty" includes="*.jar"/>
<fileset dir="lib/jdbc_drivers" includes="jconn4.jar"/>
<fileset dir="lib/jdbc_drivers" includes="mssql-jdbc-13.2.1.jre11.jar"/>
<!--
<pathelement location="lib/"/>
<pathelement path="${java.class.path}/"/>
<pathelement path="${additional.path}"/>
-->
</path>
<!-- - - - - - - - - - - - - - -->
<!-- target: help -->
<!-- - - - - - - - - - - - - - -->
<target name="help">
<echo>Here is a couple of commands</echo>
<echo> ant -p --- List things that can be done</echo>
<echo> ant --- just build a ZIP file</echo>
<echo> ant clean --- Remove various files</echo>
<echo> ant [-DscpPrivateFile=filename] push --- build and pushes a build to host in file 'ant_push_private.properties'</echo>
<echo> ant starter --- build only the DbxTuneStarter (.NET) package</echo>
</target>
<!-- - - - - - - - - - - - - - -->
<!-- target: init -->
<!-- - - - - - - - - - - - - - -->
<target name="init">
<!-- Create the time stamp -->
<tstamp>
<format property="DSTAMP" pattern="yyyy-MM-dd"/>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
</target>
<!-- - - - - - - - - - - - - - -->
<!-- target: build -->
<!-- - - - - - - - - - - - - - -->
<target name="build" depends="init" description="--> compile and jar this component">
<javac srcdir="${src.home}" destdir="${build.home}" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}">
<!-- <classpath refid="compile.classpath" />-->
<classpath refid="project.class.path"/>
</javac>
<jar destfile="${dist.home}/${app.name}.jar" basedir="${build.home}" excludes="**/*UT.class" />
</target>
<!-- - - - - - - - - - - - - - -->
<!-- target: compile -->
<!-- - - - - - - - - - - - - - -->
<target name="compile" depends="init" description="compile the source " >
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<!-- Compile the java code from ${src} into ${build} -->
<javac source="11" target="11" srcdir="${src}" destdir="${build}" debug="on" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
</target>
<!-- - - - - - - - - - - - - - -->
<!-- target: dist -->
<!-- - - - - - - - - - - - - - -->
<target name="dist" depends="compile" description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/bin"/>
<mkdir dir="${dist}/conf"/>
<mkdir dir="${dist}/doc"/>
<mkdir dir="${dist}/lib"/>
<mkdir dir="${dist}/data"/>
<mkdir dir="${dist}/classes"/>
<mkdir dir="${dist}/resources"/>
<!-- <launch4j configFile="./launch4j.xml" />-->
<copy file="README.txt" toFile="${dist}/README.txt"/>
<copy file="README_dbxcentral_install.txt" toFile="${dist}/README_dbxcentral_install.txt"/>
<copy file="LICENCE.txt" toFile="${dist}/LICENCE.txt"/>
<copy file="COPYING" toFile="${dist}/doc/COPYING"/>
<copy file="bin/perfdemo.bat" toFile="${dist}/bin/perfdemo.bat"/>
<copy file="bin/sqlw.bat" toFile="${dist}/bin/sqlw.bat"/>
<copy file="bin/sqlw.sh" toFile="${dist}/bin/sqlw.sh"/>
<copy file="bin/tailw.bat" toFile="${dist}/bin/tailw.bat"/>
<copy file="bin/tailw.sh" toFile="${dist}/bin/tailw.sh"/>
<copy file="${src}/com/dbxtune/images/sqlw_splash.jpg" toFile="${dist}/lib/sqlw_splash.jpg"/>
<copy file="${src}/com/dbxtune/images/sql_query_window_32.png" toFile="${dist}/lib/sqlw_icon_32.png"/>
<copy file="bin/dbxtune.bat" toFile="${dist}/bin/dbxtune.bat"/>
<copy file="bin/dbxtune.sh" toFile="${dist}/bin/dbxtune.sh"/>
<copy file="bin/dbxcentral.bat" toFile="${dist}/bin/dbxcentral.bat"/>
<copy file="bin/dbxcentral.sh" toFile="${dist}/bin/dbxcentral.sh"/>
<copy file="bin/asetune.bat" toFile="${dist}/bin/asetune.bat"/>
<copy file="bin/asetune.sh" toFile="${dist}/bin/asetune.sh"/>
<copy file="${src}/com/dbxtune/images/asetune_splash.jpg" toFile="${dist}/lib/asetune_splash.jpg"/>
<copy file="${src}/com/dbxtune/images/asetune_icon_32.gif" toFile="${dist}/lib/asetune_icon_32.gif"/>
<copy file="${src}/com/dbxtune/images/asetune_icon_32.png" toFile="${dist}/lib/asetune_icon_32.png"/>
<copy file="conf/dbxtune.properties" toFile="${dist}/conf/dbxtune.properties"/>
<copy file="doc/dbxtune-central.pptx" toFile="${dist}/doc/dbxtune-central.pptx"/>
<!-- - - - - - - - - - - - - - -->
<!-- Some files for DbxCental -->
<!-- - - - - - - - - - - - - - -->
<copy file="bin/dbxc_list_ALL.sh" toFile="${dist}/bin/dbxc_list_ALL.sh"/>
<copy file="bin/dbxc_start_ALL.sh" toFile="${dist}/bin/dbxc_start_ALL.sh"/>
<copy file="bin/dbxc_stop_ALL.sh" toFile="${dist}/bin/dbxc_stop_ALL.sh"/>
<copy file="bin/dbxPassword.sh" toFile="${dist}/bin/dbxPassword.sh"/>
<!--
<copy file="bin/dbxc_list_ALL.ps1" toFile="${dist}/bin/dbxc_list_ALL.ps1"/>
<copy file="bin/dbxc_start_ALL.ps1" toFile="${dist}/bin/dbxc_start_ALL.ps1"/>
<copy file="bin/dbxc_stop_ALL.ps1" toFile="${dist}/bin/dbxc_stop_ALL.ps1"/>
-->
<copy file="bin/dbxPassword.bat" toFile="${dist}/bin/dbxPassword.bat"/>
<!-- - - - - - - - - - - - - - -->
<!-- And the rest of the tools... but put them in the bin directory -->
<!-- - - - - - - - - - - - - - -->
<copy file="bin/iqtune.bat" toFile="${dist}/bin/iqtune.bat"/>
<copy file="bin/iqtune.sh" toFile="${dist}/bin/iqtune.sh"/>
<copy file="${src}/com/dbxtune/images/iqtune_splash.jpg" toFile="${dist}/lib/iqtune_splash.jpg"/>
<copy file="bin/rstune.bat" toFile="${dist}/bin/rstune.bat"/>
<copy file="bin/rstune.sh" toFile="${dist}/bin/rstune.sh"/>
<copy file="${src}/com/dbxtune/images/rstune_splash.jpg" toFile="${dist}/lib/rstune_splash.jpg"/>
<copy file="bin/raxtune.bat" toFile="${dist}/bin/raxtune.bat"/>
<copy file="bin/raxtune.sh" toFile="${dist}/bin/raxtune.sh"/>
<copy file="${src}/com/dbxtune/images/raxtune_splash.jpg" toFile="${dist}/lib/raxtune_splash.jpg"/>
<copy file="bin/hanatune.bat" toFile="${dist}/bin/hanatune.bat"/>
<copy file="bin/hanatune.sh" toFile="${dist}/bin/hanatune.sh"/>
<copy file="${src}/com/dbxtune/images/hanatune_splash.jpg" toFile="${dist}/lib/hanatune_splash.jpg"/>
<copy file="bin/sqlservertune.bat" toFile="${dist}/bin/sqlservertune.bat"/>
<copy file="bin/sqlservertune.sh" toFile="${dist}/bin/sqlservertune.sh"/>
<copy file="${src}/com/dbxtune/images/sqlservertune_splash.jpg" toFile="${dist}/lib/sqlservertune_splash.jpg"/>
<copy file="bin/oracletune.bat" toFile="${dist}/bin/oracletune.bat"/>
<copy file="bin/oracletune.sh" toFile="${dist}/bin/oracletune.sh"/>
<copy file="${src}/com/dbxtune/images/oracletune_splash.jpg" toFile="${dist}/lib/oracletune_splash.jpg"/>
<copy file="bin/postgrestune.bat" toFile="${dist}/bin/postgrestune.bat"/>
<copy file="bin/postgrestune.sh" toFile="${dist}/bin/postgrestune.sh"/>
<copy file="${src}/com/dbxtune/images/postgrestune_splash.jpg" toFile="${dist}/lib/postgrestune_splash.jpg"/>
<copy file="bin/mysqltune.bat" toFile="${dist}/bin/mysqltune.bat"/>
<copy file="bin/mysqltune.sh" toFile="${dist}/bin/mysqltune.sh"/>
<copy file="${src}/com/dbxtune/images/mysqltune_splash.jpg" toFile="${dist}/lib/mysqltune_splash.jpg"/>
<copy file="bin/db2tune.bat" toFile="${dist}/bin/db2tune.bat"/>
<copy file="bin/db2tune.sh" toFile="${dist}/bin/db2tune.sh"/>
<copy file="${src}/com/dbxtune/images/db2tune_splash.jpg" toFile="${dist}/lib/db2tune_splash.jpg"/>
<!-- - - - - - - - - - - - - - -->
<!-- And some extra files -->
<!-- - - - - - - - - - - - - - -->
<copy file="${src}/com/dbxtune/history.html" toFile="${dist}/history.html"/>
<copy todir="${dist}/lib">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</copy>
<copy todir="${dist}/lib/jetty">
<fileset dir="lib/jetty"/>
</copy>
<copy todir="${dist}/lib/jdbc_drivers">
<fileset dir="lib/jdbc_drivers"/>
</copy>
<copy todir="${dist}/lib/jaxb-ri">
<fileset dir="lib/jaxb-ri"/>
</copy>
<copy todir="${dist}/resources">
<fileset dir="resources"/>
</copy>
<!-- SQL Server - Showplan -->
<copy todir="${dist}/resources/WebContent/scripts/showplan/sqlserver">
<fileset dir="${src}/com/dbxtune/sql/showplan/sqlserver"/>
</copy>
<!-- Postgres - Showplan - PEV2 -->
<copy todir="${dist}/resources/WebContent/scripts/showplan/postgres">
<fileset dir="${src}/com/dbxtune/sql/showplan/postgres"/>
</copy>
<!-- Put everything in ${build} into the dbxtune.jar file -->
<jar destfile="${dist}/lib/dbxtune.jar">
<fileset dir="${build}"/>
<fileset dir="${src}" excludes="**/*.java"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="com.dbxtune.AseTune"/>
<attribute name="Built-Date" value="${TODAY}"/>
<!--
<attribute name="Implementation-Vendor" value="Goran Schwarz"/>
<attribute name="Implementation-Title" value="DbxTune - Database Performance Monitor Tool"/>
<attribute name="Implementation-Version" value="FIXME - ASA example: build 3152 J2SE"/>
<attribute name="Implementation-Version" value="${version.num}-b${build.number}"/>
<attribute name="Specification-Vendor" value="Goran Schwarz"/>
<attribute name="Specification-Title" value="DbxTune - Database Performance Monitor Tool"/>
<attribute name="Specification-Version" value="FIXME - ASA example: 12.0.1"/>
-->
</manifest>
</jar>
<!-- - - - - - - - - - - - - - -->
<!-- make a zip file dbxtune_${DSTAMP}.jar -->
<!-- - - - - - - - - - - - - - -->
<zip destfile="dbxtune_${DSTAMP}.zip"
basedir="${dist}"
/>
</target>
<!-- - - - - - - - - - - - - - -->
<!-- target: starter -->
<!-- - - - - - - - - - - - - - -->
<target name="starter" depends="init" description="build the DbxTuneStarter (.NET) package">
<exec executable="powershell" dir="${basedir}" failonerror="true">
<arg value="-NoProfile"/>
<arg value="-ExecutionPolicy"/>
<arg value="Bypass"/>
<arg value="-File"/>
<arg value="DbxTuneStarter/build.ps1"/>
<arg value="-Version"/>
<arg value="${DSTAMP}"/>
</exec>
</target>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- target: check-scp-private-props -->
<!-- - - - - - - - - - - - - - - - - - -->
<target name="check-scp-private-props">
<available file="ant_push_private.properties" property="scp-private.props.exists"/>
<fail unless="scp-private.props.exists"
message="Missing file 'ant_push_private.properties' -- copy 'ant_push_private.properties.TEMPLATE' and fill it in."/>
</target>
<!-- - - - - - - - - - - - - - -->
<!-- target: push -->
<!-- - - - - - - - - - - - - - -->
<target name="push" depends="init,check-scp-private-props,clean,dist" description="Push a temporary drop" >
<echo> =====================================================================</echo>
<echo> Note: specify scp props file with: ant -DscpPrivateFile=filename push</echo>
<echo> ---------------------------------------------------------------------</echo>
<!-- tries key auth first, falls back to password if key auth fails -->
<scp file="dbxtune_${DSTAMP}.zip" todir="${scp.user}@${scp.host}:${scp.path}" port="${scp.port}" trust="true"
keyfile="${scp.keyfile}" passphrase="${scp.passphrase}" password="${scp.password}" />
<!-- If a DbxTuneStarter package was built TODAY (via 'ant starter'), push it too -->
<available file="DbxTuneStarter/DbxTuneStarter_${DSTAMP}.zip" property="starter.zip.exists"/>
<antcall target="push-starter"/>
<antcall target="push-starter-skip-msg"/>
<antcall target="push-cleanup"/>
<!-- echo datetime -->
<tstamp>
<format property="BUILD_DATE" pattern="yyyy-MM-dd HH:mm:ss.sss zzz" locale="en,UK"/>
</tstamp>
<echo>PUSH END TIME: ${BUILD_DATE}</echo>
</target>
<!-- - - - - - - - - - - - - - -->
<!-- target: push-cleanup -->
<!-- - - - - - - - - - - - - - -->
<!-- Not meant to be run directly - deletes the ${build}/${dist} trees after push -->
<target name="push-cleanup">
<echo>Cleaning up build/dist directories...</echo>
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<!-- - - - - - - - - - - - - - -->
<!-- target: push-starter -->
<!-- - - - - - - - - - - - - - -->
<!-- Not meant to be run directly - called from 'push' only if a same-day -->
<!-- DbxTuneStarter_${DSTAMP}.zip exists (see 'starter.zip.exists' above) -->
<target name="push-starter" if="starter.zip.exists">
<echo>Found DbxTuneStarter_${DSTAMP}.zip - pushing it along with dbxtune_${DSTAMP}.zip</echo>
<scp file="DbxTuneStarter/DbxTuneStarter_${DSTAMP}.zip" todir="${scp.user}@${scp.host}:${scp.path}" port="${scp.port}" trust="true"
keyfile="${scp.keyfile}" passphrase="${scp.passphrase}" password="${scp.password}" />
</target>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- target: push-starter-skip-msg -->
<!-- - - - - - - - - - - - - - - - - - -->
<!-- Not meant to be run directly - the "else" branch of push-starter -->
<target name="push-starter-skip-msg" unless="starter.zip.exists">
<echo>No DbxTuneStarter_${DSTAMP}.zip file was found - skipping push of the starter</echo>
</target>
<!-- - - - - - - - - - - - - - -->
<!-- target: clean -->
<!-- - - - - - - - - - - - - - -->
<target name="clean" depends="init" description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete>
<fileset dir="." includes="dbxtune_*.zip"/>
</delete>
</target>
<!-- - - - - - - - - - - - - - -->
<!-- target: exe -->
<!-- - - - - - - - - - - - - - -->
<!--
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar" />
<target name="exe" description="Use launch4j to generate an EXE for DbxTune" depends="dist" >
<launch4j configFile="./launch4j.xml" />
</target>
-->
<!-- - - - - - - - - - - - - - -->
<!-- target: strip_svn -->
<!-- - - - - - - - - - - - - - -->
<!--
<target name="strip_svn" description="Strip Subversion directories... WARNING..." >
<delete includeemptydirs="true">
<fileset dir="." includes="**/.svn" defaultexcludes="false"/>
</delete>
</target>
-->
</project>