forked from splunk/eventgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
58 lines (47 loc) · 1.92 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="SA-Eventgen" default="package">
<!-- Get the environment -->
<property environment="env" />
<property name="build.dir" value="build"/>
<property name="build.version" value="5.0.2"/>
<!-- if BUILDNUMBER is not set, set it as 0 -->
<condition property="build.number" value="0">
<not>
<isset property="env.BUILDNUMBER"/>
</not>
</condition>
<!-- Grab the latest build number from Bamboo -->
<property name="build.number" value="${env.BUILDNUMBER}" />
<property name="dist.file" value="${build.dir}/dist/${ant.project.name}-${build.version}-${build.number}.spl"/>
<property name="mainapp.dir" value="${build.dir}/${ant.project.name}"/>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="mainapp">
<mkdir dir="${mainapp.dir}"/>
<copy todir="${mainapp.dir}">
<fileset dir=".">
<exclude name="**/.*"/>
<exclude name="local/**"/>
<exclude name="build/**"/>
<exclude name="**/*-gist"/>
<exclude name="**/*.xcf"/>
<exclude name="build.*"/>
</fileset>
</copy>
<replace file="${mainapp.dir}/default/app.conf" value="${build.version}">
<replacetoken>@build.version@</replacetoken>
</replace>
<replace file="${mainapp.dir}/default/app.conf" value="${build.number}">
<replacetoken>@build.number@</replacetoken>
</replace>
</target>
<target name="package" depends="mainapp">
<mkdir dir="${build.dir}/dist"/>
<tar destfile="${dist.file}" longfile="gnu" compression="gzip">
<tarfileset dir="${build.dir}" filemode="755" username="splunk" group="splunk">
<include name="SA-Eventgen/**"/>
</tarfileset>
</tar>
</target>
</project>