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