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