-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
116 lines (90 loc) · 3.29 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?xml version="1.0"?>
<project name="hadoop-extra" default="build" basedir=".">
<property name="hadoop.lib" location="${hadoop.home}/lib"/>
<property name="dist.version" value="0.1"/>
<property name="src.dir" location="${basedir}/src/java"/>
<property name="src.test" location="${basedir}/src/test"/>
<available file="${src.dir}" type="dir" property="main.available"/>
<available file="${src.test}" type="dir" property="test.available"/>
<property name="conf.dir" location="${hadoop.home}/conf"/>
<property name="lib.dir" location="${basedir}/lib"/>
<property name="build.dir" location="${basedir}/build/"/>
<property name="build.classes" location="${build.dir}/classes"/>
<property name="build.test" location="${build.dir}/test"/>
<property name="test.results" location="${build.dir}/results"/>
<property name="javac.debug" value="true"/>
<property name="dist" location="dist"/>
<path id="project.class.path">
<pathelement location="${build.classes}"/>
<pathelement location="${build.test}"/>
<fileset dir="${lib.dir}" erroronmissingdir="false">
<include name="*.jar"/>
</fileset>
<fileset dir="${hadoop.home}">
<include name="*.jar"/>
</fileset>
<fileset dir="${hadoop.home}/build" erroronmissingdir="false">
<include name="*.jar"/>
</fileset>
<fileset dir="${hadoop.lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${hbase.home}">
<include name="*.jar"/>
</fileset>
<fileset dir="${hbase.home}/lib/">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean">
<echo message="cleaning..."/>
<delete dir="${build.dir}"/>
<delete dir="${dist}"/>
<delete dir="${ant.project.name}.tgz"/>
</target>
<target name="build">
<echo message="building..."/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.test}"/>
<javac srcdir="${src.dir}" destdir="${build.classes}" verbose="off" debug="${javac.debug}"
includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<copy todir="${build.classes}">
<fileset dir="${src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<javac srcdir="${src.test}" destdir="${build.test}" verbose="off" debug="${javac.debug}" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<copy todir="${build.test}">
<fileset dir="${src.test}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="jar" depends="build" description="creates module jar">
<jar jarfile="${build.dir}/${ant.project.name}-${dist.version}.jar">
<fileset dir="${build.classes}"/>
</jar>
</target>
<target name="dist" depends="clean" description="packages current project">
<mkdir dir="${dist}"/>
<copy todir="${dist}">
<fileset dir=".">
<include name="src/**"/>
<include name="build.xml"/>
<include name="README.txt"/>
</fileset>
</copy>
</target>
<target name="tar" depends="dist" description="creates an archive of current project">
<tar destfile="${ant.project.name}.tgz"
compression="gzip">
<tarfileset dir="dist/" prefix="${ant.project.name}">
<include name="**/**"/>
</tarfileset>
</tar>
</target>
</project>