-
Notifications
You must be signed in to change notification settings - Fork 63
/
build.xml
120 lines (101 loc) · 4.31 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
<project name="auto-phrase-tokenfilter" default="dist" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant" >
<description>Builds Autophrasing Token Filter</description>
<!-- set global properties for this build -->
<property name="build.dir" location="build"/>
<property name="dist.dir" location="dist"/>
<property name="build.lib.dir" value="${basedir}/build-lib"/>
<property name="src.dir" location="src/main/java"/>
<property name="classes.dir" location="${build.dir}/java" />
<property name="test.dir" location="src/test" />
<property name="test.classes.dir" location="${build.dir}/test" />
<property name="ivy.dir" location="${basedir}/ivy"/>
<property name="ivy.dep.file" location="ivy.xml" />
<property name="ivy.version" value="2.3.0"/>
<property name="ivy.lib.dir" location="${build.lib.dir}/ivy/lib" />
<property name="project.name" value="${ant.project.name}" />
<property name="version.number" value="1.0"/>
<!-- change this to include ivy download dest -->
<target name="set-classpaths" depends="ivy-retrieve" >
<path id="compile-classpath" >
<fileset dir="${ivy.lib.dir}/compile" includes="*.jar"/>
</path>
<path id="test-classpath">
<fileset dir="${ivy.lib.dir}/test" includes="*.jar"/>
</path>
</target>
<target name="init">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${test.classes.dir}"/>
</target>
<target name="compile" depends="init,ivy-retrieve,set-classpaths" description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src.dir}" destdir="${classes.dir}" includeantruntime="false" >
<classpath>
<fileset dir="${ivy.lib.dir}" includes="compile/*.jar" />
</classpath>
</javac>
</target>
<target name="compile-test" depends="compile" >
<javac srcdir="${test.dir}" destdir="${test.classes.dir}" includeantruntime="false" >
<classpath>
<fileset dir="${ivy.lib.dir}" includes="test/*.jar" />
<pathelement location="${classes.dir}" />
</classpath>
</javac>
</target>
<target name="dist" depends="compile,test" description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${classes.dir}"/>
<jar jarfile="${dist.dir}/${project.name}-${version.number}.jar" basedir="${classes.dir}"/>
<!-- Add JavaDocs -->
</target>
<target name="clean" description="clean up" >
<!-- Delete the ${build.dir} and ${dist.dir} directory trees -->
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${ivy.lib.dir}"/>
</target>
<target name="test" depends="compile,compile-test">
<echo message=""/>
<junit printsummary="yes" fork="yes" haltonfailure="yes">
<formatter usefile="false" type="plain"/>
<classpath>
<path refid="test-classpath"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${test.classes.dir}" />
</classpath>
<assertions>
<enable/>
</assertions>
<test name="com.lucidworks.analysis.TestAutoPhrasingTokenFilter"/>
</junit>
</target>
<!-- Ivy -->
<condition property="ivy.jar.exists">
<or>
<available file="${build.lib.dir}/ivy-${ivy.version}.jar"/>
<isset property="offline"/>
</or>
</condition>
<target name="ivy-download" unless="ivy.jar.exists">
<mkdir dir="${build.lib.dir}"/>
<get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
dest="${build.lib.dir}/ivy-${ivy.version}.jar"
usetimestamp="true"/>
</target>
<target name="ivy-init" depends="ivy-download" unless="skip.ivy" description="initialize ivy">
<path id="ivy.lib.path">
<fileset dir="${build.lib.dir}" includes="ivy-${ivy.version}.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
<ivy:settings file="${ivy.dir}/ivy-settings.xml"/>
</target>
<target name="ivy-resolve" depends="ivy-init" >
<ivy:resolve />
</target>
<target name="ivy-retrieve" depends="ivy-resolve" >
<ivy:retrieve pattern="${ivy.lib.dir}/[conf]/[artifact]-[revision].[ext]" sync="true" />
</target>
</project>