-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
148 lines (130 loc) · 4.82 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<project name="AppEngineMapper" default="dist" basedir=".">
<description>
A user space mapper library for AppEngine.
</description>
<property name="src" location="src" />
<property name="build" location="build" />
<property name="lib" location="lib" />
<property name="dist" location="dist" />
<property name="static" location="static" />
<property name="testsrc" location="test" />
<property name="testbuild" location="test_build" />
<property name="testlib" location="test_lib" />
<property name="sdk" location="sdk" />
<property name="version" value="1.4.3" />
<property name="sdkdirname" value="appengine-java-sdk-${version}" />
<property name="sdkfilename" value="${sdkdirname}.zip" />
<property name="sdklibdir" location="${sdk}/${sdkdirname}/lib" />
<path id="sdkjars">
<fileset dir="${sdklibdir}/user">
<include name="appengine-api-1.0-sdk-${version}.jar" />
</fileset>
<fileset dir="${sdklibdir}/shared">
<include name="geronimo-servlet_2.5_spec-1.2.jar" />
<include name="servlet-api.jar" />
</fileset>
</path>
<!-- We plan to move to downloading all of these on the fly, but for now
hadoop is modified, json is jar'ed up, and the other two are released
relatively infrequently. -->
<path id="thirdpartyjars">
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>
</path>
<path id="testjars">
<pathelement path="${testlib}/easymock-3.0.jar" />
<pathelement path="${testlib}/junit-4.8.2.jar" />
<pathelement path="${testlib}/cglib-nodep-2.2.jar" />
<pathelement path="${testlib}/objenesis-1.2.jar" />
<pathelement path="${sdklibdir}/testing/appengine-testing.jar" />
<pathelement path="${sdklibdir}/impl/appengine-api-stubs.jar" />
</path>
<target name="init">
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init,download_sdk">
<javac srcdir="${src}" destdir="${build}" debug="on" debuglevel="lines,source">
<classpath>
<path refid="sdkjars" />
<path refid="thirdpartyjars" />
</classpath>
</javac>
</target>
<target name="test_init">
<mkdir dir="${testbuild}" />
</target>
<target name="test_compile" depends="test_init,dist,download_sdk">
<javac srcdir="${testsrc}" destdir="${testbuild}" debug="on" debuglevel="lines,source">
<classpath>
<path refid="sdkjars" />
<path refid="thirdpartyjars" />
<path refid="testjars" />
<pathelement location="${dist}/lib/appengine-mapper.jar" />
</classpath>
</javac>
</target>
<target name="test" depends="test_compile">
<junit filtertrace="off">
<test name="com.google.appengine.tools.mapreduce.AllTests" />
<classpath>
<path refid="sdkjars" />
<path refid="thirdpartyjars" />
<path refid="testjars" />
<pathelement location="${dist}/lib/appengine-mapper.jar" />
<pathelement location="${testbuild}" />
</classpath>
<formatter type="brief" usefile="false" />
</junit>
</target>
<target name="dist" depends="compile">
<mkdir dir="${dist}/lib" />
<copy todir="${build}/com/google/appengine/tools/mapreduce">
<fileset dir="${static}" />
</copy>
<copy todir="${build}">
<fileset dir="${src}" />
</copy>
<jar jarfile="${dist}/lib/appengine-mapper.jar" basedir="${build}" />
<copy todir="${dist}/lib">
<path refid="thirdpartyjars" />
</copy>
</target>
<target name="clean">
<delete dir="${build}" />
<delete dir="${dist}" />
<delete dir="${testbuild}" />
</target>
<target name="check_sdk_extracted">
<available file="${sdk}/${sdkdirname}" property="sdkextracted" />
</target>
<target name="download_sdk" description="Gets the AppEngine SDK" depends="check_sdk_extracted" unless="sdkextracted">
<mkdir dir="${sdk}" />
<get src="http://googleappengine.googlecode.com/files/${sdkfilename}" dest="${sdk}/${sdkfilename}" />
<unzip src="${sdk}/${sdkfilename}" dest="${sdk}" />
</target>
<!-- Separate target because downloading the SDK can be expensive and
usually only needs to be done once. -->
<target name="clean_sdk">
<delete dir="${sdk}" />
</target>
<target name="copy_libs_to_example" depends="dist">
<copy todir="example/war/WEB-INF/lib">
<fileset dir="${dist}/lib" />
<path refid="sdkjars" />
</copy>
</target>
<target name="compile_example" depends="copy_libs_to_example">
<mkdir dir="example/war/WEB-INF/classes" />
<javac srcdir="example" destdir="example/war/WEB-INF/classes">
<classpath>
<fileset dir="example/war/WEB-INF/lib" />
<path refid="sdkjars" />
</classpath>
</javac>
</target>
<target name="clean_example">
<delete dir="example/war/WEB-INF/lib" />
<delete dir="example/war/WEB-INF/classes" />
</target>
</project>