forked from awslabs/amazon-kinesis-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
62 lines (53 loc) · 2.55 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
<?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.7"/>
<equals arg1="${ant.java.version}" arg2="1.8"/>
</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.7 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>