/
build.xml
309 lines (264 loc) · 10.4 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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<project name="pargres" default="all" basedir="." >
<property file="build.properties"/>
<property name="bin" value="bin"/>
<property name="bintest" value="bintest"/>
<property name="src" value="src"/>
<property name="test" value="test"/>
<property name="lib" value="lib"/>
<property name="build" value="build"/>
<property name="config" value="config"/>
<property name="install" value="install"/>
<property name="language" value="language"/>
<property name="webmetadata.dir" value="webmetadata"/>
<property name="pages" value="pages"/>
<property name="dist.name" value="pargres-0.1"/>
<property name="jdbcDriver" value="pargres-jdbc-client.jar"/>
<property name="pargresServerJarFile" value="pargres-server.jar"/>
<property name="pargresTestsJarFile" value="pargres-tests.jar"/>
<property name="pargresAdminJarFile" value="pargresadmin.jar"/>
<property name="pargresAdminWarFile" value="pargresadmin.war"/>
<property name="clusterUrl" value="{sshusername}@${host}:~/${dist.name}"/>
<path id="classpath">
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</path>
<path id="classpathtest">
<pathelement location="bin"/>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${lib}/junit_4">
<include name="*.jar"/>
</fileset>
</path>
<target name="init">
<delete file="${build}"/>
<mkdir dir="${build}"/>
</target>
<target name="compile">
<javac
includeantruntime="false"
classpathref="classpath"
srcdir="${src}"
destdir="${bin}"/>
<javac
includeantruntime="false"
classpathref="classpath"
srcdir="${config}"
destdir="${bin}"/>
<javac
includeantruntime="false"
classpathref="classpathtest"
srcdir="${test}"
destdir="${bintest}"/>
</target>
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="${build}" includes="**/*"/>
<fileset dir="${bintest}" includes="**/*"/>
<fileset dir="${bin}" includes="**/*"/>
</delete>
</target>
<target name="jar.client.create">
<jar destfile="${build}/${jdbcDriver}">
<fileset dir="${bin}" includes="org/pargres/commons/**/*.*"/>
<fileset dir="${bin}" includes="org/pargres/jdbc/**/*.*"/>
<fileset dir="${bin}" includes="org/pargres/console/**/*.*"/>
<fileset dir="${bin}" includes="org/pargres/query/**/*.*"/>
<fileset dir="${bin}" includes="org/pargres/util/**/*.*"/>
<fileset dir="${config}"/>
</jar>
</target>
<target name="jar.server.create">
<jar destfile="${build}/${pargresServerJarFile}" basedir="${bin}">
</jar>
</target>
<target name="jar.tests.create">
<jar destfile="${build}/${pargresTestsJarFile}" basedir="${bintest}">
</jar>
</target>
<target name="javadoc.create">
<delete dir="${build}/docs/ap"/>
<javadoc
destdir="${build}/docs/api"
author="true"
version="true"
use="true"
windowtitle="Pargres API"
classpath="classpath">
<packageset dir="${src}" defaultexcludes="yes">
</packageset>
<doctitle>
<![CDATA[<h1>Pargres</h1>]]></doctitle>
<bottom>
<![CDATA[<i>Copyright © 2005 Pargres Development Team. All Rights Reserved.</i>]]></bottom>
<tag name="todo" scope="all" description="To do:"/>
<link href="http://pargres.nacad.ufrj.br/docs/api/"/>
</javadoc>
</target>
<!--target name="all" depends="init,compile,jar.client.create,jar.server.create,installer.console.remotecopy"/-->
<target name="all" depends="init,compile,jar.client.create,jar.server.create,jar.tests.create,installer.console.create"/>
<target name="parser.run">
<exec dir="${src}/org/pargres/parser" executable="${lib}/yacc.exe">
<arg line="-Jnorun -Jnodebug -Jthrows=org.pargres.commons.util.ParserSilentException -Jpackage=org.pargres.parser sql.y"/>
</exec>
<exec dir="${src}/org/pargres/parser" executable="${lib}/yacc.exe">
<arg line="-Jnorun -Jnodebug -Jpackage=org.pargres.parser -Jthrows=org.pargres.commons.util.ParserSilentException -Jclass=ParserIni parser_ini.y"/>
</exec>
<java classname="JFlex.Main" classpathref="classpath">
<arg value="${src}/org/pargres/parser/sql.flex"/>
</java >
<java classname="JFlex.Main" classpathref="classpath">
<arg value="${src}/org/pargres/parser/Parser_ini.flex"/>
</java >
</target>
<!-- WEB ADMIN -->
<target name="war.create" depends="jar.client.create">
<jar destfile="${build}/${pargresAdminJarFile}">
<fileset dir="bin">
<include name="org/pargres/webadmin/**/*"/>
</fileset>
</jar>
<war destfile="${build}/${pargresAdminWarFile}" webxml="${webmetadata.dir}/web.xml">
<fileset dir="${pages}"/>
<lib dir="${lib}">
<include name="log4j-1.2.9.jar"/>
</lib>
<lib dir="${build}">
<include name="${pargresAdminJarFile}"/>
<include name="${jdbcDriver}"/>
</lib>
</war>
</target>
<target name="war.remotecopy">
<sshexec host="${host}" username="${sshusername}" password="${sshpassword}" command="rm -r ${webapp.repo}/pargresadmin" trust="yes" failonerror="false"/>
<sshexec host="${host}" username="${sshusername}" password="${sshpassword}" command="rm ${webapp.repo}/${pargresAdminWarFile}" trust="yes" failonerror="false"/>
<scp password="${sshpassword}" todir="${sshusername}@${host}:${webapp.repo}" trust="yes">
<fileset dir="${build}">
<include name="${pargresAdminWarFile}"/>
</fileset>
</scp>
</target>
<target name="war.deploy" depends="war.create,war.remotecopy"/>
<target name="installer.gui.create" depends="installer.prepare">
<!-- Build Java graphical installer bin distribution -->
<unzip src="${lib}/IzPack.zip" dest="${build}" overwrite="false"/>
<taskdef name="izpack" classpath="${build}/IzPack/lib/compiler.jar"
classname="com.izforge.izpack.ant.IzPackTask"/>
<izpack input="${basedir}/install.xml"
output="${build}/${dist.name}-GuiInstaller.jar"
basedir="."
izPackDir="${basedir}/${build}/IzPack">
<property name="preparedDir" value="${build}/${dist.name}"/>
</izpack>
</target>
<target name="installer.console.create" depends="installer.prepare">
<delete file="${build}/${dist.name}-ConsoleInstaller.tar.gz"/>
<tar tarfile="${build}/${dist.name}.tar">
<tarfileset dir="${build}">
<include name="${dist.name}/**/*.*"/>
</tarfileset>
</tar>
<gzip zipfile="${build}/${dist.name}.tar.gz" src="${build}/${dist.name}.tar"/>
<delete file="${build}/${dist.name}.tar"/>
</target>
<target name="installer.prepare" depends="jar.client.create,jar.server.create">
<delete dir="${build}/${dist.name}"/>
<copy todir="${build}/${dist.name}">
<fileset dir=".">
<include name="*.*"/>
<exclude name="build.properties*"/>
<exclude name="install.xml"/>
<exclude name="build.xml"/>
<exclude name="*.log"/>
<include name="${lib}/*.jar"/>
<include name="${language}/*"/>
<include name="${config}/*"/>
</fileset>
<fileset dir="${install}">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${build}/${dist.name}/lib">
<fileset dir="${build}">
<include name="*.jar"/>
<exclude name="*installer*.jar"/>
</fileset>
</copy>
<move todir="${build}/${dist.name}">
<fileset dir="${build}">
<include name="docs/api/**/*"/>
</fileset>
</move>
</target>
<!--target name="installer.console.remotecopy">
<scp password="${sshpassword}" todir="${sshusername}@${host}:~/" trust="on">
<fileset dir="${build}">
<include name="${dist.name}.tar.gz"/>
</fileset>
</scp>
<sshexec host="${host}" username="${sshusername}" password="${sshpassword}" command="gunzip ${dist.name}.tar.gz; tar -xvvf ${dist.name}.tar; rm ${dist.name}.tar; dos2unix ${dist.name}/bin/*.sh;chmod +x ${dist.name}/bin/*.sh" trust="yes"/>
</target-->
<!--START: Needs to be costumized-->
<!--END: Needs to be costumized-->
<!--START: Proxy settings:
# Comment the following lines, if you are not behind a proxy.
# Fill in the appropriate values for:
# proxy.host
# proxy.port
# if you are behind a proxy.
-->
<!--property name="proxy.used" value="true"/>
<property name="proxy.host" value="abh-server.abh.uni-karlsruhe.de"/>
<property name="proxy.port" value="3128"/-->
<!--END: Proxy settings-->
<!--The fop librarys-->
<path id="fop.classpath">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<!--Create html output-->
<target name="html" description="Creates docbook_tutorial.html">
<echo>Creating docbook_tutorial.html</echo>
<java jar="${lib}/saxon8.jar" fork="true"
output="install/PargresUserGuide.html">
<jvmarg value="-DproxySet=${proxy.used}"/>
<jvmarg value="-DproxyHost=${proxy.host}"/>
<jvmarg value="-DproxyPort=${proxy.port}"/>
<arg value="install/PargresUserGuide.xml"/>
<arg value="${lib}/docbook/html/docbook.xsl"/>
</java>
</target>
<!--Create pdf output-->
<target name="pdf" description="Creates docbook_tutorial.pdf">
<echo>Creating docbook_tutorial.pdf</echo>
<java classname="org.apache.fop.apps.Fop" fork="true">
<!--jvmarg value="-DproxySet=${proxy.used}"/>
<jvmarg value="-DproxyHost=${proxy.host}"/>
<jvmarg value="-DproxyPort=${proxy.port}"/-->
<classpath refid="fop.classpath"/>
<arg line="-xml ${input.file}"/>
<arg line="-xsl ${docbook.dir}/fo/docbook.xsl"/>
<arg value="${output.pdf}"/>
</java>
</target>
<!--Create the changes documents-->
<target name="doc.make"
description="Creates all documents"
>
<echo>Creates all documents</echo>
<antcall target="html"></antcall>
<antcall target="pdf"></antcall>
</target>
</project>
<!--target name="dist1" depends="init">
<jar destfile="${build}/diske.jar" basedir="${bin}">
</jar>
<scp todir="${clusterUrl1}" trust="yes">
<fileset dir="${build}">
<include name="diske.jar"/>
</fileset>
</scp>
</target-->