forked from twitter/elephant-bird
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
109 lines (94 loc) · 3.6 KB
/
build.xml
File metadata and controls
109 lines (94 loc) · 3.6 KB
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
<project name="elephant-bird" default="release-jar" basedir=".">
<!-- Global properties for this build -->
<property name="jar.name" value="elephant-bird" />
<property name="version" value="1.3.0" />
<!-- Directories -->
<property name="build.dir" location="build" />
<property name="test-build.dir" value="test-build" />
<property name="javadoc.dir" location="javadoc" />
<property name="dist.dir" location="dist" />
<property name="src.dir" location="src" />
<property name="lib.dir" value="${basedir}/lib"/>
<property name="test-src.dir" value="test" />
<target name="debug" description="sets properties for debugging (logging on, debug symbols, etc)">
<echo message="Building in debug mode..."/>
<property name="compile.mode" value="debug"/>
<property name="java.debug" value="true"/>
</target>
<target name="release" description="sets properties for release builds.">
<echo message="Building in release mode..."/>
<property name="compile.mode" value="release"/>
<property name="java.debug" value="false"/>
</target>
<target name="init">
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}" />
<mkdir dir="${test-build.dir}"/>
</target>
<macrodef name="compile-standard">
<sequential>
<!-- Compile the java code from ${src.java} into ${build} -->
<javac srcdir="${src.dir}" destdir="${build.dir}" debug="${java.debug}" debuglevel="lines,vars,source">
<classpath>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
<javac debug="true" debuglevel="lines,vars,source" srcdir="${test-src.dir}" destdir="${test-build.dir}">
<classpath>
<pathelement location="${build.dir}" />
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</sequential>
</macrodef>
<target name="compile" depends="init" description="compile the source">
<compile-standard />
</target>
<target name="jar" depends="compile" description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist.dir}"/>
<!-- Delete the old jar file -->
<delete file="${dist.dir}/${jar.name}-${version}.jar"/>
<jar jarfile="${dist.dir}/${jar.name}-${version}.jar">
<fileset dir="${build.dir}"/>
</jar>
</target>
<target name="javadoc" depends="compile" description="generate documentation" >
<delete dir="${javadoc.dir}" />
<javadoc destdir="${javadoc.dir}">
<fileset dir="${src.dir}" />
<classpath>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
<target name="debug-jar" description="Build debug and jar" depends="debug,jar"/>
<target name="release-jar" description="Build release and jar" depends="release,jar"/>
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build.dir}"/>
<delete dir="${test-build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="test" depends="compile">
<junit printsummary="yes" fork="yes" haltonfailure="no">
<classpath>
<pathelement path="${build.dir}" />
<pathelement path="${test-build.dir}" />
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
<sysproperty key="java.library.path" value="/usr/local/lib" />
<formatter type="plain"/>
<test name="com.twitter.elephantbird.pig.load.TestJsonLoader"/>
</junit>
</target>
</project>