-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
executable file
·320 lines (299 loc) · 10.8 KB
/
build.xml
File metadata and controls
executable file
·320 lines (299 loc) · 10.8 KB
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
310
311
312
313
314
315
316
317
318
319
320
<?xml version="1.0" encoding="UTF-8" ?>
<project name="SQLRunner" default="all" basedir=".">
<property name="project" location="." />
<property name="src" location="src/main/java" />
<property name="websrc" location="src/main/website" />
<property name="bin" location="classes" />
<property name="build" location="build" />
<property name="lib" location="libs" />
<property name="distrib" location="distrib" />
<property name="appname" value="SQLRunner" />
<property name="mainclass" value="sqlrunner.Main" />
<property name="javawebstart" location="distrib/javawebstart" />
<property name="macappdir" location="distrib/${appname}MacOSX" />
<property name="localapp" location="distrib/localapp" />
<property name="linuxdir" location="/usr/lib/sqlrunner" />
<property name="jws-jar-filename" value="sqlrunner-jws.jar" />
<path id="project.class.path">
<fileset dir="${lib}" includes="**/*.jar" />
</path>
<path id="build.class.path">
<fileset dir="${build}" includes="**/*.jar" />
</path>
<target name="loadversion" description="Initalize">
<loadfile property="version" srcFile="${src}/VERSION" >
<filterchain>
<striplinebreaks/>
</filterchain>
</loadfile>
<property name="jarfilename" value="sqlrunner-${version}.jar" />
</target>
<target name="clean" description="cleans the output folder">
<delete failonerror="false" includeemptydirs="true" dir="${bin}" />
<mkdir dir="${bin}" />
</target>
<target name="generateIconCode">
<taskdef name="iconCodeGen" classname="org.jugbb.ant.iconcodegen.IconCodeGenTask" classpathref="build.class.path"/>
<iconCodeGen
sourceDir="${src}"
iconPackage="sqlrunner.resources"
iconFileExtensions="png gif jpg"
encoding="UTF-8"
/>
</target>
<target name="generateImageCode">
<taskdef name="imageCodeGen" classname="org.jugbb.ant.iconcodegen.ImageCodeGenTask" classpathref="build.class.path" />
<imageCodeGen
sourceDir="${src}"
imagePackage="sqlrunner.resources.images"
imageFileExtensions="png gif jpg"
encoding="UTF-8"
/>
</target>
<target name="compile" depends="clean, generateIconCode, generateImageCode" description="compile the source">
<javac
classpathref="project.class.path"
debug="true"
deprecation="true"
nowarn="false"
srcdir="${src}"
encoding="UTF-8"
source="1.8"
target="1.8"
destdir="${bin}" />
<copy todir="${bin}">
<fileset dir="${src}">
<include name="**/*" />
<exclude name="**/*.java" />
<exclude name="**/*.psd" />
<exclude name="**/messages*.properties" />
<exclude name="CVS" />
</fileset>
</copy>
<native2ascii
encoding="UTF-8"
includes="**/messages*.properties"
src="${src}"
dest="${bin}" />
</target>
<target name="run" depends="compile">
<java classname="${mainclass}" fork="true">
<jvmarg value="-Xmx512m" />
<classpath>
<path refid="project.class.path" />
<path location="${bin}" />
</classpath>
</java>
</target>
<path id="jar.class.path">
<fileset dir="${lib}">
<include name="*.jar" />
<include name="mssql_license" />
<exclude name="ui.jar" />
</fileset>
</path>
<target name="jar"
depends="compile, loadversion"
description="create the main jar">
<mkdir dir="${distrib}"/>
<delete failonerror="false">
<fileset dir="${distrib}">
<include name="*.jar" />
<include name="*src.zip" />
</fileset>
</delete>
<manifestclasspath property="classpathvalue"
jarfile="${lib}/${jarfilename}">
<classpath refid="project.class.path" />
</manifestclasspath>
<jar jarfile="${distrib}/${jarfilename}" basedir="${bin}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Class-Path" value="${classpathvalue}" />
<attribute name="Main-Class" value="${mainclass}" />
</manifest>
</jar>
<zip destfile="${distrib}/${jarfilename}-src.zip">
<fileset dir="${src}">
<include name="**/*.properties" />
<include name="*.cfg" />
<include name="*.txt" />
<include name="**/*.gif" />
<include name="**/*.png" />
<include name="**/*.jpg" />
<include name="**/*.java" />
</fileset>
</zip>
<copy todir="${distrib}" flatten="true">
<fileset dir="${src}">
<include name="**/sqlrunner.png" />
</fileset>
</copy>
</target>
<target name="all"
depends="clean, localapp, deb, dmg, dmg_linux"
description="create complete distribution" />
<target name="localapp" depends="jar" description="sign all jars">
<delete failonerror="false">
<fileset dir="${distrib}">
<include name="*.zip" />
<exclude name="*-src.zip" />
</fileset>
</delete>
<delete failonerror="false" includeemptydirs="true" dir="${localapp}" />
<mkdir dir="${localapp}" />
<copy todir="${localapp}">
<fileset dir="${src}">
<include name="sqlrunner.sh" />
<include name="sqlrunner.cmd" />
<include name="sqlrunner.ico" />
</fileset>
</copy>
<chmod perm="ugo+rx">
<fileset dir="${localapp}">
<include name="sqlrunner.sh" />
</fileset>
</chmod>
<copy todir="${localapp}">
<fileset dir="${lib}">
<include name="*.jar" />
<exclude name="ui.jar" />
</fileset>
</copy>
<copy tofile="${localapp}/sqlrunner.jar" file="${distrib}/${jarfilename}" />
<zip destfile="${distrib}/sqlrunner-${version}.zip">
<fileset dir="${localapp}">
<exclude name="**/.Spotlight*" />
</fileset>
</zip>
</target>
<target name="macapp"
depends="jar"
description="build Mac OS X application bundle">
<delete failonerror="false"
includeemptydirs="true"
dir="${macappdir}" />
<mkdir dir="${macappdir}" />
<taskdef name="jarbundler" classname="net.sourceforge.jarbundler.JarBundler" classpathref="build.class.path" />
<jarbundler dir="${macappdir}"
name="${appname}"
shortname="${appname}"
infostring="Version ${version} Copyright Jan Lolling"
icon="${src}/sqlrunner.icns"
version="${version}"
mainclass="${mainclass}"
jvmversion="1.8+"
vmoptions="-Xmx4G -Dcom.sun.management.jmxremote=true -Dapple.awt.graphics.UseQuartz=true">
<jarfileset dir="${lib}">
<include name="*.jar" />
<exclude name="ui.jar" />
</jarfileset>
<jarfileset dir="${distrib}">
<include name="${jarfilename}" />
</jarfileset>
<documenttype
name="SQL script"
extensions="sql" role="Editor" />
<documenttype
name="SQLRunner CSV Import Configuration"
extensions="importconfig"
role="Editor" />
</jarbundler>
<mkdir dir="${macappdir}/${appname}.app/Contents/Resources/German.lproj" />
<mkdir dir="${macappdir}/${appname}.app/Contents/Resources/English.lproj" />
<delete file="${macappdir}/${appname}.app/Contents/MacOS/JavaApplicationStub" />
<echo>copy universalJavaApplicationStub</echo>
<exec executable="cp">
<arg line="${build}/universalJavaApplicationStub" />
<arg value="${macappdir}/${appname}.app/Contents/MacOS/JavaApplicationStub" />
</exec>
<chmod perm="guo+x" file="${macappdir}/${appname}.app/Contents/MacOS/JavaApplicationStub"></chmod>
<available file="/usr/bin/hdiutil" property="hdiutil.present"/>
</target>
<target name="dmg" depends="macapp" if="hdiutil.present">
<delete failonerror="false">
<fileset dir="${distrib}">
<include name="*.dmg" />
</fileset>
</delete>
<exec executable="hdiutil">
<arg line="create -srcfolder ${macappdir} ${distrib}/sqlrunner-${version}.dmg" />
</exec>
</target>
<target name="dmg_linux" depends="macapp" unless="hdiutil.present">
<delete failonerror="false">
<fileset dir="${distrib}">
<include name="*.dmg" />
</fileset>
</delete>
<exec executable="genisoimage">
<arg line="-V SQLRunner -r -apple -l -o ${distrib}/sqlrunner-${version}.dmg ${macappdir}"/>
</exec>
</target>
<target name="source_distrib">
<zip destfile="${distrib}/sql-complete-${version}.zip">
<fileset dir="${project}" includes="src/ libs/ build/ nbproject/">
<exclude name="**/.Spotlight*" />
</fileset>
</zip>
</target>
<target name="deb" depends="jar" description="build the i386 deb file">
<delete failonerror="false">
<fileset dir="${distrib}">
<include name="sqlrunner*.deb" />
<include name="sqlrunner*.desktop" />
</fileset>
</delete>
<taskdef name="desktopentry" classname="com.googlecode.ant_deb_task.DesktopEntry">
<classpath>
<pathelement path="build/ant-deb.jar"/>
</classpath>
</taskdef>
<desktopentry toFile="${distrib}/sqlrunner.desktop"
name="${appname}"
comment="Database SQL Client"
icon="${linuxdir}/sqlrunner.png"
exec="java -jar ${linuxdir}/${jarfilename} %f"
type="Application"
terminal="false"
mimeType="text/x-sql"
path="${linuxdir}"
categories="Development;" />
<taskdef name="deb" classname="com.googlecode.ant_deb_task.Deb">
<classpath>
<pathelement path="build/ant-deb.jar"/>
</classpath>
</taskdef>
<deb todir="${distrib}"
package="sqlrunner"
section="devel"
architecture="all"
debfilenameproperty="debfilename"
depends="default-jre|openjdk-7-jre|sun-java7-jre|openjdk-8-jre">
<version upstream="${version}" />
<maintainer name="Jan Lolling" email="jan.lolling@gmail.com" />
<changelog file="${src}/ReleaseNotes.txt" format="plain" />
<description synopsis="Java based database client">
SQLRunner is a Java programm to handle database with an easy to use SQL interface.
The SQLRunner has advanced import and export capabilities.
SQLRunner ships with a large number of JDBC driver (e.g. Oracle, Postgres, DB2, MS-SQL, Informix, Derby, Sybase, MaxDB, MySQL).
Homepage:
[http://jan-lolling.de/Home/SQLRunner.html]
</description>
<tarfileset dir="${lib}" prefix="${linuxdir}">
<include name="*.jar" />
<exclude name="ui.jar" />
</tarfileset>
<tarfileset file="${distrib}/${jarfilename}"
prefix="${linuxdir}" />
<tarfileset file="${distrib}/sqlrunner.png"
prefix="${linuxdir}" />
<tarfileset file="${src}/sqlrunner.sh"
prefix="${linuxdir}"
filemode="755" />
<tarfileset file="${distrib}/sqlrunner.desktop"
prefix="/usr/share/applications" />
</deb>
<echo>deb file: ${debfilename}</echo>
</target>
</project>