/
build.xml
83 lines (72 loc) · 2.85 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
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<project name="Mozilla Crash-Reports" default="compile" basedir=".">
<!-- Load all properties -->
<property file="${basedir}/build.properties"/>
<path id="classpath">
<pathelement location="${build.classes}"/>
<pathelement location="."/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="build"/>
</delete>
</target>
<target name="init" depends="clean">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.javadoc}"/>
<mkdir dir="${build.lib}"/>
</target>
<target name="compile-java" depends="init">
<javac encoding="${build.encoding}" srcdir="${java.src.dir}" includes="**/*.java" destdir="${build.classes}" debug="${debug}" source="${java.src.version}" optimize="${optimize}" deprecation="${deprecation}" includeAntRuntime="false">
<classpath refid="classpath"/>
<compilerarg line="-Xlint:unchecked"/>
</javac>
</target>
<target name="compile" depends="compile-java"/>
<target name="ensure-class-name" unless="class">
<fail message="You must run this target with -Dclass=ClassName"/>
</target>
<target name="hadoop-jar" depends="compile">
<delete file="${build.lib}/${project.name}-job.jar"/>
<jar destfile="${build.lib}/${project.name}-job.jar">
<fileset dir="${build.classes}"/>
<fileset dir=".">
<include name="lib/*.jar"/>
<exclude name="lib/hadoop*.jar"/>
<exclude name="lib/hbase*.jar"/>
<exclude name="lib/zookeeper*.jar"/>
<exclude name="lib/pig*.jar"/>
</fileset>
</jar>
</target>
<target name="jar" depends="compile">
<jar destfile="${build.lib}/${project.name}.jar">
<fileset dir="${build.classes}"/>
</jar>
</target>
<target name="war" depends="compile" description="--> Create the WAR file">
<mkdir dir="${dist.dir}"/>
<!-- Copy Log4j config to build so it gets included in classes dir -->
<copy todir="${build.dir}/classes">
<fileset dir="${webapp.webinf.dir}/config" includes="log4j.*"/>
</copy>
<war destfile="${dist.dir}/${project.name}.war" webxml="${webapp.webinf.dir}/web.xml">
<webinf dir="${webapp.webinf.dir}">
<exclude name="web.xml"/>
</webinf>
<metainf dir="${webapp.metainf.dir}"/>
<lib dir="${lib.dir}"/>
<classes dir="${build.dir}/classes"/>
</war>
</target>
<target name="deploy" depends="war" description="--> Deploy the WAR file">
<copy file="${dist.dir}/${project.name}.war" todir="${tomcat.dir}/webapps" overwrite="true"/>
</target>
</project>