You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 42KB

13 years ago
12 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
Ticket tracker with patchset contributions A basic issue tracker styled as a hybrid of GitHub and BitBucket issues. You may attach commits to an existing ticket or you can push a single commit to create a *proposal* ticket. Tickets keep track of patchsets (one or more commits) and allow patchset rewriting (rebase, amend, squash) by detecing the non-fast-forward update and assigning a new patchset number to the new commits. Ticket tracker -------------- The ticket tracker stores tickets as an append-only journal of changes. The journals are deserialized and a ticket is built by applying the journal entries. Tickets are indexed using Apache Lucene and all queries and searches are executed against this Lucene index. There is one trade-off to this persistence design: user attributions are non-relational. What does that mean? Each journal entry stores the username of the author. If the username changes in the user service, the journal entry will not reflect that change because the values are hard-coded. Here are a few reasons/justifications for this design choice: 1. commit identifications (author, committer, tagger) are non-relational 2. maintains the KISS principle 3. your favorite text editor can still be your administration tool Persistence Choices ------------------- **FileTicketService**: stores journals on the filesystem **BranchTicketService**: stores journals on an orphan branch **RedisTicketService**: stores journals in a Redis key-value datastore It should be relatively straight-forward to develop other backends (MongoDB, etc) as long as the journal design is preserved. Pushing Commits --------------- Each push to a ticket is identified as a patchset revision. A patchset revision may add commits to the patchset (fast-forward) OR a patchset revision may rewrite history (rebase, squash, rebase+squash, or amend). Patchset authors should not be afraid to polish, revise, and rewrite their code before merging into the proposed branch. Gitblit will create one ref for each patchset. These refs are updated for fast-forward pushes or created for rewrites. They are formatted as `refs/tickets/{shard}/{id}/{patchset}`. The *shard* is the last two digits of the id. If the id < 10, prefix a 0. The *shard* is always two digits long. The shard's purpose is to ensure Gitblit doesn't exceed any filesystem directory limits for file creation. **Creating a Proposal Ticket** You may create a new change proposal ticket just by pushing a **single commit** to `refs/for/{branch}` where branch is the proposed integration branch OR `refs/for/new` or `refs/for/default` which both will use the default repository branch. git push origin HEAD:refs/for/new **Updating a Patchset** The safe way to update an existing patchset is to push to the patchset ref. git push origin HEAD:refs/heads/ticket/{id} This ensures you do not accidentally create a new patchset in the event that the patchset was updated after you last pulled. The not-so-safe way to update an existing patchset is to push using the magic ref. git push origin HEAD:refs/for/{id} This push ref will update an exisitng patchset OR create a new patchset if the update is non-fast-forward. **Rebasing, Squashing, Amending** Gitblit makes rebasing, squashing, and amending patchsets easy. Normally, pushing a non-fast-forward update would require rewind (RW+) repository permissions. Gitblit provides a magic ref which will allow ticket participants to rewrite a ticket patchset as long as the ticket is open. git push origin HEAD:refs/for/{id} Pushing changes to this ref allows the patchset authors to rebase, squash, or amend the patchset commits without requiring client-side use of the *--force* flag on push AND without requiring RW+ permission to the repository. Since each patchset is tracked with a ref it is easy to recover from accidental non-fast-forward updates. Features -------- - Ticket tracker with status changes and responsible assignments - Patchset revision scoring mechanism - Update/Rewrite patchset handling - Close-on-push detection - Server-side Merge button for simple merges - Comments with Markdown syntax support - Rich mail notifications - Voting - Mentions - Watch lists - Querying - Searches - Partial miletones support - Multiple backend options
10 years ago
11 years ago
13 years ago
13 years ago
13 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
Ticket tracker with patchset contributions A basic issue tracker styled as a hybrid of GitHub and BitBucket issues. You may attach commits to an existing ticket or you can push a single commit to create a *proposal* ticket. Tickets keep track of patchsets (one or more commits) and allow patchset rewriting (rebase, amend, squash) by detecing the non-fast-forward update and assigning a new patchset number to the new commits. Ticket tracker -------------- The ticket tracker stores tickets as an append-only journal of changes. The journals are deserialized and a ticket is built by applying the journal entries. Tickets are indexed using Apache Lucene and all queries and searches are executed against this Lucene index. There is one trade-off to this persistence design: user attributions are non-relational. What does that mean? Each journal entry stores the username of the author. If the username changes in the user service, the journal entry will not reflect that change because the values are hard-coded. Here are a few reasons/justifications for this design choice: 1. commit identifications (author, committer, tagger) are non-relational 2. maintains the KISS principle 3. your favorite text editor can still be your administration tool Persistence Choices ------------------- **FileTicketService**: stores journals on the filesystem **BranchTicketService**: stores journals on an orphan branch **RedisTicketService**: stores journals in a Redis key-value datastore It should be relatively straight-forward to develop other backends (MongoDB, etc) as long as the journal design is preserved. Pushing Commits --------------- Each push to a ticket is identified as a patchset revision. A patchset revision may add commits to the patchset (fast-forward) OR a patchset revision may rewrite history (rebase, squash, rebase+squash, or amend). Patchset authors should not be afraid to polish, revise, and rewrite their code before merging into the proposed branch. Gitblit will create one ref for each patchset. These refs are updated for fast-forward pushes or created for rewrites. They are formatted as `refs/tickets/{shard}/{id}/{patchset}`. The *shard* is the last two digits of the id. If the id < 10, prefix a 0. The *shard* is always two digits long. The shard's purpose is to ensure Gitblit doesn't exceed any filesystem directory limits for file creation. **Creating a Proposal Ticket** You may create a new change proposal ticket just by pushing a **single commit** to `refs/for/{branch}` where branch is the proposed integration branch OR `refs/for/new` or `refs/for/default` which both will use the default repository branch. git push origin HEAD:refs/for/new **Updating a Patchset** The safe way to update an existing patchset is to push to the patchset ref. git push origin HEAD:refs/heads/ticket/{id} This ensures you do not accidentally create a new patchset in the event that the patchset was updated after you last pulled. The not-so-safe way to update an existing patchset is to push using the magic ref. git push origin HEAD:refs/for/{id} This push ref will update an exisitng patchset OR create a new patchset if the update is non-fast-forward. **Rebasing, Squashing, Amending** Gitblit makes rebasing, squashing, and amending patchsets easy. Normally, pushing a non-fast-forward update would require rewind (RW+) repository permissions. Gitblit provides a magic ref which will allow ticket participants to rewrite a ticket patchset as long as the ticket is open. git push origin HEAD:refs/for/{id} Pushing changes to this ref allows the patchset authors to rebase, squash, or amend the patchset commits without requiring client-side use of the *--force* flag on push AND without requiring RW+ permission to the repository. Since each patchset is tracked with a ref it is easy to recover from accidental non-fast-forward updates. Features -------- - Ticket tracker with status changes and responsible assignments - Patchset revision scoring mechanism - Update/Rewrite patchset handling - Close-on-push detection - Server-side Merge button for simple merges - Comments with Markdown syntax support - Rich mail notifications - Voting - Mentions - Watch lists - Querying - Searches - Partial miletones support - Multiple backend options
10 years ago
11 years ago
11 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="gitblit" default="compile" xmlns:mx="antlib:org.moxie">
  3. <!--
  4. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. Retrieve Moxie Toolkit
  6. documentation @ http://gitblit.github.io/moxie
  7. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. -->
  9. <property name="moxie.version" value="0.9.1" />
  10. <property name="moxie.url" value="http://gitblit.github.io/moxie/maven" />
  11. <property name="moxie.jar" value="moxie-toolkit-${moxie.version}.jar" />
  12. <property name="moxie.dir" value="${user.home}/.moxie" />
  13. <!-- Download Moxie from it's Maven repository to user.home -->
  14. <mkdir dir="${moxie.dir}" />
  15. <get src="${moxie.url}/com/gitblit/moxie/moxie-toolkit/${moxie.version}/${moxie.jar}"
  16. dest="${moxie.dir}" skipexisting="true" verbose="true" />
  17. <!-- Register Moxie tasks -->
  18. <taskdef uri="antlib:org.moxie">
  19. <classpath location="${moxie.dir}/${moxie.jar}" />
  20. </taskdef>
  21. <!-- Project directories -->
  22. <property name="project.src.dir" value="${basedir}/src/main/java" />
  23. <property name="project.resources.dir" value="${basedir}/src/main/resources" />
  24. <property name="project.distrib.dir" value="${basedir}/src/main/distrib" />
  25. <!--
  26. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  27. Initialize Moxie and setup build properties
  28. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  29. -->
  30. <target name="prepare">
  31. <!-- Setup Ant build from build.moxie and resolve dependencies.
  32. If it exists, build.properties is automatically loaded.
  33. Explicitly set mxroot allowing CI servers to override the default. -->
  34. <mx:init verbose="no" mxroot="${moxie.dir}" />
  35. <!-- Set Ant project properties -->
  36. <property name="distribution.zipfile" value="gitblit-${project.version}.zip" />
  37. <property name="distribution.tgzfile" value="gitblit-${project.version}.tar.gz" />
  38. <property name="distribution.warfile" value="gitblit-${project.version}.war" />
  39. <property name="fedclient.zipfile" value="fedclient-${project.version}.zip" />
  40. <property name="manager.zipfile" value="manager-${project.version}.zip" />
  41. <property name="authority.zipfile" value="authority-${project.version}.zip" />
  42. <property name="gbapi.zipfile" value="gbapi-${project.version}.zip" />
  43. <property name="express.zipfile" value="express-${project.version}.zip" />
  44. <property name="maven.directory" value="${basedir}/../gitblit-maven" />
  45. <!-- Download links -->
  46. <property name="gc.url" value="http://code.google.com/p/gitblit/downloads/detail?name=" />
  47. </target>
  48. <!--
  49. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  50. Cleanup all build artifacts and directories
  51. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  52. -->
  53. <target name="clean" depends="prepare" description="Cleanup all build artifacts and directories">
  54. <!-- Clean build and target directories -->
  55. <mx:clean />
  56. </target>
  57. <!--
  58. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  59. Setup
  60. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  61. -->
  62. <target name="setup" depends="prepare" description="Setup up project">
  63. <!-- copy distrib/data to project data directory -->
  64. <mkdir dir="${basedir}/data" />
  65. <copy todir="${basedir}/data" overwrite="false">
  66. <fileset dir="${project.distrib.dir}/data" />
  67. </copy>
  68. <!-- copy gitblit.properties to the source directory.
  69. this file is only used for parsing setting descriptions. -->
  70. <copy tofile="${project.src.dir}/reference.properties" overwrite="true"
  71. file="${project.distrib.dir}/data/gitblit.properties" />
  72. <!-- copy clientapps.json to the source directory.
  73. this file is only used if a local file is not provided. -->
  74. <copy tofile="${project.src.dir}/clientapps.json" overwrite="true"
  75. file="${project.distrib.dir}/data/clientapps.json" />
  76. </target>
  77. <!--
  78. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  79. Compile
  80. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. -->
  82. <target name="compile" depends="setup" description="compiles Gitblit from source">
  83. <!-- Generate the Keys class from the properties file -->
  84. <mx:keys propertiesfile="${project.distrib.dir}/data/gitblit.properties"
  85. outputclass="com.gitblit.Keys"
  86. todir="${project.src.dir}" />
  87. <!-- Compile project -->
  88. <mx:javac scope="compile" clean="true" />
  89. </target>
  90. <!--
  91. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  92. Report the compile dependencies on the console
  93. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  94. -->
  95. <target name="report" depends="prepare" description="generate dependency report">
  96. <!-- Report compile dependencies to the console -->
  97. <mx:report scope="compile" destfile="${project.targetDirectory}/dependencies.txt" />
  98. </target>
  99. <!--
  100. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  101. Test
  102. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  103. -->
  104. <target name="test" depends="compile" description="compiles Gitblit from source and runs unit tests">
  105. <!-- Compile unit tests -->
  106. <mx:javac scope="test" />
  107. <!-- Run unit tests -->
  108. <mx:test failonerror="true" />
  109. </target>
  110. <!--
  111. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  112. Run Gitblit GO
  113. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  114. -->
  115. <target name="run" depends="compile" description="Run Gitblit GO">
  116. <!-- copy static files -->
  117. <copy todir="${basedir}/build/classes" overwrite="false">
  118. <fileset dir="${project.resources.dir}">
  119. <exclude name="thumbs.db" />
  120. <exclude name="*.mkd" />
  121. </fileset>
  122. </copy>
  123. <!-- run the mainclass in a separate JVM -->
  124. <mx:run fork="true" />
  125. </target>
  126. <!--
  127. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  128. Build Gitblit GO
  129. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  130. -->
  131. <target name="buildGO" depends="compile" description="Build Gitblit GO distribution">
  132. <echo>Building Gitblit GO ${project.version}</echo>
  133. <local name="go.dir" />
  134. <property name="go.dir" value="${project.outputDirectory}/go" />
  135. <delete dir="${go.dir}" />
  136. <prepareDataDirectory toDir="${go.dir}/data" />
  137. <!-- Build jar -->
  138. <mx:jar destfile="${go.dir}/gitblit.jar" includeresources="true">
  139. <mainclass name="com.gitblit.GitBlitServer" />
  140. <launcher paths="ext" />
  141. </mx:jar>
  142. <!-- Generate the docs for the GO build -->
  143. <generateDocs toDir="${go.dir}/docs" />
  144. <!-- Create GO Windows Zip deployment -->
  145. <mx:zip basedir="${go.dir}">
  146. <!-- LICENSE and NOTICE -->
  147. <fileset dir="${basedir}" >
  148. <include name="LICENSE" />
  149. <include name="NOTICE" />
  150. </fileset>
  151. <!-- Windows distrib files -->
  152. <zipfileset dir="${project.distrib.dir}/win" />
  153. <!-- Gitblit Authority data -->
  154. <zipfileset dir="${project.distrib.dir}/data/certs" prefix="data/certs" />
  155. <!-- include all dependencies -->
  156. <dependencies prefix="ext" />
  157. </mx:zip>
  158. <!-- Create GO Linux/OSX tar.gz deployment -->
  159. <mx:tar basedir="${go.dir}" longfile="gnu" compression="gzip">
  160. <!-- LICENSE and NOTICE -->
  161. <fileset dir="${basedir}" >
  162. <include name="LICENSE" />
  163. <include name="NOTICE" />
  164. </fileset>
  165. <!-- Linux/OSX distrib files -->
  166. <tarfileset dir="${project.distrib.dir}/linux" filemode="755" />
  167. <!-- Gitblit Authority data -->
  168. <zipfileset dir="${project.distrib.dir}/data/certs" prefix="data/certs" />
  169. <!-- include all dependencies -->
  170. <dependencies prefix="ext" />
  171. </mx:tar>
  172. </target>
  173. <!--
  174. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  175. Build Gitblit WAR
  176. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  177. -->
  178. <target name="buildWAR" depends="compile" description="Build Gitblit WAR">
  179. <echo>Building Gitblit WAR ${project.version}</echo>
  180. <local name="war.dir" />
  181. <property name="war.dir" value="${project.outputDirectory}/war" />
  182. <delete dir="${war.dir}" />
  183. <local name="webinf" />
  184. <property name="webinf" value="${war.dir}/WEB-INF" />
  185. <!-- Generate the docs for the WAR build -->
  186. <generateDocs toDir="${webinf}/docs" />
  187. <!-- Prepare the data directory -->
  188. <prepareDataDirectory toDir="${webinf}/data" />
  189. <!-- Build the WAR web.xml from the prototype web.xml -->
  190. <mx:webxml sourcefile="${project.src.dir}/WEB-INF/web.xml" destfile="${webinf}/web.xml">
  191. <replace token="@gb.version@" value="${project.version}" />
  192. </mx:webxml>
  193. <!-- Gitblit jar -->
  194. <mx:jar destfile="${webinf}/lib/gitblit.jar" includeresources="false" />
  195. <!-- Build the WAR file -->
  196. <mx:zip basedir="${war.dir}" destfile="${project.targetDirectory}/${distribution.warfile}" compress="true" >
  197. <!-- Resources in root -->
  198. <fileset dir="${project.resources.dir}">
  199. <exclude name="thumbs.db" />
  200. <exclude name="*.mkd" />
  201. </fileset>
  202. <!-- WEB-INF directory -->
  203. <zipfileset prefix="WEB-INF" dir="${basedir}" >
  204. <include name="LICENSE" />
  205. <include name="NOTICE" />
  206. </zipfileset>
  207. <zipfileset prefix="WEB-INF" file="${project.compileOutputDirectory}/WEB-INF/weblogic.xml" />
  208. <!-- include "war" tagged dependencies -->
  209. <dependencies prefix="WEB-INF/lib" tag="war" />
  210. </mx:zip>
  211. </target>
  212. <!--
  213. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  214. Build the stand-alone, command-line Gitblit Federation Client
  215. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  216. -->
  217. <target name="buildFederationClient" depends="compile" description="Builds the stand-alone Gitblit federation client">
  218. <echo>Building Gitblit Federation Client ${project.version}</echo>
  219. <!-- generate jar by traversing the class hierarchy of the specified
  220. classes, exclude any classes in classpath jars -->
  221. <mx:genjar tag="" includeresources="false" excludeClasspathJars="true"
  222. destfile="${project.targetDirectory}/fedclient.jar"
  223. excludes="**/.class,**/*.java, **/Thumbs.db, **/*.mkd, com/gitblit/wicket/**">
  224. <mainclass name="com.gitblit.FederationClient" />
  225. <class name="com.gitblit.Keys" />
  226. <launcher paths="ext" />
  227. <resource file="${project.compileOutputDirectory}/log4j.properties" />
  228. </mx:genjar>
  229. <!-- Build the federation client zip file -->
  230. <mx:zip destfile="${project.targetDirectory}/${fedclient.zipfile}">
  231. <fileset dir="${basedir}">
  232. <include name="LICENSE" />
  233. <include name="NOTICE" />
  234. </fileset>
  235. <fileset dir="${project.targetDirectory}">
  236. <include name="fedclient.jar" />
  237. </fileset>
  238. <fileset dir="${project.distrib.dir}">
  239. <include name="federation.properties" />
  240. </fileset>
  241. <!-- include "fedclient" tagged dependencies -->
  242. <dependencies prefix="ext" tag="fedclient" />
  243. </mx:zip>
  244. <!-- Cleanup -->
  245. <delete file="${project.targetDirectory}/fedclient.jar" />
  246. </target>
  247. <!--
  248. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  249. Build a Gitblit filesystem for deployment to RedHat OpenShift Express
  250. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  251. -->
  252. <target name="buildExpress" depends="compile" description="Build exploded WAR file suitable for deployment to OpenShift Express">
  253. <echo>Building Gitblit Express for RedHat OpenShift ${project.version}</echo>
  254. <local name="express.dir" />
  255. <property name="express.dir" value="${project.outputDirectory}/express" />
  256. <delete dir="${express.dir}" />
  257. <!-- Create the OpenShift filesystem -->
  258. <local name="deployments.root" />
  259. <property name="deployments.root" value="${express.dir}/deployments/ROOT.war"/>
  260. <mkdir dir="${deployments.root}" />
  261. <touch file="${express.dir}/deployments/ROOT.war.dodeploy" />
  262. <local name="webinf" />
  263. <property name="webinf" value="${deployments.root}/WEB-INF" />
  264. <!-- Prepare the data directory -->
  265. <prepareDataDirectory toDir="${webinf}/data" />
  266. <!-- Build the Express web.xml from the prototype web.xml and gitblit.properties -->
  267. <!-- THIS FILE IS NOT OVERRIDDEN ONCE IT IS BUILT!!! -->
  268. <mx:webxml sourcefile="${project.src.dir}/WEB-INF/web.xml" destfile="${webinf}/web.xml"
  269. propertiesFile="${project.distrib.dir}/data/gitblit.properties"
  270. skip="server.*">
  271. <replace token="@gb.version@" value="${project.version}" />
  272. </mx:webxml>
  273. <!-- Gitblit classes -->
  274. <mx:jar destfile="${webinf}/lib/gitblit.jar" includeresources="false" />
  275. <!-- Build Express Zip file -->
  276. <mx:zip basedir="${express.dir}" destfile="${project.targetDirectory}/${express.zipfile}">
  277. <fileset dir="${basedir}">
  278. <include name="LICENSE" />
  279. <include name="NOTICE" />
  280. </fileset>
  281. <!-- README -->
  282. <zipfileset fullpath="README.gitblit" file="${project.siteSourceDirectory}/openshift.mkd" />
  283. <!-- resources -->
  284. <zipfileset prefix="deployments/ROOT.war" dir="${project.resources.dir}">
  285. <exclude name="thumbs.db" />
  286. <exclude name="*.mkd" />
  287. </zipfileset>
  288. <!-- include "war" tagged dependencies -->
  289. <dependencies prefix="deployments/ROOT.war/WEB-INF/lib" tag="war" />
  290. </mx:zip>
  291. </target>
  292. <!--
  293. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  294. Build the stand-alone, Gitblit Manager
  295. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  296. -->
  297. <target name="buildManager" depends="compile" description="Builds the stand-alone Gitblit Manager">
  298. <echo>Building Gitblit Manager ${project.version}</echo>
  299. <!-- generate jar by traversing the class hierarchy of the specified
  300. classes, exclude any classes in classpath jars -->
  301. <mx:genjar tag="" includeResources="false" excludeClasspathJars="true"
  302. destfile="${project.targetDirectory}/manager.jar">
  303. <resource file="${project.src.dir}/com/gitblit/client/splash.png" />
  304. <resource file="${project.resources.dir}/gitblt-favicon.png" />
  305. <resource file="${project.resources.dir}/gitweb-favicon.png" />
  306. <resource file="${project.resources.dir}/git-orange-16x16.png" />
  307. <resource file="${project.resources.dir}/user_16x16.png" />
  308. <resource file="${project.resources.dir}/users_16x16.png" />
  309. <resource file="${project.resources.dir}/settings_16x16.png" />
  310. <resource file="${project.resources.dir}/lock_go_16x16.png" />
  311. <resource file="${project.resources.dir}/lock_pull_16x16.png" />
  312. <resource file="${project.resources.dir}/shield_16x16.png" />
  313. <resource file="${project.resources.dir}/federated_16x16.png" />
  314. <resource file="${project.resources.dir}/cold_16x16.png" />
  315. <resource file="${project.resources.dir}/book_16x16.png" />
  316. <resource file="${project.resources.dir}/bug_16x16.png" />
  317. <resource file="${project.resources.dir}/health_16x16.png" />
  318. <resource file="${project.resources.dir}/feed_16x16.png" />
  319. <resource file="${project.resources.dir}/bullet_feed.png" />
  320. <resource file="${project.resources.dir}/search-icon.png" />
  321. <resource file="${project.resources.dir}/commit_changes_16x16.png" />
  322. <resource file="${project.resources.dir}/commit_merge_16x16.png" />
  323. <resource file="${project.resources.dir}/commit_divide_16x16.png" />
  324. <resource file="${project.resources.dir}/star_16x16.png" />
  325. <resource file="${project.resources.dir}/mirror_16x16.png" />
  326. <resource file="${project.resources.dir}/blank.png" />
  327. <resource file="${project.src.dir}/log4j.properties" />
  328. <resource>
  329. <!-- inlcude all translations -->
  330. <fileset dir="${project.src.dir}/com/gitblit/wicket">
  331. <include name="*.properties" />
  332. </fileset>
  333. </resource>
  334. <mainclass name="com.gitblit.client.GitblitManagerLauncher" />
  335. <class name="com.gitblit.Keys" />
  336. <class name="com.gitblit.client.GitblitClient" />
  337. <class name="com.gitblit.models.FederationModel" />
  338. <class name="com.gitblit.models.FederationProposal" />
  339. <class name="com.gitblit.models.FederationSet" />
  340. <manifest>
  341. <attribute name="SplashScreen-Image" value="splash.png" />
  342. </manifest>
  343. </mx:genjar>
  344. <!-- Build Manager Zip file -->
  345. <mx:zip destfile="${project.targetDirectory}/${manager.zipfile}">
  346. <fileset dir="${basedir}">
  347. <include name="LICENSE" />
  348. <include name="NOTICE" />
  349. </fileset>
  350. <fileset dir="${project.targetDirectory}">
  351. <include name="manager.jar" />
  352. </fileset>
  353. <!-- include "manager" tagged dependencies -->
  354. <dependencies prefix="ext" tag="manager" />
  355. </mx:zip>
  356. <!-- Cleanup -->
  357. <delete file="${project.targetDirectory}/manager.jar" />
  358. </target>
  359. <!--
  360. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  361. Build the Gitblit API client library
  362. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  363. -->
  364. <target name="buildApiLibrary" depends="compile" description="Builds the Gitblit RPC client library">
  365. <echo>Building Gitblit API Library ${project.version}</echo>
  366. <local name="javadoc.dir" />
  367. <property name="javadoc.dir" value="${project.outputDirectory}/javadoc" />
  368. <delete dir="${javadoc.dir}" />
  369. <!-- Build API Library jar -->
  370. <mx:genjar tag="" includeResources="false" excludeClasspathJars="true"
  371. destfile="${project.targetDirectory}/gbapi-${project.version}.jar">
  372. <class name="com.gitblit.Keys" />
  373. <class name="com.gitblit.client.GitblitClient" />
  374. <class name="com.gitblit.models.FederationModel" />
  375. <class name="com.gitblit.models.FederationProposal" />
  376. <class name="com.gitblit.models.FederationSet" />
  377. </mx:genjar>
  378. <!-- Build API sources jar -->
  379. <zip destfile="${project.targetDirectory}/gbapi-${project.version}-sources.jar">
  380. <fileset dir="${project.src.dir}" defaultexcludes="yes">
  381. <include name="com/gitblit/Constants.java"/>
  382. <include name="com/gitblit/GitBlitException.java"/>
  383. <include name="com/gitblit/Keys.java"/>
  384. <include name="com/gitblit/client/**/*.java"/>
  385. <include name="com/gitblit/models/**/*.java"/>
  386. <include name="com/gitblit/utils/**/*.java"/>
  387. </fileset>
  388. </zip>
  389. <!-- Build API JavaDoc jar -->
  390. <mx:javadoc destdir="${javadoc.dir}" redirect="true">
  391. <fileset dir="${project.src.dir}" defaultexcludes="yes">
  392. <include name="com/gitblit/Constants.java"/>
  393. <include name="com/gitblit/GitBlitException.java"/>
  394. <include name="com/gitblit/Keys.java"/>
  395. <include name="com/gitblit/client/**/*.java"/>
  396. <include name="com/gitblit/models/**/*.java"/>
  397. <include name="com/gitblit/utils/**/*.java"/>
  398. </fileset>
  399. </mx:javadoc>
  400. <zip destfile="${project.targetDirectory}/gbapi-${project.version}-javadoc.jar">
  401. <fileset dir="${javadoc.dir}" />
  402. </zip>
  403. <!-- Build the API library zip file -->
  404. <mx:zip destfile="${project.targetDirectory}/${gbapi.zipfile}">
  405. <fileset dir="${basedir}">
  406. <include name="LICENSE" />
  407. <include name="NOTICE" />
  408. </fileset>
  409. <fileset dir="${project.targetDirectory}">
  410. <include name="gbapi-${project.version}.jar" />
  411. <include name="gbapi-${project.version}-sources.jar" />
  412. <include name="gbapi-${project.version}-javadoc.jar" />
  413. </fileset>
  414. <!-- include "api" tagged dependencies -->
  415. <dependencies prefix="ext" tag="api" />
  416. </mx:zip>
  417. <!-- Cleanup -->
  418. <delete>
  419. <fileset dir="${project.targetDirectory}">
  420. <include name="javadoc/**" />
  421. </fileset>
  422. </delete>
  423. </target>
  424. <!--
  425. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  426. Build the Gitblit Website
  427. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  428. -->
  429. <target name="buildSite" depends="prepare" description="Build the Gitblit website">
  430. <echo>Building Gitblit Website ${project.version}</echo>
  431. <property name="releaselog" value="${basedir}/releases.moxie" />
  432. <!-- Build Site -->
  433. <mx:doc googleplusid="114464678392593421684" googleanalyticsid="UA-24377072-1"
  434. googlePlusOne="true" minify="true" customless="custom.less">
  435. <structure>
  436. <menu name="about">
  437. <page name="overview" src="siteindex.mkd" out="index.html" headerLinks="false" />
  438. <page name="features" src="features.mkd" />
  439. <page name="screenshots" src="screenshots.mkd" />
  440. </menu>
  441. <menu name="documentation" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  442. <menu name="Gitblit GO" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  443. <page name="setup GO" src="setup_go.mkd" />
  444. <page name="upgrade GO" src="upgrade_go.mkd" />
  445. </menu>
  446. <divider />
  447. <menu name="Gitblit WAR" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  448. <page name="setup WAR" src="setup_war.mkd" />
  449. <page name="upgrade WAR" src="upgrade_war.mkd" />
  450. </menu>
  451. <divider />
  452. <menu name="Gitblit Express" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  453. <page name="setup Express" src="setup_express.mkd" />
  454. <page name="upgrade Express" src="upgrade_express.mkd" />
  455. </menu>
  456. <divider />
  457. <menu name="Server Configuration" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  458. <page name="administration" src="administration.mkd" />
  459. <page name="authentication" src="setup_authentication.mkd" />
  460. <page name="push hooks" src="setup_hooks.mkd" />
  461. <page name="lucene indexing" src="setup_lucene.mkd" />
  462. <page name="reverse proxies" src="setup_proxy.mkd" />
  463. <page name="client app menus" src="setup_clientmenus.mkd" />
  464. <page name="bugtraq" src="setup_bugtraq.mkd" />
  465. <page name="mirrors" src="setup_mirrors.mkd" />
  466. <page name="scaling" src="setup_scaling.mkd" />
  467. <divider />
  468. <page name="Gitblit as a viewer" src="setup_viewer.mkd" />
  469. </menu>
  470. <divider />
  471. <menu name="Client Configuration" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  472. <page name="git client setup" src="setup_client.mkd" />
  473. <page name="eclipse plugin" src="eclipse_plugin.mkd" />
  474. </menu>
  475. <divider />
  476. <menu name="tickets" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  477. <page name="overview" src="tickets_overview.mkd" />
  478. <page name="using" src="tickets_using.mkd" />
  479. <page name="barnum" src="tickets_barnum.mkd" />
  480. <page name="setup" src="tickets_setup.mkd" />
  481. </menu>
  482. <divider />
  483. <page name="federation" src="federation.mkd" />
  484. <divider />
  485. <page name="settings" src="properties.mkd" />
  486. <page name="faq" src="faq.mkd" />
  487. <divider />
  488. <page name="design" src="design.mkd" />
  489. <page name="rpc" src="rpc.mkd" />
  490. </menu>
  491. <menu name="releases">
  492. <page name="release notes" out="releasenotes.html">
  493. <template src="releasecurrent.ftl" data="${releaselog}" />
  494. </page>
  495. <page name="release history" out="releases.html">
  496. <template src="releasehistory.ftl" data="${releaselog}" />
  497. </page>
  498. <divider />
  499. <page name="roadmap" src="roadmap.mkd" />
  500. </menu>
  501. <menu name="downloads">
  502. <link name="Gitblit GO (Windows)" src="${gc.url}gitblit-${project.releaseVersion}.zip" />
  503. <link name="Gitblit GO (Linux/OSX)" src="${gc.url}gitblit-${project.releaseVersion}.tar.gz" />
  504. <link name="Gitblit WAR" src="${gc.url}gitblit-${project.releaseVersion}.war" />
  505. <link name="Gitblit Express" src="${gc.url}express-${project.releaseVersion}.zip" />
  506. <divider />
  507. <link name="Gitblit Manager" src="${gc.url}manager-${project.releaseVersion}.zip" />
  508. <link name="Federation Client" src="${gc.url}fedclient-${project.releaseVersion}.zip" />
  509. <divider />
  510. <link name="API Library" src="${gc.url}gbapi-${project.releaseVersion}.zip" />
  511. </menu>
  512. <menu name="links">
  513. <link name="Gitblit Demo (RELEASE)" src="https://demo-gitblit.rhcloud.com" />
  514. <link name="Gitblit Next (SNAPSHOT)" src="https://next-gitblit.rhcloud.com" />
  515. <divider />
  516. <link name="Github" src="${project.scmUrl}" />
  517. <link name="Issues" src="${project.issuesUrl}" />
  518. <link name="Discussion" src="${project.forumUrl}" />
  519. <link name="Google+" src="${project.socialNetworkUrl}" />
  520. <link name="Ohloh" src="http://www.ohloh.net/p/gitblit" />
  521. </menu>
  522. <divider />
  523. </structure>
  524. <replace token="%GCURL%" value="${gc.url}" />
  525. <properties token="%PROPERTIES%" file="${project.distrib.dir}/data/gitblit.properties" />
  526. <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;" />
  527. <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;" />
  528. <!-- Set the logo from the mx:doc resources -->
  529. <logo file="${project.resources.dir}/gitblt_25_white.png" />
  530. <favicon file="${project.resources.dir}/gitblt-favicon.png" />
  531. <resource>
  532. <fileset dir="${project.resources.dir}">
  533. <include name="lock_go_16x16.png" />
  534. <include name="lock_pull_16x16.png" />
  535. <include name="shield_16x16.png" />
  536. <include name="cold_16x16.png" />
  537. <include name="bug_16x16.png" />
  538. <include name="book_16x16.png" />
  539. <include name="blank.png" />
  540. <include name="federated_16x16.png" />
  541. <include name="arrow_page.png" />
  542. </fileset>
  543. </resource>
  544. </mx:doc>
  545. <!-- Copy Fancybox -->
  546. <mkdir dir="${project.siteTargetDirectory}/fancybox" />
  547. <copy todir="${project.siteTargetDirectory}/fancybox">
  548. <fileset dir="${project.siteSourceDirectory}/fancybox">
  549. <exclude name="thumbs.db" />
  550. </fileset>
  551. </copy>
  552. <!-- Generate thumbnails of screenshots -->
  553. <mx:thumbs input="png" output="png" maximumDimension="250"
  554. sourceDir="${project.siteSourceDirectory}/screenshots"
  555. destDir="${project.siteTargetDirectory}/thumbs" />
  556. <!-- Copy screenshots -->
  557. <mkdir dir="${project.siteTargetDirectory}/screenshots" />
  558. <copy todir="${project.siteTargetDirectory}/screenshots">
  559. <fileset dir="${project.siteSourceDirectory}/screenshots">
  560. <include name="*.png" />
  561. </fileset>
  562. </copy>
  563. </target>
  564. <!--
  565. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  566. Package and deploy RELEASE artifacts to the Maven repository
  567. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  568. -->
  569. <target name="buildMavenArtifacts" depends="buildApiLibrary">
  570. <mx:package />
  571. <mx:deploy basedir="${maven.directory}" allowsnapshots="false" />
  572. <mx:deploy basedir="${maven.directory}" allowsnapshots="false"
  573. name="Gitblit API" description="Gitblit JSON/RSS API client library"
  574. tags="api" artifactid="gbapi" />
  575. </target>
  576. <!--
  577. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  578. Build all binaries and site
  579. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  580. -->
  581. <target name="buildAll" depends="buildGO,buildWAR,buildExpress,buildFederationClient,buildManager,buildApiLibrary,buildSite" />
  582. <!--
  583. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  584. Update the gh-pages branch with the current site
  585. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  586. -->
  587. <target name="updateGhPages">
  588. <!-- Build gh-pages branch -->
  589. <mx:ghpages repositorydir="${basedir}" obliterate="true" />
  590. </target>
  591. <!--
  592. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  593. Publish binaries to Google Code
  594. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  595. -->
  596. <target name="publishBinaries" depends="prepare" description="Publish the Gitblit binaries to Google Code">
  597. <echo>Uploading Gitblit ${project.version} binaries</echo>
  598. <!-- Upload Gitblit GO Windows ZIP file -->
  599. <mx:gcupload
  600. username="${googlecode.user}"
  601. password="${googlecode.password}"
  602. projectname="gitblit"
  603. filename="${project.targetDirectory}/${distribution.zipfile}"
  604. targetFilename="gitblit-${project.version}.zip"
  605. summary="Gitblit GO v${project.version} (standalone, integrated Gitblit server for Windows)" />
  606. <!-- Upload Gitblit GO Linux/Unix tar.gz file -->
  607. <mx:gcupload
  608. username="${googlecode.user}"
  609. password="${googlecode.password}"
  610. projectname="gitblit"
  611. filename="${project.targetDirectory}/${distribution.tgzfile}"
  612. targetFilename="gitblit-${project.version}.tar.gz"
  613. summary="Gitblit GO v${project.version} (standalone, integrated Gitblit server for Linux/Unix)" />
  614. <!-- Upload Gitblit WAR file -->
  615. <mx:gcupload
  616. username="${googlecode.user}"
  617. password="${googlecode.password}"
  618. projectname="gitblit"
  619. filename="${project.targetDirectory}/${distribution.warfile}"
  620. targetFilename="gitblit-${project.version}.war"
  621. summary="Gitblit WAR v${project.version} (standard WAR webapp for servlet containers)" />
  622. <!-- Upload Gitblit FedClient -->
  623. <mx:gcupload
  624. username="${googlecode.user}"
  625. password="${googlecode.password}"
  626. projectname="gitblit"
  627. filename="${project.targetDirectory}/${fedclient.zipfile}"
  628. targetFilename="fedclient-${project.version}.zip"
  629. summary="Gitblit Federation Client v${project.version} (command-line tool to clone data from federated Gitblit instances)" />
  630. <!-- Upload Gitblit Manager -->
  631. <mx:gcupload
  632. username="${googlecode.user}"
  633. password="${googlecode.password}"
  634. projectname="gitblit"
  635. filename="${project.targetDirectory}/${manager.zipfile}"
  636. targetFilename="manager-${project.version}.zip"
  637. summary="Gitblit Manager v${project.version} (Swing tool to remotely administer a Gitblit server)" />
  638. <!-- Upload Gitblit API Library -->
  639. <mx:gcupload
  640. username="${googlecode.user}"
  641. password="${googlecode.password}"
  642. projectname="gitblit"
  643. filename="${project.targetDirectory}/${gbapi.zipfile}"
  644. targetFilename="gbapi-${project.version}.zip"
  645. summary="Gitblit API Library v${project.version} (JSON RPC library to integrate with your software)" />
  646. <!-- Upload Gitblit Express for RedHat OpenShift -->
  647. <mx:gcupload
  648. username="${googlecode.user}"
  649. password="${googlecode.password}"
  650. projectname="gitblit"
  651. filename="${project.targetDirectory}/${express.zipfile}"
  652. targetFilename="express-${project.version}.zip"
  653. summary="Gitblit Express v${project.version} (run Gitblit on RedHat's OpenShift cloud)" />
  654. </target>
  655. <!--
  656. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  657. Publish site to site hosting service
  658. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  659. -->
  660. <target name="publishSite" depends="clean,buildSite,updateGhPages" description="Publish the Gitblit site to a host" >
  661. <echo>Uploading Gitblit ${project.version} website</echo>
  662. <mx:ftp server="${ftp.server}"
  663. userid="${ftp.user}"
  664. password="${ftp.password}"
  665. remotedir="${ftp.dir}"
  666. passive="true"
  667. verbose="yes">
  668. <fileset dir="${project.siteTargetDirectory}" />
  669. </mx:ftp>
  670. </target>
  671. <!--
  672. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  673. Tag a new version and prepare for the next development cycle.
  674. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  675. -->
  676. <target name="tagRelease" depends="prepare" description="tag a new version and prepare for the next development cycle">
  677. <!-- release -->
  678. <property name="dryrun" value="false" />
  679. <mx:version stage="release" dryrun="${dryrun}" />
  680. <property name="project.tag" value="v${project.version}" />
  681. <!-- commit build.moxie & releases.moxie (automatic) -->
  682. <mx:commit showtitle="no">
  683. <message>Prepare ${project.version} release</message>
  684. <tag name="${project.tag}">
  685. <message>${project.name} ${project.version} release</message>
  686. </tag>
  687. </mx:commit>
  688. <!-- create the release process script -->
  689. <mx:if>
  690. <os family="windows" />
  691. <then>
  692. <!-- Windows PowerShell script -->
  693. <!-- set-executionpolicy remotesigned -->
  694. <property name="recipe" value="release_${project.version}.ps1" />
  695. </then>
  696. <else>
  697. <!-- Bash script -->
  698. <property name="recipe" value="release_${project.version}.sh" />
  699. </else>
  700. </mx:if>
  701. <delete file="${recipe}" failonerror="false" quiet="true" verbose="false" />
  702. <!-- Work-around for lack of proper ant property substitution in copy -->
  703. <property name="dollar" value="$"/>
  704. <copy file="release.template" tofile="${recipe}">
  705. <filterset begintoken="${dollar}{" endtoken="}">
  706. <filter token="project.version" value="${project.version}" />
  707. <filter token="project.commitId" value="${project.commitId}" />
  708. <filter token="project.tag" value="${project.tag}" />
  709. <filter token="project.directory" value="${basedir}" />
  710. <filter token="maven.directory" value="${maven.directory}" />
  711. </filterset>
  712. </copy>
  713. <chmod file="${recipe}" perm="ugo+rx" />
  714. <!-- next cycle -->
  715. <mx:version stage="snapshot" incrementNumber="incremental" dryrun="${dryrun}" />
  716. <mx:commit showtitle="no">
  717. <message>Reset build identifiers for next development cycle</message>
  718. </mx:commit>
  719. </target>
  720. <!--
  721. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  722. Build Gitblit Docs
  723. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  724. -->
  725. <macrodef name="generateDocs">
  726. <attribute name="toDir"/>
  727. <sequential>
  728. <mx:doc toDir="@{toDir}" minify="true" customless="custom.less">
  729. <structure>
  730. <menu name="about">
  731. <page name="overview" src="siteindex.mkd" out="index.html" headerLinks="false" />
  732. <page name="features" src="features.mkd" />
  733. </menu>
  734. <menu name="documentation">
  735. <menu name="Gitblit GO" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  736. <page name="setup GO" src="setup_go.mkd" />
  737. <page name="upgrade GO" src="upgrade_go.mkd" />
  738. </menu>
  739. <divider />
  740. <menu name="Gitblit WAR" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  741. <page name="setup WAR" src="setup_war.mkd" />
  742. <page name="upgrade WAR" src="upgrade_war.mkd" />
  743. </menu>
  744. <divider />
  745. <menu name="Gitblit Express" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  746. <page name="setup Express" src="setup_express.mkd" />
  747. <page name="upgrade Express" src="upgrade_express.mkd" />
  748. </menu>
  749. <divider />
  750. <menu name="Server Configuration" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  751. <page name="administration" src="administration.mkd" />
  752. <page name="authentication" src="setup_authentication.mkd" />
  753. <page name="push hooks" src="setup_hooks.mkd" />
  754. <page name="lucene indexing" src="setup_lucene.mkd" />
  755. <page name="reverse proxies" src="setup_proxy.mkd" />
  756. <page name="client app menus" src="setup_clientmenus.mkd" />
  757. <page name="bugtraq" src="setup_bugtraq.mkd" />
  758. <page name="mirrors" src="setup_mirrors.mkd" />
  759. <page name="scaling" src="setup_scaling.mkd" />
  760. <divider />
  761. <page name="Gitblit as a viewer" src="setup_viewer.mkd" />
  762. </menu>
  763. <divider />
  764. <menu name="Client Configuration" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  765. <page name="git client setup" src="setup_client.mkd" />
  766. <page name="eclipse plugin" src="eclipse_plugin.mkd" />
  767. </menu>
  768. <divider />
  769. <menu name="tickets" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  770. <page name="overview" src="tickets_overview.mkd" />
  771. <page name="using" src="tickets_using.mkd" />
  772. <page name="barnum" src="tickets_barnum.mkd" />
  773. <page name="setup" src="tickets_setup.mkd" />
  774. </menu>
  775. <divider />
  776. <page name="federation" src="federation.mkd" />
  777. <divider />
  778. <page name="settings" src="properties.mkd" />
  779. <page name="faq" src="faq.mkd" />
  780. <divider />
  781. <page name="design" src="design.mkd" />
  782. <page name="rpc" src="rpc.mkd" />
  783. </menu>
  784. <menu name="changelog">
  785. <page name="current release" src="releasecurrent.mkd" />
  786. <page name="older releases" src="releasehistory.mkd" />
  787. </menu>
  788. <menu name="links">
  789. <link name="Gitblit Demo (RELEASE)" src="https://demo-gitblit.rhcloud.com" />
  790. <link name="Gitbilt Next (SNAPSHOT)" src="https://next-gitblit.rhcloud.com" />
  791. <divider />
  792. <link name="Github" src="${project.scmUrl}" />
  793. <link name="Issues" src="${project.issuesUrl}" />
  794. <link name="Discussion" src="${project.forumUrl}" />
  795. <link name="Google+" src="${project.socialNetworkUrl}" />
  796. <link name="Ohloh" src="http://www.ohloh.net/p/gitblit" />
  797. </menu>
  798. </structure>
  799. <properties token="%PROPERTIES%" file="${project.distrib.dir}/data/gitblit.properties" />
  800. <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;" />
  801. <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;" />
  802. <!-- Set the logo from the mx:doc resources -->
  803. <logo file="${project.resources.dir}/gitblt_25_white.png" />
  804. <favicon file="${project.resources.dir}/gitblt-favicon.png" />
  805. <resource>
  806. <fileset dir="${project.resources.dir}">
  807. <include name="lock_go_16x16.png" />
  808. <include name="lock_pull_16x16.png" />
  809. <include name="shield_16x16.png" />
  810. <include name="cold_16x16.png" />
  811. <include name="bug_16x16.png" />
  812. <include name="book_16x16.png" />
  813. <include name="blank.png" />
  814. <include name="federated_16x16.png" />
  815. <include name="arrow_page.png" />
  816. </fileset>
  817. </resource>
  818. </mx:doc>
  819. </sequential>
  820. </macrodef>
  821. <!--
  822. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  823. Macro to create a pristine data directory for the target build
  824. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  825. -->
  826. <macrodef name="prepareDataDirectory">
  827. <attribute name="toDir"/>
  828. <sequential>
  829. <mkdir dir="@{toDir}" />
  830. <copy todir="@{toDir}" overwrite="false">
  831. <fileset dir="${project.distrib.dir}/data">
  832. <include name="users.conf" />
  833. <include name="projects.conf" />
  834. <include name="gitblit.properties" />
  835. </fileset>
  836. </copy>
  837. <mkdir dir="@{toDir}/git" />
  838. <copy todir="@{toDir}/git" overwrite="false">
  839. <fileset dir="${project.distrib.dir}/data/git">
  840. <include name="project.mkd" />
  841. </fileset>
  842. </copy>
  843. <mkdir dir="@{toDir}/groovy" />
  844. <copy todir="@{toDir}/groovy">
  845. <fileset dir="${project.distrib.dir}/data/groovy">
  846. <include name="sendmail.groovy" />
  847. <include name="sendmail-html.groovy" />
  848. <include name="jenkins.groovy" />
  849. <include name="protect-refs.groovy" />
  850. <include name="blockpush.groovy" />
  851. <include name="localclone.groovy" />
  852. <include name="fogbugz.groovy" />
  853. <include name="thebuggenie.groovy" />
  854. <include name="fisheye.groovy" />
  855. <include name="redmine-fetch.groovy" />
  856. <include name="subgit.groovy" />
  857. </fileset>
  858. </copy>
  859. </sequential>
  860. </macrodef>
  861. <!--
  862. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  863. Macro to upload binaries to GoogleCode
  864. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  865. -->
  866. <macrodef name="googleUpload">
  867. <attribute name="sourceFile"/>
  868. <attribute name="targetFile"/>
  869. <attribute name="description"/>
  870. <sequential>
  871. <gcupload
  872. username="${googlecode.user}"
  873. password="${googlecode.password}"
  874. projectname="gitblit"
  875. filename="${project.targetDirectory}/@{sourceFile}"
  876. targetfilename="@{targetFile}"
  877. summary="@{description}"
  878. labels="Featured, Type-Package, OpSys-All" />
  879. </sequential>
  880. </macrodef>
  881. <!--
  882. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  883. Install Gitblit JAR for usage as Maven module
  884. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  885. -->
  886. <target name="installMaven" depends="compile" description="Install Gitblit JAR as Maven module">
  887. <local name="project.jar" />
  888. <property name="project.jar" value="${project.outputDirectory}/gitblit.jar" />
  889. <property name="resourceFolderPrefix" value="" />
  890. <mx:jar destfile="${project.jar}" includeresources="true" resourceFolderPrefix="${resourceFolderPrefix}" />
  891. <exec executable="mvn">
  892. <arg value="install:install-file" />
  893. <arg value="-Dfile=${project.jar}" />
  894. <arg value="-DpomFile=${basedir}/pom.xml" />
  895. <arg value="-DcreateChecksum=true" />
  896. </exec>
  897. </target>
  898. <!--
  899. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  900. Upload Gitblit JAR to remote Maven repository
  901. build.properties:
  902. project.maven.repo.url = http://whatever.com/maven2
  903. project.maven.repo.id = whateverId
  904. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  905. -->
  906. <target name="uploadMaven" depends="compile" description="Upload Gitblit JAR to remote Maven repository">
  907. <local name="project.jar" />
  908. <property name="project.jar" value="${project.outputDirectory}/gitblit.jar" />
  909. <mx:jar destfile="${project.jar}" includeresources="true" />
  910. <exec executable="mvn">
  911. <arg value="deploy:deploy-file" />
  912. <arg value="-Dfile=${project.jar}" />
  913. <arg value="-DpomFile=${basedir}/pom.xml" />
  914. <arg value="-Durl=${project.maven.repo.url}" />
  915. <arg value="-DrepositoryId=${project.maven.repo.id}" />
  916. <arg value="-DcreateChecksum=true" />
  917. </exec>
  918. </target>
  919. </project>