-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
191 lines (167 loc) · 6.19 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<project default="build">
<property file="${basedir}/build.properties" />
<!-- Important: Core API folder is now in ../Xponents-Core/ as its own buildable, independent repo.
- ./Core - Java src, foundational data and APIs
- ./python - opensextant python library including client apps.
Changes take place in v3.7.0+ to improve buildability
-->
<property name="tmp" value="${basedir}/tmp" />
<property name="xponents.home" value="${basedir}/" />
<property name="release" location="${xponents.home}/../dist/Xponents-${xponents.version}" />
<property name="solr.release" location="${release}/xponents-solr" />
<!-- Build and Distribution mechanics -->
<target name="clean">
<delete dir="${xponents.home}/lib" />
<delete dir="${xponents.home}/Examples/lib" />
<exec executable="mvn" dir="${xponents.home}/Examples" failonerror="true">
<arg value="clean" />
</exec>
<exec executable="mvn" dir="${xponents.home}/" failonerror="true">
<arg value="clean" />
</exec>
</target>
<target name="build" depends="clean">
<exec executable="mvn" dir="${xponents.home}" failonerror="true">
<arg value="clean" />
<arg value="install" />
</exec>
</target>
<target name="build-examples">
<!-- Clean lib -->
<delete dir="${xponents.home}/Examples/lib" />
<exec executable="mvn" dir="${xponents.home}/Examples" failonerror="true">
<arg value="clean" />
<arg value="install" />
</exec>
</target>
<target name="compile" depends="build, build-examples">
</target>
<target name="reports" >
<exec executable="mvn" dir="${xponents.home}" failonerror="true">
<arg value="-DincludeScope=test" />
<arg value="-DincludeScope=runtime" />
<arg value="-DincludeScope=compile" />
<arg value="javadoc:jar" />
<arg value="dependency:copy-dependencies" />
<arg value="project-info-reports:dependencies" />
</exec>
<!-- Clean lib -->
<delete dir="${xponents.home}/Examples/lib" />
<exec executable="mvn" dir="${xponents.home}/Examples" failonerror="true">
<arg value="-DincludeScope=test" />
<arg value="-DincludeScope=runtime" />
<arg value="-DincludeScope=compile" />
<arg value="dependency:copy-dependencies" />
<arg value="project-info-reports:dependencies" />
</exec>
</target>
<!-- Release script for Xponents complete. -->
<target name="mkdirs">
<delete dir="${release}" />
<mkdir dir="${release}" />
<mkdir dir="${release}/lib" />
<mkdir dir="${release}/python" />
<mkdir dir="${release}/log" />
<mkdir dir="${release}/etc" />
<mkdir dir="${release}/test" />
<mkdir dir="${release}/script" />
</target>
<target name="copy-src">
<copy todir="${release}/">
<file file="${xponents.home}/pom.xml"/>
</copy>
<copy todir="${release}/src">
<fileset dir="${xponents.home}/src"/>
</copy>
</target>
<target name="copy-examples">
<copy todir="${release}/Examples/src">
<fileset dir="${xponents.home}/Examples/src"/>
</copy>
<copy todir="${release}/Examples/">
<file file="${xponents.home}/Examples/pom.xml"/>
</copy>
</target>
<target name="copy-libs">
<!-- As Examples requires all other dependencies it is a good one for forcing the copy -->
<exec executable="mvn" dir="${xponents.home}/Examples" failonerror="true">
<arg value="-DoutputDirectory=${release}/lib" />
<arg value="-DincludeScope=test" />
<arg value="-DincludeScope=runtime" />
<arg value="-DincludeScope=compile" />
<arg value="dependency:copy-dependencies" />
</exec>
<copy todir="${release}/lib/">
<fileset dir="${xponents.home}/Examples/target">
<include name="*.jar" />
</fileset>
</copy>
<copy todir="${release}/lib/">
<fileset dir="${xponents.home}/Examples/lib">
<include name="*.jar" />
</fileset>
</copy>
<copy todir="${release}/lib/">
<fileset dir="${xponents.home}/target">
<include name="*.jar" />
</fileset>
</copy>
</target>
<target name="copy-solr7">
<copy todir="${solr.release}/" overwrite="true">
<fileset dir="${xponents.home}/solr">
<!-- temporary files or legacy items that do not need to come over -->
<exclude name="tmp*/**" />
<exclude name="etc/taxcat/data/**" />
<exclude name="solr7-dist/server/logs/**" />
</fileset>
</copy>
<copy file="${xponents.home}/build.properties" todir="${release}" overwrite="true" />
</target>
<target name="copy-data">
<!-- Source data is also in Xponents-Core -->
<unzip src="${xponents.home}/test/data/xcoord-patterns-testcases.zip" dest="${release}/test"/>
<unzip src="${xponents.home}/etc/langdetect-profiles-v3.zip" dest="${release}/etc" />
</target>
<target name="copy-script">
<copy todir="${release}/script/" overwrite="true">
<fileset dir="${xponents.home}/script">
<include name="*.*" />
</fileset>
<fileset dir="${xponents.home}/Examples/script">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${release}/test/" overwrite="true">
<fileset dir="${xponents.home}/test">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${release}/etc/" overwrite="true">
<fileset dir="${xponents.home}/etc">
<include name="*.xml" />
<include name="*.txt" />
<include name="*.properties" />
</fileset>
</copy>
</target>
<target name="apidocs">
<exec executable="mvn" dir="${xponents.home}" failonerror="true">
<arg value="javadoc:jar" />
</exec>
</target>
<target name="copy-docs" depends="apidocs">
<copy todir="${release}/">
<fileset dir="${xponents.home}/">
<include name="NOTICE" />
<include name="LICENSE" />
<include name="*.md" />
</fileset>
</copy>
<copy todir="${release}/doc/">
<fileset dir="${xponents.home}/doc" />
</copy>
</target>
<target name="dist" depends="mkdirs, reports, copy-examples, copy-src, copy-libs, copy-solr7, copy-script, copy-data, copy-docs"
description="Build a SDK full distribution folder containing a distributable, runnable thing." />
</project>