-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.xml
220 lines (189 loc) · 9.24 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<project name="geoscript.org" default="info" basedir=".">
<property name="js.version" value="1.4.0"/>
<property name="js.short" value="js"/>
<property name="js.long" value="JavaScript"/>
<property name="js.repo" value="geoscript/geoscript-js"/>
<property name="py.version" value="1.8.0"/>
<property name="py.short" value="py"/>
<property name="py.long" value="Python"/>
<property name="py.repo" value="geoscript/geoscript-py"/>
<property name="scala.version" value="0.9"/>
<property name="scala.short" value="scala"/>
<property name="scala.long" value="Scala"/>
<property name="scala.repo" value="dwins/geoscript.scala"/>
<property name="scala.lib.version" value="2.10"/>
<property name="groovy.version" value="1.17.0"/>
<property name="groovy.short" value="groovy"/>
<property name="groovy.long" value="Groovy"/>
<property name="groovy.repo" value="geoscript/geoscript-groovy"/>
<property name="repos" value="${basedir}/.repos"/>
<property name="t" value="	"/>
<property name="build.root" value="${basedir}/build"/>
<property name="build.dir" value="${build.root}/html"/>
<condition property="mvn.offline" value="-o" else="">
<istrue value="${maven.offline}"/>
</condition>
<target name="info">
<echo message="Checks out GeoScript sources and builds the site. The built site is located in the build directory."/>
<echo message=""/>
<echo message="Tasks:"/>
<echo message="${t}site: Build the entire site."/>
<echo message="${t}js-doc: Build the js docs (js-pull first)."/>
<echo message="${t}js-pull: Update js repo."/>
<echo message="${t}py-doc: Build the py docs (py-pull first)."/>
<echo message="${t}py-pull: Update py repo."/>
<echo message="${t}scala-doc: Build the scala docs (scala-pull first)."/>
<echo message="${t}scala-pull: Update scala repo."/>
<echo message="${t}groovy-doc: Build the groovy docs (groovy-pull first)."/>
<echo message="${t}groovy-pull: Update groovy repo."/>
<echo message="${t}init: Check out local git repos."/>
<echo message="${t}clean: Delete doc builds."/>
<echo message="${t}clean-full: Delete doc builds and local git repos."/>
<echo message=""/>
<echo message="Properties:"/>
<echo message="${t}-Dmaven.offline=[t|f]: Runs maven builds offline."/>
</target>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${repos}"/>
<condition property="repo.js.exists">
<available file="${repos}/${js.short}"/>
</condition>
<condition property="repo.py.exists">
<available file="${repos}/${py.short}"/>
</condition>
<condition property="repo.scala.exists">
<available file="${repos}/${scala.short}"/>
</condition>
<condition property="repo.groovy.exists">
<available file="${repos}/${groovy.short}"/>
</condition>
</target>
<target name="init-js" depends="init">
<antcall target="js-clone"/>
</target>
<target name="js-clone" unless="repo.js.exists">
<exec executable="git" dir="${repos}">
<arg value="clone"/>
<arg value="git://github.com/${js.repo}.git"/>
<arg value="${js.short}"/>
</exec>
</target>
<target name="js-pull" if="repo.js.exists" depends="init-js">
<exec executable="git" dir="${repos}/${js.short}">
<arg value="pull"/>
</exec>
</target>
<target name="js-doc" depends="init-js">
<exec executable="sphinx-build" dir="${basedir}/source" failonerror="true">
<arg line="-E -b html -c ${basedir}/source -D html_theme_options.impl_repo='${js.repo}' -D html_theme_options.impl_long='${js.long}' -D primary_domain=js -D html_theme_options.impl_short='${js.short}' -D version='${js.version}' -D release='${js.version}' -D html_title='GeoScript JS' -D html_short_title='GeoScript JS' -D html_theme=geoscript-common ${repos}/${js.short}/doc ${build.dir}/${js.short}"/>
</exec>
</target>
<target name="init-py" depends="init">
<antcall target="py-clone"/>
</target>
<target name="py-clone" unless="repo.py.exists">
<exec executable="git" dir="${repos}">
<arg value="clone"/>
<arg value="git://github.com/${py.repo}.git"/>
<arg value="${py.short}"/>
</exec>
</target>
<target name="py-pull" if="repo.py.exists" depends="init-py">
<exec executable="git" dir="${repos}/${py.short}">
<arg value="pull"/>
</exec>
</target>
<target name="py-doc" depends="init-py">
<exec executable="mvn" dir="${repos}/${py.short}/" failonerror="true">
<arg line="${mvn.offline}"/>
<arg line="-Dmaven.test.skip=true"/>
<arg line="clean"/>
<arg line="install"/>
</exec>
<path id="py.jarpath">
<fileset dir="${repos}/${py.short}/jars" includes="*.jar"/>
</path>
<property name="py.classpath" refid="py.jarpath"/>
<echo message="${py.classpath}"/>
<exec executable="sphinx-build" dir="${basedir}/source" failonerror="true">
<env key="CLASSPATH" path="${py.classpath}"/>
<arg line="-E -b html ${repos}/${py.short}/doc ${build.dir}/${py.short}"/>
</exec>
</target>
<target name="init-scala" depends="init">
<antcall target="scala-clone"/>
</target>
<target name="scala-clone" unless="repo.scala.exists">
<exec executable="git" dir="${repos}">
<arg value="clone"/>
<arg value="git://github.com/${scala.repo}.git"/>
<arg value="${scala.short}"/>
</exec>
</target>
<target name="scala-pull" if="repo.scala.exists" depends="init-scala">
<exec executable="git" dir="${repos}/${scala.short}">
<arg value="pull"/>
</exec>
</target>
<target name="scala-doc" depends="init-scala">
<exec executable="sphinx-build" dir="${basedir}/source" failonerror="true">
<arg line="-E -b html -c ${basedir}/source -D html_theme_options.impl_repo='${scala.repo}' -D html_theme_options.impl_long='${scala.long}' -D html_theme_options.impl_short='${scala.short}' -D version='${scala.version}' -D release='${scala.version}' -D html_title='GeoScript Scala' -D html_short_title='GeoScript Scala' -D html_theme=geoscript-common ${repos}/${scala.short}/geoscript/src/main/sphinx ${build.dir}/${scala.short}"/>
</exec>
<exec executable="sbt" dir="${repos}/${scala.short}/">
<arg value="update"/>
<arg value="doc"/>
</exec>
<move file="${repos}/${scala.short}/geoscript/target/scala-${scala.lib.version}/api/"
todir="${build.dir}/${scala.short}/"/>
</target>
<target name="init-groovy" depends="init">
<antcall target="groovy-clone"/>
</target>
<target name="groovy-clone" unless="repo.groovy.exists">
<exec executable="git" dir="${repos}">
<arg value="clone"/>
<arg value="git://github.com/${groovy.repo}.git"/>
<arg value="${groovy.short}"/>
</exec>
</target>
<target name="groovy-pull" if="repo.groovy.exists" depends="init-groovy">
<exec executable="git" dir="${repos}/${groovy.short}">
<arg value="pull"/>
</exec>
</target>
<target name="groovy-doc" depends="init-groovy">
<exec executable="sphinx-build" dir="${basedir}/source" failonerror="true">
<arg line="-E -b html -c ${basedir}/source -D html_theme_options.impl_repo='${groovy.repo}' -D html_theme_options.impl_long='${groovy.long}' -D html_theme_options.impl_short='${groovy.short}' -D version='${groovy.version}' -D release='${groovy.version}' -D html_title='GeoScript Groovy' -D html_short_title='GeoScript Groovy' -D html_theme=geoscript-common ${repos}/${groovy.short}/doc ${build.dir}/${groovy.short}"/>
</exec>
<exec executable="mvn" dir="${repos}/${groovy.short}/">
<arg line="${mvn.offline}"/>
<arg line="-Dmaven.test.skip=true"/>
<arg line="package"/>
</exec>
<mkdir dir="${build.dir}/${groovy.short}/api"/>
<copy todir="${build.dir}/${groovy.short}/api">
<fileset dir="${repos}/${groovy.short}/target/groovydoc/">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="site-doc" depends="init">
<exec executable="sphinx-build" dir="${basedir}/source" failonerror="true">
<arg line="-E -b html . ${build.dir}"/>
</exec>
</target>
<!-- scala-pull, scala-doc, -->
<target name="site" depends="js-pull, js-doc, py-pull, py-doc, groovy-pull, groovy-doc, site-doc"/>
<target name="clean">
<delete dir="${build.root}"/>
</target>
<target name="clean-full" depends="clean">
<delete dir="${repos}"/>
</target>
<target name="bundle" depends="site">
<zip destfile="${build.root}/geoscript.org.zip">
<fileset dir="${build.dir}" includes="**/*"/>
</zip>
</target>
</project>