-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
74 lines (64 loc) · 2.03 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
<project name="bacon" default="all" basedir=".">
<property environment="env" />
<property name="src.dir" value="src" />
<property name="es.lib" value="${env.ES_HOME}/libexec" />
<property name="lib.dir" value="lib" />
<property name="build.dir" value="build" />
<target name="all" depends="jar" />
<macrodef name="git-revision">
<attribute name="output" />
<sequential>
<exec executable="git" outputproperty="head">
<arg value="rev-parse" />
<arg value="HEAD" />
</exec>
<echo message="Git revision: ${head}"/>
<exec executable="git" outputproperty="dirty">
<arg value="status" />
<arg value="-s" />
</exec>
<condition property="@{output}" value="${head}" else="${head}-dirty">
<equals arg1="${dirty}" arg2="" />
</condition>
</sequential>
</macrodef>
<target name="compile">
<fail message="ES_HOME must be set">
<condition>
<equals arg1="${env.ES_HOME}" arg2="$${env.ES_HOME}" trim="true" />
</condition>
</fail>
<mkdir dir="${build.dir}/classes" />
<javac
destdir="${build.dir}/classes"
debug="true"
verbose="false"
source="1.7"
target="1.7"
encoding="UTF-8"
fork="true"
deprecation="false">
<src path="${src.dir}/java" />
<include name="**/*.java" />
<classpath>
<fileset dir="${es.lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<git-revision output="git.rev"></git-revision>
<echo message="${git.rev}" file="${build.dir}/version" />
<jar destfile="${build.dir}/elasticsource-${git.rev}.jar">
<fileset file="${build.dir}/version" />
<fileset dir="${build.dir}/classes" />
</jar>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
</project>