-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
353 lines (267 loc) · 13 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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<project name="sukukk" default="all" basedir=".">
<condition property="doOverride">
<available file="setup/version.properties"/>
</condition>
<property name="app.name" value="suku"/>
<property name="build.home" value="${basedir}/build"/>
<property name="resources.home" value="${basedir}/resources"/>
<property name="dist.home" value="${basedir}/dist"/>
<property name="docs.home" value="${basedir}/docs"/>
<property name="src.home" value="${basedir}/src"/>
<property name="conf.home" value="${basedir}/conf"/>
<property name="devc.home" value="${basedir}/devc"/>
<property name="junit.home" value="${basedir}/junit" />
<property name="lib.home" value="${basedir}/lib"/>
<property name="test.home" value="${basedir}/test"/>
<property name="swing.home" value="${basedir}/swing"/>
<property name="web.home" value="${basedir}/WebContent"/>
<target name="overrideProps" if="doOverride">
<property file="setup/version.properties"/>
</target>
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="false"/>
<property name="compile.optimize" value="true"/>
<!-- ==================== Compilation Classpath =========================== -->
<!--
Rather than relying on the CLASSPATH environment variable, Ant includes
features that makes it easy to dynamically construct the classpath you
need for each compilation. The example below constructs the compile
classpath to include the servlet.jar file, as well as the other components
that Tomcat makes available to web applications automatically, plus anything
that you explicitly added.
-->
<path id="compile.classpath">
<fileset dir="${lib.home}">
<include name="*.jar"/>
</fileset>
</path>
<target name="all" depends="dist,war" description="Clean build and dist directories, then compile"/>
<!-- ==================== Jar Target ====================================== -->
<!--
The "jar" target is a shortcut for running the "clean" target followed
by the "compile" target and packaging the result in a jar-file
-->
<target name="jar" depends="clean,compile,junit" description="Clean build and dist directories, then compile">
<mkdir dir="${dist.home}"/>
<jar destfile="${dist.home}/suku.jar" basedir="${build.home}/classes">
<fileset dir="${basedir}/resources" >
<include name="images/**"/>
<include name="sql/**"/>
</fileset>
<manifest >
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="fi.kaila.suku.swing.Suku"/>
<attribute name="Class-Path" value="lib/postgresql-9.0-801.jdbc4.jar lib/jfreechart-1.0.13.jar lib/jcommon-1.0.16.jar lib/jxl.jar lib/jcalendarbutton-1.4.5.jar lib/looks-2.3.1.jar lib/swingx-1.6.jar lib/swingx-ws-1.0.jar resources/"/>
<section name="common">
<attribute name="Specification-Title" value="Example"/>
<attribute name="Specification-Version" value="${app.version}.${revision.version}"/>
<attribute name="Specification-Vendor" value="KK Software"/>
<attribute name="Implementation-Title" value="common"/>
<attribute name="Implementation-Version" value="${version} ${TODAY}"/>
<attribute name="Implementation-Vendor" value="KK Software"/>
</section>
</manifest>
</jar>
</target>
<target name="war" depends="jar,servlet" description="Build war">
<copy file="${web.home}/WEB-INF/lib/finfamily.jar" tofile="${web.home}/suku.jar" />
<copy file="${lib.home}/jxl.jar" tofile="${web.home}/jxl.jar" />
<copy file="${lib.home}/jcalendarbutton-1.4.5.jar" tofile="${web.home}/jcalendarbutton-1.4.5.jar" />
<copy file="${lib.home}/jfreechart-1.0.13.jar" tofile="${web.home}/jfreechart-1.0.13.jar" />
<copy file="${lib.home}/jcommon-1.0.16.jar" tofile="${web.home}/jcommon-1.0.16.jar" />
<war destfile="${dist.home}/finfamily.war" basedir="${basedir}/WebContent">
</war>
</target>
<target name="servlet" depends="clean,compile" description="Build war">
<mkdir dir="${web.home}"/>
<mkdir dir="${web.home}/WEB-INF"/>
<jar destfile="${web.home}/WEB-INF/lib/finfamily.jar" basedir="${build.home}/classes">
<fileset dir="${basedir}/resources" >
<include name="**/*.xls"/>
<include name="/images/**"/>
<include name="/sql/**"/>
<include name="/xml/**"/>
</fileset>
<manifest >
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="fi.kaila.suku.swing.Suku"/>
<attribute name="Class-Path" value="jfreechart-1.0.13.jar jcommon-1.0.16.jar lib/jxl.jar jcalendarbutton-1.4.5.jar looks-2.3.1.jar swingx-1.6.jar swingx-ws-1.0.jar resources/"/>
<section name="common">
<attribute name="Specification-Title" value="Example"/>
<attribute name="Specification-Version" value="${app.version}.${revision.version}"/>
<attribute name="Specification-Vendor" value="KK Software"/>
<attribute name="Implementation-Title" value="common"/>
<attribute name="Implementation-Version" value="${version} ${TODAY}"/>
<attribute name="Implementation-Vendor" value="KK Software"/>
</section>
</manifest>
</jar>
<copy todir="${web.home}/WEB-INF">
<fileset dir="${basedir}" >
<include name="resources/FinFamily.xls"/>
<include name="resources/images/**"/>
<include name="resources/xml/**"/>
<include name="resources/sql/**"/>
<include name="lib/jfreechart-1.0.13.jar"/>
<include name="lib/jcommon-1.0.16.jar"/>
<include name="lib/jcalendarbutton-1.4.5.jar"/>
<include name="lib/jxl.jar"/>
</fileset>
</copy>
</target>
<target name="dist" depends="jar" description="Create distribution folder">
<mkdir dir="${dist.home}/lib"/>
<mkdir dir="${dist.home}/properties"/>
<mkdir dir="${dist.home}/resources"/>
<mkdir dir="${dist.home}/resources/excel"/>
<mkdir dir="${dist.home}/resources/xml"/>
<mkdir dir="${swing.home}"/>
<copy file="${resources.home}/properties/logging.properties" todir="${dist.home}/properties"/>
<copy file="${resources.home}/excel/PlaceLocations.xls" todir="${dist.home}/resources/excel"/>
<copy file="${resources.home}/excel/Taivut_fi.xls" todir="${dist.home}/resources/excel"/>
<copy file="${resources.home}/excel/FinFamily.xls" todir="${dist.home}/resources/excel"/>
<copy todir="${dist.home}/resources/xml">
<fileset dir="${resources.home}/xml" includes="*.xsl"/>
</copy>
<!-- <copy file="${devc.home}/Suku.exe" todir="${dist.home}"/>
-->
<copy file="${devc.home}/suku.sh" todir="${dist.home}"/>
<copy file="${devc.home}/SukuMac" todir="${dist.home}"/>
<copy todir="${dist.home}/lib">
<fileset dir="${lib.home}">
</fileset>
</copy>
<zip destfile="${swing.home}/finfamily${revision.version}.zip" basedir="${dist.home}"
includes="suku.jar suku.sh SukuMac lib/postgresql-9.0-801.jdbc4.jar
lib/jxl.jar lib/jcalendarbutton-1.4.5.jar lib/jfreechart-1.0.13.jar lib/jcommon-1.0.16.jar lib/swingx-1.6.jar lib/swingx-ws-1.0.jar
lib/looks-2.3.1.jar properties/*
resources/excel/FinFamily.xls resources/excel/Taivut_fi.xls
resources/xml/*">
</zip>
</target>
<!-- ==================== Clean Target ==================================== -->
<!--
The "clean" target deletes any previous "build" and "dist" directory,
so that you can be ensured the application can be built from scratch.
-->
<target name="clean" description="Delete old build and dist directories">
<delete dir="${build.home}"/>
<delete dir="${dist.home}"/>
</target>
<!-- ==================== Compile Target ================================== -->
<!--
The "compile" target transforms source files (from your "src" directory)
into object files in the appropriate location in the build directory.
This example assumes that you will be including your classes in an
unpacked directory hierarchy under "/WEB-INF/classes".
-->
<target name="compile" depends="overrideProps" description="Compile Java sources">
<!-- A java class with generated version # -->
<echo file="src/fi/kaila/suku/ant/AntVersion.java">
package fi.kaila.suku.ant;
/** Dont modify. Generated by Ant */
public class AntVersion {
/** Generated version number by Ant */
public static final String antVersion = "${app.version}.${revision.version}";
}
</echo>
<!-- A script file for innosetup to create the windows installer
Innosetup is found at http://www.jrsoftware.org/
-->
<echo file="setup/antsetup.iss">
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{68611E54-42B6-437B-9857-411678FE2E68}
AppName=FinFamily
AppVerName=FinFamily ${app.version}.${revision.version}
AppPublisher=Kaarle Kaila
AppPublisherURL=http://www.sukuohjelmisto.fi
AppSupportURL=http://www.sukuohjelmisto.fi
AppUpdatesURL=http://www.sukuohjelmisto.fi
DefaultDirName={pf}\FinFamily
DefaultGroupName=FinFamily
OutputDir=..\swing
OutputBaseFilename=FinFamily${revision.version}
SetupIconFile=..\resources\images\Genealogia.ico
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "..\devc\Suku.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\dist\suku.jar"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\dist\suku.sh"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\dist\lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\dist\properties\*"; DestDir: "{app}\properties"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\dist\resources\*"; DestDir: "{app}\resources"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\FinFamily"; Filename: "{app}\Suku.exe"
Name: "{group}\{cm:UninstallProgram,FinFamily}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\FinFamily"; Filename: "{app}\Suku.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\FinFamily"; Filename: "{app}\Suku.exe"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\Suku.exe"; Description: "{cm:LaunchProgram,FinFamily}"; Flags: nowait postinstall skipifsilent
</echo>
<!-- Compile Java classes as necessary -->
<mkdir dir="${build.home}/classes"/>
<javac source="1.6" destdir="${build.home}/classes"
includeantruntime="false"
debug="yes" encoding="UTF-8">
<src path="${src.home}" />
<src path="${junit.home}" />
<classpath>
<fileset dir="${lib.home}">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
<!-- Copy application resources -->
<!--
<copy todir="${build.home}/WEB-INF/classes">
<fileset dir="${src.home}" includes="**/*.java"/>
<fileset dir="${src.home}" includes="**/*.xsl"/>
</copy>
-->
</target>
<target name="junit" depends="compile" description="Runs JUnit tests" >
<mkdir dir="${test.home}/test"/>
<!--
<copy todir="${tests.dir}">
<fileset dir="../src/${resource.dir}" includes="swpparchiving.*"/>
</copy>
-->
<!--
<junit printsummary="yes" fork="yes" haltonfailure="yes">
<classpath>
<pathelement path="${java.class.path}" />
<pathelement path="${build.home}/classes"/>
<pathelement path="${lib.home}/junit-4.4.jar" />
<pathelement path="${basedir}/resources"/>
<pathelement path="${lib.home}/pg73jdbc3.jar" />
</classpath>
<formatter type="plain"/>
<batchtest todir="${test.home}/test">
<fileset dir="${junit.home}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
-->
</target>
<target name="javadoc">
<javadoc access="public" encoding="UTF-8" author="true" classpath="lib/servlet.jar;lib/postgresql-9.0-801.jdbc4.jar;lib/jxl.jar;resources;lib/junit-4.4.jar;lib/jnlp.jar;lib/swingx-1.6.jar;lib/swingx-ws-1.0.jar"
destdir="guide/javadoc" doctitle="FinFamily" nodeprecated="false"
nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false"
overview="src\overview.html" source="1.6" sourcepath="src;junit" excludepackagenames="components"
splitindex="true" use="true" version="true"/>
</target>
</project>