James Moger
2014-06-13 7fb8d1209a3926329638fc3ca5f0b4bc428029f6
commit | author | age
5fe7df 1 <?xml version="1.0" encoding="UTF-8"?>
f6b200 2 <project name="gitblit" default="compile" xmlns:mx="antlib:org.moxie">
5fe7df 3
ff3015 4     <!--
JM 5         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f6b200 6         Retrieve Moxie Toolkit
f38c90 7         
JM 8         documentation @ http://gitblit.github.io/moxie
ff3015 9         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JM 10     -->
79cad5 11     <property name="moxie.version" value="0.9.1" />
a4c680 12     <property name="moxie.url" value="http://gitblit.github.io/moxie/maven" />
f6b200 13     <property name="moxie.jar" value="moxie-toolkit-${moxie.version}.jar" />
JM 14     <property name="moxie.dir" value="${user.home}/.moxie" />
5450d0 15     
f6b200 16     <!-- Download Moxie from it's Maven repository to user.home -->
8e2b99 17     <mkdir dir="${moxie.dir}" />
abd152 18     <get src="${moxie.url}/com/gitblit/moxie/moxie-toolkit/${moxie.version}/${moxie.jar}"
f6b200 19         dest="${moxie.dir}" skipexisting="true" verbose="true" />
JM 20     
21     <!-- Register Moxie tasks -->
22     <taskdef uri="antlib:org.moxie">
23         <classpath location="${moxie.dir}/${moxie.jar}" />
24     </taskdef>
25     
26     <!-- Project directories -->
27     <property name="project.src.dir" value="${basedir}/src/main/java" />    
28     <property name="project.resources.dir" value="${basedir}/src/main/resources" />    
29     <property name="project.distrib.dir" value="${basedir}/src/main/distrib" />
85c2e6 30     
JM 31     <!--
32         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f6b200 33         Initialize Moxie and setup build properties
85c2e6 34         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JM 35     -->
f6b200 36     <target name="prepare">
5450d0 37     
f6b200 38         <!-- Setup Ant build from build.moxie and resolve dependencies.
358545 39              If it exists, build.properties is automatically loaded.
JM 40              Explicitly set mxroot allowing CI servers to override the default. -->
41         <mx:init verbose="no" mxroot="${moxie.dir}" />
f6b200 42                 
JM 43         <!-- Set Ant project properties -->
44         <property name="distribution.zipfile" value="gitblit-${project.version}.zip" />
45         <property name="distribution.tgzfile" value="gitblit-${project.version}.tar.gz" />
46         <property name="distribution.warfile" value="gitblit-${project.version}.war" />
47         <property name="fedclient.zipfile" value="fedclient-${project.version}.zip" />
48         <property name="manager.zipfile" value="manager-${project.version}.zip" />
49         <property name="authority.zipfile" value="authority-${project.version}.zip" />
50         <property name="gbapi.zipfile" value="gbapi-${project.version}.zip" />
51         <property name="express.zipfile" value="express-${project.version}.zip" />
f12685 52         <property name="maven.directory" value="${basedir}/../gitblit-maven" />
JM 53
f6b200 54         <!-- Download links -->
69eeaa 55         <property name="gc.url" value="http://dl.bintray.com/gitblit/releases/" />
f6b200 56     </target>
JM 57
58     
59     <!--
60         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61         Cleanup all build artifacts and directories
62         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63     -->
64     <target name="clean" depends="prepare" description="Cleanup all build artifacts and directories">
93d506 65         
f6b200 66         <!-- Clean build and target directories -->
JM 67         <mx:clean />
68
69     </target>
70
71     
72     <!--
73         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74         Setup
75         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76     -->
77     <target name="setup" depends="prepare" description="Setup up project">
78
79         <!-- copy distrib/data to project data directory -->
93d506 80         <mkdir dir="${basedir}/data" />
JM 81         <copy todir="${basedir}/data" overwrite="false">
f6b200 82             <fileset dir="${project.distrib.dir}/data" />
f98825 83         </copy>
d8a0f1 84         
b9afce 85         <!-- copy gitblit.properties to the source directory.
f6b200 86              this file is only used for parsing setting descriptions. -->
b9afce 87         <copy tofile="${project.src.dir}/reference.properties" overwrite="true"
f6b200 88             file="${project.distrib.dir}/data/gitblit.properties" />
ffbf03 89
JM 90         <!-- copy clientapps.json to the source directory.
91              this file is only used if a local file is not provided. -->
92         <copy tofile="${project.src.dir}/clientapps.json" overwrite="true"
93             file="${project.distrib.dir}/data/clientapps.json" />
289efb 94
85c2e6 95     </target>
JM 96
f6b200 97
JM 98     <!--
99         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100         Compile
101         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102     -->
103     <target name="compile" depends="setup" description="compiles Gitblit from source">
104         
105         <!-- Generate the Keys class from the properties file -->
106         <mx:keys propertiesfile="${project.distrib.dir}/data/gitblit.properties"
107                  outputclass="com.gitblit.Keys"
108                  todir="${project.src.dir}" />
109
433190 110         <!-- Compile project -->
JM 111         <mx:javac scope="compile" clean="true" />
f6b200 112         
JM 113     </target>
114
115         
116     <!--
117         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118         Report the compile dependencies on the console
119         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120     -->
121     <target name="report" depends="prepare" description="generate dependency report">
122         
123         <!-- Report compile dependencies to the console -->
124         <mx:report scope="compile" destfile="${project.targetDirectory}/dependencies.txt" />
125         
126     </target>
127
128     
129     <!--
130         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131         Test
132         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133     -->
134     <target name="test" depends="compile" description="compiles Gitblit from source and runs unit tests">
135         
136         <!-- Compile unit tests -->
137         <mx:javac scope="test" />
138         
139         <!-- Run unit tests -->
140         <mx:test failonerror="true" />
141         
142     </target>
143
144
145     <!--
146         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147         Run Gitblit GO
148         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149     -->
150     <target name="run" depends="compile" description="Run Gitblit GO">
1e2c11 151         <!-- copy static files -->
GH 152         <copy todir="${basedir}/build/classes" overwrite="false">
153             <fileset dir="${project.resources.dir}">
154                 <exclude name="thumbs.db" />
155                 <exclude name="*.mkd" />
156             </fileset>
157         </copy>
f6b200 158         
JM 159         <!-- run the mainclass in a separate JVM -->
160         <mx:run fork="true" />
161         
162     </target>            
163             
85c2e6 164     
JM 165     <!--
166         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167         Build Gitblit GO
168         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
169     -->
f6b200 170     <target name="buildGO" depends="compile" description="Build Gitblit GO distribution">
85c2e6 171         
f6b200 172         <echo>Building Gitblit GO ${project.version}</echo>
85c2e6 173
f6b200 174         <local name="go.dir" />
JM 175         <property name="go.dir" value="${project.outputDirectory}/go" />    
176         <delete dir="${go.dir}" />
85c2e6 177
f6b200 178         <prepareDataDirectory toDir="${go.dir}/data" />
JM 179         
180         <!-- Build jar -->
181         <mx:jar destfile="${go.dir}/gitblit.jar" includeresources="true">
182             <mainclass name="com.gitblit.GitBlitServer" />
183             <launcher paths="ext" />
184         </mx:jar>
185
186         <!-- Generate the docs for the GO build -->
187         <generateDocs toDir="${go.dir}/docs" />
188         
189         <!-- Create GO Windows Zip deployment -->
190         <mx:zip basedir="${go.dir}">
191             <!-- LICENSE and NOTICE -->
192             <fileset dir="${basedir}" >
7c643b 193                 <include name="LICENSE" />
JM 194                 <include name="NOTICE" />
93d506 195             </fileset>
dbf594 196             <!-- Windows distrib files -->
f6b200 197             <zipfileset dir="${project.distrib.dir}/win" />
dbf594 198             <!-- Gitblit Authority data -->
JM 199             <zipfileset dir="${project.distrib.dir}/data/certs" prefix="data/certs" />
f6b200 200             <!-- include all dependencies -->
JM 201             <dependencies prefix="ext" />
202         </mx:zip>
5fe7df 203
f6b200 204         <!-- Create GO Linux/OSX tar.gz deployment -->
JM 205         <mx:tar basedir="${go.dir}" longfile="gnu" compression="gzip">
206             <!-- LICENSE and NOTICE -->
207             <fileset dir="${basedir}" >
208                 <include name="LICENSE" />
209                 <include name="NOTICE" />
9be337 210             </fileset>
dbf594 211             <!-- Linux/OSX distrib files -->
f6b200 212             <tarfileset dir="${project.distrib.dir}/linux" filemode="755" />
dbf594 213             <!-- Gitblit Authority data -->
JM 214             <zipfileset dir="${project.distrib.dir}/data/certs" prefix="data/certs" />
f6b200 215             <!-- include all dependencies -->
JM 216             <dependencies prefix="ext" />
217         </mx:tar>        
85c2e6 218
JM 219     </target>
220     
221     
222     <!--
223         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
224         Build Gitblit WAR
225         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
226     -->
227     <target name="buildWAR" depends="compile" description="Build Gitblit WAR">
228         
f6b200 229         <echo>Building Gitblit WAR ${project.version}</echo>
85c2e6 230
f6b200 231         <local name="war.dir" />
JM 232         <property name="war.dir" value="${project.outputDirectory}/war" />
233         <delete dir="${war.dir}" />
85c2e6 234         
f6b200 235         <local name="webinf" />
JM 236         <property name="webinf" value="${war.dir}/WEB-INF" />
fa54be 237
f6b200 238         <!-- Generate the docs for the WAR build -->
JM 239         <generateDocs toDir="${webinf}/docs" />
93d506 240
f6b200 241         <!-- Prepare the data directory -->
JM 242         <prepareDataDirectory toDir="${webinf}/data" />
fa54be 243
f6b200 244         <!-- Build the WAR web.xml from the prototype web.xml -->
9985ed 245         <mx:webxml sourcefile="${project.src.dir}/WEB-INF/web.xml" destfile="${webinf}/web.xml">
JM 246             <replace token="@gb.version@" value="${project.version}" />
247         </mx:webxml>
85c2e6 248
b9afce 249         <!-- Gitblit jar -->
cacf8b 250         <mx:jar destfile="${webinf}/lib/gitblit.jar" includeresources="false" />
b9afce 251
85c2e6 252         <!-- Build the WAR file -->
f6b200 253         <mx:zip basedir="${war.dir}" destfile="${project.targetDirectory}/${distribution.warfile}" compress="true" >
JM 254             <!-- Resources in root -->
6534b7 255             <fileset dir="${project.resources.dir}">
LM 256                 <exclude name="thumbs.db" />
f6b200 257                 <exclude name="*.mkd" />
6534b7 258             </fileset>
f6b200 259             <!-- WEB-INF directory -->
JM 260             <zipfileset prefix="WEB-INF" dir="${basedir}" >
261                 <include name="LICENSE" />
262                 <include name="NOTICE" />
263             </zipfileset>
d9c9fe 264             <zipfileset prefix="WEB-INF" file="${project.compileOutputDirectory}/WEB-INF/weblogic.xml" />
f6b200 265             <!-- include "war" tagged dependencies -->
JM 266             <dependencies prefix="WEB-INF/lib" tag="war" />
267         </mx:zip>
85f639 268     </target>
LM 269
270
f6740d 271     <!-- 
JM 272         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273         Build the stand-alone, command-line Gitblit Federation Client
274         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
275     -->
276     <target name="buildFederationClient" depends="compile" description="Builds the stand-alone Gitblit federation client">
f6b200 277         <echo>Building Gitblit Federation Client ${project.version}</echo>
f6740d 278     
f6b200 279         <!-- generate jar by traversing the class hierarchy of the specified
JM 280              classes, exclude any classes in classpath jars -->
b9afce 281         <mx:genjar tag="" includeresources="false" excludeClasspathJars="true"
23e08c 282             destfile="${project.targetDirectory}/fedclient.jar"
JM 283             excludes="**/.class,**/*.java, **/Thumbs.db, **/*.mkd, com/gitblit/wicket/**">
f6b200 284             <mainclass name="com.gitblit.FederationClient" />
7b1240 285             <class name="com.gitblit.Keys" />
f6b200 286             <launcher paths="ext" />
JM 287             <resource file="${project.compileOutputDirectory}/log4j.properties" />
288         </mx:genjar>
f6740d 289         
JM 290         <!-- Build the federation client zip file -->
f6b200 291         <mx:zip destfile="${project.targetDirectory}/${fedclient.zipfile}">
f6740d 292             <fileset dir="${basedir}">
d65f71 293                 <include name="LICENSE" />
JM 294                 <include name="NOTICE" />
93d506 295             </fileset>
f6b200 296             <fileset dir="${project.targetDirectory}">
93d506 297                 <include name="fedclient.jar" />
f6740d 298             </fileset>
f6b200 299             <fileset dir="${project.distrib.dir}">
773bb6 300                 <include name="federation.properties" />
f6740d 301             </fileset>
f6b200 302             <!-- include "fedclient" tagged dependencies -->
JM 303             <dependencies prefix="ext" tag="fedclient" />
304         </mx:zip>
93d506 305         
JM 306         <!-- Cleanup -->
f6b200 307         <delete file="${project.targetDirectory}/fedclient.jar" />
JM 308         
f6740d 309     </target>
JM 310
841651 311
JM 312     <!-- 
313         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f6b200 314         Build a Gitblit filesystem for deployment to RedHat OpenShift Express
b774de 315         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JM 316     -->
9be337 317     <target name="buildExpress" depends="compile" description="Build exploded WAR file suitable for deployment to OpenShift Express">
f6b200 318         <echo>Building Gitblit Express for RedHat OpenShift ${project.version}</echo>
b774de 319         
f6b200 320         <local name="express.dir" />
JM 321         <property name="express.dir" value="${project.outputDirectory}/express" />        
322         <delete dir="${express.dir}" />
b774de 323         
JM 324         <!-- Create the OpenShift filesystem -->
f6b200 325         <local name="deployments.root" />
JM 326         <property name="deployments.root" value="${express.dir}/deployments/ROOT.war"/>
b774de 327         <mkdir dir="${deployments.root}" />
f6b200 328         <touch file="${express.dir}/deployments/ROOT.war.dodeploy" />
b774de 329
f6b200 330         <local name="webinf" />
JM 331         <property name="webinf" value="${deployments.root}/WEB-INF" />
b774de 332
f6b200 333         <!-- Prepare the data directory -->
JM 334         <prepareDataDirectory toDir="${webinf}/data" />
93d506 335                     
f6b200 336         <!-- Build the Express web.xml from the prototype web.xml and gitblit.properties -->
b774de 337         <!-- THIS FILE IS NOT OVERRIDDEN ONCE IT IS BUILT!!! -->
f6b200 338         <mx:webxml sourcefile="${project.src.dir}/WEB-INF/web.xml" destfile="${webinf}/web.xml"
9985ed 339             propertiesFile="${project.distrib.dir}/data/gitblit.properties"
JM 340             skip="server.*">
341             <replace token="@gb.version@" value="${project.version}" />
342         </mx:webxml>
b774de 343
JM 344         <!-- Gitblit classes -->
cacf8b 345         <mx:jar destfile="${webinf}/lib/gitblit.jar" includeresources="false" />
b774de 346
JM 347         <!-- Build Express Zip file -->
f6b200 348         <mx:zip basedir="${express.dir}" destfile="${project.targetDirectory}/${express.zipfile}">
JM 349             <fileset dir="${basedir}">
350                 <include name="LICENSE" />
351                 <include name="NOTICE" />
352             </fileset>
353             <!-- README -->
354             <zipfileset fullpath="README.gitblit" file="${project.siteSourceDirectory}/openshift.mkd" />
355             <!-- resources -->
356             <zipfileset prefix="deployments/ROOT.war" dir="${project.resources.dir}">
357                 <exclude name="thumbs.db" />
358                 <exclude name="*.mkd" />
359             </zipfileset>
360             <!-- include "war" tagged dependencies -->
361             <dependencies prefix="deployments/ROOT.war/WEB-INF/lib" tag="war" />
362         </mx:zip>
b774de 363
JM 364     </target>
365
366
367     <!-- 
368         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a7a9f7 369         Build the stand-alone, Gitblit Manager
841651 370         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JM 371     -->
a7a9f7 372     <target name="buildManager" depends="compile" description="Builds the stand-alone Gitblit Manager">
f6b200 373         <echo>Building Gitblit Manager ${project.version}</echo>
b774de 374
f6b200 375         <!-- generate jar by traversing the class hierarchy of the specified
JM 376              classes, exclude any classes in classpath jars -->
b9afce 377         <mx:genjar tag="" includeResources="false" excludeClasspathJars="true"
f6b200 378             destfile="${project.targetDirectory}/manager.jar">
JM 379             <resource file="${project.src.dir}/com/gitblit/client/splash.png" />
380             <resource file="${project.resources.dir}/gitblt-favicon.png" />
381             <resource file="${project.resources.dir}/gitweb-favicon.png" />
382             <resource file="${project.resources.dir}/git-orange-16x16.png" />
383             <resource file="${project.resources.dir}/user_16x16.png" />
384             <resource file="${project.resources.dir}/users_16x16.png" />
385             <resource file="${project.resources.dir}/settings_16x16.png" />
386             <resource file="${project.resources.dir}/lock_go_16x16.png" />
387             <resource file="${project.resources.dir}/lock_pull_16x16.png" />
388             <resource file="${project.resources.dir}/shield_16x16.png" />
389             <resource file="${project.resources.dir}/federated_16x16.png" />
390             <resource file="${project.resources.dir}/cold_16x16.png" />
391             <resource file="${project.resources.dir}/book_16x16.png" />
392             <resource file="${project.resources.dir}/bug_16x16.png" />
393             <resource file="${project.resources.dir}/health_16x16.png" />
394             <resource file="${project.resources.dir}/feed_16x16.png" />
395             <resource file="${project.resources.dir}/bullet_feed.png" />
396             <resource file="${project.resources.dir}/search-icon.png" />
397             <resource file="${project.resources.dir}/commit_changes_16x16.png" />
398             <resource file="${project.resources.dir}/commit_merge_16x16.png" />
399             <resource file="${project.resources.dir}/commit_divide_16x16.png" />
400             <resource file="${project.resources.dir}/star_16x16.png" />
c44dd0 401             <resource file="${project.resources.dir}/mirror_16x16.png" />
f6b200 402             <resource file="${project.resources.dir}/blank.png" />
JM 403             <resource file="${project.src.dir}/log4j.properties" />
404             <resource>
405                 <!-- inlcude all translations -->
406                 <fileset dir="${project.src.dir}/com/gitblit/wicket">
407                     <include name="*.properties" />
408                 </fileset>
409             </resource>
b774de 410
f6b200 411             <mainclass name="com.gitblit.client.GitblitManagerLauncher" />
c8e08d 412             <class name="com.gitblit.Keys" />
JM 413             <class name="com.gitblit.client.GitblitClient" />
414             <class name="com.gitblit.models.FederationModel" />
415             <class name="com.gitblit.models.FederationProposal" />
416             <class name="com.gitblit.models.FederationSet" />            
841651 417             <manifest>
JM 418                 <attribute name="SplashScreen-Image" value="splash.png" />
419             </manifest>
f6b200 420         </mx:genjar>
b774de 421
d65f71 422         <!-- Build Manager Zip file -->
f6b200 423         <mx:zip destfile="${project.targetDirectory}/${manager.zipfile}">
d65f71 424             <fileset dir="${basedir}">
JM 425                 <include name="LICENSE" />
426                 <include name="NOTICE" />
427             </fileset>
f6b200 428             <fileset dir="${project.targetDirectory}">
JM 429                 <include name="manager.jar" />
93d506 430             </fileset>
f6b200 431             <!-- include "manager" tagged dependencies -->
JM 432             <dependencies prefix="ext" tag="manager" />
433         </mx:zip>
93d506 434         
JM 435         <!-- Cleanup -->
f6b200 436         <delete file="${project.targetDirectory}/manager.jar" />
841651 437     </target>
4ad1eb 438
JM 439                     
440     <!-- 
441         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
442         Build the Gitblit API client library
443         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
444     -->
445     <target name="buildApiLibrary" depends="compile" description="Builds the Gitblit RPC client library">
f6b200 446         <echo>Building Gitblit API Library ${project.version}</echo>
4ad1eb 447     
f6b200 448         <local name="javadoc.dir" />
JM 449         <property name="javadoc.dir" value="${project.outputDirectory}/javadoc" />
450         <delete dir="${javadoc.dir}" />
451
4ad1eb 452         <!-- Build API Library jar -->
b9afce 453         <mx:genjar tag="" includeResources="false" excludeClasspathJars="true"
f6b200 454             destfile="${project.targetDirectory}/gbapi-${project.version}.jar">
4ad1eb 455             <class name="com.gitblit.Keys" />
JM 456             <class name="com.gitblit.client.GitblitClient" />
4bef08 457             <class name="com.gitblit.models.FederationModel" />
JM 458             <class name="com.gitblit.models.FederationProposal" />
459             <class name="com.gitblit.models.FederationSet" />            
f6b200 460         </mx:genjar>
773bb6 461         
4ad1eb 462         <!-- Build API sources jar -->
f6b200 463         <zip destfile="${project.targetDirectory}/gbapi-${project.version}-sources.jar">
JM 464             <fileset dir="${project.src.dir}" defaultexcludes="yes">
4ad1eb 465                 <include name="com/gitblit/Constants.java"/>
JM 466                 <include name="com/gitblit/GitBlitException.java"/>
467                 <include name="com/gitblit/Keys.java"/>
468                   <include name="com/gitblit/client/**/*.java"/>
469                   <include name="com/gitblit/models/**/*.java"/>
470                   <include name="com/gitblit/utils/**/*.java"/>                      
471             </fileset>
472         </zip>
473         
474         <!-- Build API JavaDoc jar -->
f6b200 475         <mx:javadoc destdir="${javadoc.dir}" redirect="true">
JM 476             <fileset dir="${project.src.dir}" defaultexcludes="yes">
4ad1eb 477                 <include name="com/gitblit/Constants.java"/>
JM 478                 <include name="com/gitblit/GitBlitException.java"/>
479                 <include name="com/gitblit/Keys.java"/>
480                   <include name="com/gitblit/client/**/*.java"/>
481                   <include name="com/gitblit/models/**/*.java"/>
482                   <include name="com/gitblit/utils/**/*.java"/>                      
483             </fileset>
f6b200 484         </mx:javadoc>
JM 485                       
486         <zip destfile="${project.targetDirectory}/gbapi-${project.version}-javadoc.jar">
487             <fileset dir="${javadoc.dir}" />
4ad1eb 488         </zip>
JM 489         
490         <!-- Build the API library zip file -->
f6b200 491         <mx:zip destfile="${project.targetDirectory}/${gbapi.zipfile}">
4ad1eb 492             <fileset dir="${basedir}">
93d506 493                 <include name="LICENSE" />
JM 494                 <include name="NOTICE" />
495             </fileset>
f6b200 496             <fileset dir="${project.targetDirectory}">
JM 497                 <include name="gbapi-${project.version}.jar" />
498                 <include name="gbapi-${project.version}-sources.jar" />
499                 <include name="gbapi-${project.version}-javadoc.jar" />
4ad1eb 500             </fileset>
f6b200 501             <!-- include "api" tagged dependencies -->
JM 502             <dependencies prefix="ext" tag="api" />
503         </mx:zip>
93d506 504         
JM 505         <!-- Cleanup -->
506         <delete>
f6b200 507             <fileset dir="${project.targetDirectory}">
93d506 508                 <include name="javadoc/**" />
JM 509         </fileset>
510         </delete>
4ad1eb 511     </target>
841651 512         
f6740d 513         
85c2e6 514     <!-- 
JM 515         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
516         Build the Gitblit Website
517         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
518     -->
f6b200 519     <target name="buildSite" depends="prepare" description="Build the Gitblit website">
85c2e6 520         
f6b200 521         <echo>Building Gitblit Website ${project.version}</echo>
JM 522
523         <property name="releaselog" value="${basedir}/releases.moxie" />
85c2e6 524
dd7961 525         <!-- Build Site -->
f6b200 526         <mx:doc    googleplusid="114464678392593421684" googleanalyticsid="UA-24377072-1"
JM 527             googlePlusOne="true" minify="true" customless="custom.less">
528             <structure>
529                 <menu name="about">
530                     <page name="overview" src="siteindex.mkd" out="index.html" headerLinks="false" />
531                     <page name="features" src="features.mkd" />
532                     <page name="screenshots" src="screenshots.mkd" />
533                 </menu>
8c99a7 534                 <menu name="documentation" pager="true" pagerPlacement="bottom" pagerLayout="justified">
cc0477 535                     <menu name="Gitblit GO" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 536                         <page name="setup GO" src="setup_go.mkd" />
537                         <page name="upgrade GO" src="upgrade_go.mkd" />
538                     </menu>
8c99a7 539                     <divider />
cc0477 540                     <menu name="Gitblit WAR" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 541                         <page name="setup WAR" src="setup_war.mkd" />
542                         <page name="upgrade WAR" src="upgrade_war.mkd" />
543                     </menu>
8c99a7 544                     <divider />
044549 545                     <menu name="Gitblit Express" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 546                         <page name="setup Express" src="setup_express.mkd" />
547                         <page name="upgrade Express" src="upgrade_express.mkd" />
548                     </menu>
549                     <divider />
d02011 550                     <menu name="Server Configuration" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 551                         <page name="administration" src="administration.mkd" />
552                         <page name="authentication" src="setup_authentication.mkd" />
553                         <page name="push hooks" src="setup_hooks.mkd" />
554                         <page name="lucene indexing" src="setup_lucene.mkd" />
555                         <page name="reverse proxies" src="setup_proxy.mkd" />
556                         <page name="client app menus" src="setup_clientmenus.mkd" />
557                         <page name="bugtraq" src="setup_bugtraq.mkd" />
558                         <page name="mirrors" src="setup_mirrors.mkd" />
559                         <page name="scaling" src="setup_scaling.mkd" />
560                         <divider />
561                         <page name="Gitblit as a viewer" src="setup_viewer.mkd" />
562                     </menu>
cc0477 563                     <divider />
22957a 564                     <menu name="Client Usage" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 565                         <page name="using HTTP/HTTPS" src="setup_transport_http.mkd" />
566                         <page name="using SSH" src="setup_transport_ssh.mkd" />
567                         <page name="using the Eclipse plugin" src="eclipse_plugin.mkd" />
d02011 568                     </menu>
8c99a7 569                     <divider />
413e9b 570                     <menu name="Tickets" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 571                       <page name="overview" src="tickets_overview.mkd" />
572                       <page name="using" src="tickets_using.mkd" />
573                       <page name="barnum" src="tickets_barnum.mkd" />
148b40 574                       <page name="setup" src="tickets_setup.mkd" />
413e9b 575                       <page name="replication &amp; advanced administration" src="tickets_replication.mkd" />
df3594 576                     </menu>
JM 577                     <divider />
578                     <menu name="Plugins" pager="true" pagerPlacement="bottom" pagerLayout="justified">
c5dfd6 579                       <page name="overview" src="plugins_overview.mkd" />
JM 580                       <page name="extension points" src="plugins_extensions.mkd" />
413e9b 581                     </menu>
JM 582                     <divider />
f6b200 583                     <page name="federation" src="federation.mkd" />
JM 584                     <divider />
585                     <page name="settings" src="properties.mkd" />
586                     <page name="faq" src="faq.mkd" />
587                     <divider />
588                     <page name="design" src="design.mkd" />
589                     <page name="rpc" src="rpc.mkd" />
590                 </menu>
591                 
592                 <menu name="releases">
593                     <page name="release notes" out="releasenotes.html">
594                         <template src="releasecurrent.ftl" data="${releaselog}" />
595                     </page>
596                     <page name="release history" out="releases.html">
597                         <template src="releasehistory.ftl" data="${releaselog}" />
598                     </page>
599                     <divider />
600                     <page name="roadmap" src="roadmap.mkd" />                    
601                 </menu>
602                 
603                 <menu name="downloads">
604                     <link name="Gitblit GO (Windows)" src="${gc.url}gitblit-${project.releaseVersion}.zip" />
605                     <link name="Gitblit GO (Linux/OSX)" src="${gc.url}gitblit-${project.releaseVersion}.tar.gz" />
606                     <link name="Gitblit WAR" src="${gc.url}gitblit-${project.releaseVersion}.war" />
607                     <link name="Gitblit Express" src="${gc.url}express-${project.releaseVersion}.zip" />
608                     <divider />
609                     <link name="Gitblit Manager" src="${gc.url}manager-${project.releaseVersion}.zip" />
610                     <link name="Federation Client" src="${gc.url}fedclient-${project.releaseVersion}.zip" />
611                     <divider />
612                     <link name="API Library" src="${gc.url}gbapi-${project.releaseVersion}.zip" />
14b6ab 613                     <divider />
69eeaa 614                     <link name="Bintray (1.4.0+)" src="https://bintray.com/gitblit/releases/gitblit" />
14b6ab 615                     <link name="GoogleCode (pre-1.4.0)" src="https://code.google.com/p/gitblit/downloads/list?can=1" />
9cce43 616                     <divider />
JM 617                     <link name="Maven Repository" src="${project.mavenUrl}" />
f6b200 618                 </menu>
JM 619                 
620                 <menu name="links">
69eeaa 621                     <link name="dev.gitblit.com (self-hosted)" src="https://dev.gitblit.com" />
df3594 622                     <divider />
JM 623                     <link name="Plugin Registry" src="http://plugins.gitblit.com" />
751ecd 624                     <divider />
f6b200 625                     <link name="Github" src="${project.scmUrl}" />
JM 626                     <link name="Issues" src="${project.issuesUrl}" />
627                     <link name="Discussion" src="${project.forumUrl}" />
628                     <link name="Google+" src="${project.socialNetworkUrl}" />
751ecd 629                     <link name="Twitter" src="https://twitter.com/gitblit" />
f6b200 630                     <link name="Ohloh" src="http://www.ohloh.net/p/gitblit" />
751ecd 631                     <divider />
JM 632                     <link name="+JamesMoger" src="https://plus.google.com/+JamesMoger" />
633                     <link name="@JamesMoger" src="https://twitter.com/JamesMoger" />
f6b200 634                 </menu>
JM 635                 <divider />
636             </structure>
637             
638             <replace token="%GCURL%" value="${gc.url}" />
639             
640             <properties token="%PROPERTIES%" file="${project.distrib.dir}/data/gitblit.properties" />
641             
642             <regex searchPattern="\b(issue)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='http://code.google.com/p/gitblit/issues/detail?id=$3'&gt;issue $3&lt;/a&gt;" />
3daba4 643             <regex searchPattern="\b(pr|pull request)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='https://github.com/gitblit/gitblit/pull/$3'&gt;pull request #$3&lt;/a&gt;" />
5d0f71 644             <regex searchPattern="\b(ticket)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='https://dev.gitblit.com/tickets/gitblit.git/$3'&gt;ticket $3&lt;/a&gt;" />
f6b200 645             
JM 646             <!-- Set the logo from the mx:doc resources -->
647             <logo file="${project.resources.dir}/gitblt_25_white.png" />
648             <favicon file="${project.resources.dir}/gitblt-favicon.png" />
649             
650             <resource>
651                 <fileset dir="${project.resources.dir}">
652                     <include name="lock_go_16x16.png" />
653                     <include name="lock_pull_16x16.png" />
654                     <include name="shield_16x16.png" />
655                     <include name="cold_16x16.png" />
656                     <include name="bug_16x16.png" />
657                     <include name="book_16x16.png" />
658                     <include name="blank.png" />
659                     <include name="federated_16x16.png" />
660                     <include name="arrow_page.png" />
661                 </fileset>
662             </resource>
663         </mx:doc>        
a4d249 664
f90dc6 665         <!-- Copy Fancybox -->
f6b200 666         <mkdir dir="${project.siteTargetDirectory}/fancybox" />
JM 667         <copy todir="${project.siteTargetDirectory}/fancybox">
668             <fileset dir="${project.siteSourceDirectory}/fancybox">
230632 669                 <exclude name="thumbs.db" />
JM 670             </fileset>
671         </copy>
672
24d08f 673         <!-- Generate thumbnails of screenshots -->
f6b200 674         <mx:thumbs input="png" output="png" maximumDimension="250" 
JM 675             sourceDir="${project.siteSourceDirectory}/screenshots"
676             destDir="${project.siteTargetDirectory}/thumbs" />
a4d249 677
f90dc6 678         <!-- Copy screenshots -->
f6b200 679         <mkdir dir="${project.siteTargetDirectory}/screenshots" />
JM 680         <copy todir="${project.siteTargetDirectory}/screenshots">
681             <fileset dir="${project.siteSourceDirectory}/screenshots">
f90dc6 682                 <include name="*.png" />
JM 683             </fileset>
684         </copy>
685
85c2e6 686     </target>
b774de 687
f12685 688     <!--
JM 689         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
690         Package and deploy RELEASE artifacts to the Maven repository
691         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
692     -->
392854 693     <target name="buildMavenArtifacts" depends="buildApiLibrary">
JM 694         <mx:package />
f12685 695         <mx:deploy basedir="${maven.directory}" allowsnapshots="false" />
392854 696         <mx:deploy basedir="${maven.directory}" allowsnapshots="false"
JM 697             name="Gitblit API" description="Gitblit JSON/RSS API client library"
698             tags="api" artifactid="gbapi" />
f12685 699     </target>
JM 700
424fe1 701
85c2e6 702     <!--
JM 703         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
f6b200 704         Build all binaries and site
85c2e6 705         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JM 706     -->
289efb 707     <target name="buildAll" depends="buildGO,buildWAR,buildExpress,buildFederationClient,buildManager,buildApiLibrary,buildSite" />        
b774de 708
746aaf 709     
JM 710     <!--
711         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
712         Update the gh-pages branch with the current site
713         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
714     -->
5aec86 715     <target name="updateGhPages">
746aaf 716         <!-- Build gh-pages branch -->
f6b200 717         <mx:ghpages repositorydir="${basedir}" obliterate="true" />
746aaf 718     </target>
JM 719     
b774de 720
85c2e6 721     <!-- 
JM 722         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14b6ab 723         Publish binaries to Bintray
85c2e6 724         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JM 725     -->
14b6ab 726     <target name="publishBinaries" depends="prepare" description="Publish the Gitblit binaries to Bintray">
b774de 727
f6b200 728         <echo>Uploading Gitblit ${project.version} binaries</echo>
b774de 729
f6b200 730         <!-- Upload Gitblit GO Windows ZIP file -->
14b6ab 731         <bintrayUpload
JM 732             source="${project.targetDirectory}/${distribution.zipfile}" 
733             target="gitblit-${project.version}.zip" />
f6b200 734
JM 735         <!-- Upload Gitblit GO Linux/Unix tar.gz file -->
14b6ab 736         <bintrayUpload
JM 737             source="${project.targetDirectory}/${distribution.tgzfile}" 
738             target="gitblit-${project.version}.tar.gz" />
b774de 739
773bb6 740         <!-- Upload Gitblit WAR file -->
14b6ab 741         <bintrayUpload
JM 742             source="${project.targetDirectory}/${distribution.warfile}" 
743             target="gitblit-${project.version}.war" />
b774de 744
773bb6 745         <!-- Upload Gitblit FedClient -->
14b6ab 746         <bintrayUpload
JM 747             source="${project.targetDirectory}/${fedclient.zipfile}" 
748             target="fedclient-${project.version}.zip" />
841651 749
773bb6 750         <!-- Upload Gitblit Manager -->
14b6ab 751         <bintrayUpload
JM 752             source="${project.targetDirectory}/${manager.zipfile}" 
753             target="manager-${project.version}.zip" />
4ad1eb 754
773bb6 755         <!-- Upload Gitblit API Library -->
14b6ab 756         <bintrayUpload
JM 757             source="${project.targetDirectory}/${gbapi.zipfile}" 
758             target="gbapi-${project.version}.zip" />
b774de 759
JM 760         <!-- Upload Gitblit Express for RedHat OpenShift -->
14b6ab 761         <bintrayUpload
JM 762             source="${project.targetDirectory}/${express.zipfile}" 
763             target="express-${project.version}.zip" />
b774de 764
5450d0 765     </target>
JM 766
14b6ab 767     
85c2e6 768     <!--
JM 769         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
b774de 770         Publish site to site hosting service
85c2e6 771         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JM 772     -->
5aec86 773     <target name="publishSite" depends="clean,buildSite,updateGhPages" description="Publish the Gitblit site to a host" >
b774de 774
f6b200 775         <echo>Uploading Gitblit ${project.version} website</echo>
b774de 776
5aec86 777         <mx:ftp server="${ftp.server}"
81f881 778             userid="${ftp.user}"
JM 779             password="${ftp.password}"
780             remotedir="${ftp.dir}"
781             passive="true"
782             verbose="yes">
f6b200 783             <fileset dir="${project.siteTargetDirectory}" />
5aec86 784         </mx:ftp>
81f881 785     </target>
85c2e6 786
b774de 787
f6b200 788     <!--
JM 789         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
790         Tag a new version and prepare for the next development cycle.
791         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
792     -->
fd9086 793     <target name="tagRelease" depends="prepare" description="tag a new version and prepare for the next development cycle">
f6b200 794         <!-- release -->
JM 795         <property name="dryrun" value="false" />
796         <mx:version stage="release" dryrun="${dryrun}" />        
5aec86 797         <property name="project.tag" value="v${project.version}" />
f6b200 798         <!-- commit build.moxie & releases.moxie (automatic) -->
JM 799         <mx:commit showtitle="no">
800             <message>Prepare ${project.version} release</message>
5aec86 801             <tag name="${project.tag}">
f6b200 802                 <message>${project.name} ${project.version} release</message>
JM 803             </tag>
804         </mx:commit>
5aec86 805
JM 806         <!-- create the release process script -->
807         <mx:if>
808             <os family="windows" />
809             <then>
810                 <!-- Windows PowerShell script        -->
811                 <!-- set-executionpolicy remotesigned -->
812                 <property name="recipe" value="release_${project.version}.ps1" />
813             </then>
814             <else>
815                 <!-- Bash script -->
816                 <property name="recipe" value="release_${project.version}.sh" />
817             </else>
818         </mx:if>
819         <delete file="${recipe}" failonerror="false" quiet="true" verbose="false" />
820         <!-- Work-around for lack of proper ant property substitution in copy -->
821         <property name="dollar" value="$"/>
822         <copy file="release.template" tofile="${recipe}">
823             <filterset begintoken="${dollar}{" endtoken="}">
824                 <filter token="project.version" value="${project.version}" />
825                 <filter token="project.commitId" value="${project.commitId}" />
826                 <filter token="project.tag" value="${project.tag}" />
f12685 827                 <filter token="project.directory" value="${basedir}" />
JM 828                 <filter token="maven.directory" value="${maven.directory}" />
5aec86 829             </filterset>
JM 830         </copy>
831         <chmod file="${recipe}" perm="ugo+rx" />
f6b200 832
JM 833         <!-- next cycle -->
834         <mx:version stage="snapshot" incrementNumber="incremental" dryrun="${dryrun}" />
835         <mx:commit showtitle="no">
836             <message>Reset build identifiers for next development cycle</message>
5aec86 837         </mx:commit>        
85c2e6 838     </target>
f6b200 839
JM 840         
841     <!--
842         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
843         Build Gitblit Docs
844         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
845     -->
846     <macrodef name="generateDocs">
847         <attribute name="toDir"/>
848         <sequential>
849             <mx:doc toDir="@{toDir}" minify="true" customless="custom.less">
850                 <structure>
851                     <menu name="about">
852                         <page name="overview" src="siteindex.mkd" out="index.html" headerLinks="false" />
853                         <page name="features" src="features.mkd" />
854                     </menu>
855                     <menu name="documentation">
cc0477 856                         <menu name="Gitblit GO" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 857                             <page name="setup GO" src="setup_go.mkd" />
858                             <page name="upgrade GO" src="upgrade_go.mkd" />
859                         </menu>
860                         <divider />
861                         <menu name="Gitblit WAR" pager="true" pagerPlacement="bottom" pagerLayout="justified">
862                             <page name="setup WAR" src="setup_war.mkd" />
863                             <page name="upgrade WAR" src="upgrade_war.mkd" />
864                         </menu>
865                         <divider />
044549 866                         <menu name="Gitblit Express" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 867                             <page name="setup Express" src="setup_express.mkd" />
868                             <page name="upgrade Express" src="upgrade_express.mkd" />
869                         </menu>
870                         <divider />
d02011 871                         <menu name="Server Configuration" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 872                             <page name="administration" src="administration.mkd" />
873                             <page name="authentication" src="setup_authentication.mkd" />
874                             <page name="push hooks" src="setup_hooks.mkd" />
875                             <page name="lucene indexing" src="setup_lucene.mkd" />
876                             <page name="reverse proxies" src="setup_proxy.mkd" />
877                             <page name="client app menus" src="setup_clientmenus.mkd" />
878                             <page name="bugtraq" src="setup_bugtraq.mkd" />
879                             <page name="mirrors" src="setup_mirrors.mkd" />
880                             <page name="scaling" src="setup_scaling.mkd" />
881                             <divider />
882                             <page name="Gitblit as a viewer" src="setup_viewer.mkd" />
883                         </menu>
cc0477 884                         <divider />
22957a 885                         <menu name="Client Usage" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 886                             <page name="using HTTP/HTTPS" src="setup_transport_http.mkd" />
887                             <page name="using SSH" src="setup_transport_ssh.mkd" />
888                             <page name="using the Eclipse plugin" src="eclipse_plugin.mkd" />
d02011 889                         </menu>
cc0477 890                         <divider />
413e9b 891                         <menu name="Tickets" pager="true" pagerPlacement="bottom" pagerLayout="justified">
JM 892                             <page name="overview" src="tickets_overview.mkd" />
893                             <page name="using" src="tickets_using.mkd" />
894                             <page name="barnum" src="tickets_barnum.mkd" />
895                             <page name="setup" src="tickets_setup.mkd" />
148b40 896                             <page name="replication &amp; advanced administration" src="tickets_replication.mkd" />
413e9b 897                         </menu>
JM 898                         <divider />
df3594 899                         <menu name="Plugins" pager="true" pagerPlacement="bottom" pagerLayout="justified">
c5dfd6 900                           <page name="overview" src="plugins_overview.mkd" />
JM 901                           <page name="extension points" src="plugins_extensions.mkd" />
df3594 902                         </menu>
JM 903                         <divider />
f6b200 904                         <page name="federation" src="federation.mkd" />
JM 905                         <divider />
906                         <page name="settings" src="properties.mkd" />
cc0477 907                         <page name="faq" src="faq.mkd" />
f6b200 908                         <divider />
JM 909                         <page name="design" src="design.mkd" />
910                         <page name="rpc" src="rpc.mkd" />
911                     </menu>
912                     <menu name="changelog">
913                         <page name="current release" src="releasecurrent.mkd" />
914                         <page name="older releases" src="releasehistory.mkd" />
915                     </menu>
916                     <menu name="links">
69eeaa 917                         <link name="dev.gitblit.com (self-hosted)" src="https://dev.gitblit.com" />
f6b200 918                         <divider />
df3594 919                         <link name="Plugin Registry" src="http://plugins.gitblit.com" />
JM 920                         <divider />
f6b200 921                         <link name="Github" src="${project.scmUrl}" />
JM 922                         <link name="Issues" src="${project.issuesUrl}" />
923                         <link name="Discussion" src="${project.forumUrl}" />
924                         <link name="Google+" src="${project.socialNetworkUrl}" />
925                         <link name="Ohloh" src="http://www.ohloh.net/p/gitblit" />
926                     </menu>
927                 </structure>
928                 
929                 <properties token="%PROPERTIES%" file="${project.distrib.dir}/data/gitblit.properties" />
930                 
931                 <regex searchPattern="\b(issue)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='http://code.google.com/p/gitblit/issues/detail?id=$3'&gt;issue $3&lt;/a&gt;" />
3daba4 932                 <regex searchPattern="\b(pr|pull request)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='https://github.com/gitblit/gitblit/pull/$3'&gt;pull request #$3&lt;/a&gt;" />
5d0f71 933                 <regex searchPattern="\b(ticket)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='https://dev.gitblit.com/tickets/gitblit.git/$3'&gt;ticket $3&lt;/a&gt;" />
3daba4 934
f6b200 935                 <!-- Set the logo from the mx:doc resources -->
JM 936                 <logo file="${project.resources.dir}/gitblt_25_white.png" />
937                 <favicon file="${project.resources.dir}/gitblt-favicon.png" />
938                 
939                 <resource>
940                     <fileset dir="${project.resources.dir}">
941                         <include name="lock_go_16x16.png" />
942                         <include name="lock_pull_16x16.png" />
943                         <include name="shield_16x16.png" />
944                         <include name="cold_16x16.png" />
945                         <include name="bug_16x16.png" />
946                         <include name="book_16x16.png" />
947                         <include name="blank.png" />
948                         <include name="federated_16x16.png" />
949                         <include name="arrow_page.png" />
950                     </fileset>
951                 </resource>
952             </mx:doc>
953         </sequential>
954     </macrodef>
955     
956     <!--
957         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
958         Macro to create a pristine data directory for the target build
959         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
960     -->
961     <macrodef name="prepareDataDirectory">
962         <attribute name="toDir"/>
963         <sequential>
964             <mkdir dir="@{toDir}" />
965             <copy todir="@{toDir}" overwrite="false">
966                 <fileset dir="${project.distrib.dir}/data">
967                     <include name="users.conf" />
968                     <include name="projects.conf" />
4fb6af 969                     <include name="gitblit.properties" />                    
f6b200 970                 </fileset>
JM 971             </copy>
abab3a 972             <mkdir dir="@{toDir}/git" />
JM 973             <copy todir="@{toDir}/git" overwrite="false">
974                 <fileset dir="${project.distrib.dir}/data/git">
975                     <include name="project.mkd" />
976                 </fileset>
977             </copy>
f6b200 978             <mkdir dir="@{toDir}/groovy" />
JM 979             <copy todir="@{toDir}/groovy">
980                 <fileset dir="${project.distrib.dir}/data/groovy">                    
981                     <include name="sendmail.groovy" />
982                     <include name="sendmail-html.groovy" />
983                     <include name="jenkins.groovy" />
984                     <include name="protect-refs.groovy" />
7847af 985                     <include name="blockpush.groovy" />
JM 986                     <include name="localclone.groovy" />
f6b200 987                     <include name="fogbugz.groovy" />
JM 988                     <include name="thebuggenie.groovy" />
72a782 989                     <include name="fisheye.groovy" />
0dfb98 990                     <include name="redmine-fetch.groovy" />
f6a8cf 991                     <include name="subgit.groovy" />
f6b200 992                 </fileset>
JM 993             </copy>
994       </sequential>
995     </macrodef>
996     
997     <!--
998         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
14b6ab 999         Macro to upload binaries to Bintray
f6b200 1000         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JM 1001     -->
14b6ab 1002     <macrodef name="bintrayUpload">
JM 1003         <attribute name="source"/>
1004         <attribute name="target"/>
f6b200 1005         <sequential>
14b6ab 1006             <echo>uploading @{source} to Bintray</echo>
JM 1007             <exec executable="curl">
b65e6d 1008                 <arg line="--silent --show-error -T @{source} -u${bintray.username}:${bintray.apikey} https://api.bintray.com/content/gitblit/releases/gitblit/${project.version}/@{target}"></arg>
14b6ab 1009             </exec>
JM 1010         </sequential>
f6b200 1011     </macrodef>
JM 1012
1013     <!--
1014         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1015         Install Gitblit JAR for usage as Maven module
1016         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1017     -->
1018     <target name="installMaven" depends="compile" description="Install Gitblit JAR as Maven module">
1019         <local name="project.jar" />
22659c 1020         <property name="project.jar" value="${project.outputDirectory}/${project.artifactId}.jar" />
358545 1021         <property name="resourceFolderPrefix" value="" />
22659c 1022         <mx:jar destfile="${project.jar}" packageSources="true" includeresources="true" resourceFolderPrefix="${resourceFolderPrefix}" />
f6b200 1023
22659c 1024         <!-- Install Binary jar -->
f6b200 1025         <exec executable="mvn">
JM 1026             <arg value="install:install-file" />
1027             <arg value="-Dfile=${project.jar}" />
22659c 1028             <arg value="-DpomFile=${basedir}/pom.xml" />
JM 1029             <arg value="-DcreateChecksum=true" />
1030         </exec>
1031         
1032         <!-- Install Sources  jar -->
1033         <exec executable="mvn">
1034             <arg value="install:install-file" />
1035             <arg value="-Dfile=${project.outputDirectory}/${project.artifactId}-sources.jar" />
1036             <arg value="-Dclassifier=sources" />
f6b200 1037             <arg value="-DpomFile=${basedir}/pom.xml" />
JM 1038             <arg value="-DcreateChecksum=true" />
1039         </exec>
1040     </target>
1041
1042     <!--
1043         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1044         Upload Gitblit JAR to remote Maven repository
1045         
1046         build.properties:
1047            project.maven.repo.url = http://whatever.com/maven2
1048            project.maven.repo.id = whateverId
1049         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1050     -->
1051     <target name="uploadMaven" depends="compile" description="Upload Gitblit JAR to remote Maven repository">
1052         <local name="project.jar" />
1053         <property name="project.jar" value="${project.outputDirectory}/gitblit.jar" />
22659c 1054         <mx:jar destfile="${project.jar}" packageSources="true" includeresources="true" />
f6b200 1055
JM 1056         <exec executable="mvn">
1057             <arg value="deploy:deploy-file" />
1058             <arg value="-Dfile=${project.jar}" />
1059             <arg value="-DpomFile=${basedir}/pom.xml" />
1060             <arg value="-Durl=${project.maven.repo.url}" />
1061             <arg value="-DrepositoryId=${project.maven.repo.id}" />
1062             <arg value="-DcreateChecksum=true" />
1063         </exec>
289efb 1064     </target>
413e9b 1065
JM 1066     <!--
1067         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1068         Install Gitblit JAR for usage as Moxie artifact
1069         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1070     -->
1071     <target name="installMoxie" depends="compile" description="Install Gitblit JAR as a Moxie artifact">
1072         <local name="project.jar" />
1073         <property name="project.jar" value="${project.targetDirectory}/${project.artifactId}-${project.version}.jar" />
1074         <property name="resourceFolderPrefix" value="" />
22659c 1075         <mx:jar destfile="${project.jar}" packageSources="true" includeresources="true" resourceFolderPrefix="${resourceFolderPrefix}" />
413e9b 1076
JM 1077         <mx:install />
1078     </target>
289efb 1079     
764d94 1080 </project>