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