-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
271 lines (233 loc) · 11.3 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
<?xml version="1.0"?>
<!-- =============================================================== -->
<!-- Ant own build file -->
<!-- =============================================================== -->
<project name="SQLeoVQB" default="compile" basedir=".">
<description>Builds, tests, and runs the project SQLeo.</description>
<property name="build.compiler" value="modern"/>
<property name="build.sysclasspath" value="ignore"/>
<property name="name" value="SQLeoVQB"/>
<property name="version" value="2019.01.rc1"/>
<property name="src" value="${basedir}/src"/>
<property name="lib" value="${basedir}/lib"/>
<property name="target" value="${basedir}/build" />
<property name="classes" value="${target}/classes"/>
<property name="javadocs" value="${target}/javadocs"/>
<property name="dist" value="${basedir}/dist"/>
<property name="packages" value="*"/>
<!-- ============================================================= -->
<!-- Classpath with libraries needed to compile this application -->
<!-- ============================================================= -->
<path id="compile.classpath">
<fileset dir="${lib}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>
<!-- ============================================================= -->
<!-- Prepares the project -->
<!-- ============================================================= -->
<target name="prepare">
<defaultexcludes echo="false" add="**/*.nbattrs"/>
<mkdir dir="${classes}"/>
<mkdir dir="${lib}"/>
<mkdir dir="${dist}"/>
<!-- Copy all images to the classes directory -->
<copy todir="${classes}">
<fileset dir="${src}">
<include name="**/*.jpg"/>
<include name="**/*.gif"/>
<include name="**/*.dtd"/>
<include name="**/*.jav"/>
<include name="**/*.png"/>
<include name="**/*.xml"/>
<include name="**/*.jrxml"/>
<include name="**/*.properties"/>
<include name="**/*.jasper"/>
</fileset>
</copy>
</target>
<!-- ============================================================= -->
<!-- Compiles the source code -->
<!-- ============================================================= -->
<target name="compile" depends="prepare">
<javac srcdir="${src}"
destdir="${classes}"
debug="on"
excludes="**/bak/**"
optimize="on"
target="8"
source="7">
<!-- TO DO check compilation Warning -->
<!-- compilerarg value="-Xlint" /> -->
<classpath refid="compile.classpath"/>
</javac>
<!-- convert unicode files into ASCII properties. -->
<native2ascii encoding="UTF8" src="${src}" dest="${src}"
includes="**/*.utf8" ext=".properties"/>
<!-- copy over the language and other properties files. -->
<copy todir="${classes}">
<fileset dir="${src}">
<include name="**/*.properties"/>
</fileset>
</copy>
</target>
<!-- ============================================================= -->
<!-- Clean up all files that are generated. -->
<!-- ============================================================= -->
<target name="clean">
<delete quiet="true" dir="${classes}"/>
<delete dir="${dist}" />
<delete file="${target}/${name}-${version}.jar"/>
<delete file="${target}/${name}-utils-${version}.jar"/>
</target>
<!-- ============================================================= -->
<!-- Clean and then compile the project -->
<!-- ============================================================= -->
<target name="rebuild">
<antcall target="clean"/>
<antcall target="compile"/>
</target>
<!-- ============================================================= -->
<!-- Create the jar file -->
<!-- ============================================================= -->
<target name="jar" depends="compile">
<jar jarfile="${target}/${name}-${version}.jar">
<manifest>
<attribute name="Main-Class" value="com.sqleo.environment.Application"/>
<attribute name="Built-By" value="none"/>
<section name="Global">
<attribute name="Specification-Title" value="${name}"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="none"/>
<attribute name="Implementation-Title" value="${name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="none"/>
</section>
</manifest>
<fileset dir="${classes}" excludes="com/apple/"/>
</jar>
</target>
<!-- ============================================================= -->
<!-- Create the dist_bin_zip -->
<!-- ============================================================= -->
<target name="dist_bin_zip" depends="jar">
<!-- Full includes a bunch of JDBC drivers so, the user has nothing todo -->
<!-- It just works out of the box -->
<zip destfile="${dist}/${name}-${version}.zip">
<zipfileset dir="lib" includes="*.jar" prefix="${name}-${version}/lib"/>
<zipfileset dir="lib" includes="*.txt" prefix="${name}-${version}/lib"/>
<zipfileset dir="${target}" includes="${name}-${version}.jar" fullpath="${name}-${version}/${name}.jar"/>
<zipfileset dir="." includes="LICENSE.txt" fullpath="${name}-${version}/LICENSE.txt"/>
<zipfileset dir="." includes="README.txt" fullpath="${name}-${version}/README.txt"/>
</zip>
</target>
<!-- ============================================================= -->
<!-- Create the dist_src_zip -->
<!-- ============================================================= -->
<target name="dist_src_zip">
<!-- Full includes a bunch of JDBC drivers so, the user has nothing todo -->
<!-- It just works out of the box -->
<zip destfile="${dist}/${name}-${version}-src.zip">
<zipfileset dir="src" excludes="**/*.class" prefix="${name}-${version}-src/src"/>
<zipfileset dir="lib" includes="*.jar" prefix="${name}-${version}-src/lib"/>
<zipfileset dir="lib" includes="*.txt" prefix="${name}-${version}-src/lib"/>
<zipfileset dir="." includes="build.xml" fullpath="${name}-${version}-src/build.xml"/>
<zipfileset dir="." includes="LICENSE.txt" fullpath="${name}-${version}-src/LICENSE.txt"/>
<zipfileset dir="." includes="README.txt" fullpath="${name}-${version}-src/README.txt"/>
</zip>
</target>
<!-- ============================================================= -->
<!-- Create the dist_bin_zip -->
<!-- ============================================================= -->
<target name="dist_bin_tar" depends="jar">
<!-- Full includes a bunch of JDBC drivers so, the user has nothing todo -->
<!-- It just works out of the box -->
<tar destfile="${dist}/${name}-${version}.tar">
<tarfileset dir="lib" includes="*.jar" prefix="${name}-${version}/lib"/>
<tarfileset dir="lib" includes="*.txt" prefix="${name}-${version}/lib"/>
<tarfileset dir="${target}" includes="${name}-${version}.jar" fullpath="${name}-${version}/${name}.jar"/>
<tarfileset dir="." includes="LICENSE.txt" fullpath="${name}-${version}/LICENSE.txt"/>
<tarfileset dir="." includes="README.txt" fullpath="${name}-${version}/README.txt"/>
</tar>
<gzip src="${dist}/${name}-${version}.tar" destfile="${dist}/${name}-${version}.tar.gz"/>
<delete file="${dist}/${name}-${version}.tar"/>
</target>
<!-- ============================================================= -->
<!-- Create the dist -->
<!-- ============================================================= -->
<target name="dist" depends="dist_bin_zip, dist_bin_tar, dist_src_zip">
<!-- Full includes a bunch of JDBC drivers so, the user has nothing todo -->
<!-- It just works out of the box -->
</target>
<!-- ============================================================= -->
<!-- Execute SQLeo -->
<!-- ============================================================= -->
<target name="run" depends="compile">
<java classname="com.sqleo.environment.Application" fork="true">
<jvmarg value="-Xms48m"/>
<jvmarg value="-Xmx512m"/>
<sysproperty key="sun.swing.enableImprovedDragGesture" value="true"/>
<sysproperty key="com.sqleo.laf.class" value="com.sun.java.swing.plaf.windows.WindowsLookAndFeel"/>
<classpath>
<pathelement location="${classes}"/>
<pathelement location="./${name}-{${version}.jar"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</classpath>
</java>
</target>
<!-- ============================================================= -->
<!-- Creates the API documentation -->
<!-- ============================================================= -->
<target name="javadocs" depends="compile">
<mkdir dir="${javadocs}"/>
<javadoc packagenames="${packages}"
sourcepath="${src}"
destdir="${javadocs}"
author="true"
version="true"
windowtitle="SQLeo API"
doctitle="SQLeo"
use="true"
bottom="Copyright © All Rights Reserved."
/>
</target>
<property name="test.build.dir" value="${basedir}/build/test-classes"/>
<property name="test.src.dir" value="${basedir}/test"/>
<property name="test.lib.dir" value="${basedir}/test/lib"/>
<property name="test.res.dir" value="${basedir}/test/resources"/>
<path id="classpath.test">
<fileset dir="${test.lib.dir}" includes="**/*.jar"/>
<pathelement location="${test.build.dir}"/>
<pathelement location="${test.res.dir}"/>
</path>
<target name="test-compile">
<mkdir dir="${test.build.dir}"/>
<copy todir="${test.build.dir}">
<fileset dir="${test.res.dir}" />
</copy>
<javac destdir="${test.build.dir}">
<src path="${src}" />
<exclude name="com/apple/**"/>
<exclude name="org/**"/>
<exclude name="com/sqleo/environment/SQLeoMacApp.java"/>
</javac>
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}">
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="test" depends="test-compile">
<junit printsummary="on" haltonfailure="yes" fork="true">
<classpath>
<path refid="classpath.test"/>
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${test.src.dir}" />
</batchtest>
</junit>
</target>
</project>