forked from adrrowcliffe/splunk-alerting-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
159 lines (150 loc) · 7.37 KB
/
build.xml
File metadata and controls
159 lines (150 loc) · 7.37 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is the splunkClient build file, it builds all files needed and packages them.
It makes one jar splunkClient.jar and packages it with other required files into a single
archive file com.appdynamics.splunk.splunkClient<version>.zip
-->
<project name="splunkClient" default="compile" basedir=".">
<property file="version.properties" />
<property name="common-src" location="src/main/java"/>
<property name="src" location="src/main/java"/>
<property name="build" location="build"/>
<property name="classes" location="${build}/classes"/>
<property name="docs" location="${build}/docs"/>
<property name="dist" location="dist"/>
<property name="conf" location="src/main/conf"/>
<property name="custom-actions" location="src/main/custom/actions"/>
<property name="log4j" location="lib/log4j/log4j-1.2.15.jar"/>
<property name="commons-lang" location="lib/commons/commons-lang-2.4.jar"/>
<property name="commons-collections" location="lib/commons/commons-collections-3.2.1.jar"/>
<property name="splunk" location="lib/splunk/splunk.jar"/>
<property name="splunk-logging" location="lib/splunk/splunklogging.jar"/>
<property name="apache-license" location="lib/splunk/Apache-LICENSE.txt"/>
<property name="splunklogging-license" location="lib/splunk/SplunkLogging-LICENSE.txt"/>
<property name="commons-codec" location="lib/axis2/commons-codec-1.3.jar"/>
<property environment="env"/>
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm"/>
</tstamp>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="lib/ant-contrib/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<target name="init" depends="clean">
<mkdir dir="${dist}"/>
<mkdir dir="${build}"/>
<mkdir dir="${classes}"/>
<mkdir dir="${build}/temp"/>
<mkdir dir="${build}/temp/custom"/>
<mkdir dir="${build}/temp/custom/lib"/>
<mkdir dir="${build}/temp/custom/logs"/>
<mkdir dir="${build}/temp/custom/conf"/>
<mkdir dir="${build}/temp/custom/actions"/>
<mkdir dir="${build}/temp/custom/actions/notify-splunk-of-event"/>
<mkdir dir="${build}/temp/custom/actions/notify-splunk-of-policy-violation"/>
</target>
<target name="clean">
<delete failonerror="true" quiet="true" dir="${dist}"/>
<delete failonerror="true" quiet="true" dir="${build}"/>
</target>
<target name="debugcompile">
<javac fork="true" destdir="${classes}" source="1.5" target="1.5" debug="on" debuglevel="lines,vars,source" includeantruntime="false">
<src path="${common-src}"/>
<src path="${src}"/>
<classpath>
<pathelement location="${log4j}"/>
<pathelement location="${commons-codec}"/>
<pathelement location="${commons-lang}"/>
<pathelement location="${commons-collections}"/>
<pathelement location="${splunk}"/>
<pathelement location="${splunk-logging}"/>
</classpath>
<include name="com/appdynamics/**/*.java"/>
</javac>
</target>
<target name="compile" depends="init">
<javac fork="true" destdir="${classes}" source="1.5" target="1.5" debug="off" includeantruntime="false">
<src path="${common-src}"/>
<src path="${src}"/>
<classpath>
<pathelement location="${log4j}"/>
<pathelement location="${commons-codec}"/>
<pathelement location="${commons-lang}"/>
<pathelement location="${commons-collections}"/>
<pathelement location="${splunk}"/>
<pathelement location="${splunk-logging}"/>
</classpath>
<include name="com/appdynamics/**/*.java"/>
</javac>
</target>
<target name="debugjar" depends="debugcompile">
<jar destfile="${build}/temp/custom/lib/splunkClient.jar">
<fileset dir="${classes}"/>
<manifest>
<attribute name="Implementation-Vendor" value="AppDynamics Inc."/>
<attribute name="Implementation-Version" value="Splunk Client v${splunkClient-client-version} ${release} Build Date ${TODAY}"/>
<attribute name="Main-Class" value="com.appdynamics.splunk.splunkClient.SendADNotificationToSplunk"/>
<attribute name="Class-Path" value="./log4j.xml ./log4j-1.2.15.jar ./commons-lang-2.4.jar ./commons-collections-3.2.1.jar ./splunk.jar ./splunklogging.jar ./commons-codec-1.3.jar"/>
</manifest>
</jar>
</target>
<target name="jar" depends="compile">
<jar destfile="${build}/temp/custom/lib/splunkClient.jar">
<fileset dir="${classes}"/>
<manifest>
<attribute name="Implementation-Vendor" value="AppDynamics Inc."/>
<attribute name="Implementation-Version" value="Splunk Client v${splunk-client-version} ${release} Build Date ${TODAY}"/>
<attribute name="Main-Class" value="com.appdynamics.splunk.splunkClient.SendADNotificationToSplunk"/>
<attribute name="Class-Path" value="./log4j.xml ./log4j-1.2.15.jar ./commons-lang-2.4.jar ./commons-collections-3.2.1.jar ./splunk.jar ./splunklogging.jar ./commons-codec-1.3.jar"/>
</manifest>
</jar>
</target>
<target name="package" depends="jar">
<if>
<or>
<os family="unix" />
<os family="mac" />
</or>
<then>
<copy tofile="${build}/temp/custom/actions/custom.xml" file="${custom-actions}/custom.xml.linux" /> </then>
<elseif> <os family="windows" />
<then>
<copy tofile="${build}/temp/custom/actions/custom.xml" file="${custom-actions}/custom.xml.windows" /> </then>
</elseif>
<else>
<then>
<copy tofile="${build}/temp/custom/actions/custom.xml" file="${custom-actions}/custom.xml.linux" />
</then> </else>
</if>
<copy todir="${build}/temp/custom/actions/notify-splunk-of-event">
<fileset dir="${custom-actions}/notify-splunk-of-event/" includes="notify-splunk-of-event.*"/>
</copy>
<chmod perm="a+x">
<fileset dir="${build}/temp/custom/actions/notify-splunk-of-event" includes="notify-splunk-of-event.*"/>
</chmod>
<copy todir="${build}/temp/custom/actions/notify-splunk-of-policy-violation">
<fileset dir="${custom-actions}/notify-splunk-of-policy-violation/" includes="notify-splunk-of-policy-violation.*"/>
</copy>
<chmod perm="a+x">
<fileset dir="${build}/temp/custom/actions/notify-splunk-of-policy-violation/" includes="notify-splunk-of-policy-violation.*"/>
</chmod>
<copy todir="${build}/temp/custom/conf/">
<fileset file="${conf}/.splunkrc"/>
<fileset file="${conf}/log4j.dtd"/>
<fileset file="${conf}/log4j.xml"/>
</copy>
<copy todir="${build}/temp/custom/lib/">
<fileset file="${log4j}"/>
<fileset file="${commons-lang}"/>
<fileset file="${commons-collections}"/>
<fileset file="${splunk}"/>
<fileset file="${splunk-logging}"/>
<fileset file="${commons-codec}"/>
<fileset file="${apache-license}"/>
<fileset file="${splunklogging-license}"/>
</copy>
<zip destfile="${dist}/splunkClient-${splunk-client-version}.zip">
<zipfileset dir="${build}/temp" filemode="755"/>
</zip>
</target>
</project>