-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
772 lines (665 loc) · 32.6 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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- blojsom -->
<!-- ======================================================================= -->
<project name="blojsom" default="compile" basedir=".">
<property name="name" value="blojsom"/>
<property name="version" value="3.3"/>
<property name="distro.dir" value="${basedir}/distro"/>
<property name="war.file" value="${distro.dir}/${name}.war"/>
<property name="compile.dir" value="${basedir}/classes"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="plugins.src.dir" value="${basedir}/plugins/src"/>
<property name="extensions.src.dir" value="${basedir}/extensions/src"/>
<property name="test.src.dir" value="${basedir}/test/src"/>
<property name="war.dir" value="${basedir}/war"/>
<property name="resources.dir" value="${war.dir}/resources"/>
<property name="webinf.dir" value="${war.dir}/WEB-INF"/>
<property name="webinf.classes.dir" value="${webinf.dir}/classes"/>
<property name="webinf.lib.dir" value="${webinf.dir}/lib"/>
<property name="build.dir" value="${webinf.dir}/classes"/>
<property name="docs.dir" value="${basedir}/docs"/>
<property name="javadoc.dir" value="${docs.dir}/content/javadoc"/>
<property name="javadoc.zip" value="${distro.dir}/${name}-javadocs.zip"/>
<property name="velocidoc.dir" value="${basedir}/velocidoc"/>
<property name="ant.lib.dir" value="${basedir}/ant-lib"/>
<property name="velocidoc.zip" value="${distro.dir}/${name}-velocidocs.zip"/>
<property name="pagemacros.dir" value="${basedir}/plugins/src/org/blojsom/plugin/velocity"/>
<property name="properties.dir" value="${basedir}/properties"/>
<property name="templates.dir" value="${basedir}/templates"/>
<property name="templates.resources.dir" value="${templates.dir}/resources"/>
<property name="themes.dir" value="${basedir}/themes"/>
<property name="default.theme.dir" value="${themes.dir}/asual/"/>
<property name="default.theme.templates.dir" value="${default.theme.dir}/templates/"/>
<property name="default.theme.resources.dir" value="${default.theme.dir}/resources/"/>
<property name="core.jar" value="${webinf.lib.dir}/${name}-core-${version}.jar"/>
<property name="resources.jar" value="${webinf.lib.dir}/${name}-resources-${version}.jar"/>
<property name="plugins.jar" value="${webinf.lib.dir}/${name}-plugins-${version}.jar"/>
<property name="plugins-templates.jar" value="${webinf.lib.dir}/${name}-plugins-templates-${version}.jar"/>
<property name="extensions.jar" value="${webinf.lib.dir}/${name}-extensions-${version}.jar"/>
<property name="templates.jar" value="${webinf.lib.dir}/${name}-templates-${version}.jar"/>
<property name="javadocs.zip" value="${distro.dir}/${name}-javadocs.zip"/>
<property name="tinymce.dir" value="${war.dir}/administration/tiny_mce"/>
<property name="default.blog" value="default"/>
<property name="default.blog.dir" value="blogs/default"/>
<property name="bootstrap.blog" value="bootstrap"/>
<property name="bootstrap.blog.dir" value="blogs/bootstrap"/>
<property name="sql.scripts.dir" value="${basedir}/sql-scripts"/>
<property name="source.version" value="1.4"/>
<property name="target.version" value="1.4"/>
<!-- Tomcat deployment target properties -->
<property name="manager.url" value="http://localhost:8080/manager"/>
<property name="manager.username" value="username"/>
<property name="manager.password" value="password"/>
<property name="app.path" value="/${name}"/>
<property name="build.home" value="${war.dir}"/>
<!-- Add-on properties -->
<property name="addon.lib.dir" value="${basedir}/addon-lib"/>
<property name="addon.extensions.src.dir" value="${basedir}/addon/extensions/src"/>
<property name="addon.plugins.src.dir" value="${basedir}/addon/plugins/src"/>
<property name="addon.core.src.dir" value="${basedir}/addon/core/src"/>
<property name="addon.core.jar" value="${webinf.lib.dir}/${name}-addon-core-${version}.jar"/>
<property name="addon.plugins.jar" value="${webinf.lib.dir}/${name}-addon-plugins-${version}.jar"/>
<property name="addon.extensions.jar" value="${webinf.lib.dir}/${name}-addon-extensions-${version}.jar"/>
<property name="addon.resources.jar" value="${webinf.lib.dir}/${name}-addon-resources-${version}.jar"/>
<!-- Upgrade properties -->
<property name="upgrade.lib.dir" value="${basedir}/upgrade-lib"/>
<property name="upgrade.src.dir" value="${basedir}/upgrade/src"/>
<property name="upgrade.jar" value="${webinf.lib.dir}/${name}-upgrade-utility-${version}.jar"/>
<property name="debug" value="on"/>
<property name="deprecation" value="on"/>
<property name="optimize" value="on"/>
<!-- =================================================================== -->
<!-- Classpath -->
<!-- =================================================================== -->
<path id="build.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${webinf.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${addon.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${upgrade.lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<!-- =================================================================== -->
<!-- Sourcepath (for javadoc) -->
<!-- =================================================================== -->
<path id="source.path">
<pathelement path="${src.dir}"/>
<pathelement path="${plugins.src.dir}"/>
<pathelement path="${extensions.src.dir}"/>
<pathelement path="${addon.core.src.dir}"/>
<!-- <pathelement path="${addon.extensions.src.dir}"/> -->
<pathelement path="${addon.plugins.src.dir}"/>
</path>
<!-- =================================================================== -->
<!-- Prepares the build process -->
<!-- =================================================================== -->
<target name="prepare"
description="Prepares the build by creating necessary directories and copying necessary files">
<tstamp/>
<mkdir dir="${compile.dir}"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${distro.dir}"/>
<copy todir="${build.dir}">
<fileset dir="${properties.dir}">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</fileset>
</copy>
<!-- Copy general templates for default user -->
<mkdir dir="${war.dir}/WEB-INF/${default.blog.dir}/templates/"/>
<copy todir="${war.dir}/WEB-INF/${default.blog.dir}/templates/">
<fileset dir="${templates.dir}">
<include name="**/*.vm"/>
<exclude name="**/html*.vm"/>
</fileset>
</copy>
<!-- Copy general templates for bootstrap user -->
<mkdir dir="${war.dir}/WEB-INF/${bootstrap.blog.dir}/templates/"/>
<copy todir="${war.dir}/WEB-INF/${bootstrap.blog.dir}/templates/">
<fileset dir="${templates.dir}">
<include name="**/*.vm"/>
<exclude name="**/html*.vm"/>
</fileset>
</copy>
<!-- Copy theme templates and resources for default user -->
<mkdir dir="${resources.dir}/${default.blog}"/>
<copy todir="${war.dir}/WEB-INF/${default.blog.dir}/templates">
<fileset dir="${default.theme.templates.dir}"/>
</copy>
<copy todir="${resources.dir}/${default.blog}">
<fileset dir="${templates.resources.dir}"/>
</copy>
<copy todir="${resources.dir}/${default.blog}">
<fileset dir="${default.theme.resources.dir}"/>
</copy>
<!-- Copy theme templates and resources for bootstrap user -->
<mkdir dir="${war.dir}/WEB-INF/${bootstrap.blog.dir}/resources/"/>
<copy todir="${war.dir}/WEB-INF/${bootstrap.blog.dir}/templates">
<fileset dir="${default.theme.templates.dir}"/>
</copy>
<copy todir="${war.dir}/WEB-INF/${bootstrap.blog.dir}/resources/">
<fileset dir="${templates.resources.dir}"/>
</copy>
<copy todir="${war.dir}/WEB-INF/${bootstrap.blog.dir}/resources/">
<fileset dir="${default.theme.resources.dir}"/>
</copy>
<!-- Copy the SQL scripts -->
<copy todir="${build.dir}">
<fileset dir="${sql.scripts.dir}"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Cleans up generated stuff -->
<!-- =================================================================== -->
<target name="clean" description="Removes generated files from the build">
<delete dir="${compile.dir}"/>
<delete dir="${build.dir}"/>
<delete dir="${docs.dir}"/>
<delete dir="${velocidoc.dir}"/>
<delete dir="${distro.dir}"/>
<delete dir="${build.dir}"/>
<delete>
<fileset dir="${webinf.lib.dir}" includes="${name}-*.jar"/>
<fileset dir="${webinf.lib.dir}" includes="hsqldb.jar"/>
</delete>
<delete file="${war.file}"/>
<delete dir="${webinf.dir}/themes"/>
</target>
<!-- =================================================================== -->
<!-- Cleans up generated stuff -->
<!-- =================================================================== -->
<target name="clean-with-templates" description="Removes generated files from the build">
<delete dir="${compile.dir}"/>
<delete dir="${build.dir}"/>
<delete dir="${docs.dir}"/>
<delete dir="${velocidoc.dir}"/>
<delete dir="${distro.dir}"/>
<delete dir="${build.dir}"/>
<delete>
<fileset dir="${webinf.lib.dir}" includes="${name}-*.jar"/>
</delete>
<delete file="${war.file}"/>
<delete dir="${webinf.dir}/themes"/>
<delete dir="${war.dir}/WEB-INF/${default.blog.dir}" includeemptydirs="true"/>
<delete dir="${war.dir}/WEB-INF/${bootstrap.blog.dir}" includeemptydirs="true"/>
<delete dir="${resources.dir}/${default.blog}" includeemptydirs="true"/>
<delete dir="${resources.dir}/${bootstrap.blog}" includeemptydirs="true"/>
</target>
<!-- =================================================================== -->
<!-- Compiles the source code -->
<!-- =================================================================== -->
<target name="compile" depends="prepare" description="Compiles the core, plugin, and extensions">
<!-- Core -->
<javac srcdir="${src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<jar file="${core.jar}" basedir="${compile.dir}"/>
<!-- Plugins -->
<delete dir="${compile.dir}"/>
<mkdir dir="${compile.dir}"/>
<javac srcdir="${plugins.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<jar file="${plugins.jar}" basedir="${compile.dir}"/>
<!-- Plugins templates -->
<jar file="${plugins-templates.jar}" basedir="${plugins.src.dir}" includes="**/*.vm"/>
<!-- Extensions -->
<delete dir="${compile.dir}"/>
<mkdir dir="${compile.dir}"/>
<javac srcdir="${extensions.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
excludes="**/Test*"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<jar file="${extensions.jar}" basedir="${compile.dir}"/>
<!-- Resources -->
<delete dir="${compile.dir}"/>
<mkdir dir="${compile.dir}"/>
<copy todir="${compile.dir}">
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
</fileset>
</copy>
<copy todir="${compile.dir}">
<fileset dir="${extensions.src.dir}">
<include name="**/*.properties"/>
</fileset>
</copy>
<copy todir="${compile.dir}">
<fileset dir="${plugins.src.dir}">
<include name="**/*.properties"/>
</fileset>
</copy>
<jar file="${resources.jar}" basedir="${compile.dir}"/>
<delete dir="${compile.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Compiles the source code and does not delete nor jar. For Testing -->
<!-- =================================================================== -->
<target name="compile-for-testing" depends="prepare" description="Compiles the class files">
<!-- Core -->
<javac srcdir="${src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<javac srcdir="${plugins.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<javac srcdir="${extensions.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<!--
<javac srcdir="${test.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
-->
<javac srcdir="${addon.core.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<javac srcdir="${addon.plugins.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
</target>
<!-- =================================================================== -->
<!-- Compiles the add-on source code -->
<!-- =================================================================== -->
<target name="compile-addon" depends="compile" description="Compiles the add-on core, extensions, and plugins">
<!-- Add-on core -->
<delete dir="${compile.dir}"/>
<mkdir dir="${compile.dir}"/>
<javac srcdir="${addon.core.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<jar file="${addon.core.jar}" basedir="${compile.dir}"/>
<delete dir="${compile.dir}"/>
<!-- Add-on plugins -->
<delete dir="${compile.dir}"/>
<mkdir dir="${compile.dir}"/>
<javac srcdir="${addon.plugins.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<copy todir="${compile.dir}">
<fileset dir="${addon.plugins.src.dir}" includes="**/*.vm"/>
</copy>
<jar file="${addon.plugins.jar}" basedir="${compile.dir}"/>
<delete dir="${compile.dir}"/>
<!-- Add-on extensions -->
<!--
<delete dir="${compile.dir}"/>
<mkdir dir="${compile.dir}"/>
<javac srcdir="${addon.extensions.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<jar file="${addon.extensions.jar}" basedir="${compile.dir}"/>
<delete dir="${compile.dir}"/>
-->
</target>
<!-- =================================================================== -->
<!-- Create the war file -->
<!-- =================================================================== -->
<target name="war" depends="clean-with-templates, compile" description="Create a deployable WAR file">
<copy todir="${war.dir}/WEB-INF/themes">
<fileset dir="${themes.dir}"/>
</copy>
<!-- Uncomment this if you want to JAR up the templates for running blojsom from a WAR file (i.e. a packed WAR) -->
<!-- <jar jarfile="${templates.jar}" basedir="${templates.dir}"/> -->
<jar jarfile="${war.file}" basedir="${war.dir}">
<exclude name="**/quickrstart"/>
</jar>
<delete dir="${war.dir}/WEB-INF/default/templates"/>
<delete dir="${war.dir}/themes"/>
</target>
<!-- =================================================================== -->
<!-- Create the "quicker" start bundle -->
<!-- =================================================================== -->
<target name="quickrstart" depends="clean-with-templates, compile" description="Create a deployable WAR file">
<copy todir="${war.dir}/WEB-INF/themes">
<fileset dir="${themes.dir}"/>
</copy>
<!--
quickrstart properties needs to go into WEB-INF/classes
quickrstart lib needs to go into WEB-INF/lib
-->
<copy todir="${war.dir}/WEB-INF/classes" overwrite="true">
<fileset dir="${basedir}/quickrstart/properties"/>
</copy>
<copy todir="${war.dir}/WEB-INF/lib">
<fileset dir="${basedir}/quickrstart/lib"/>
</copy>
<jar jarfile="${war.file}" basedir="${war.dir}"/>
<delete dir="${war.dir}/WEB-INF/default/templates"/>
<delete dir="${war.dir}/themes"/>
</target>
<!-- =================================================================== -->
<!-- Create the add-on bundle -->
<!-- =================================================================== -->
<target name="create-addon-bundle" depends="compile-addon" description="Create the add-on bundle">
<tstamp/>
<zip zipfile="${distro.dir}/${name}-${version}-addons.zip">
<fileset dir="${webinf.lib.dir}">
<include name="${name}-addon-*.jar"/>
</fileset>
<fileset dir="${addon.lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${properties.dir}">
<include name="oscache.properties"/>
</fileset>
</zip>
</target>
<!-- =================================================================== -->
<!-- Create the templates bundle -->
<!-- =================================================================== -->
<target name="create-templates-bundle" description="Create the templates bundle">
<tstamp/>
<zip zipfile="${distro.dir}/${name}-${version}-templates.zip">
<fileset dir="${templates.dir}">
<include name="**/*"/>
</fileset>
</zip>
</target>
<!-- =================================================================== -->
<!-- Create the themes bundle -->
<!-- =================================================================== -->
<target name="create-themes-bundle" description="Create the themes bundle">
<tstamp/>
<zip zipfile="${distro.dir}/${name}-${version}-themes.zip">
<fileset dir="${themes.dir}">
<include name="**/*"/>
</fileset>
</zip>
</target>
<!-- =================================================================== -->
<!-- Create the TinyMCE bundle -->
<!-- =================================================================== -->
<target name="create-tinymce-bundle" description="Create the TinyMCE bundle">
<tstamp/>
<zip zipfile="${distro.dir}/${name}-${version}-tinymce.zip">
<fileset dir="${tinymce.dir}.dir}">
<include name="**/*"/>
</fileset>
</zip>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadoc" description="Creates the API documentation">
<mkdir dir="${javadoc.dir}"/>
<javadoc packagenames="org.*"
destdir="${javadoc.dir}"
author="true"
version="true"
use="true"
windowtitle="${name} ${version} API"
doctitle="${name} ${version} API">
<group
packages="org.*:org.blojsom.authorization.*:org.blojsom.blog.*:org.blojsom.dispatcher.*:org.blojsom.event.*:org.blojsom.fetcher.*:org.blojsom.filter.*:org.blojsom.servlet.*:org.blojsom.util.*:org.blojsom.util.resources.*"
title="blojsom core"/>
<group packages="org.blojsom.extension.*"
title="blojsom extensions"/>
<group packages="org.blojsom.plugin.*"
title="blojsom plugins"/>
<classpath refid="build.classpath"/>
<sourcepath refid="source.path"/>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Creates the Velocity macro documentation -->
<!-- =================================================================== -->
<target name="velocidoc" description="Creates the Velocity macro documentation">
<mkdir dir="${velocidoc.dir}"/>
<java fork="true" jar="${ant.lib.dir}/velocidoc-0.2.jar">
<arg line="-src ${pagemacros.dir} -dst ${velocidoc.dir}"/>
</java>
</target>
<!-- ========================================================================= -->
<!-- Creates a ZIP of the Velocity macro documentation for the blojsom website -->
<!-- ========================================================================= -->
<target name="velocidoc-archive" depends="velocidoc"
description="Creates a ZIP of the Velocity macro documentation for the blojsom website">
<mkdir dir="${distro.dir}"/>
<zip zipfile="${velocidoc.zip}" basedir="${velocidoc.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Creates a ZIP of the documentation for the website -->
<!-- =================================================================== -->
<target name="website-docs" depends="javadoc" description="Creates a ZIP for the blojsom website">
<mkdir dir="${distro.dir}"/>
<zip zipfile="${javadocs.zip}" basedir="${docs.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Create a source distribution -->
<!-- =================================================================== -->
<target name="create-source-distribution" depends="clean-with-templates"
description="Creates the source distribution">
<tstamp/>
<mkdir dir="${compile.dir}"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${distro.dir}"/>
<zip zipfile="${distro.dir}/${name}-${version}-source.zip">
<zipfileset dir="${basedir}">
<!-- Base files -->
<include name="build.xml"/>
<include name="LICENSE"/>
<include name="README"/>
<!-- Source directories -->
<include name="addon/**"/>
<include name="extensions/**"/>
<include name="plugins/**"/>
<include name="src/**"/>
<include name="sql-scripts/**"/>
<!-- Library directory -->
<include name="lib/"/>
<include name="addon-lib/"/>
<!-- Properties directory -->
<include name="properties/"/>
<!-- Templates and themes -->
<include name="templates/"/>
<include name="themes/**"/>
<!-- Upgrade utility directories -->
<include name="upgrade/**"/>
<include name="upgrade-lib/**"/>
<!-- WAR directory -->
<include name="war/"/>
<include name="war/WEB-INF"/>
<include name="war/WEB-INF/lib"/>
<exclude name="war/WEB-INF/lib/blojsom*.jar"/>
</zipfileset>
</zip>
</target>
<!-- =================================================================== -->
<!-- Create a distribution (add-ons, themes, templates, source) -->
<!-- =================================================================== -->
<target name="create-distribution"
depends="clean-with-templates, create-addon-bundle, create-source-distribution, create-themes-bundle, create-templates-bundle"
description="Create the add-on bundle, themes and templates packages, and source distribution">
</target>
<!-- =================================================================== -->
<!-- Compile the upgrade utility -->
<!-- =================================================================== -->
<target name="compile-upgrade-utility" depends="prepare" description="Compile the upgrade utility">
<mkdir dir="${compile.dir}"/>
<!-- Upgrade -->
<javac srcdir="${upgrade.src.dir}"
destdir="${compile.dir}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
source="${source.version}"
target="${target.version}">
<classpath refid="build.classpath"/>
</javac>
<jar file="${upgrade.jar}" basedir="${compile.dir}"/>
<delete dir="${compile.dir}"/>
</target>
<!-- ================== Custom Ant Task Definitions ======================= -->
<!--
These properties define custom tasks for the Ant build tool that interact
with the "/manager" web application installed with Tomcat 6. Before they
can be successfully utilized, you must perform the following steps:
- Copy the file "lib/catalina-ant.jar" from your Tomcat 6
installation into the "lib" directory of your Ant installation.
- Create a "build.properties" file in your application's top-level
source directory (or your user login home directory) that defines
appropriate values for the "manager.password", "manager.url", and
"manager.username" properties described above.
For more information about the Manager web application, and the functionality
of these tasks, see <http://localhost:8080/tomcat-docs/manager-howto.html>.
-->
<taskdef name="list" classname="org.apache.catalina.ant.ListTask"/>
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
<!-- ==================== Install Target ================================== -->
<!--
The "install" target tells the specified Tomcat 6 installation to dynamically
install this web application and make it available for execution. It does
*not* cause the existence of this web application to be remembered across
Tomcat restarts; if you restart the server, you will need to re-install all
this web application.
If you have already installed this application, and simply want Tomcat to
recognize that you have updated Java classes (or the web.xml file), use the
"reload" target instead.
NOTE: This target will only succeed if it is run from the same server that
Tomcat is running on.
NOTE: This is the logical opposite of the "remove" target.
-->
<target name="install" depends="compile"
description="Install application to servlet container">
<deploy url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
path="${app.path}"
localWar="file://${build.home}"/>
</target>
<target name="install-war"
description="Install distro build to servlet container">
<deploy url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
path="${app.path}"
localWar="file://${war.file}"/>
</target>
<!-- ====================== List Target =================================== -->
<!--
The "list" target asks the specified Tomcat 6 installation to list the
currently running web applications, either loaded at startup time or
installed dynamically. It is useful to determine whether or not the
application you are currently developing has been installed.
-->
<target name="list"
description="List installed applications on servlet container">
<list url="${manager.url}"
username="${manager.username}"
password="${manager.password}"/>
</target>
<!-- ==================== Reload Target =================================== -->
<!--
The "reload" signals the specified application Tomcat 6 to shut itself down
and reload. This can be useful when the web application context is not
reloadable and you have updated classes or property files in the
/WEB-INF/classes directory or when you have added or updated jar files in the
/WEB-INF/lib directory.
NOTE: The /WEB-INF/web.xml web application configuration file is not reread
on a reload. If you have made changes to your web.xml file you must stop
then start the web application.
-->
<target name="reload" depends="compile"
description="Reload application on servlet container">
<reload url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
path="${app.path}"/>
</target>
<!-- ==================== Remove Target =================================== -->
<!--
The "remove" target tells the specified Tomcat 6 installation to dynamically
remove this web application from service.
NOTE: This is the logical opposite of the "install" target.
-->
<target name="remove"
description="Remove application on servlet container">
<undeploy url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
path="${app.path}"/>
</target>
</project>