-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
108 lines (98 loc) · 4.15 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
<project name="TitleHarvester" default="test" basedir=".">
<description>
Commoncrawl Title harvester
</description>
<taskdef resource="testngtasks" classpath="lib/testng-6.8.7.jar"/>
<!-- set global properties for this build -->
<property name="main.dir" location="src/main"/>
<property name="test.dir" location="src/test"/>
<property name="build.dir" location="build"/>
<property name="build.main.dir" location="build/main"/>
<property name="build.test.dir" location="build/test"/>
<property name="dist.dir" location="dist"/>
<property name="test.output.dir" location="test_output"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.main.dir}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<javac srcdir="${main.dir}" destdir="${build.main.dir}" debug="true">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist.dir}"/>
<mkdir dir="${build.main.dir}/lib"/>
<mkdir dir="${build.main.dir}/data"/>
<mkdir dir="${build.main.dir}/data/domain_cat_index"/>
<mkdir dir="${build.main.dir}/data/profiles"/>
<mkdir dir="${build.main.dir}/data/stop-words"/>
<!-- Put everything in ${build}/lib into the lib/ dir of build -->
<copy todir="${build.main.dir}/lib">
<fileset dir="lib" includes="*.jar" excludes="jcommander-1.32.jar,jmockit.jar,testng-6.8.7.jar,weka.jar,jsoup-1.6.1.jar,*-sources.jar"/>
</copy>
<copy todir="${build.main.dir}/data">
<fileset dir="data" includes="*.json" />
</copy>
<copy todir="${build.main.dir}/data/domain_cat_index">
<fileset dir="data/domain_cat_index" includes="*.json" />
</copy>
<copy todir="${build.main.dir}/data/profiles">
<fileset dir="data/profiles" includes="*" />
</copy>
<copy todir="${build.main.dir}/data/stop-words">
<fileset dir="data/stop-words" includes="*.txt" />
</copy>
<jar jarfile="${dist.dir}/TitleHarvester.jar" basedir="${build.main.dir}">
<zipfileset includes="**/*.class **/*.json data/profiles/* data/stop-words/*.txt" src="lib/jsoup-1.6.1.jar"/>
</jar>
</target>
<target name="test-compile" depends="compile"
description="compile tests">
<mkdir dir="${build.test.dir}"/>
<javac srcdir="${test.dir}" destdir="${build.test.dir}" debug="true">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
<classpath>
<pathelement path="${build.main.dir}"/>
</classpath>
</javac>
</target>
<target name="test" depends="test-compile"
description="run test suite" >
<mkdir dir="${test.output.dir}"/>
<path id="test.classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<pathelement path="${build.main.dir}"/>
<pathelement location="${build.test.dir}"/>
</path>
<testng classpathref="test.classpath"
outputDir="${test.output.dir}"
haltOnFailure="true" verbose="2">
<classfileset dir="${build.test.dir}" includes="**/*.class" excludes="**/*$1.class"/>
</testng>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${test.output.dir}"/>
</target>
</project>