-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.xml
125 lines (107 loc) · 4.66 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
117
118
119
120
121
122
123
124
125
<project name="beeno" basedir="." default="jar">
<property environment="env"/>
<property name="project.title" value="Meetup Beeno" />
<property name="project.version" value="0.2-dev" />
<property name="build.dir" value="${basedir}/build" />
<property name="build.test" value="${basedir}/build/test" />
<property name="dist.dir" value="${basedir}/dist" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="src.dir" value="${basedir}/src/java" />
<property name="docs" value="${basedir}/docs" />
<property name="test.src.dir" value="${basedir}/test/java" />
<property name="test.jysrc.dir" value="${basedir}/test/jython" />
<property name="docs" value="${basedir}/docs" />
<path id="project.class.path">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<!-- ====================== Prep Work =========================================== -->
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="clean" description="Cleans up any previous build products" >
<delete dir="${dist.dir}" failonerror="false"/>
<delete dir="${build.dir}" failonerror="false"/>
</target>
<!-- ====================== Compilation Targets ================================= -->
<!-- build the source -->
<target name="compile" depends="init"
description="Compile java classes">
<javac debug="yes" srcdir="${src.dir}" destdir="${build.dir}" deprecation="true" source="1.6" nowarn="true" >
<classpath refid="project.class.path"/>
<compilerarg line="-Xmaxerrs 10000"/>
</javac>
<javac debug="yes" srcdir="${test.src.dir}" destdir="${build.dir}" deprecation="true" source="1.6" nowarn="true" >
<classpath refid="project.class.path"/>
<compilerarg line="-Xmaxerrs 10000"/>
</javac>
</target>
<!-- really build all source -->
<target name="compile_clean" depends="clean, compile"
description="Compile java classes from scratch" />
<!-- package up classes into a jar file -->
<target name="jar" depends="compile_clean"
description="Package compiled classes into a jar file for distribution">
<jar destfile="${dist.dir}/meetup.beeno-${project.version}.jar">
<fileset dir="${build.dir}" includes="**/*" />
</jar>
</target>
<!-- ====================== Run Tests ============================== -->
<target name="test" depends="-jyunit_prepare"
description="Run all unit tests">
<mkdir dir="${build.test}/data" />
<exec executable="${basedir}/bin/run_tests.sh"
failonerror="yes"
inputstring="${tests.files}">
<!-- system properties need for hbase test case -->
<env key="JAVA_OPTS" value="-Dtest.build.data=${build.test}/data -Xmx2048M -XX:MaxPermSize=128M"/>
<arg value="--javasrc=${test.src.dir}" />
<arg value="--directory=${test.jysrc.dir}" />
<arg value="--product=Meetup.Beeno" />
<!-- read test files list from stdin -->
<arg value="--file=-" />
</exec>
</target>
<!-- prepare the standard test run (skips API/flow tests) -->
<target name="-jyunit_prepare" depends="compile_clean">
<pathconvert property="tests.files" pathsep="${line.separator}">
<fileset dir="${test.src.dir}" id="tests.java">
<include name="**/*.java" />
<exclude name="**/*$py.java" />
</fileset>
<fileset dir="${test.jysrc.dir}" id="tests.jython">
<include name="**/test_*.py" />
</fileset>
</pathconvert>
</target>
<!-- ====================== JavaDoc Generation ================================ -->
<target name="javadoc" description="Generate JavaDoc API docs">
<delete quiet="true">
<fileset dir="${docs}" />
</delete>
<mkdir dir="$(docs)" />
<javadoc sourcepath="${src.dir}"
destdir="${docs}"
packagenames="meetup.beeno.*"
author="true"
source="1.6"
private="true"
version="true"
defaultexcludes="yes"
use="true"
maxmemory="512m"
windowtitle="Meetup Beeno API Documentation"
doctitle="<h1>${project.title} Documentation (Version ${project.version})</h1>"
bottom="Copyright © 2004 - Meetup Inc">
<classpath refid="project.class.path"/>
</javadoc>
</target>
<!-- Regenerate Protocol Buffer classes for data types -->
<target name="hbaseprotobuf" description="Generate Java classes and protocol buffer descriptors for HBase data types" depends="init">
<exec executable="protoc">
<arg line="-I=/usr/local/include:${src.dir}" />
<arg line="--java_out=${src.dir}" />
<arg line="${src.dir}/meetup/beeno/datatypes.proto" />
</exec>
</target>
</project>