forked from metzlerd/mavuno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
165 lines (145 loc) · 6.04 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<project name="mavuno" default="jar" xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:artifact="antlib:org.apache.maven.artifact.ant" basedir=".">
<description>Mavuno build file.</description>
<property name="lib.dir" value="lib" />
<property name="build.dir" value="build" />
<property name="src.dir" value="src" />
<property name="dist.dir" value="dist" />
<property name="javadoc.dir" location="docs/api/" />
<property name="version" value="0.2" />
<!-- paths used for compilation and run -->
<path id="lib.path.id">
<fileset dir="${lib.dir}" />
</path>
<path id="run.path.id">
<path refid="lib.path.id" />
<path location="${build.dir}" />
</path>
<property name="maven.ant.task.version" value="2.1.2" />
<property name="maven.jar.dir" value="${basedir}/${lib.dir}" />
<property name="maven.jar.file" value="${maven.jar.dir}/maven.jar" />
<property name="ivy.install.version" value="2.2.0" />
<property name="ivy.jar.dir" value="${basedir}/ivy" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<property name="ivy.settings.file" value="${basedir}/ivy/ivysettings.xml" />
<property name="ivy.dep.file" value="${basedir}/ivy/ivy.xml" />
<!-- define Maven coordinates, repository url and artifacts name etc -->
<property name="groupId" value="edu.isi" />
<property name="artifactId" value="mavuno" />
<property name="version" value="${version}" />
<target name="init">
<tstamp />
<condition property="platform" value="unix">
<os family="unix" />
</condition>
<condition property="platform" value="unix">
<os family="mac" />
</condition>
<condition property="platform" value="windows">
<os family="windows" />
</condition>
<mkdir dir="${build.dir}" />
<mkdir dir="${lib.dir}" />
<mkdir dir="${dist.dir}" />
</target>
<!-- download Ivy from web site so that it can be used even without any
special installation -->
<target name="download-ivy" unless="skip.download">
<echo message="installing ivy..." />
<get
src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true" />
</target>
<!-- try to load ivy here from local ivy dir, in case the user has not already
dropped it into ant's lib dir (note that the latter copy will always take
precedence). We will not fail as long as local lib dir exists (it may be
empty) and ivy is in at least one of ant's lib dir or the local lib dir. -->
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar" />
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant"
classpathref="ivy.lib.path" />
</target>
<!-- download maven from web site so that it can be used even without any
special installation -->
<target name="download-maven" depends="init" unless="skip.download">
<mkdir dir="${maven.jar.dir}" />
<echo message="installing maven ant tasks..." />
<get
src="http://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/${maven.ant.task.version}/maven-ant-tasks-${maven.ant.task.version}.jar"
dest="${maven.jar.file}" usetimestamp="true" />
</target>
<!-- try to load ivy here from local ivy dir, in case the user has not already
dropped it into ant's lib dir (note that the latter copy will always take
precedence). We will not fail as long as local lib dir exists (it may be
empty) and ivy is in at least one of ant's lib dir or the local lib dir. -->
<target name="install-maven" depends="download-maven"
description="--> install ivy">
<path id="maven.lib.path">
<fileset dir="${maven.jar.dir}" includes="*.jar" />
</path>
<taskdef uri="antlib:org.apache.maven.artifact.ant" classpathref="maven.lib.path" />
</target>
<target name="resolve" depends="install-ivy"
description="--> retreive dependencies with ivy" unless="skip.resolve">
<ivy:retrieve />
</target>
<target name="report" depends="resolve"
description="--> generates a report of dependencies">
<ivy:report todir="${build.dir}" />
</target>
<target name="compile" depends="init,resolve" description="compile the source ">
<javac classpathref="lib.path.id" srcdir="${src.dir}" destdir="${build.dir}" />
</target>
<target name="jar" depends="compile" description="builds the jar">
<jar jarfile="mavuno-${version}.jar" basedir="${build.dir}" />
<jar jarfile="${lib.dir}/mavuno-models-${version}.jar">
<fileset dir=".">
<include name="models/**" />
<include name="wordnet/**" />
</fileset>
</jar>
</target>
<target name="javadoc">
<javadoc destdir="${javadoc.dir}" access="public" use="false"
notree="false" nonavbar="false" noindex="false" splitindex="no"
author="true" version="true" nodeprecatedlist="true" nodeprecated="true"
classpathref="lib.path.id">
<fileset dir="${src.dir}">
<include name="**/*.java" />
<exclude name="ivory/**/*.java" />
<exclude name="org/**/*.java" />
</fileset>
<link href="http://download.oracle.com/javase/6/docs/api/" />
<link href="http://hadoop.apache.org/common/docs/current/api/" />
<link href="http://www.umiacs.umd.edu/~jimmylin/Cloud9/docs/api/" />
<link href="http://nlp.stanford.edu/nlp/javadoc/javanlp/" />
</javadoc>
</target>
<target name="dist" depends="clean,jar,javadoc" description="generate the distribution">
<tar destfile="mavuno-${version}.tar.gz">
<fileset dir=".">
<exclude name="build/**" />
<exclude name="models/**" />
</fileset>
</tar>
<zip destfile="mavuno-${version}.zip">
<fileset dir=".">
<exclude name="mavuno-${version}.tar.gz" />
<exclude name="build/**" />
<exclude name="models/**" />
</fileset>
</zip>
</target>
<target name="clean" description="clean up">
<delete dir="${lib.dir}" />
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${javadoc.dir}" />
<delete file="mavuno-${version}.jar" />
<delete file="mavuno-models-${version}.jar" />
<delete file="mavuno-${version}.zip" />
<delete file="mavuno-${version}.tar.gz" />
</target>
</project>