-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbuild.xml
148 lines (110 loc) · 4.36 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
<project name="vn.hus.nlp.tagger" basedir="." default="jar">
<property name="version" value="4.2.0" />
<property name="src.dir" value="src" />
<property name="build.dir" value="build" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="jar.dir" value="${build.dir}/jar" />
<property name="lib.dir" value="lib" />
<property name="dist.dir" value="dist" />
<property name="dist.src.dir" value="${dist.dir}/${ant.project.name}-${version}-src" />
<property name="dist.bin.dir" value="${dist.dir}/${ant.project.name}-${version}-bin" />
<property name="main-class" value="vn.hus.nlp.tagger.VietnameseMaxentTagger" />
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<target name="compile">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" />
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}" />
<jar destfile="${jar.dir}/${ant.project.name}-${version}.jar" basedir="${classes.dir}" manifest="MANIFEST">
</jar>
</target>
<target name="run" depends="jar">
<java fork="true" classname="${main-class}">
<classpath>
<path refid="classpath" />
<path location="${jar.dir}/${ant.project.name}-${version}.jar" />
</classpath>
</java>
</target>
<target name="javadoc">
<javadoc destdir="docs/api" sourcepath="src" defaultexcludes="yes" author="true" version="true" use="true" windowtitle="vnTagger API">
<doctitle><![CDATA[<h1>vnTagger 4.0.0</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2009 [email protected]</i>]]></bottom>
</javadoc>
</target>
<target name="main" depends="clean,run" />
<!-- Files common to both the binary and src distributions -->
<target name="dist-common" description="Files common to both the bin and src distributions">
<!-- files common for bin and src distributions -->
<patternset id="dist.common.files">
<include name="samples/**" />
<include name="resources/**" />
<include name="*.txt" />
<include name="**/.properties" />
<exclude name="**/.*" />
</patternset>
<!-- scripts to run application -->
<patternset id="dist.script.files">
<include name="*.sh" />
<include name="*.bat" />
</patternset>
<!-- source files -->
<patternset id="dist.src.files">
<include name="${src.dir}/**"/>
<!-- <include name="schema/**"/> -->
<!-- <include name="data/**"/> -->
<!-- <include name="notes/**"/> -->
<include name="*.xml" />
<include name="MANIFEST" />
</patternset>
</target>
<!-- Creates the binary distribution -->
<target name="dist-bin" depends="jar,dist-common" description="Creates the binary distribution.">
<mkdir dir="${dist.bin.dir}" />
<mkdir dir="${dist.bin.dir}/${lib.dir}" />
<!-- Copy common and script files -->
<copy todir="${dist.bin.dir}">
<fileset dir="./">
<patternset refid="dist.common.files" />
<patternset refid="dist.script.files" />
</fileset>
</copy>
<!-- Copy the main jar files -->
<copy todir="${dist.bin.dir}">
<fileset dir="${jar.dir}" includes="*.jar" />
</copy>
<!-- Copy jar files in the lib directory -->
<copy todir="${dist.bin.dir}/${lib.dir}">
<fileset dir="${lib.dir}" includes="*.jar" />
</copy>
</target>
<target name="dist-src" depends="dist-common" description="Creates the source distribution.">
<mkdir dir="${dist.src.dir}" />
<mkdir dir="${dist.src.dir}/${lib.dir}" />
<!-- Copy source files -->
<copy todir="${dist.src.dir}">
<fileset dir="./">
<patternset refid="dist.src.files" />
<patternset refid="dist.common.files" />
<patternset refid="dist.script.files" />
</fileset>
</copy>
<!-- Copy jar files in the lib directory -->
<copy todir="${dist.src.dir}/${lib.dir}">
<fileset dir="${lib.dir}" includes="*.jar" />
</copy>
</target>
<target name="dist-tar" depends="dist-src,dist-bin" description="Creates tar.gz files for bin and src distributions">
<!-- Produces the bin dist tar/gzip file -->
<tar tarfile="${dist.dir}/${ant.project.name}-${version}-bin.tar.gz" basedir="${dist.bin.dir}" compression="gzip" />
<!-- Produces the src dist tar/gzip file -->
<tar tarfile="${dist.dir}/${ant.project.name}-${version}-src.tar.gz" basedir="${dist.src.dir}" compression="gzip" />
</target>
</project>