1 | <?xml version="1.0"?> |
---|
2 | |
---|
3 | <!-- |
---|
4 | Licensed to the Apache Software Foundation (ASF) under one or more |
---|
5 | contributor license agreements. See the NOTICE file distributed with |
---|
6 | this work for additional information regarding copyright ownership. |
---|
7 | The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
8 | (the "License"); you may not use this file except in compliance with |
---|
9 | the License. You may obtain a copy of the License at |
---|
10 | |
---|
11 | http://www.apache.org/licenses/LICENSE-2.0 |
---|
12 | |
---|
13 | Unless required by applicable law or agreed to in writing, software |
---|
14 | distributed under the License is distributed on an "AS IS" BASIS, |
---|
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
16 | See the License for the specific language governing permissions and |
---|
17 | limitations under the License. |
---|
18 | --> |
---|
19 | |
---|
20 | <project name="index" default="jar"> |
---|
21 | |
---|
22 | <import file="../build-contrib.xml"/> |
---|
23 | |
---|
24 | <!-- Override jar target to specify main class --> |
---|
25 | <target name="jar" depends="compile" unless="skip.contrib"> |
---|
26 | <echo message="contrib: ${name}"/> |
---|
27 | <jar |
---|
28 | jarfile="${build.dir}/hadoop-${version}-${name}.jar" |
---|
29 | basedir="${build.classes}" |
---|
30 | > |
---|
31 | <manifest> |
---|
32 | <attribute name="Main-Class" value="org.apache.hadoop.contrib.index.main.UpdateIndex"/> |
---|
33 | </manifest> |
---|
34 | </jar> |
---|
35 | </target> |
---|
36 | |
---|
37 | <!-- Override test target to copy sample data --> |
---|
38 | <target name="test" depends="compile-test, compile, compile-examples" if="test.available"> |
---|
39 | <echo message="contrib: ${name}"/> |
---|
40 | <delete dir="${hadoop.log.dir}"/> |
---|
41 | <mkdir dir="${hadoop.log.dir}"/> |
---|
42 | <delete dir="${build.test}/sample"/> |
---|
43 | <mkdir dir="${build.test}/sample"/> |
---|
44 | <copy todir="${build.test}/sample"> |
---|
45 | <fileset dir="${root}/sample"/> |
---|
46 | </copy> |
---|
47 | <junit |
---|
48 | printsummary="yes" showoutput="${test.output}" |
---|
49 | haltonfailure="no" fork="yes" maxmemory="256m" |
---|
50 | errorProperty="tests.failed" failureProperty="tests.failed" |
---|
51 | timeout="${test.timeout}"> |
---|
52 | |
---|
53 | <sysproperty key="test.build.data" value="${build.test}/data"/> |
---|
54 | <sysproperty key="build.test" value="${build.test}"/> |
---|
55 | <sysproperty key="contrib.name" value="${name}"/> |
---|
56 | |
---|
57 | <!-- requires fork=yes for: |
---|
58 | relative File paths to use the specified user.dir |
---|
59 | classpath to use build/contrib/*.jar |
---|
60 | --> |
---|
61 | <sysproperty key="user.dir" value="${build.test}/data"/> |
---|
62 | |
---|
63 | <sysproperty key="fs.default.name" value="${fs.default.name}"/> |
---|
64 | <sysproperty key="hadoop.test.localoutputfile" value="${hadoop.test.localoutputfile}"/> |
---|
65 | <sysproperty key="hadoop.log.dir" value="${hadoop.log.dir}"/> |
---|
66 | <classpath refid="test.classpath"/> |
---|
67 | <formatter type="${test.junit.output.format}" /> |
---|
68 | <batchtest todir="${build.test}" unless="testcase"> |
---|
69 | <fileset dir="${src.test}" |
---|
70 | includes="**/Test*.java" excludes="**/${test.exclude}.java" /> |
---|
71 | </batchtest> |
---|
72 | <batchtest todir="${build.test}" if="testcase"> |
---|
73 | <fileset dir="${src.test}" includes="**/${testcase}.java"/> |
---|
74 | </batchtest> |
---|
75 | </junit> |
---|
76 | <fail if="tests.failed">Tests failed!</fail> |
---|
77 | |
---|
78 | </target> |
---|
79 | |
---|
80 | </project> |
---|