-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
78 lines (66 loc) · 2.72 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
75
76
77
78
<?xml version="1.0" encoding="UTF-8"?>
<project name="hadoop-distexec" default="main">
<description>
Distributed execution tool on hadoop.
</description>
<property environment="env"/>
<property file="local.properties"/>
<property name="version" value="1.0" />
<property name="hadoop.home" location="${env.HADOOP_HOME}"/>
<property name="src.dir" value="src/main/java"/>
<property name="test.dir" value="src/test/java"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="classes.test.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="dist"/>
<property name="lib.dir" value="lib"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
<fileset dir="${hadoop.home}" includes="hadoop-core-*.jar"/>
<fileset dir="${hadoop.home}" includes="lib/*.jar"/>
<!--<fileset dir="${hadoop.home}"-->
<!--includes="contrib/streaming/hadoop-streaming-*.jar" />-->
</path>
<path id="classpath.test">
<path refid="classpath"/>
<pathelement location="${classes.dir}"/>
</path>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${jar.dir}"/>
</target>
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="on"
classpathref="classpath"/>
<javac srcdir="${test.dir}" destdir="${classes.test.dir}" debug="on"
classpathref="classpath.test"/>
</target>
<target name="test" depends="compile">
<junit printsummary="yes" fork="yes" haltonfailure="yes">
<formatter type="plain" usefile="false"/>
<classpath>
<pathelement location="lib/junit-4.10.jar"/>
<path refid="classpath.test"/>
</classpath>
<batchtest>
<fileset dir="${test.dir}"/>
</batchtest>
</junit>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar"
basedir="${classes.dir}">
<!-- define MANIFEST.MF -->
<manifest>
<attribute name="Built-By" value="${ant.project.name}" />
<attribute name="Created-By" value="${ant.project.name}" />
<attribute name="Implementation-Version"
value="${version}" />
<attribute name="Main-Class" value="com.kadwa.hadoop.DistExec" />
</manifest>
</jar>
</target>
<target name="main" depends="clean,jar"/>
</project>