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
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
|
<?xml version="1.0" encoding="UTF-8"?>
<project name="gitblit" default="compile" basedir=".">
<!-- Google Code upload task -->
<taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask"
classpath="${basedir}/tools/ant-googlecode-0.0.3.jar" name="gcupload"/>
<!-- GenJar task -->
<taskdef resource="genjar.properties" classpath="${basedir}/tools/GenJar.jar" />
<!-- Project Properties -->
<property name="project.jar" value="gitblit.jar" />
<property name="project.mainclass" value="com.gitblit.Launcher" />
<property name="project.build.dir" value="${basedir}/build" />
<property name="project.deploy.dir" value="${basedir}/deploy" />
<property name="project.war.dir" value="${basedir}/war" />
<property name="project.site.dir" value="${basedir}/site" />
<property name="project.resources.dir" value="${basedir}/resources" />
<available property="hasBuildProps" file="${basedir}/build.properties"/>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Load build.properties, if available
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildprops" if="hasBuildProps">
<!-- Load publication servers, paths, and credentials -->
<loadproperties>
<file file="${basedir}/build.properties" />
</loadproperties>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Scrape the version info from code and setup the build properties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildinfo" depends="buildprops">
<!-- extract Gitblit version number from source code -->
<loadfile property="gb.version" srcfile="${basedir}/src/com/gitblit/Constants.java">
<filterchain>
<linecontains>
<contains value="public static final String VERSION = " />
</linecontains>
<striplinebreaks />
<tokenfilter>
<replacestring from="public static final String VERSION = "" to="" />
<replacestring from="";" to="" />
<trim />
</tokenfilter>
</filterchain>
</loadfile>
<!-- extract Gitblit version date from source code -->
<loadfile property="gb.versionDate" srcfile="${basedir}/src/com/gitblit/Constants.java">
<filterchain>
<linecontains>
<contains value="public static final String VERSION_DATE = " />
</linecontains>
<striplinebreaks />
<tokenfilter>
<replacestring from="public static final String VERSION_DATE = "" to="" />
<replacestring from="";" to="" />
<trim />
</tokenfilter>
</filterchain>
</loadfile>
<!-- extract JGit version number from source code -->
<loadfile property="jgit.version" srcfile="${basedir}/src/com/gitblit/Constants.java">
<filterchain>
<linecontains>
<contains value="public static final String JGIT_VERSION = " />
</linecontains>
<striplinebreaks />
<tokenfilter>
<replacestring from="public static final String JGIT_VERSION = "" to="" />
<replacestring from="";" to="" />
<trim />
</tokenfilter>
</filterchain>
</loadfile>
<property name="distribution.zipfile" value="gitblit-${gb.version}.zip" />
<property name="distribution.warfile" value="gitblit-${gb.version}.war" />
<property name="fedclient.zipfile" value="fedclient-${gb.version}.zip" />
<property name="manager.zipfile" value="manager-${gb.version}.zip" />
<property name="gbapi.zipfile" value="gbapi-${gb.version}.zip" />
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="compile" depends="buildinfo" description="Retrieves dependencies and compiles Gitblit from source">
<!-- copy required distribution files to project folder -->
<copy todir="${basedir}" overwrite="false">
<fileset dir="${basedir}/distrib">
<include name="gitblit.properties" />
<include name="users.properties" />
</fileset>
</copy>
<!-- copy gitblit.properties to the WEB-INF folder.
this file is only used for parsing setting descriptions. -->
<copy tofile="${basedir}/src/WEB-INF/reference.properties" overwrite="true"
file="${basedir}/distrib/gitblit.properties" />
<!-- Compile the build tool and execute it.
This downloads missing compile-time dependencies from Maven. -->
<delete dir="${project.build.dir}" />
<mkdir dir="${project.build.dir}" />
<javac debug="true" srcdir="${basedir}/src" destdir="${project.build.dir}">
<include name="com/gitblit/build/Build.java" />
<include name="com/gitblit/Constants.java" />
<include name="com/gitblit/utils/StringUtils.java" />
</javac>
<java classpath="${project.build.dir}" classname="com.gitblit.build.Build" />
<!-- Compile Project -->
<path id="master-classpath">
<fileset dir="${basedir}/ext">
<include name="*.jar" />
</fileset>
<pathelement path="${project.build.dir}" />
</path>
<javac debug="true" destdir="${project.build.dir}" failonerror="false">
<src path="${basedir}/src" />
<classpath refid="master-classpath" />
</javac>
<copy todir="${project.build.dir}">
<fileset dir="${basedir}/src" excludes="**/*.java,**/thumbs.db" />
</copy>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build Gitblit GO
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildGO" depends="compile" description="Build Gitblit GO distribution">
<echo>Building Gitblit GO ${gb.version}</echo>
<!-- Delete the deploy folder -->
<delete dir="${project.deploy.dir}" />
<!-- Create deployment folder structure -->
<mkdir dir="${project.deploy.dir}" />
<copy todir="${project.deploy.dir}">
<fileset dir="${basedir}/distrib">
<include name="**/*" />
<exclude name="federation.properties" />
</fileset>
<fileset dir="${basedir}">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
</copy>
<!-- Build jar -->
<jar jarfile="${project.deploy.dir}/${project.jar}">
<fileset dir="${project.build.dir}">
<include name="**/*" />
<exclude name="com/gitblit/client/**" />
</fileset>
<fileset dir="${project.resources.dir}">
<exclude name="thumbs.db" />
</fileset>
<manifest>
<attribute name="Main-Class" value="${project.mainclass}" />
</manifest>
</jar>
<!-- Build the docs for the deploy -->
<antcall target="buildDocs" inheritall="true" inheritrefs="true">
<param name="docs.output.dir" value="${project.deploy.dir}/docs" />
</antcall>
<!-- Create Zip deployment -->
<zip destfile="${distribution.zipfile}">
<fileset dir="${project.deploy.dir}">
<include name="**/*" />
</fileset>
</zip>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build Gitblit Docs which are bundled with GO and WAR downloads
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildDocs">
<!-- Build Docs -->
<mkdir dir="${docs.output.dir}" />
<copy todir="${docs.output.dir}">
<!-- Copy selected Gitblit resources -->
<fileset dir="${project.resources.dir}">
<include name="bootstrap.140.css" />
<include name="bootstrap.gb.css" />
<include name="markdown.css" />
<include name="gitblt_25_white.png" />
<include name="gitblt-favicon.png" />
<include name="lock_go_16x16.png" />
<include name="lock_pull_16x16.png" />
<include name="shield_16x16.png" />
<include name="cold_16x16.png" />
<include name="bug_16x16.png" />
<include name="book_16x16.png" />
<include name="blank.png" />
<include name="federated_16x16.png" />
<include name="arrow_page.png" />
</fileset>
<!-- Copy Doc images -->
<fileset dir="${basedir}/docs">
<include name="*.png" />
</fileset>
</copy>
<!-- Copy google-code-prettify -->
<mkdir dir="${docs.output.dir}/prettify" />
<copy todir="${docs.output.dir}/prettify">
<fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
<exclude name="thumbs.db" />
</fileset>
</copy>
<!-- Build deployment doc pages -->
<java classpath="${project.build.dir}" classname="com.gitblit.build.BuildSite">
<classpath refid="master-classpath" />
<arg value="--sourceFolder" />
<arg value="${basedir}/docs" />
<arg value="--outputFolder" />
<arg value="${docs.output.dir}" />
<arg value="--pageHeader" />
<arg value="${basedir}/docs/doc_header.html" />
<arg value="--pageFooter" />
<arg value="${basedir}/docs/doc_footer.html" />
<arg value="--skip" />
<arg value="screenshots" />
<arg value="--skip" />
<arg value="releases" />
<arg value="--alias" />
<arg value="index=overview" />
<arg value="--alias" />
<arg value="properties=settings" />
<arg value="--substitute" />
<arg value="%VERSION%=${gb.version}" />
<arg value="--substitute" />
<arg value="%GO%=${distribution.zipfile}" />
<arg value="--substitute" />
<arg value="%WAR%=${distribution.warfile}" />
<arg value="--substitute" />
<arg value="%FEDCLIENT%=${fedclient.zipfile}" />
<arg value="--substitute" />
<arg value="%MANAGER%=${manager.zipfile}" />
<arg value="--substitute" />
<arg value="%API%=${gbapi.zipfile}" />
<arg value="--substitute" />
<arg value="%BUILDDATE%=${gb.versionDate}" />
<arg value="--substitute" />
<arg value="%JGIT%=${jgit.version}" />
<arg value="--properties" />
<arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
<arg value="--nomarkdown" />
<arg value="%BEGINCODE%:%ENDCODE%" />
<arg value="--substitute" />
<arg value=""%BEGINCODE%=<pre class='prettyprint lang-java'>"" />
<arg value="--substitute" />
<arg value="%ENDCODE%=</pre>" />
<arg value="--regex" />
<arg value=""\b(issue)(\s*[#]?|-){0,1}(\d+)\b!!!<a href='http://code.google.com/p/gitblit/issues/detail?id=$3'>issue $3</a>"" />
</java>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build Gitblit WAR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildWAR" depends="compile" description="Build Gitblit WAR">
<echo>Building Gitblit WAR ${gb.version}</echo>
<delete dir="${project.war.dir}" />
<!-- Copy web.xml and users.properties to WEB-INF -->
<copy todir="${project.war.dir}/WEB-INF">
<fileset dir="${basedir}/distrib">
<include name="users.properties" />
</fileset>
<fileset dir="${basedir}/src/WEB-INF">
<include name="web.xml" />
</fileset>
<fileset dir="${basedir}">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
</copy>
<!-- Copy gitblit.properties as reference.properties -->
<copy tofile="${project.war.dir}/WEB-INF/reference.properties"
file="${basedir}/distrib/gitblit.properties"/>
<!-- Build the docs for the WAR build -->
<antcall target="buildDocs" inheritall="true" inheritrefs="true">
<param name="docs.output.dir" value="${project.war.dir}/WEB-INF/docs" />
</antcall>
<!-- Build the WAR web.xml from the prototype web.xml and gitblit.properties -->
<java classpath="${project.build.dir}" classname="com.gitblit.build.BuildWebXml">
<classpath refid="master-classpath" />
<arg value="--sourceFile" />
<arg value="${basedir}/src/WEB-INF/web.xml" />
<arg value="--destinationFile" />
<arg value="${project.war.dir}/WEB-INF/web.xml" />
<arg value="--propertiesFile" />
<arg value="${basedir}/distrib/gitblit.properties" />
</java>
<!-- Gitblit resources -->
<copy todir="${project.war.dir}">
<fileset dir="${project.resources.dir}">
<exclude name="thumbs.db" />
</fileset>
</copy>
<!-- Gitblit library dependencies -->
<mkdir dir="${project.war.dir}/WEB-INF/lib"/>
<copy todir="${project.war.dir}/WEB-INF/lib">
<fileset dir="${basedir}/ext">
<exclude name="*-sources.jar" />
<exclude name="*-javadoc.jar" />
<exclude name="jcommander*.jar" />
<exclude name="jetty*.jar" />
<exclude name="junit*.jar" />
<exclude name="servlet*.jar" />
</fileset>
</copy>
<!-- Gitblit classes -->
<mkdir dir="${project.war.dir}/WEB-INF/classes"/>
<copy todir="${project.war.dir}/WEB-INF/classes">
<fileset dir="${project.build.dir}">
<exclude name="WEB-INF/web.xml" />
<exclude name="com/gitblit/tests/" />
<exclude name="com/gitblit/build/**" />
<exclude name="com/gitblit/client/**" />
<exclude name="com/gitblit/GitBlitServer*.class" />
<exclude name="com/gitblit/Launcher*.class" />
<exclude name="com/gitblit/MakeCertificate*.class" />
</fileset>
</copy>
<!-- Build the WAR file -->
<jar basedir="${project.war.dir}" destfile="${distribution.warfile}" compress="true" />
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build the stand-alone, command-line Gitblit Federation Client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildFederationClient" depends="compile" description="Builds the stand-alone Gitblit federation client">
<echo>Building Gitblit Federation Client ${gb.version}</echo>
<genjar jarfile="fedclient.jar">
<class name="com.gitblit.FederationClientLauncher" />
<resource file="${project.build.dir}/log4j.properties" />
<classfilter>
<exclude name="org.apache." />
<exclude name="org.bouncycastle." />
<exclude name="org.eclipse." />
<exclude name="org.slf4j." />
<exclude name="com.beust." />
<exclude name="com.google." />
</classfilter>
<classpath refid="master-classpath" />
<manifest>
<attribute name="Main-Class" value="com.gitblit.FederationClientLauncher" />
<attribute name="Specification-Version" value="${gb.version}" />
<attribute name="Release-Date" value="${gb.versionDate}" />
</manifest>
</genjar>
<!-- Build the federation client zip file -->
<zip destfile="${fedclient.zipfile}">
<fileset dir="${basedir}">
<include name="fedclient.jar" />
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
<fileset dir="${basedir}/distrib">
<include name="federation.properties" />
</fileset>
</zip>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build the stand-alone, Gitblit Manager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildManager" depends="compile" description="Builds the stand-alone Gitblit Manager">
<echo>Building Gitblit Manager ${gb.version}</echo>
<genjar jarfile="manager-${gb.version}.jar">
<resource file="${basedir}/src/com/gitblit/client/splash.png" />
<resource file="${basedir}/resources/gitblt-favicon.png" />
<resource file="${basedir}/resources/gitweb-favicon.png" />
<resource file="${basedir}/resources/user_16x16.png" />
<resource file="${basedir}/resources/settings_16x16.png" />
<resource file="${basedir}/resources/lock_go_16x16.png" />
<resource file="${basedir}/resources/lock_pull_16x16.png" />
<resource file="${basedir}/resources/shield_16x16.png" />
<resource file="${basedir}/resources/federated_16x16.png" />
<resource file="${basedir}/resources/cold_16x16.png" />
<resource file="${basedir}/resources/book_16x16.png" />
<resource file="${basedir}/resources/bug_16x16.png" />
<resource file="${basedir}/resources/health_16x16.png" />
<resource file="${basedir}/resources/feed_16x16.png" />
<resource file="${basedir}/resources/bullet_feed.png" />
<resource file="${basedir}/resources/search-icon.png" />
<resource file="${basedir}/resources/commit_changes_16x16.png" />
<resource file="${basedir}/resources/commit_merge_16x16.png" />
<resource file="${basedir}/resources/blank.png" />
<resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp.properties" />
<class name="com.gitblit.client.GitblitManagerLauncher" />
<classfilter>
<exclude name="org.apache." />
<exclude name="org.bouncycastle." />
<exclude name="org.eclipse." />
<exclude name="org.slf4j." />
<exclude name="com.beust." />
<exclude name="com.google." />
</classfilter>
<classpath refid="master-classpath" />
<manifest>
<attribute name="Main-Class" value="com.gitblit.client.GitblitManagerLauncher" />
<attribute name="SplashScreen-Image" value="splash.png" />
<attribute name="Specification-Version" value="${gb.version}" />
<attribute name="Release-Date" value="${gb.versionDate}" />
</manifest>
</genjar>
<!-- Build Manager Zip file -->
<zip destfile="${manager.zipfile}">
<fileset dir="${basedir}">
<include name="manager-${gb.version}.jar" />
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
</zip>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build the Gitblit API client library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildApiLibrary" depends="compile" description="Builds the Gitblit RPC client library">
<echo>Building Gitblit API Library ${gb.version}</echo>
<!-- Build API Library jar -->
<genjar jarfile="gbapi-${gb.version}.jar">
<class name="com.gitblit.Keys" />
<class name="com.gitblit.client.GitblitClient" />
<classpath refid="master-classpath" />
<classfilter>
<exclude name="com.google.gson." />
<exclude name="com.sun.syndication." />
</classfilter>
<manifest>
<attribute name="Specification-Version" value="${gb.version}" />
<attribute name="Release-Date" value="${gb.versionDate}" />
</manifest>
</genjar>
<!-- Build API sources jar -->
<zip destfile="gbapi-${gb.version}-sources.jar">
<fileset dir="${basedir}/src" defaultexcludes="yes">
<include name="com/gitblit/Constants.java"/>
<include name="com/gitblit/GitBlitException.java"/>
<include name="com/gitblit/Keys.java"/>
<include name="com/gitblit/client/**/*.java"/>
<include name="com/gitblit/models/**/*.java"/>
<include name="com/gitblit/utils/**/*.java"/>
</fileset>
</zip>
<!-- Build API JavaDoc jar -->
<javadoc destdir="${basedir}/javadoc">
<fileset dir="${basedir}/src" defaultexcludes="yes">
<include name="com/gitblit/Constants.java"/>
<include name="com/gitblit/GitBlitException.java"/>
<include name="com/gitblit/Keys.java"/>
<include name="com/gitblit/client/**/*.java"/>
<include name="com/gitblit/models/**/*.java"/>
<include name="com/gitblit/utils/**/*.java"/>
</fileset>
</javadoc>
<zip destfile="gbapi-${gb.version}-javadoc.jar">
<fileset dir="${basedir}/javadoc" />
</zip>
<!-- Build the API library zip file -->
<zip destfile="${gbapi.zipfile}">
<fileset dir="${basedir}">
<include name="gbapi-${gb.version}.jar" />
<include name="gbapi-${gb.version}-sources.jar" />
<include name="gbapi-${gb.version}-javadoc.jar" />
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
<fileset dir="${basedir}/ext">
<include name="gson*.jar" />
<exclude name="gson*-sources.jar" />
<exclude name="gson*-javadoc.jar" />
<include name="rome*.jar" />
<exclude name="rome*-sources.jar" />
<exclude name="rome*-javadoc.jar" />
</fileset>
</zip>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build the Gitblit Website
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildSite" depends="compile" description="Build the Gitblit website">
<echo>Building Gitblit Website ${gb.version}</echo>
<!-- Build Site -->
<delete dir="${project.site.dir}" />
<mkdir dir="${project.site.dir}" />
<copy todir="${project.site.dir}">
<!-- Copy selected Gitblit resources -->
<fileset dir="${project.resources.dir}">
<include name="bootstrap.140.css" />
<include name="bootstrap.gb.css" />
<include name="markdown.css" />
<include name="gitblt_25_white.png" />
<include name="gitblt-favicon.png" />
<include name="lock_go_16x16.png" />
<include name="lock_pull_16x16.png" />
<include name="shield_16x16.png" />
<include name="cold_16x16.png" />
<include name="bug_16x16.png" />
<include name="book_16x16.png" />
<include name="blank.png" />
<include name="federated_16x16.png" />
<include name="arrow_page.png" />
</fileset>
<!-- Copy Doc images -->
<fileset dir="${basedir}/docs">
<include name="*.png" />
<include name="*.js" />
</fileset>
</copy>
<!-- Copy Fancybox -->
<mkdir dir="${project.site.dir}/fancybox" />
<copy todir="${project.site.dir}/fancybox">
<fileset dir="${basedir}/docs/fancybox">
<exclude name="thumbs.db" />
</fileset>
</copy>
<!-- Copy google-code-prettify -->
<mkdir dir="${basedir}/src/com/gitblit/wicket/pages/prettify" />
<copy todir="${project.site.dir}/prettify">
<fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
<exclude name="thumbs.db" />
</fileset>
</copy>
<!-- Generate thumbnails of screenshots -->
<java classpath="${project.build.dir}" classname="com.gitblit.build.BuildThumbnails">
<classpath refid="master-classpath" />
<arg value="--sourceFolder" />
<arg value="${basedir}/docs/screenshots" />
<arg value="--destinationFolder" />
<arg value="${project.site.dir}/thumbs" />
<arg value="--maximumDimension" />
<arg value="250" />
</java>
<!-- Copy screenshots -->
<mkdir dir="${project.site.dir}/screenshots" />
<copy todir="${project.site.dir}/screenshots">
<fileset dir="${basedir}/docs/screenshots">
<include name="*.png" />
</fileset>
</copy>
<!-- Build site pages -->
<java classpath="${project.build.dir}" classname="com.gitblit.build.BuildSite">
<classpath refid="master-classpath" />
<arg value="--sourceFolder" />
<arg value="${basedir}/docs" />
<arg value="--outputFolder" />
<arg value="${project.site.dir}" />
<arg value="--pageHeader" />
<arg value="${basedir}/docs/site_header.html" />
<arg value="--pageFooter" />
<arg value="${basedir}/docs/site_footer.html" />
<arg value="--analyticsSnippet" />
<arg value="${basedir}/docs/site_analytics.html" />
<arg value="--adSnippet" />
<arg value="${basedir}/docs/site_ads.html" />
<arg value="--alias" />
<arg value="index=overview" />
<arg value="--alias" />
<arg value="properties=settings" />
<arg value="--substitute" />
<arg value="%VERSION%=${gb.version}" />
<arg value="--substitute" />
<arg value="%GO%=${distribution.zipfile}" />
<arg value="--substitute" />
<arg value="%WAR%=${distribution.warfile}" />
<arg value="--substitute" />
<arg value="%FEDCLIENT%=${fedclient.zipfile}" />
<arg value="--substitute" />
<arg value="%MANAGER%=${manager.zipfile}" />
<arg value="--substitute" />
<arg value="%API%=${gbapi.zipfile}" />
<arg value="--substitute" />
<arg value="%BUILDDATE%=${gb.versionDate}" />
<arg value="--substitute" />
<arg value="%JGIT%=${jgit.version}" />
<arg value="--properties" />
<arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
<arg value="--nomarkdown" />
<arg value="%BEGINCODE%:%ENDCODE%" />
<arg value="--substitute" />
<arg value=""%BEGINCODE%=<pre class='prettyprint lang-java'>"" />
<arg value="--substitute" />
<arg value="%ENDCODE%=</pre>" />
<arg value="--regex" />
<arg value=""\b(issue)(\s*[#]?|-){0,1}(\d+)\b!!!<a href='http://code.google.com/p/gitblit/issues/detail?id=$3'>issue $3</a>"" />
</java>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compile from source, publish binaries, and build & deploy site
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="buildAll" depends="buildGO,buildWAR,buildFederationClient,buildManager,buildApiLibrary,buildSite">
<!-- Cleanup -->
<delete dir="${project.build.dir}" />
<delete dir="${project.war.dir}" />
<delete dir="${project.deploy.dir}" />
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Publish binaries to Google Code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="publishBinaries" depends="buildGO,buildWAR,buildFederationClient,buildManager" description="Publish the Gitblit binaries to Google Code">
<echo>Uploading Gitblit ${gb.version} binaries</echo>
<!-- Upload Gitblit GO ZIP file -->
<gcupload
username="${googlecode.user}"
password="${googlecode.password}"
projectname="gitblit"
filename="${distribution.zipfile}"
targetfilename="gitblit-${gb.version}.zip"
summary="Gitblit GO v${gb.version} (standalone, integrated Gitblit server)"
labels="Featured, Type-Package, OpSys-All" />
<!-- Upload Gitblit WAR file -->
<gcupload
username="${googlecode.user}"
password="${googlecode.password}"
projectname="gitblit"
filename="${distribution.warfile}"
targetfilename="gitblit-${gb.version}.war"
summary="Gitblit WAR v${gb.version} (standard WAR webapp for servlet containers)"
labels="Featured, Type-Package, OpSys-All" />
<!-- Upload Gitblit FedClient -->
<gcupload
username="${googlecode.user}"
password="${googlecode.password}"
projectname="gitblit"
filename="${fedclient.zipfile}"
targetfilename="fedclient-${gb.version}.zip"
summary="Gitblit Federation Client v${gb.version} (command-line tool to clone data from federated Gitblit instances)"
labels="Featured, Type-Package, OpSys-All" />
<!-- Upload Gitblit Manager -->
<gcupload
username="${googlecode.user}"
password="${googlecode.password}"
projectname="gitblit"
filename="${manager.zipfile}"
targetfilename="manager-${gb.version}.zip"
summary="Gitblit Manager v${gb.version} (Swing tool to remotely administer a Gitblit server)"
labels="Featured, Type-Package, OpSys-All" />
<!-- Upload Gitblit API Library -->
<gcupload
username="${googlecode.user}"
password="${googlecode.password}"
projectname="gitblit"
filename="${gbapi.zipfile}"
targetfilename="gbapi-${gb.version}.zip"
summary="Gitblit API Library v${gb.version} (JSON RPC library to integrate with your software)"
labels="Featured, Type-Package, OpSys-All" />
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Publish site to hosting service
You must add ext/commons-net-1.4.0.jar to your ANT classpath.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="publishSite" depends="buildSite" description="Publish the Gitblit site to a webserver (requires ext/commons-net-1.4.0.jar)" >
<echo>Uploading Gitblit ${gb.version} website</echo>
<ftp server="${ftp.server}"
userid="${ftp.user}"
password="${ftp.password}"
remotedir="${ftp.dir}"
passive="true"
verbose="yes">
<fileset dir="${project.site.dir}" />
</ftp>
</target>
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compile from source, publish binaries, and build & deploy site
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="publishAll" depends="publishBinaries,publishSite">
<!-- Cleanup -->
<delete dir="${project.build.dir}" />
<delete dir="${project.war.dir}" />
<delete dir="${project.deploy.dir}" />
</target>
</project>
|