-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
194 lines (163 loc) · 6.23 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
<?xml version="1.0"?>
<!--
Copyright (c) 2011, Stado Global Development Group
Copyright (c) 2016 Regents of the University of Minnesota
This file is part of the Minnesota Population Center's Terra Populus project.
For copyright and licensing information, see the NOTICE and LICENSE files
in this project's top-level directory, and also online at:
https://github.com/mnpopcenter/stado
Build file to allow ant (http://ant.apache.org/) to be used
to build Stado.
-->
<!DOCTYPE project [
<!ENTITY jarfiles "stado.jar">
]>
<project name="stado" default="all" basedir=".">
<!-- set global properties for this build -->
<property name="srcdir" value="src" />
<property name="jardir" value="jars" />
<property name="libdir" value="lib" />
<property name="builddir" value="build" />
<property name="distdir" value="dist" />
<property name="package" value="org/postgresql/stado" />
<property name="driver" value="org/postgresql/driver" />
<property name="packdir" value="${srcdir}/${package}" />
<property name="driverdir" value="${srcdir}/${driver}" />
<property name="version" value="2_5_beta" />
<target name="clean">
<delete quiet="true" dir="${builddir}" />
<delete quiet="true" dir="${jardir}" />
<delete quiet="true" dir="${distdir}" />
</target>
<target name="prepare">
<mkdir dir="${builddir}" />
<mkdir dir="${jardir}" />
<mkdir dir="${distdir}" />
</target>
<!-- default target -->
<target name="all">
<antcall target="jar" />
</target>
<!-- create the jar file -->
<target name="jar" depends="compile">
<jar jarfile="${jardir}/stado.jar">
<fileset dir="${builddir}">
<include name="${package}/**/*.class" />
<include name="${driver}/**/*.class" />
</fileset>
</jar>
</target>
<target name="compile" depends="prepare">
<javac srcdir="${driverdir}" destdir="${builddir}" source="1.6" includeAntRuntime="false">
<classpath>
<pathelement path="${builddir}" />
</classpath>
<include name="*.java" />
<include name="copy/**" />
<include name="core/**" />
<include name="ds/**" />
<include name="jdbc2/**" />
<include name="jdbc3/**" />
<include name="ssl/**" />
<include name="util/**" />
</javac>
<javac srcdir="${packdir}" destdir="${builddir}" source="1.6" includeAntRuntime="false">
<classpath>
<pathelement location="${libdir}/edb-jdbc14.jar" />
<pathelement location="${libdir}/log4j.jar" />
<pathelement location="${libdir}/jline-0_9_5.jar" />
<pathelement path="${builddir}" />
</classpath>
<include name="parser/**" />
<include name="common/**" />
<include name="communication/**" />
<include name="constraintchecker/**" />
<include name="engine/**" />
<include name="exception/**" />
<include name="metadata/**" />
<include name="misc/**" />
<include name="optimizer/**" />
<include name="protocol/**" />
<include name="planner/**" />
<include name="util/**" />
<include name="queryproc/**" />
<include name="server/**" />
</javac>
</target>
<target name="buildparser">
<java classname="org.apache.tools.ant.Main"
fork="true" clonevm="true" dir="${basedir}/src/org/postgresql/stado/parser/core">
<arg value="-buildfile" />
<arg value="${basedir}/src/org/postgresql/stado/parser/core/build.xml" />
</java>
</target>
<target name="builddist" depends="clean, buildparser, jar, doc">
<mkdir dir="${distdir}/stado" />
<mkdir dir="${distdir}/stado/lib" />
<mkdir dir="${distdir}/stado/bin" />
<mkdir dir="${distdir}/stado/doc" />
<mkdir dir="${distdir}/stado/log" />
<mkdir dir="${distdir}/stado/config" />
<mkdir dir="${distdir}/stado/license" />
<copy file="${jardir}/stado.jar" todir="${distdir}/stado/lib"/>
<copy file="${libdir}/jline-0_9_5.jar" todir="${distdir}/stado/lib"/>
<copy file="${libdir}/log4j.jar" todir="${distdir}/stado/lib"/>
<copy file="${libdir}/jline_license.txt" todir="${distdir}/stado/license"/>
<copy file="${libdir}/log4j_license.txt" todir="${distdir}/stado/license"/>
<copy file="LICENSE" todir="${distdir}/stado/license"/>
<copy file="${srcdir}/config/server/stado.config" todir="${distdir}/stado/config"/>
<copy file="${srcdir}/config/agent/stado_agent.config" todir="${distdir}/stado/config"/>
<copy todir="${distdir}/stado/bin/">
<fileset dir="${srcdir}/scripts/server"/>
</copy>
<copy todir="${distdir}/stado/bin/">
<fileset dir="${srcdir}/scripts/agent"/>
</copy>
<copy todir="${distdir}/stado/bin/">
<fileset dir="${srcdir}/scripts/client"/>
</copy>
<copy file="misc/release_notes.txt" todir="${distdir}/stado/doc"/>
<copy todir="${distdir}/stado/doc/">
<fileset dir="${builddir}/doc"/>
</copy>
<tar destfile="${distdir}/stado.tar" basedir="${distdir}"/>
<gzip destfile="${distdir}/stado_${version}.tar.gz" src="${distdir}/stado.tar"/>
<delete quiet="true" file="${distdir}/stado.tar" />
</target>
<!-- Build the documentation -->
<target name="doc" depends="prepare">
<mkdir dir="${builddir}/doc" />
<mkdir dir="${builddir}/doc/images" />
<copy todir="${builddir}/doc/images">
<fileset dir="docs/images"/>
</copy>
<exec executable="xmlto">
<arg value="--skip-validation"/>
<arg value="html-nochunks"/>
<arg value="-o"/>
<arg value="${builddir}/doc"/>
<arg value="docs/stado_loader.xml"/>
</exec>
<exec executable="xmlto">
<arg value="--skip-validation"/>
<arg value="html-nochunks"/>
<arg value="-o"/>
<arg value="${builddir}/doc"/>
<arg value="docs/stado_planning_guide.xml"/>
</exec>
<exec executable="xmlto">
<arg value="--skip-validation"/>
<arg value="html-nochunks"/>
<arg value="-o"/>
<arg value="${builddir}/doc"/>
<arg value="docs/stado_sql_reference.xml"/>
</exec>
<exec executable="xmlto">
<arg value="--skip-validation"/>
<arg value="html-nochunks"/>
<arg value="-o"/>
<arg value="${builddir}/doc"/>
<arg value="docs/stado_admin_guide.xml"/>
</exec>
</target>
</project>