James Moger
2012-11-29 8fef1f8128b35e7378b8af1d9d76a731a74851c5
commit | author | age
5fe7df 1 <?xml version="1.0" encoding="UTF-8"?>
85c2e6 2 <project name="gitblit" default="compile" basedir=".">
JM 3
4     <!-- Google Code upload task -->
9cf48d 5     <taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask" 
JM 6         classpath="${basedir}/tools/ant-googlecode-0.0.3.jar" name="gcupload"/>
5fe7df 7
f6740d 8     <!-- GenJar task -->
JM 9     <taskdef resource="genjar.properties" classpath="${basedir}/tools/GenJar.jar" />
10
5fe7df 11     <!-- Project Properties -->
JM 12     <property name="project.jar" value="gitblit.jar" />
dd7961 13     <property name="project.mainclass" value="com.gitblit.Launcher" />
5fe7df 14     <property name="project.build.dir" value="${basedir}/build" />
85c2e6 15     <property name="project.deploy.dir" value="${basedir}/deploy" />
JM 16     <property name="project.war.dir" value="${basedir}/war" />
85f639 17     <property name="project.jar.dir" value="${basedir}/jar" />
85c2e6 18     <property name="project.site.dir" value="${basedir}/site" />
JM 19     <property name="project.resources.dir" value="${basedir}/resources" />    
b774de 20     <property name="project.express.dir" value="${basedir}/express" />
85f639 21     <property name="project.maven.repo.url" value="enter here your Maven repo URL" />
LM 22     <property name="project.maven.repo.id" value="gitblit.maven.repo" />
ff3015 23     <available property="hasBuildProps" file="${basedir}/build.properties"/>
5fe7df 24
ff3015 25     <!--
JM 26         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27         Load build.properties, if available
28         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29     -->
30     <target name="buildprops" if="hasBuildProps">
31         <!-- Load publication servers, paths, and credentials --> 
32         <loadproperties>
33             <file file="${basedir}/build.properties" />
34         </loadproperties>
35     </target>
5450d0 36     
85c2e6 37     
JM 38     <!--
39         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40         Scrape the version info from code and setup the build properties 
41         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42     -->
ff3015 43     <target name="buildinfo" depends="buildprops">
5450d0 44     
f13c4c 45         <!-- extract Gitblit version number from source code -->
f98825 46         <loadfile property="gb.version" srcfile="${basedir}/src/com/gitblit/Constants.java">
JM 47             <filterchain>
48                 <linecontains>
2a7306 49                     <contains value="public static final String VERSION = " />
dd7961 50                 </linecontains>
JM 51                 <striplinebreaks />
52                 <tokenfilter>
2a7306 53                     <replacestring from="public static final String VERSION = &quot;" to="" />
a4d249 54                     <replacestring from="&quot;;" to="" />
JM 55                     <trim />
56                 </tokenfilter>
1f9dae 57             </filterchain>
a4d249 58         </loadfile>
d39680 59
JM 60         <!-- extract Gitblit version date from source code -->
61         <loadfile property="gb.versionDate" srcfile="${basedir}/src/com/gitblit/Constants.java">
62             <filterchain>
63                 <linecontains>
64                     <contains value="public static final String VERSION_DATE = " />
65                 </linecontains>
66                 <striplinebreaks />
67                 <tokenfilter>
68                     <replacestring from="public static final String VERSION_DATE = &quot;" to="" />
69                     <replacestring from="&quot;;" to="" />
70                     <trim />
71                 </tokenfilter>
72             </filterchain>
73         </loadfile>
74                     
a4d249 75         <!-- extract JGit version number from source code -->
JM 76         <loadfile property="jgit.version" srcfile="${basedir}/src/com/gitblit/Constants.java">
77             <filterchain>
78                 <linecontains>
2a7306 79                     <contains value="public static final String JGIT_VERSION = " />
a4d249 80                 </linecontains>
JM 81                 <striplinebreaks />
82                 <tokenfilter>
2a7306 83                     <replacestring from="public static final String JGIT_VERSION = &quot;" to="" />
dd7961 84                     <replacestring from="&quot;;" to="" />
f98825 85                     <trim />
JM 86                 </tokenfilter>
87             </filterchain>
85c2e6 88         </loadfile>    
5450d0 89         <property name="distribution.zipfile" value="gitblit-${gb.version}.zip" />
JM 90         <property name="distribution.warfile" value="gitblit-${gb.version}.war" />
85f639 91         <property name="distribution.jarfile" value="gitblit-${gb.version}.jar" />
LM 92         <property name="distribution.pomfile" value="${basedir}/pom.xml" />
f6740d 93         <property name="fedclient.zipfile" value="fedclient-${gb.version}.zip" />
d65f71 94         <property name="manager.zipfile" value="manager-${gb.version}.zip" />
4ad1eb 95         <property name="authority.zipfile" value="authority-${gb.version}.zip" />
773bb6 96         <property name="gbapi.zipfile" value="gbapi-${gb.version}.zip" />
b774de 97         <property name="express.zipfile" value="express-${gb.version}.zip" />
5450d0 98     </target>
JM 99     
85c2e6 100     
JM 101     <!--
102         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103         Compile
104         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105     -->
106     <target name="compile" depends="buildinfo" description="Retrieves dependencies and compiles Gitblit from source">
dd7961 107
f98825 108         <!-- copy required distribution files to project folder -->
JM 109         <copy todir="${basedir}" overwrite="false">
110             <fileset dir="${basedir}/distrib">
111                 <include name="gitblit.properties" />
93f472 112                 <include name="users.conf" />
f98825 113             </fileset>
JM 114         </copy>
d8a0f1 115         
JM 116         <!-- copy required distribution files to project folder -->
117         <mkdir dir="${basedir}/certs" />
118         <copy todir="${basedir}/certs" overwrite="false">
119             <fileset dir="${basedir}/distrib">
120                 <include name="authority.conf" />
4ad1eb 121                 <include name="*.tmpl" />
d8a0f1 122             </fileset>
JM 123         </copy>
dd7961 124
b75734 125         <!-- copy gitblit.properties to the WEB-INF folder.
JM 126              this file is only used for parsing setting descriptions. -->
97a20e 127         <copy tofile="${basedir}/src/WEB-INF/reference.properties" overwrite="true"
b75734 128             file="${basedir}/distrib/gitblit.properties" />
JM 129
5fe7df 130         <!-- Compile the build tool and execute it.
JM 131              This downloads missing compile-time dependencies from Maven. -->
132
133         <delete dir="${project.build.dir}" />
134         <mkdir dir="${project.build.dir}" />
f2da4a 135         <javac debug="true" srcdir="${basedir}/src" destdir="${project.build.dir}" includeantruntime="false">
22fc5e 136             <include name="com/gitblit/build/Build.java" />            
155bf7 137             <include name="com/gitblit/Constants.java" />
5450d0 138             <include name="com/gitblit/utils/StringUtils.java" />            
5fe7df 139         </javac>
d1231c 140
1370d4 141         <java classpath="${project.build.dir}" classname="com.gitblit.build.Build" failonerror="true">
d1231c 142             <syspropertyset id="proxy.properties">
JP 143                 <propertyref prefix="java.net.useSystemProxies"/>
144                 <propertyref prefix="http."/>
145                 <propertyref prefix="https."/>
146                 <propertyref prefix="ftp."/>
147                 <propertyref prefix="socksProxy"/>
148             </syspropertyset>
149         </java>
5fe7df 150
JM 151         <!-- Compile Project -->
152         <path id="master-classpath">
153             <fileset dir="${basedir}/ext">
154                 <include name="*.jar" />
155             </fileset>
f6740d 156             <pathelement path="${project.build.dir}" />                
5fe7df 157         </path>
f2da4a 158         <javac debug="true" destdir="${project.build.dir}" failonerror="false" includeantruntime="false">
5fe7df 159             <src path="${basedir}/src" />
JM 160             <classpath refid="master-classpath" />
161         </javac>
162         <copy todir="${project.build.dir}">
163             <fileset dir="${basedir}/src" excludes="**/*.java,**/thumbs.db" />
164         </copy>
85c2e6 165     </target>
JM 166
167     
168     <!--
169         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170         Build Gitblit GO
171         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172     -->
173     <target name="buildGO" depends="compile" description="Build Gitblit GO distribution">
174         
175         <echo>Building Gitblit GO ${gb.version}</echo>
176
177         <!-- Delete the deploy folder -->
178         <delete dir="${project.deploy.dir}" />
179
180         <!-- Create deployment folder structure -->
181         <mkdir dir="${project.deploy.dir}" />
182         <copy todir="${project.deploy.dir}">
183             <fileset dir="${basedir}/distrib">
184                 <include name="**/*" />
f6740d 185                 <exclude name="federation.properties" />
b774de 186                 <exclude name="openshift.mkd" />
d8a0f1 187                 <exclude name="authority.conf" />
e8c417 188                 <exclude name="*.tmpl" />
85c2e6 189             </fileset>
7c643b 190             <fileset dir="${basedir}">
JM 191                 <include name="LICENSE" />
192                 <include name="NOTICE" />
c8b26c 193             </fileset>            
d8a0f1 194         </copy>
c8b26c 195         <copy tofile="${project.deploy.dir}/authority.jar" file="${basedir}/authority-${gb.version}.jar" />
d8a0f1 196         
JM 197         <!-- Certificate templates -->
198         <mkdir dir="${project.deploy.dir}/certs"/>
199         <copy todir="${project.deploy.dir}/certs">
200             <fileset dir="${basedir}/distrib">
e8c417 201                 <include name="*.tmpl" />
d8a0f1 202                 <include name="authority.conf" />
7c643b 203             </fileset>
85c2e6 204         </copy>
4ad1eb 205                         
5fe7df 206         <!-- Build jar -->
85c2e6 207         <jar jarfile="${project.deploy.dir}/${project.jar}">
5fe7df 208             <fileset dir="${project.build.dir}">
JM 209                 <include name="**/*" />
4ad1eb 210                 <exclude name="com/gitblit/client/**" />                
5fe7df 211             </fileset>
5450d0 212             <fileset dir="${project.resources.dir}">
JM 213                 <exclude name="thumbs.db" />
214             </fileset>
5fe7df 215             <manifest>
JM 216                 <attribute name="Main-Class" value="${project.mainclass}" />
217             </manifest>
218         </jar>
219
9be337 220         <!-- Gitblit library dependencies -->
836b11 221         <mkdir dir="${project.deploy.dir}/ext"/>
JM 222         <copy todir="${project.deploy.dir}/ext">
9be337 223             <fileset dir="${basedir}/ext">
5e351a 224                 <exclude name="src/**" />
836b11 225                 <exclude name="junit*.jar" />
926f19 226                 <exclude name="hamcrest*.jar" />
836b11 227                 <exclude name="commons-net*.jar" />
9be337 228             </fileset>
JM 229         </copy>
230         
85c2e6 231         <!-- Build the docs for the deploy -->
JM 232         <antcall target="buildDocs" inheritall="true" inheritrefs="true">
233             <param name="docs.output.dir" value="${project.deploy.dir}/docs" />
234         </antcall>
235         
59ee92 236         <!-- Copy the supported Groovy hook scripts -->
fa54be 237         <mkdir dir="${project.deploy.dir}/groovy" />
JM 238         <copy todir="${project.deploy.dir}/groovy">
239             <fileset dir="${basedir}/groovy">
59ee92 240                 <include name="sendmail.groovy" />
000bb3 241                 <include name="sendmail-html.groovy" />
59ee92 242                 <include name="jenkins.groovy" />
58a1e4 243                 <include name="protect-refs.groovy" />
a411c8 244                 <include name="localclone.groovy" />
fa54be 245             </fileset>
JM 246         </copy>
247     
85c2e6 248         <!-- Create Zip deployment -->        
JM 249         <zip destfile="${distribution.zipfile}">
250             <fileset dir="${project.deploy.dir}">
251                 <include name="**/*" />
252             </fileset>
253         </zip>
254
255     </target>
256     
257     
258     <!--
259         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
260         Build Gitblit Docs which are bundled with GO and WAR downloads
261         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
262     -->
263     <target name="buildDocs">
264     <!-- Build Docs -->
265             <mkdir dir="${docs.output.dir}" />
266             <copy todir="${docs.output.dir}">
267                 <!-- Copy selected Gitblit resources -->
268                 <fileset dir="${project.resources.dir}">
3cc6e2 269                     <include name="bootstrap/**/*" />
JM 270                     <include name="gitblit.css" />
8c5d72 271                     <include name="gitblt_25_white.png" />
85c2e6 272                     <include name="gitblt-favicon.png" />
JM 273                     <include name="lock_go_16x16.png" />
274                     <include name="lock_pull_16x16.png" />
275                     <include name="shield_16x16.png" />
276                     <include name="cold_16x16.png" />
277                     <include name="bug_16x16.png" />
278                     <include name="book_16x16.png" />
279                     <include name="blank.png" />
831469 280                     <include name="federated_16x16.png" />
0aa6ec 281                     <include name="arrow_page.png" />
85c2e6 282                 </fileset>
JM 283
284                 <!-- Copy Doc images -->
285                 <fileset dir="${basedir}/docs">
286                     <include name="*.png" />
f35a98 287                     <include name="*.gif" />
85c2e6 288                 </fileset>
JM 289             </copy>
290
291             <!-- Copy google-code-prettify -->
292             <mkdir dir="${docs.output.dir}/prettify" />
293             <copy todir="${docs.output.dir}/prettify">
294                 <fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
295                     <exclude name="thumbs.db" />
296                 </fileset>
297             </copy>
298
299             <!-- Build deployment doc pages -->
22fc5e 300             <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildSite">
85c2e6 301                 <classpath refid="master-classpath" />
JM 302                 <arg value="--sourceFolder" />
303                 <arg value="${basedir}/docs" />
304
305                 <arg value="--outputFolder" />
306                 <arg value="${docs.output.dir}" />
307
308                 <arg value="--pageHeader" />
309                 <arg value="${basedir}/docs/doc_header.html" />
310
311                 <arg value="--pageFooter" />
312                 <arg value="${basedir}/docs/doc_footer.html" />
313
314                 <arg value="--skip" />
315                 <arg value="screenshots" />
316
317                 <arg value="--skip" />
318                 <arg value="releases" />
319
320                 <arg value="--alias" />
321                 <arg value="index=overview" />
322
323                 <arg value="--alias" />
4c835e 324                 <arg value="properties=settings" />
85c2e6 325
JM 326                 <arg value="--substitute" />
327                 <arg value="%VERSION%=${gb.version}" />
328
329                 <arg value="--substitute" />
330                 <arg value="%GO%=${distribution.zipfile}" />
331
332                 <arg value="--substitute" />
333                 <arg value="%WAR%=${distribution.warfile}" />
334
335                 <arg value="--substitute" />
f6740d 336                 <arg value="%FEDCLIENT%=${fedclient.zipfile}" />
JM 337
338                 <arg value="--substitute" />
d65f71 339                 <arg value="%MANAGER%=${manager.zipfile}" />
773bb6 340
JM 341                 <arg value="--substitute" />
342                 <arg value="%API%=${gbapi.zipfile}" />
841651 343
JM 344                 <arg value="--substitute" />
b774de 345                 <arg value="%EXPRESS%=${express.zipfile}" />
JM 346
347                 <arg value="--substitute" />
d39680 348                 <arg value="%BUILDDATE%=${gb.versionDate}" />
85c2e6 349
JM 350                 <arg value="--substitute" />
351                 <arg value="%JGIT%=${jgit.version}" />
352
230632 353                 <arg value="--properties" />
85c2e6 354                 <arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
JM 355
230632 356                 <arg value="--nomarkdown" />
JM 357                 <arg value="%BEGINCODE%:%ENDCODE%" />
358
359                 <arg value="--substitute" />
360                 <arg value="&quot;%BEGINCODE%=&lt;pre class='prettyprint lang-java'&gt;&quot;" />
361
362                 <arg value="--substitute" />
363                 <arg value="%ENDCODE%=&lt;/pre&gt;" />
5c563c 364                 
JM 365                 <arg value="--regex" />
366                 <arg value="&quot;\b(issue)(\s*[#]?|-){0,1}(\d+)\b!!!&lt;a href='http://code.google.com/p/gitblit/issues/detail?id=$3'&gt;issue $3&lt;/a&gt;&quot;" />
367         
85c2e6 368             </java>
JM 369     </target>
370     
371                 
372     <!--
373         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
374         Build Gitblit WAR
375         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
376     -->
377     <target name="buildWAR" depends="compile" description="Build Gitblit WAR">
378         
379         <echo>Building Gitblit WAR ${gb.version}</echo>
380         
b774de 381         <delete dir="${project.war.dir}" />
85c2e6 382
93f472 383         <!-- Copy web.xml and users.conf to WEB-INF -->
85c2e6 384         <copy todir="${project.war.dir}/WEB-INF">
JM 385             <fileset dir="${basedir}/distrib">
93f472 386                  <include name="users.conf" />
85c2e6 387             </fileset>
JM 388             <fileset dir="${basedir}/src/WEB-INF">
389                  <include name="web.xml" />
390             </fileset>
7c643b 391             <fileset dir="${basedir}">
JM 392                 <include name="LICENSE" />
393                 <include name="NOTICE" />
394             </fileset>
85c2e6 395         </copy>
JM 396         
97a20e 397         <!-- Copy gitblit.properties as reference.properties -->
JM 398         <copy tofile="${project.war.dir}/WEB-INF/reference.properties" 
399             file="${basedir}/distrib/gitblit.properties"/>
400         
85c2e6 401         <!-- Build the docs for the WAR build -->
JM 402         <antcall target="buildDocs" inheritall="true" inheritrefs="true">
403             <param name="docs.output.dir" value="${project.war.dir}/WEB-INF/docs" />
404         </antcall>
fa54be 405
59ee92 406         <!-- Copy the supported Groovy hook scripts -->
fa54be 407         <mkdir dir="${project.war.dir}/WEB-INF/groovy" />
JM 408         <copy todir="${project.war.dir}/WEB-INF/groovy">
409             <fileset dir="${basedir}/groovy">
59ee92 410                 <include name="sendmail.groovy" />
000bb3 411                 <include name="sendmail-html.groovy" />
59ee92 412                 <include name="jenkins.groovy" />
58a1e4 413                 <include name="protect-refs.groovy" />
a411c8 414                 <include name="localclone.groovy" />
fa54be 415             </fileset>
JM 416         </copy>
417
85c2e6 418         <!-- Build the WAR web.xml from the prototype web.xml and gitblit.properties --> 
22fc5e 419         <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildWebXml">
85c2e6 420             <classpath refid="master-classpath" />
JM 421             
422             <arg value="--sourceFile" />
423             <arg value="${basedir}/src/WEB-INF/web.xml" />
424                     
425             <arg value="--destinationFile" />
426             <arg value="${project.war.dir}/WEB-INF/web.xml" />
427             
428             <arg value="--propertiesFile" />
429             <arg value="${basedir}/distrib/gitblit.properties" />
430         </java>
431
432         <!-- Gitblit resources -->
433         <copy todir="${project.war.dir}">
434             <fileset dir="${project.resources.dir}">
435                 <exclude name="thumbs.db" />
436             </fileset>
437         </copy>
438         
439         <!-- Gitblit library dependencies -->
440         <mkdir dir="${project.war.dir}/WEB-INF/lib"/>
441         <copy todir="${project.war.dir}/WEB-INF/lib">
442             <fileset dir="${basedir}/ext">
5e351a 443                 <exclude name="src/**" />
85c2e6 444                 <exclude name="jcommander*.jar" />
JM 445                 <exclude name="jetty*.jar" />
446                 <exclude name="junit*.jar" />
926f19 447                 <exclude name="hamcrest*.jar" />
85c2e6 448                 <exclude name="servlet*.jar" />
5e43f6 449                 <exclude name="javax.servlet*.jar" />
85c2e6 450             </fileset>
JM 451         </copy>
452
453         <!-- Gitblit classes -->
454         <mkdir dir="${project.war.dir}/WEB-INF/classes"/>
455         <copy todir="${project.war.dir}/WEB-INF/classes">
456             <fileset dir="${project.build.dir}">
b774de 457                 <exclude name="WEB-INF/" />
85c2e6 458                 <exclude name="com/gitblit/tests/" />
22fc5e 459                 <exclude name="com/gitblit/build/**" />
44f2da 460                 <exclude name="com/gitblit/client/**" />
126dde 461                 <exclude name="com/gitblit/AddIndexedBranch*.class" />
85c2e6 462                 <exclude name="com/gitblit/GitBlitServer*.class" />
JM 463                 <exclude name="com/gitblit/Launcher*.class" />
4ad1eb 464                 <exclude name="com/gitblit/authority/**" />
85c2e6 465             </fileset>
JM 466         </copy>
467
468         <!-- Build the WAR file -->
469         <jar basedir="${project.war.dir}" destfile="${distribution.warfile}" compress="true" />
470     </target>
471
472     
85f639 473     <!--
LM 474         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
475         Build Gitblit JAR for usage in other projects plug-ins (i.e. Gerrit)
476         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
477     -->
478     <target name="buildJAR" depends="compile" description="Build Gitblit JAR">
479
480         <echo>Building Gitblit JAR ${gb.version}</echo>
481
482         <delete dir="${project.jar.dir}" />
483
484         <!-- Gitblit classes -->
485         <mkdir dir="${project.jar.dir}"/>
486         <copy todir="${project.jar.dir}">
487             <fileset dir="${project.build.dir}">
488                 <exclude name="WEB-INF/" />
489                 <exclude name="com/gitblit/tests/" />
490                 <exclude name="com/gitblit/build/**" />
491                 <exclude name="com/gitblit/client/**" />
4ad1eb 492                 <exclude name="com/gitblit/authority/**" />
85f639 493                 <exclude name="com/gitblit/AddIndexedBranch*.class" />
LM 494                 <exclude name="com/gitblit/GitBlitServer*.class" />
495                 <exclude name="com/gitblit/Launcher*.class" />
496             </fileset>
497         </copy>
498
499         <!-- Build the JAR file -->
500         <jar basedir="${project.jar.dir}" destfile="${distribution.jarfile}" compress="true" />
501     </target>
502
503     <!--
504         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
505         Build pom.xml for GitBlit JAR Maven module
506         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
507     -->
508     <target name="buildMaven" depends="buildJAR" description="Build pom.xml for Gitblit JAR Maven module">
509         <copy tofile="${distribution.pomfile}" file="${distribution.pomfileTmplt}"/>
510         <replace file="${distribution.pomfile}" token="@gb.version@" value="${gb.version}" />
511     </target>
512
513     <!--
514         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
515         Install Gitblit JAR for usage as Maven module
516         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
517     -->
518     <target name="installMaven" depends="buildMaven" description="Install Gitblit JAR as Maven module">
519         <exec executable="mvn">
520             <arg value="install:install-file" />
521             <arg value="-Dfile=${distribution.jarfile}" />
522             <arg value="-DpomFile=${distribution.pomfile}" />
523             <arg value="-DcreateChecksum=true" />
524         </exec>
525     </target>
526
527     <!--
528         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
529         Upload Gitblit JAR to remote Maven repository
530         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
531     -->
532     <target name="uploadMaven" depends="buildJAR" description="Upload Gitblit JAR to remote Maven repository">
533         <exec executable="mvn">
534             <arg value="deploy:deploy-file" />
535             <arg value="-Dfile=${distribution.jarfile}" />
536             <arg value="-DpomFile=${distribution.pomfile}" />
537             <arg value="-Durl=${project.maven.repo.url}" />
538             <arg value="-DrepositoryId=${project.maven.repo.id}" />
539             <arg value="-DcreateChecksum=true" />
540         </exec>
541     </target>
542
f6740d 543     <!-- 
JM 544         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
545         Build the stand-alone, command-line Gitblit Federation Client
546         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
547     -->
548     <target name="buildFederationClient" depends="compile" description="Builds the stand-alone Gitblit federation client">
549         <echo>Building Gitblit Federation Client ${gb.version}</echo>
550     
551         <genjar jarfile="fedclient.jar">
552             <class name="com.gitblit.FederationClientLauncher" />
553             <resource file="${project.build.dir}/log4j.properties" />
554             <classfilter>
555                 <exclude name="org.apache." />
556                 <exclude name="org.bouncycastle." />
557                 <exclude name="org.eclipse." />
558                 <exclude name="org.slf4j." />
559                 <exclude name="com.beust." />
560                 <exclude name="com.google." />
1b437a 561                 <exclude name="com.unboundid." />
f6740d 562             </classfilter>
JM 563             <classpath refid="master-classpath" />
564             <manifest>
565                 <attribute name="Main-Class" value="com.gitblit.FederationClientLauncher" />
773bb6 566                 <attribute name="Specification-Version" value="${gb.version}" />
f6740d 567                 <attribute name="Release-Date" value="${gb.versionDate}" />
JM 568             </manifest>
569         </genjar>
570         
571         <!-- Build the federation client zip file -->
572         <zip destfile="${fedclient.zipfile}">
573             <fileset dir="${basedir}">
773bb6 574                 <include name="fedclient.jar" />
d65f71 575                 <include name="LICENSE" />
JM 576                 <include name="NOTICE" />
f6740d 577             </fileset>
JM 578             <fileset dir="${basedir}/distrib">
773bb6 579                 <include name="federation.properties" />
f6740d 580             </fileset>
JM 581         </zip>
582     </target>
583
841651 584
JM 585     <!-- 
586         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
b774de 587         Build a Gitblit filesystem for deployment to RedHat OpenShif Expresst
JM 588         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
589     -->
9be337 590     <target name="buildExpress" depends="compile" description="Build exploded WAR file suitable for deployment to OpenShift Express">
b774de 591         <echo>Building Gitblit Express for RedHat OpenShift ${gb.version}</echo>
JM 592         
593         <delete dir="${project.express.dir}" />
594         
595         <!-- Create the OpenShift filesystem -->
596         <property name="deployments.root" value="${project.express.dir}/deployments/ROOT.war"/>
597         <mkdir dir="${deployments.root}" />
598         <touch file="${project.express.dir}/deployments/ROOT.war.dodeploy" />
599
600         <!-- Copy the Gitblit OpenShift readme file -->
601         <copy tofile="${project.express.dir}/README.gitblit" 
602             file="${basedir}/distrib/openshift.mkd"/>
603
604         <!-- Copy LICENSE and NOTICE to WEB-INF -->
605         <copy todir="${deployments.root}/WEB-INF">
606             <fileset dir="${basedir}">
607                 <include name="LICENSE" />
608                 <include name="NOTICE" />
609             </fileset>
610         </copy>
611
612         <!-- Copy gitblit.properties as reference.properties -->
613         <copy tofile="${deployments.root}/WEB-INF/reference.properties" 
614             file="${basedir}/distrib/gitblit.properties"/>
615
e36d4d 616         <!-- Copy the supported Groovy hook scripts -->
JM 617         <mkdir dir="${deployments.root}/WEB-INF/groovy" />
618         <copy todir="${deployments.root}/WEB-INF/groovy">
619             <fileset dir="${basedir}/groovy">
620                 <include name="sendmail.groovy" />
000bb3 621                 <include name="sendmail-html.groovy" />
e36d4d 622                 <include name="jenkins.groovy" />
58a1e4 623                 <include name="protect-refs.groovy" />
e36d4d 624             </fileset>
JM 625         </copy>
626                     
b774de 627         <!-- Build the WAR web.xml from the prototype web.xml and gitblit.properties -->
JM 628         <!-- THIS FILE IS NOT OVERRIDDEN ONCE IT IS BUILT!!! -->
629         <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildWebXml">
630             <classpath refid="master-classpath" />
631
632             <arg value="--sourceFile" />
633             <arg value="${basedir}/src/WEB-INF/web.xml" />
634
635             <arg value="--destinationFile" />
636             <arg value="${deployments.root}/WEB-INF/web.xml" />
637
638             <arg value="--propertiesFile" />
639             <arg value="${basedir}/distrib/gitblit.properties" />
640         </java>
641
642         <!-- Gitblit resources -->
643         <copy todir="${deployments.root}">
644             <fileset dir="${project.resources.dir}">
645                 <exclude name="thumbs.db" />
646             </fileset>
647         </copy>
648
649         <!-- Gitblit library dependencies -->
650         <mkdir dir="${deployments.root}/WEB-INF/lib"/>
651         <copy todir="${deployments.root}/WEB-INF/lib">
652             <fileset dir="${basedir}/ext">
5e351a 653                 <exclude name="src/**" />
b774de 654                 <exclude name="jcommander*.jar" />
JM 655                 <exclude name="jetty*.jar" />
656                 <exclude name="junit*.jar" />
926f19 657                 <exclude name="hamcrest*.jar" />
b774de 658                 <exclude name="servlet*.jar" />
5e43f6 659                 <exclude name="javax.servlet*.jar" />
b774de 660             </fileset>
JM 661         </copy>
662
663         <!-- Gitblit classes -->
764d94 664         <jar destfile="${deployments.root}/WEB-INF/lib/gitblit-${gb.version}.jar">
b774de 665             <fileset dir="${project.build.dir}">
JM 666                 <exclude name="WEB-INF/" />
667                 <exclude name="com/gitblit/tests/" />
668                 <exclude name="com/gitblit/build/**" />
669                 <exclude name="com/gitblit/client/**" />
670                 <exclude name="com/gitblit/GitBlitServer*.class" />
671                 <exclude name="com/gitblit/Launcher*.class" />
4ad1eb 672                 <exclude name="com/gitblit/authority/**" />
b774de 673             </fileset>
764d94 674         </jar>
b774de 675
JM 676         <!-- Build Express Zip file -->
677         <zip destfile="${express.zipfile}">
678             <fileset dir="${project.express.dir}" />
679         </zip>
680
681     </target>
682
683
684     <!-- 
685         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a7a9f7 686         Build the stand-alone, Gitblit Manager
841651 687         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JM 688     -->
a7a9f7 689     <target name="buildManager" depends="compile" description="Builds the stand-alone Gitblit Manager">
JM 690         <echo>Building Gitblit Manager ${gb.version}</echo>
b774de 691
712210 692         <genjar jarfile="manager-${gb.version}.jar">
841651 693             <resource file="${basedir}/src/com/gitblit/client/splash.png" />
JM 694             <resource file="${basedir}/resources/gitblt-favicon.png" />
ee25c8 695             <resource file="${basedir}/resources/gitweb-favicon.png" />
0cf876 696             <resource file="${basedir}/resources/git-orange-16x16.png" />
ee25c8 697             <resource file="${basedir}/resources/user_16x16.png" />
04627e 698             <resource file="${basedir}/resources/users_16x16.png" />
ee25c8 699             <resource file="${basedir}/resources/settings_16x16.png" />
841651 700             <resource file="${basedir}/resources/lock_go_16x16.png" />
JM 701             <resource file="${basedir}/resources/lock_pull_16x16.png" />
702             <resource file="${basedir}/resources/shield_16x16.png" />
703             <resource file="${basedir}/resources/federated_16x16.png" />
704             <resource file="${basedir}/resources/cold_16x16.png" />
705             <resource file="${basedir}/resources/book_16x16.png" />
706             <resource file="${basedir}/resources/bug_16x16.png" />
a70b43 707             <resource file="${basedir}/resources/health_16x16.png" />
4cac0d 708             <resource file="${basedir}/resources/feed_16x16.png" />
JM 709             <resource file="${basedir}/resources/bullet_feed.png" />
9119cf 710             <resource file="${basedir}/resources/search-icon.png" />
ee458f 711             <resource file="${basedir}/resources/commit_changes_16x16.png" />
c7e7e9 712             <resource file="${basedir}/resources/commit_merge_16x16.png" />
c25b98 713             <resource file="${basedir}/resources/commit_divide_16x16.png" />
841651 714             <resource file="${basedir}/resources/blank.png" />
b7f591 715             <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp.properties" />
c890e1 716             <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_es.properties" />
df35ad 717             <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_ja.properties" />
c890e1 718             <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_ko.properties" />
JM 719             <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_pl.properties" />
b774de 720
a7a9f7 721             <class name="com.gitblit.client.GitblitManagerLauncher" />
841651 722             <classfilter>
JM 723                 <exclude name="org.apache." />
724                 <exclude name="org.bouncycastle." />
725                 <exclude name="org.eclipse." />
726                 <exclude name="org.slf4j." />
727                 <exclude name="com.beust." />
728                 <exclude name="com.google." />
1b437a 729                 <exclude name="com.unboundid." />
841651 730             </classfilter>
JM 731             <classpath refid="master-classpath" />
732             <manifest>
a7a9f7 733                 <attribute name="Main-Class" value="com.gitblit.client.GitblitManagerLauncher" />
841651 734                 <attribute name="SplashScreen-Image" value="splash.png" />
773bb6 735                 <attribute name="Specification-Version" value="${gb.version}" />
841651 736                 <attribute name="Release-Date" value="${gb.versionDate}" />
JM 737             </manifest>
738         </genjar>
b774de 739
d65f71 740         <!-- Build Manager Zip file -->
JM 741         <zip destfile="${manager.zipfile}">
742             <fileset dir="${basedir}">
743                 <include name="manager-${gb.version}.jar" />
744                 <include name="LICENSE" />
745                 <include name="NOTICE" />
746             </fileset>
747         </zip>
841651 748     </target>
773bb6 749     
4ad1eb 750     
773bb6 751     <!-- 
4ad1eb 752         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JM 753         Build the stand-alone, Gitblit Authority
754         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
755     -->
756     <target name="buildAuthority" depends="compile" description="Builds the stand-alone Gitblit Authority">
757         <echo>Building Gitblit Authority ${gb.version}</echo>
758
759         <genjar jarfile="authority-${gb.version}.jar">
760             <resource file="${basedir}/src/com/gitblit/client/splash.png" />
761             <resource file="${basedir}/resources/gitblt-favicon.png" />
762             <resource file="${basedir}/resources/user_16x16.png" />
763             <resource file="${basedir}/resources/users_16x16.png" />
764             <resource file="${basedir}/resources/rosette_16x16.png" />
765             <resource file="${basedir}/resources/vcard_16x16.png" />
766             <resource file="${basedir}/resources/settings_16x16.png" />
c8b26c 767             <resource file="${basedir}/resources/settings_32x32.png" />
4ad1eb 768             <resource file="${basedir}/resources/search-icon.png" />
e571c4 769             <resource file="${basedir}/resources/mail_16x16.png" />
6e9911 770             <resource file="${basedir}/resources/script_16x16.png" />
4ad1eb 771             <resource file="${basedir}/resources/blank.png" />
JM 772             <resource file="${basedir}/resources/bullet_green.png" />
773             <resource file="${basedir}/resources/bullet_orange.png" />
774             <resource file="${basedir}/resources/bullet_red.png" />
775             <resource file="${basedir}/resources/bullet_white.png" />
776             <resource file="${basedir}/resources/bullet_delete.png" />
777             <resource file="${basedir}/resources/bullet_key.png" />
c8b26c 778             <resource file="${basedir}/src/log4j.properties" />
4ad1eb 779             <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp.properties" />
JM 780             <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_es.properties" />
781             <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_ja.properties" />
782             <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_ko.properties" />
783             <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp_pl.properties" />
784
785             <class name="com.gitblit.authority.GitblitAuthorityLauncher" />
786             <classfilter>
787                 <exclude name="org.apache." />
788                 <exclude name="org.bouncycastle." />
789                 <exclude name="org.eclipse." />
790                 <exclude name="org.slf4j." />
791                 <exclude name="com.beust." />
792                 <exclude name="com.google." />
793                 <exclude name="com.unboundid." />
794             </classfilter>
795             <classpath refid="master-classpath" />
796             <manifest>
797                 <attribute name="Main-Class" value="com.gitblit.authority.GitblitAuthorityLauncher" />
798                 <attribute name="SplashScreen-Image" value="splash.png" />
799                 <attribute name="Specification-Version" value="${gb.version}" />
800                 <attribute name="Release-Date" value="${gb.versionDate}" />
801             </manifest>
802         </genjar>
803
804         <!-- Build Authority Zip file -->
805         <zip destfile="${authority.zipfile}">
806             <fileset dir="${basedir}">
807                 <include name="authority-${gb.version}.jar" />
808                 <include name="LICENSE" />
809                 <include name="NOTICE" />
810             </fileset>
811             <zipfileset dir="${basedir}/distrib" prefix="certs">
812                 <include name="authority.conf" />
813                 <include name="mail.tmpl" />
814                 <include name="instructions.tmpl" />
815             </zipfileset>
816         </zip>
817     </target>
818                     
819     <!-- 
820         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
821         Build the Gitblit API client library
822         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
823     -->
824     <target name="buildApiLibrary" depends="compile" description="Builds the Gitblit RPC client library">
825         <echo>Building Gitblit API Library ${gb.version}</echo>
826     
827         <!-- Build API Library jar -->
828         <genjar jarfile="gbapi-${gb.version}.jar">
829             <class name="com.gitblit.Keys" />
830             <class name="com.gitblit.client.GitblitClient" />
831             <classpath refid="master-classpath" />
832             <classfilter>
833                 <exclude name="com.google.gson." />
834                 <exclude name="com.sun.syndication." />
835             </classfilter>
836             <manifest>
837                 <attribute name="Specification-Version" value="${gb.version}" />
838                 <attribute name="Release-Date" value="${gb.versionDate}" />
839             </manifest>
840         </genjar>
773bb6 841         
4ad1eb 842         <!-- Build API sources jar -->
JM 843         <zip destfile="gbapi-${gb.version}-sources.jar">
844             <fileset dir="${basedir}/src" defaultexcludes="yes">
845                 <include name="com/gitblit/Constants.java"/>
846                 <include name="com/gitblit/GitBlitException.java"/>
847                 <include name="com/gitblit/Keys.java"/>
848                   <include name="com/gitblit/client/**/*.java"/>
849                   <include name="com/gitblit/models/**/*.java"/>
850                   <include name="com/gitblit/utils/**/*.java"/>                      
851             </fileset>
852         </zip>
853         
854         <!-- Build API JavaDoc jar -->
855         <javadoc destdir="${basedir}/javadoc">
856             <fileset dir="${basedir}/src" defaultexcludes="yes">
857                 <include name="com/gitblit/Constants.java"/>
858                 <include name="com/gitblit/GitBlitException.java"/>
859                 <include name="com/gitblit/Keys.java"/>
860                   <include name="com/gitblit/client/**/*.java"/>
861                   <include name="com/gitblit/models/**/*.java"/>
862                   <include name="com/gitblit/utils/**/*.java"/>                      
863             </fileset>
864         </javadoc>
865         <zip destfile="gbapi-${gb.version}-javadoc.jar">
866             <fileset dir="${basedir}/javadoc" />
867         </zip>
868         
869         <!-- Build the API library zip file -->
870         <zip destfile="${gbapi.zipfile}">
871             <fileset dir="${basedir}">
872                 <include name="gbapi-${gb.version}.jar" />
873                 <include name="gbapi-${gb.version}-sources.jar" />
874                 <include name="gbapi-${gb.version}-javadoc.jar" />
875                 <include name="LICENSE" />
876                 <include name="NOTICE" />
877             </fileset>
878             <fileset dir="${basedir}/ext">
879                 <exclude name="src/**" />
880                 <include name="gson*.jar" />
881                 <include name="rome*.jar" />
882                 <include name="jdom*.jar" />
883             </fileset>
884         </zip>
885     </target>
841651 886         
f6740d 887         
85c2e6 888     <!-- 
JM 889         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
890         Build the Gitblit Website
891         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
892     -->
893     <target name="buildSite" depends="compile" description="Build the Gitblit website">
894         
895         <echo>Building Gitblit Website ${gb.version}</echo>
896
dd7961 897         <!-- Build Site -->
85c2e6 898         <delete dir="${project.site.dir}" />
JM 899         <mkdir dir="${project.site.dir}" />
900         <copy todir="${project.site.dir}">
f13c4c 901             <!-- Copy selected Gitblit resources -->
5450d0 902             <fileset dir="${project.resources.dir}">
3cc6e2 903                 <include name="bootstrap/**/*" />
JM 904                 <include name="gitblit.css" />
8c5d72 905                 <include name="gitblt_25_white.png" />
dd7961 906                 <include name="gitblt-favicon.png" />
f90dc6 907                 <include name="lock_go_16x16.png" />
JM 908                 <include name="lock_pull_16x16.png" />
909                 <include name="shield_16x16.png" />
910                 <include name="cold_16x16.png" />
911                 <include name="bug_16x16.png" />
912                 <include name="book_16x16.png" />
913                 <include name="blank.png" />
831469 914                 <include name="federated_16x16.png" />
0aa6ec 915                 <include name="arrow_page.png" />
dd7961 916             </fileset>
a4d249 917
f90dc6 918             <!-- Copy Doc images -->
dd7961 919             <fileset dir="${basedir}/docs">
f90dc6 920                 <include name="*.png" />
f35a98 921                 <include name="*.gif" />
f90dc6 922                 <include name="*.js" />
JM 923             </fileset>
924         </copy>
a4d249 925
f90dc6 926         <!-- Copy Fancybox -->
85c2e6 927         <mkdir dir="${project.site.dir}/fancybox" />
JM 928         <copy todir="${project.site.dir}/fancybox">
a4d249 929             <fileset dir="${basedir}/docs/fancybox">
f90dc6 930                 <exclude name="thumbs.db" />
JM 931             </fileset>
932         </copy>
a4d249 933
230632 934         <!-- Copy google-code-prettify -->
JM 935         <mkdir dir="${basedir}/src/com/gitblit/wicket/pages/prettify" />
936         <copy todir="${project.site.dir}/prettify">
937             <fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
938                 <exclude name="thumbs.db" />
939             </fileset>
940         </copy>
941
24d08f 942         <!-- Generate thumbnails of screenshots -->
22fc5e 943         <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildThumbnails">
24d08f 944             <classpath refid="master-classpath" />
JM 945                 
946             <arg value="--sourceFolder" />
947             <arg value="${basedir}/docs/screenshots" />
948         
949             <arg value="--destinationFolder" />
85c2e6 950             <arg value="${project.site.dir}/thumbs" />
24d08f 951             
JM 952             <arg value="--maximumDimension" />
953             <arg value="250" />
954         </java>
a4d249 955
f90dc6 956         <!-- Copy screenshots -->
85c2e6 957         <mkdir dir="${project.site.dir}/screenshots" />
JM 958         <copy todir="${project.site.dir}/screenshots">
f90dc6 959             <fileset dir="${basedir}/docs/screenshots">
JM 960                 <include name="*.png" />
961             </fileset>
962         </copy>
963
a4d249 964         <!-- Build site pages -->
22fc5e 965         <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildSite">
dd7961 966             <classpath refid="master-classpath" />
JM 967             <arg value="--sourceFolder" />
968             <arg value="${basedir}/docs" />
a4d249 969
dd7961 970             <arg value="--outputFolder" />
85c2e6 971             <arg value="${project.site.dir}" />
dd7961 972
JM 973             <arg value="--pageHeader" />
81f881 974             <arg value="${basedir}/docs/site_header.html" />
e7a153 975             
dd7961 976             <arg value="--pageFooter" />
81f881 977             <arg value="${basedir}/docs/site_footer.html" />
a4d249 978
e7a153 979             <arg value="--analyticsSnippet" />
JM 980             <arg value="${basedir}/docs/site_analytics.html" />
981                 
982             <arg value="--adSnippet" />
983             <arg value="${basedir}/docs/site_ads.html" />
984
e0054b 985             <arg value="--alias" />
JM 986             <arg value="index=overview" />
424fe1 987
1f9dae 988             <arg value="--alias" />
4c835e 989             <arg value="properties=settings" />
a4d249 990
JM 991             <arg value="--substitute" />
992             <arg value="%VERSION%=${gb.version}" />
993
994             <arg value="--substitute" />
85c2e6 995             <arg value="%GO%=${distribution.zipfile}" />
JM 996
997             <arg value="--substitute" />
998             <arg value="%WAR%=${distribution.warfile}" />
a4d249 999
JM 1000             <arg value="--substitute" />
f6740d 1001             <arg value="%FEDCLIENT%=${fedclient.zipfile}" />
JM 1002
1003             <arg value="--substitute" />
d65f71 1004             <arg value="%MANAGER%=${manager.zipfile}" />
773bb6 1005
JM 1006             <arg value="--substitute" />
1007             <arg value="%API%=${gbapi.zipfile}" />
841651 1008
JM 1009             <arg value="--substitute" />
b774de 1010             <arg value="%EXPRESS%=${express.zipfile}" />
JM 1011
1012             <arg value="--substitute" />
d39680 1013             <arg value="%BUILDDATE%=${gb.versionDate}" />
a4d249 1014
JM 1015             <arg value="--substitute" />
1016             <arg value="%JGIT%=${jgit.version}" />
1f9dae 1017
a3f474 1018             <arg value="--properties" />
1f9dae 1019             <arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
230632 1020             
JM 1021             <arg value="--nomarkdown" />
1022             <arg value="%BEGINCODE%:%ENDCODE%" />
1023
1024             <arg value="--substitute" />
1025             <arg value="&quot;%BEGINCODE%=&lt;pre class='prettyprint lang-java'&gt;&quot;" />
1026
1027             <arg value="--substitute" />
1028             <arg value="%ENDCODE%=&lt;/pre&gt;" />
1f9dae 1029
5c563c 1030             <arg value="--regex" />
JM 1031             <arg value="&quot;\b(issue)(\s*[#]?|-){0,1}(\d+)\b!!!&lt;a href='http://code.google.com/p/gitblit/issues/detail?id=$3'&gt;issue $3&lt;/a&gt;&quot;" />
1032
a3f474 1033         </java>    
85c2e6 1034     </target>
b774de 1035
424fe1 1036
85c2e6 1037     <!--
JM 1038         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
1039         Compile from source, publish binaries, and build & deploy site
1040         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1041     -->
4ad1eb 1042     <target name="buildAll" depends="buildAuthority,buildGO,buildWAR,buildExpress,buildFederationClient,buildManager,buildApiLibrary,buildSite">        
1f9dae 1043         <!-- Cleanup -->
2a7306 1044         <delete dir="${project.build.dir}" />
85c2e6 1045         <delete dir="${project.war.dir}" />
JM 1046         <delete dir="${project.deploy.dir}" />
b774de 1047         <delete dir="${project.express.dir}" />
5fe7df 1048     </target>
b774de 1049
746aaf 1050     
JM 1051     <!--
1052         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
1053         Update the gh-pages branch with the current site
1054         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1055     -->
1056     <target name="updateGhPages" depends="buildSite">
1057         <!-- Build gh-pages branch -->
1058         <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildGhPages">
1059             <classpath refid="master-classpath" />
1060             <arg value="--sourceFolder" />
1061             <arg value="${basedir}/site" />
1062
1063             <arg value="--repository" />
1064             <arg value="${basedir}" />
1065             
1066             <arg value="--obliterate" />
1067         </java>
1068     </target>
1069     
b774de 1070
85c2e6 1071     <!-- 
JM 1072         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1073         Publish binaries to Google Code
1074         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1075     -->
a48c33 1076     <target name="publishBinaries" depends="buildGO,buildWAR,buildExpress,buildFederationClient,buildManager,buildApiLibrary" description="Publish the Gitblit binaries to Google Code">
b774de 1077
85c2e6 1078         <echo>Uploading Gitblit ${gb.version} binaries</echo>
b774de 1079
773bb6 1080         <!-- Upload Gitblit GO ZIP file -->
85c2e6 1081         <gcupload 
JM 1082              username="${googlecode.user}" 
1083              password="${googlecode.password}" 
1084              projectname="gitblit" 
1085              filename="${distribution.zipfile}" 
1086              targetfilename="gitblit-${gb.version}.zip"
ed21d2 1087              summary="Gitblit GO v${gb.version} (standalone, integrated Gitblit server)"
85c2e6 1088              labels="Featured, Type-Package, OpSys-All" />
b774de 1089
773bb6 1090         <!-- Upload Gitblit WAR file -->
85c2e6 1091         <gcupload 
JM 1092              username="${googlecode.user}" 
1093              password="${googlecode.password}" 
1094              projectname="gitblit" 
1095              filename="${distribution.warfile}" 
1096              targetfilename="gitblit-${gb.version}.war"
ed21d2 1097              summary="Gitblit WAR v${gb.version} (standard WAR webapp for servlet containers)"
85c2e6 1098              labels="Featured, Type-Package, OpSys-All" />
b774de 1099
773bb6 1100         <!-- Upload Gitblit FedClient -->
f6740d 1101         <gcupload 
JM 1102             username="${googlecode.user}" 
1103             password="${googlecode.password}" 
1104             projectname="gitblit" 
1105             filename="${fedclient.zipfile}" 
1106             targetfilename="fedclient-${gb.version}.zip"
1107             summary="Gitblit Federation Client v${gb.version} (command-line tool to clone data from federated Gitblit instances)"
1108             labels="Featured, Type-Package, OpSys-All" />
841651 1109
773bb6 1110         <!-- Upload Gitblit Manager -->
841651 1111         <gcupload 
JM 1112             username="${googlecode.user}" 
1113             password="${googlecode.password}" 
1114             projectname="gitblit" 
d65f71 1115             filename="${manager.zipfile}" 
JM 1116             targetfilename="manager-${gb.version}.zip"
a7a9f7 1117             summary="Gitblit Manager v${gb.version} (Swing tool to remotely administer a Gitblit server)"
4ad1eb 1118             labels="Featured, Type-Package, OpSys-All" />
JM 1119
773bb6 1120         <!-- Upload Gitblit API Library -->
JM 1121         <gcupload 
1122             username="${googlecode.user}" 
1123             password="${googlecode.password}" 
1124             projectname="gitblit" 
1125             filename="${gbapi.zipfile}" 
1126             targetfilename="gbapi-${gb.version}.zip"
1127             summary="Gitblit API Library v${gb.version} (JSON RPC library to integrate with your software)"
841651 1128             labels="Featured, Type-Package, OpSys-All" />
b774de 1129
JM 1130         <!-- Upload Gitblit Express for RedHat OpenShift -->
1131         <gcupload 
1132             username="${googlecode.user}" 
1133             password="${googlecode.password}" 
1134             projectname="gitblit" 
1135             filename="${express.zipfile}" 
1136             targetfilename="express-${gb.version}.zip"
1137             summary="Gitblit Express v${gb.version} (run Gitblit on RedHat's OpenShift cloud)"
1138             labels="Featured, Type-Package, OpSys-All" />
1139
5450d0 1140     </target>
JM 1141
b774de 1142
85c2e6 1143     <!--
JM 1144         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
b774de 1145         Publish site to site hosting service
85c2e6 1146         You must add ext/commons-net-1.4.0.jar to your ANT classpath.
JM 1147         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1148     -->
746aaf 1149     <target name="publishSite" depends="buildSite,updateGhPages" description="Publish the Gitblit site to a webserver (requires ext/commons-net-1.4.0.jar)" >
b774de 1150
85c2e6 1151         <echo>Uploading Gitblit ${gb.version} website</echo>
b774de 1152
81f881 1153         <ftp server="${ftp.server}"
JM 1154             userid="${ftp.user}"
1155             password="${ftp.password}"
1156             remotedir="${ftp.dir}"
1157             passive="true"
1158             verbose="yes">
85c2e6 1159         <fileset dir="${project.site.dir}" />
81f881 1160         </ftp>
JM 1161     </target>
85c2e6 1162
b774de 1163
85c2e6 1164     <!--
JM 1165         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
1166         Compile from source, publish binaries, and build & deploy site
1167         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1168     -->
773bb6 1169     <target name="publishAll" depends="publishBinaries,publishSite">
85c2e6 1170         <!-- Cleanup -->
JM 1171         <delete dir="${project.build.dir}" />
1172         <delete dir="${project.war.dir}" />
1173         <delete dir="${project.deploy.dir}" />
1174     </target>
764d94 1175 </project>