-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
executable file
·140 lines (127 loc) · 5.69 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
<project name="searchi" default="all" basedir="./">
<property name="shared.root" location="${basedir}" />
<property name="file.separator" location="/" />
<property name="project.root" location="${basedir}" />
<property name="build.dir" location="${project.root}" />
<property name="build.target.dir" location="${project.root}${file.separator}bin" />
<property name="target.dir" location="${project.root}${file.separator}target" />
<property name="web-inf.dir" location="${target.dir}${file.separator}WEB-INF" />
<property name="classes.dir" location="${web-inf.dir}${file.separator}classes" />
<property name="web-inf.lib.dir" location="${web-inf.dir}${file.separator}lib" />
<property name="test-classes.dir" location="${build.target.dir}${file.separator}test${file.separator}classes" />
<property name="test-lib.dir" location="${build.target.dir}${file.separator}test${file.separator}lib" />
<property name="src.main.dir" location="${build.dir}${file.separator}src${file.separator}" />
<property name="inputlib.dir" location="${shared.root}${file.separator}lib" />
<property name="src.test.dir" location="${build.dir}${file.separator}src${file.separator}test" />
<property name="resources.dir" location="${build.dir}${file.separator}resources" />
<property name="conf.dir" location="${build.dir}${file.separator}conf" />
<target name="init">
<mkdir dir="bin/" />
<copy file="src/log4j.properties" tofile="bin/log4j.properties" />
</target>
<target name="compile-all" depends="init" description="compiles all Java source code">
<javac srcdir="${src.main.dir}${file.separator}" destdir="bin" debug="on" deprecation="off" optimize="on" includeAntRuntime="no">
<classpath>
<fileset dir="${inputlib.dir}">
<include name="*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="compile-master-crawler" depends="compile-all" description="Makes the master WAR file for the crawler">
<delete file="crawler-servlet.war" />
<mkdir dir="${web-inf.dir}${file.separator}classes" />
<mkdir dir="${web-inf.dir}${file.separator}lib" />
<copy file="${conf.dir}${file.separator}master-web.xml" tofile="${web-inf.dir}${file.separator}web.xml" overwrite="true" />
<copy todir="${web-inf.dir}${file.separator}classes">
<fileset dir="bin" includes="**" />
</copy>
<copy todir="${web-inf.lib.dir}">
<fileset dir="${inputlib.dir}" includes="*.jar" />
</copy>
<delete dir="${web-inf.lib.dir}${file.separator}aws-sdk" />
<jar destfile="crawler-servlet.war" update="true">
<fileset dir="${build.target.dir}">
<include name="**/*.class" />
<include name="**/*.jar" />
<include name="WEB-INF/web.xml" />
</fileset>
</jar>
</target>
<target name="compile-slave-crawler" depends="compile-all" description="Makes the master WAR file for the crawler">
<delete file="crawler-servlet.war" />
<mkdir dir="${web-inf.dir}${file.separator}classes" />
<mkdir dir="${web-inf.dir}${file.separator}lib" />
<copy file="${conf.dir}${file.separator}worker-web.xml" tofile="${web-inf.dir}${file.separator}web.xml" overwrite="true" />
<copy todir="${web-inf.dir}${file.separator}classes">
<fileset dir="bin" includes="**" />
</copy>
<copy todir="${web-inf.lib.dir}">
<fileset dir="${inputlib.dir}" includes="*.jar" />
</copy>
<delete dir="${web-inf.lib.dir}${file.separator}aws-sdk" />
<jar destfile="crawler-servlet.war" update="true">
<fileset dir="${build.target.dir}">
<include name="**/*.class" />
<include name="**/*.jar" />
<include name="WEB-INF/web.xml" />
</fileset>
</jar>
</target>
<target name="inverted-index-job" depends="compile-all">
<jar basedir="bin" destfile="InvertedIndexJob.jar">
<fileset dir=".">
<include name="lib/*.jar" />
<include name="resources/dict/all-english" />
</fileset>
<manifest>
<attribute name="Main-Class" value="indexer.offline.InvertedIndexJob" />
</manifest>
</jar>
</target>
<target name="image-job" depends="compile-all">
<jar basedir="bin" destfile="ImageJob.jar">
<fileset dir=".">
<include name="lib/*.jar" />
<include name="resources/dict/all-english" />
</fileset>
<manifest>
<attribute name="Main-Class" value="indexer.offline.ImageJob" />
</manifest>
</jar>
</target>
<target name="compile-servlet" depends="compile-all" description="Makes the WAR file for the servlet">
<delete file="servlet.war" />
<mkdir dir="${web-inf.dir}${file.separator}classes" />
<mkdir dir="${web-inf.dir}${file.separator}lib" />
<mkdir dir="${web-inf.dir}${file.separator}classes${file.separator}resources" />
<copy file="${conf.dir}${file.separator}web.xml" tofile="${web-inf.dir}${file.separator}web.xml" overwrite="true" />
<copy todir="${web-inf.dir}${file.separator}classes">
<fileset dir="bin" includes="**" />
</copy>
<copy todir="${web-inf.dir}${file.separator}lib">
<fileset dir="lib" includes="*.jar" />
</copy>
<copy todir="${web-inf.dir}${file.separator}classes${file.separator}resources">
<fileset dir="resources" includes="**" />
</copy>
<delete dir="${web-inf.dir}${file.separator}lib${file.separator}aws-sdk" />
<jar destfile="servlet.war" update="true">
<fileset dir="${target.dir}" includes="WEB-INF/classes/**/*.class" />
<fileset dir="${target.dir}" includes="WEB-INF/lib/*.jar" />
<fileset dir="${target.dir}" includes="WEB-INF/classes/resources/**/*.*" />
<fileset dir="${target.dir}" includes="WEB-INF/*.xml" />
</jar>
<delete dir="${target.dir}" />
</target>
<target name="all">
<!-- TODO! //-->
</target>
<target name="clean">
<delete dir="bin/" />
<delete file="InvertedIndexJob.jar" />
<delete file="ImageJob.jar" />
<delete file="servlet.war" />
<delete file="crawler-servlet.war" />
</target>
</project>