-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
324 lines (287 loc) · 16.2 KB
/
Copy pathbuild.xml
File metadata and controls
324 lines (287 loc) · 16.2 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2012 Quest Software, Inc.
ALL RIGHTS RESERVED.
This software is the confidential and proprietary information of
Quest Software Inc. ("Confidential Information"). You shall not
disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement you entered
into with Quest Software Inc.
QUEST SOFTWARE INC. MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT
THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
NON-INFRINGEMENT. QUEST SOFTWARE SHALL NOT BE LIABLE FOR ANY
DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
-->
<!--
This Ant build.xml file requires version 1.7.0 (or later) of Ant.
-->
<project name="CustomFXMCollector" default="dist" xmlns:fglam="fglam:/ant/macros">
<description>
This Ant build file can compile, package, test, and deploy the
CustomFXMCollector/CustomFXMDataCollector agent.
</description>
<!--
Load up a (completely optional) local properties file. You can use this file
to override any of the Ant properties in the build file. Or perhaps to
specify the location of the FglAM dev kit like this:
fglam.devkit.home=C:/Quest_Software/FglAM-Dev-Kit
or to set the location of your server install (for deployment of the cartridge)
fgl.server.home=C:/Quest_Software/FMS
-->
<property file="${basedir}/local.build.properties"/>
<!-- Add the external environment and find the FglAM installation -->
<property environment="env"/>
<condition property="fglam.devkit.home" value="${env.FGLAM_DEVKIT_HOME}">
<isset property="env.FGLAM_DEVKIT_HOME"/>
</condition>
<fail>
<condition><not><isset property="fglam.devkit.home"/></not></condition>.
The Ant property (fglam.devkit.home) that determines which FglAM dev kit to
use has not been set. You can set this as either an Ant property
(perhaps in ${basedir}/local.build.properties
or on the command line with -Dfglam.devkit.home) or via the environment
variable FGLAM_DEVKIT_HOME.
</fail>
<fail>
<condition><not>
<and>
<available file="${fglam.devkit.home}" type="dir"/>
<available file="${fglam.devkit.home}/buildtools/lib/devkit-ant.jar" type="file"/>
</and>
</not></condition>.
The specified FglAM developer's kit location, ${fglam.devkit.home},
does not appear to exist as a valid directory or does not contain a
recognized FglAM developer's kit.
</fail>
<!-- Import the FglAM tools -->
<import file="${fglam.devkit.home}/buildtools/fglam-ant-macros.xml"/>
<!-- Define some directories used throughout the build process -->
<property name="customfxmdatacollector.src.dir" value="${basedir}/src"/>
<property name="customfxmdatacollector.config.dir" value="${basedir}/config"/>
<property name="customfxmdatacollector.build.dir" value="${basedir}/build"/>
<property name="customfxmdatacollector.build.test.dir" value="${customfxmdatacollector.build.dir}/test"/>
<property name="customfxmdatacollector.tooling.output" value="${customfxmdatacollector.build.dir}/tooling"/>
<property name="customfxmdatacollector.dist.dir" value="${customfxmdatacollector.build.dir}/dist"/>
<property name="customfxmdatacollector.test.dir" value="${basedir}/test"/>
<property name="customfxmdatacollector.java.test.dir" value="${customfxmdatacollector.test.dir}/java"/>
<property name="customfxmdatacollector.lib.dir" value="${basedir}/lib"/>
<!--
This just sets a build number based on the current timestamp, you can override
this to use an externally supplied build number on the command line
with -Dcustomfxmdatacollector.build.number=... or put in your own Ant code for generating
a build number.
-->
<tstamp/>
<property name="customfxmdatacollector.build.number" value="local-build-${DSTAMP}-${TSTAMP}"/>
<!-- Generate the source code and related XML files. This will also initialize
some Ant properties from the agent manifest. All Ant properties
will be prefixed with "customfxmdatacollector." -->
<target name="tooling-artifacts" unless="customfxmdatacollector.artifacts.generated"
description="Generate all Java and XML files for the agent">
<fglam:generator agent-definition="${customfxmdatacollector.config.dir}/agent-definition.xml"
output-dir="${customfxmdatacollector.tooling.output}"
build-number="${customfxmdatacollector.build.number}"/>
<!-- Load the generated agent.manifest to initialize build properties
for use in later fglam ant macro calls -->
<fglam:init-agent-manifest-props agent-manifest="${customfxmdatacollector.tooling.output}/agent.manifest"
prefix="customfxmdatacollector"/>
<property name="customfxmdatacollector.artifacts.generated" value="true"/>
</target>
<!-- Compile and package the agent binary files -->
<target name="compile-and-jar" depends="tooling-artifacts" unless="customfxmdatacollector.compiled"
description="Compiles all the Java code and creates the requires jar file(s)">
<!-- Main (shipped) code -->
<fglam:compile-and-jar build-dir="${customfxmdatacollector.build.dir}">
<compile-options>
<src path="${customfxmdatacollector.tooling.output}/java-gen"/>
<src path="${customfxmdatacollector.src.dir}/java"/>
<include name="**/*.java"/>
<classpath>
<fileset dir="${customfxmdatacollector.lib.dir}" includes="*.jar"/>
</classpath>
</compile-options>
<jar-options>
<!-- Adds the LogResources.properties files to the jar file -->
<fileset dir="${customfxmdatacollector.src.dir}/java" includes="**/*.properties"/>
<!-- Add any jar files in the lib directory -->
<fileset dir="${customfxmdatacollector.lib.dir}" includes="*.jar"/>
</jar-options>
</fglam:compile-and-jar>
<!-- Unit test code -->
<mkdir dir="${customfxmdatacollector.build.test.dir}/classes"/>
<javac target="1.6" source="1.6"
includeantruntime="no" includejavaruntime="no"
deprecation="true" debug="true" debuglevel="lines,vars,source"
destdir="${customfxmdatacollector.build.test.dir}/classes">
<classpath>
<fileset dir="${customfxmdatacollector.build.dir}/jars">
<include name="*.jar"/>
</fileset>
<fileset dir="${customfxmdatacollector.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${fglam.devkit.home}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${fglam.devkit.home}/buildtools/junit">
<include name="junit*.jar"/>
</fileset>
<fileset dir="${customfxmdatacollector.build.dir}/jars">
<include name="*.jar"/>
</fileset>
</classpath>
<src path="${customfxmdatacollector.java.test.dir}"/>
<include name="**/*.java"/>
</javac>
<property name="customfxmdatacollector.compiled" value="true"/>
</target>
<!-- Creates a distribution which results in a FMS 5.0 deployeable cartridge file -->
<target name="dist" depends="compile-and-jar"
description="Builds a deployable cartridge with a GAR installer">
<!-- create the dist output directory -->
<mkdir dir="${customfxmdatacollector.dist.dir}"/>
<fglam:gar agent-manifest="${customfxmdatacollector.tooling.output}/agent.manifest"
agent-lib-dir ="${customfxmdatacollector.build.dir}/jars"
build-dir="${customfxmdatacollector.build.dir}"
prefix="customfxmdatacollector">
<additional-contents>
<tarfileset prefix="lib/" dir="${customfxmdatacollector.lib.dir}">
<include name="*.jar"/>
</tarfileset>
</additional-contents>
</fglam:gar>
<echo level="info">Making topology in ${customfxmdatacollector.dist.dir}</echo>
<echo level="info">CDT file ${customfxmdatacollector.tooling.output}/cdt.xml</echo>
<echo level="info">Topology file ${customfxmdatacollector.tooling.output}/CustomFXMDataCollector-topology.xml</echo>
<echo level="info">Monitoring Policy file ${customfxmdatacollector.tooling.output}/monitoring-policy.xml</echo>
<echo level="info">WCF (input) file ${customfxmdatacollector.config.dir}/wcf.xml</echo>
<car destdir="${customfxmdatacollector.dist.dir}" buildLocalizableCar="false">
<cartridge
name="${customfxmdatacollector.agent-manifest.name}"
final="true"
version="${customfxmdatacollector.agent-manifest.ver}"
buildid="${customfxmdatacollector.agent-manifest.build-id}"
author="FglAM Agent Developers">
<installers
name="${customfxmdatacollector.agent-manifest.name}-Installers"
version="${customfxmdatacollector.agent-manifest.ver}">
<installer
name="${customfxmdatacollector.agent-manifest.name}"
version="${customfxmdatacollector.agent-manifest.ver}"
file="${customfxmdatacollector.build.dir}/gar/${customfxmdatacollector.agent-manifest.name}.gar"
type="fglam-client-pkg">
<!-- This installer contains the following agent types. Each agent
type in the cartridge must be listed here. -->
<agent type="customfxmdatacollector"
version="${customfxmdatacollector.agent-manifest.ver}"
build="${customfxmdatacollector.agent-manifest.build-id}"/>
</installer>
</installers>
<monitoringpolicy
name="${customfxmdatacollector.agent-manifest.name}-Properties"
version="${customfxmdatacollector.agent-manifest.ver}"
file="${customfxmdatacollector.tooling.output}/monitoring-policy.xml"/>
<cdt name="customfxmdatacollector-CDT"
version="${customfxmdatacollector.agent-manifest.ver}"
adapter="FglAM">
<binding type="CustomFXMDataCollector" file="${customfxmdatacollector.tooling.output}/cdt.xml"/>
</cdt>
<topologytypes
name="${customfxmdatacollector.agent-manifest.name}-Topology-Types"
version="${customfxmdatacollector.agent-manifest.ver}"
file="${customfxmdatacollector.tooling.output}/CustomFXMDataCollector-topology.xml"/>
<!-- The topology schema in a cartridge can now be localized by deploying a resource bundle.
The cartridge component must use the "topology-localizations" name and the basename must
be the name of your properties file without any locale suffixes or file extensions. If
your properties file is topology-localizations.properties, then the basename would have
to be "topology-localizations". To see the new localized names go to the Schema Browser,
select one of your topology types, and hover over the property name. The page itself should
show the camelCase name, but the hover should show the new localized name. -->
<!-- <localizations
name="topology-localizations"
cartridge="${customfxmdatacollector.agent-manifest.name}"
version="${customfxmdatacollector.agent-manifest.ver}"
basename="TopologyLocale">
<fileset dir="${customfxmdatacollector.config.dir}/locale">
<include name="**/*.properties"/>
</fileset>
</localizations>
-->
</cartridge>
</car>
</target>
<!--
Launches the Agent Harness and loads up the newly compiled agent for testing.
-->
<target name="run" depends="dist"
description="Launches the Agent Harness app">
<fglam:agent-harness agent-file="${customfxmdatacollector.config.dir}/agent-definition.xml"
gar-file="${customfxmdatacollector.build.dir}/gar/${customfxmdatacollector.agent-manifest.name}.gar"/>
</target>
<!-- Deploy the created cartridge to a running server -->
<target name="deploy" depends="dist"
description="Deploy the created cartridge to a running server">
<fglam:redeploy-cartridge name="${customfxmdatacollector.agent-manifest.name}"
version="${customfxmdatacollector.agent-manifest.ver}"
dir="${customfxmdatacollector.dist.dir}"/>
</target>
<!-- Removes all generated and compiled artifacts -->
<target name="clean"
description="Removes all generated and compiled artifacts">
<delete quiet="true" includeemptydirs="true">
<fileset dir="${customfxmdatacollector.build.dir}" includes="**"/>
</delete>
</target>
<!-- Run Findbugs on the created agent jar file. -->
<target name="findbugs" depends="compile-and-jar"
description="Run Findbugs on the created agent jar file.">
<fglam:findbugs results="${customfxmdatacollector.build.dir}/results" analyze="de.quest.pso.fxm.agent.customCollector.-">
<fglam:findbugs-jars>
<fileset dir="${customfxmdatacollector.build.dir}/jars">
<include name="*.jar"/>
</fileset>
</fglam:findbugs-jars>
<fglam:findbugs-args>
<arg value="-sourcepath"/><arg path="${basedir}/src/java"/>
<arg value="-sourcepath"/><arg path="${customfxmdatacollector.build.dir}/tooling/java-gen"/>
</fglam:findbugs-args>
<fglam:findbugs-aux>
<fileset dir="${customfxmdatacollector.lib.dir}">
<include name="*.jar"/>
</fileset>
</fglam:findbugs-aux>
</fglam:findbugs>
</target>
<target name="junit" depends="compile-and-jar"
description="Run any JUnit tests provided for the agent">
<fglam:junit results="${customfxmdatacollector.build.dir}/results">
<fglam:jvm-args/>
<fglam:jars>
<fileset dir="${customfxmdatacollector.build.dir}/jars">
<include name="*.jar"/>
</fileset>
<fileset dir="${customfxmdatacollector.lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement location="${customfxmdatacollector.build.test.dir}/classes"/>
</fglam:jars>
<fglam:files>
<fileset dir="${customfxmdatacollector.java.test.dir}">
<include name="**/*.java"/>
</fileset>
</fglam:files>
</fglam:junit>
</target>
<target name="tests" depends="junit,findbugs"
description="Runs all the tests defined for the customfxmdatacollector agent">
<fail message="One or more JUnit tests failed" if="junit.failure"/>
<fail message="One or more of the FindBugs tests failed">
<condition>
<not><equals arg1="${findbugs.exitcode}" arg2="0"/></not>
</condition>
</fail>
</target>
</project>