-
Notifications
You must be signed in to change notification settings - Fork 223
/
build.xml
72 lines (63 loc) · 3.1 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
<?xml version="1.0"?>
<project basedir="." default="release" xmlns:unless="ant:unless">
<property name="agent.name" value="aws-kinesis-agent" />
<property name="agent.package.name" value="AWSKinesisStreamingDataAgent" />
<property name="agent.version" value="1.1" />
<property name="agent.vendor" value="Amazon.com, Inc." />
<property name="src.root" location="." />
<property name="src.dir" location="src" />
<property name="build.root" location="ant_build" />
<property name="build.private" location="${build.root}/private" />
<property name="build.lib" location="${build.root}/lib" />
<property name="build.dependencies" location="dependencies" />
<path id="classpath">
<fileset dir="${build.dependencies}" includes="**/*.jar" />
<fileset dir="/usr/share/java" includes="**/*.jar" />
<fileset dir="${java.home}" includes="**/*.jar" />
</path>
<target name="get-java-version">
<condition property="current.java.version">
<or>
<equals arg1="${ant.java.version}" arg2="1.8"/>
<equals arg1="${ant.java.version}" arg2="11"/>
<equals arg1="${ant.java.version}" arg2="12"/>
<equals arg1="${ant.java.version}" arg2="13"/>
<equals arg1="${ant.java.version}" arg2="14"/>
<equals arg1="${ant.java.version}" arg2="15"/>
<equals arg1="${ant.java.version}" arg2="16"/>
<equals arg1="${ant.java.version}" arg2="17"/>
<equals arg1="${ant.java.version}" arg2="18"/>
<equals arg1="${ant.java.version}" arg2="19"/>
<equals arg1="${ant.java.version}" arg2="20"/>
<equals arg1="${ant.java.version}" arg2="21"/>
</or>
</condition>
</target>
<target name="check-java-version" depends="get-java-version" unless="current.java.version">
<fail message="Unsupported Java version: ${ant.java.version}. Make sure that the Java version is 1.8 or greater."/>
</target>
<target name="init">
<mkdir dir="${build.root}" />
</target>
<target name="compile" depends="check-java-version, init">
<mkdir dir="${build.private}" />
<property name="build.compiler" value="javac1.7" />
<javac source="1.8" target="1.8" includeantruntime="false" classpathref="classpath" srcdir="${src.dir}" destdir="${build.private}" debug="true" />
<property name="src.agent.path" value="com/amazon/kinesis/streaming/agent" />
<copy todir="${build.private}/${src.agent.path}" failonerror="true">
<fileset dir="${src.dir}/${src.agent.path}" excludes="**/*.java" />
</copy>
</target>
<target name="build" depends="compile">
<mkdir dir="${build.lib}" />
<jar jarfile="${build.lib}/${agent.package.name}-${agent.version}.jar" basedir="${build.private}">
<manifest>
<attribute name="Main-Class" value="com.amazon.kinesis.streaming.agent.Agent" />
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="${build.root}" />
</target>
<target name="release" depends="clean, compile, build" />
</project>