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 56KB

12 years ago
Zips of recreated hello-world.git and all external repositories for testing. This hello-world.git repo is created using the native Git for Windows software. Various test classes in the GitBlitSuite test suite require the presence of the hello-world.git repo in github.com/git/ which has been missing, hence causing many test failures in the suite. This recreation of the hello-world.git repo aims to conform to the many test cases' requirements in the suite, and to be checked in as part of the gitblit repo, thus eliminates the requirement of a remote hello-world.git repo during the test run. The repo is now stored is a zip ball in the new src/test/data folder. The hello-world repo's various commit IDs were hard-coded in various test classes. These commit IDs, which must now have new values in the recreated repo, are now extracted out to the src/test/data/hello-world.properties file. The gitblit's build.xml is modified to generate the HelloworldKeys.java file containing the hello-world.properties file's key strings, in similar fashion as the existing generation of the com.gitblit.Keys.java file. And these key strings in HelloworldKeys.java are now used in the various test classes, thus eliminating the hard-coding of the hello-world repo's commit IDs in the test code. During the test run by GitBlitSuite test suite, some repos from GitHub were cloned and became part of the test data. These repos are now zipped to be part of gitblit repo itself, thus eliminating the network fetch at the start of test run which can be slow, especially with the JGit repo cloning which is huge and time consuming. The cloned JGit repo is now zipped and checked in to gitblit, along with the other 4 repos (hello-world, ambition, gitective and ticgit). They will be unzipped during the test suite run and be available in the local file system, thus avoiding the need for some network fetch. Special note on the zipped JGit repo: this repo is big (and growing all the time on GitHub), and takes up about 32MB of disk space after cloning from GitHub. I've made it smaller by resetting HEAD back to a commit of 5 years ago (with git reset --hard <commitId> command), to put it back to roughly where/when the tests were written for it (which is not quite, because there are tons of commit history since which can't be removed.) The local JGit repo is then garbage-collected (with git gc --prune --aggressive) to reduce its size to about 19MB. Zipped it is still 17MB. This is a lot of MBs for a few tests. So the JGit repo is not included in this commit. Fixes #1275
5 years ago
12 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
13 years ago
13 years ago
13 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="gitblit" default="compile" xmlns:mx="antlib:org.moxie" xmlns:jacoco="antlib:org.jacoco.ant">
  3. <!--
  4. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. Retrieve Moxie Toolkit
  6. documentation @ http://gitblit-org.github.io/moxie
  7. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. -->
  9. <property name="moxie.version" value="0.10.0" />
  10. <property name="moxie.url" value="http://gitblit-org.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. <property name="jacoco.version" value="0.8.4" />
  14. <!-- Download Moxie from it's Maven repository to user.home -->
  15. <mkdir dir="${moxie.dir}" />
  16. <get src="${moxie.url}/com/gitblit/moxie/moxie-toolkit/${moxie.version}/${moxie.jar}"
  17. dest="${moxie.dir}" skipexisting="true" verbose="true" />
  18. <!-- Register Moxie tasks -->
  19. <taskdef uri="antlib:org.moxie">
  20. <classpath location="${moxie.dir}/${moxie.jar}" />
  21. </taskdef>
  22. <!-- Project directories -->
  23. <property name="project.src.dir" value="${basedir}/src/main/java" />
  24. <property name="project.resources.dir" value="${basedir}/src/main/resources" />
  25. <property name="project.distrib.dir" value="${basedir}/src/main/distrib" />
  26. <!-- Tools -->
  27. <property name="octokit" location="${basedir}/.github/ok.sh" />
  28. <property name="relnoawk" location="${basedir}/src/site/templates/ghreleasenotes.awk" />
  29. <!-- GitHub user/organization name -->
  30. <property name="gh.org" value="gitblit-org" />
  31. <!-- GitHub project name -->
  32. <property name="gh.repo" value="gitblit" />
  33. <!--
  34. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35. Initialize Moxie and setup build properties
  36. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  37. -->
  38. <target name="prepare">
  39. <!-- Setup Ant build from build.moxie and resolve dependencies.
  40. If it exists, build.properties is automatically loaded.
  41. Explicitly set mxroot allowing CI servers to override the default. -->
  42. <mx:init verbose="no" mxroot="${moxie.dir}" />
  43. <!-- Register JaCoCo tasks -->
  44. <taskdef uri="antlib:org.jacoco.ant">
  45. <classpath location="${moxie.dir}/remote/repo1.maven.org_maven2/org/jacoco/org.jacoco.ant/${jacoco.version}/org.jacoco.ant-${jacoco.version}-nodeps.jar" />
  46. </taskdef>
  47. <!-- Set Ant project properties -->
  48. <property name="release.tag" value="v${project.version}" />
  49. <property name="currentRelease.tag" value="v${project.releaseVersion}" />
  50. <property name="release.name" value="gitblit-${project.version}"/>
  51. <property name="distribution.zipfile" value="${release.name}.zip" />
  52. <property name="distribution.tgzfile" value="${release.name}.tar.gz" />
  53. <property name="distribution.warfile" value="${release.name}.war" />
  54. <property name="fedclient.zipfile" value="fedclient-${project.version}.zip" />
  55. <property name="manager.zipfile" value="manager-${project.version}.zip" />
  56. <property name="authority.zipfile" value="authority-${project.version}.zip" />
  57. <property name="gbapi.zipfile" value="gbapi-${project.version}.zip" />
  58. <property name="maven.directory" value="${basedir}/../gitblit-maven" />
  59. <property name="releaselog" value="${basedir}/releases.moxie" />
  60. <!-- Download links -->
  61. <property name="gh.url" value="https://github.com/${gh.org}" />
  62. <property name="gc.url" value="${gh.url}/gitblit/releases/download/" />
  63. <property name="docker.url" value="https://hub.docker.com/r/gitblit/gitblit" />
  64. <!-- Report Java version -->
  65. <echo>JDK version: ${ant.java.version}</echo>
  66. <exec executable="javac">
  67. <arg value="-version" />
  68. </exec>
  69. <echo>Java/JVM version: ${java.version}</echo>
  70. <echo>Github coordinates: ${gh.org}/${gh.repo}</echo>
  71. </target>
  72. <!--
  73. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  74. Cleanup all build artifacts and directories
  75. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  76. -->
  77. <target name="clean" depends="prepare" description="Cleanup all build artifacts and directories">
  78. <!-- Clean build and target directories -->
  79. <mx:clean />
  80. </target>
  81. <!--
  82. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  83. Setup
  84. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  85. -->
  86. <target name="setup" depends="prepare" description="Setup up project">
  87. <!-- copy distrib/data to project data directory -->
  88. <mkdir dir="${basedir}/data" />
  89. <copy todir="${basedir}/data" overwrite="false">
  90. <fileset dir="${project.distrib.dir}/data" />
  91. </copy>
  92. <!-- copy defaults.properties to the source directory -->
  93. <copy tofile="${project.src.dir}/defaults.properties" overwrite="true"
  94. file="${project.distrib.dir}/data/defaults.properties" />
  95. <!-- copy clientapps.json to the source directory.
  96. this file is only used if a local file is not provided. -->
  97. <copy tofile="${project.src.dir}/clientapps.json" overwrite="true"
  98. file="${project.distrib.dir}/data/clientapps.json" />
  99. </target>
  100. <!--
  101. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  102. Compile
  103. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104. -->
  105. <target name="compile" depends="setup" description="compiles Gitblit from source">
  106. <!-- Generate the Keys class from the defaults.properties file -->
  107. <mx:keys propertiesfile="${project.distrib.dir}/data/defaults.properties"
  108. outputclass="com.gitblit.Keys"
  109. todir="${project.src.dir}" />
  110. <!-- Compile project -->
  111. <mx:javac scope="compile" clean="true" />
  112. </target>
  113. <!--
  114. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  115. Report the compile dependencies on the console
  116. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  117. -->
  118. <target name="report" depends="prepare" description="generate dependency report">
  119. <!-- Report compile dependencies to the console -->
  120. <mx:report scope="compile" destfile="${project.targetDirectory}/dependencies.txt" />
  121. </target>
  122. <!--
  123. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  124. Test
  125. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  126. -->
  127. <target name="test" depends="compile" description="compiles Gitblit from source and runs unit tests">
  128. <!-- Generate the HelloworldKeys class from the hello-world.properties file -->
  129. <mx:keys propertiesfile="${basedir}/src/test/data/hello-world.properties"
  130. outputclass="com.gitblit.tests.HelloworldKeys"
  131. todir="${basedir}/src/test/java" />
  132. <!-- Compile unit tests -->
  133. <mx:javac scope="test" />
  134. <!-- Run unit tests -->
  135. <mx:test failonerror="true" />
  136. <!-- Create JaCoCo single XML report file for code coverage service. -->
  137. <jacoco:report>
  138. <executiondata>
  139. <file file="${project.outputDirectory}/jacoco.exec"/>
  140. </executiondata>
  141. <structure name="${project.name}">
  142. <classfiles>
  143. <fileset dir="${project.outputDirectory}/classes"/>
  144. </classfiles>
  145. <sourcefiles encoding="UTF-8">
  146. <fileset dir="${project.src.dir}"/>
  147. </sourcefiles>
  148. </structure>
  149. <xml destfile="${project.targetDirectory}/reports/coverage/jacoco.xml"/>
  150. </jacoco:report>
  151. </target>
  152. <!--
  153. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  154. Run Gitblit GO
  155. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  156. -->
  157. <target name="run" depends="compile" description="Run Gitblit GO">
  158. <!-- copy static files -->
  159. <copy todir="${basedir}/build/classes" overwrite="false">
  160. <fileset dir="${project.resources.dir}">
  161. <exclude name="thumbs.db" />
  162. <exclude name="*.mkd" />
  163. </fileset>
  164. </copy>
  165. <!-- run the mainclass in a separate JVM -->
  166. <mx:run fork="true" />
  167. </target>
  168. <!--
  169. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  170. Build Gitblit GO
  171. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  172. -->
  173. <target name="buildGO" depends="compile" description="Build Gitblit GO distribution">
  174. <echo>Building Gitblit GO ${project.version}</echo>
  175. <local name="go.dir"/>
  176. <property name="go.dir" value="${project.outputDirectory}/go"/>
  177. <delete dir="${go.dir}" />
  178. <local name="go.release.dir" />
  179. <property name="go.release.dir" value="${go.dir}/${release.name}" />
  180. <local name="webinf" />
  181. <property name="webinf" value="${project.compileOutputDirectory}/WEB-INF" />
  182. <prepareDataDirectory toDir="${go.release.dir}/data" />
  183. <!-- Copy the web.xml from the prototype web.xml -->
  184. <copy todir="${webinf}" overwrite="true">
  185. <fileset file="${project.src.dir}/WEB-INF/web.xml" />
  186. <filterset>
  187. <filter token="gb.version" value="${project.version}" />
  188. </filterset>
  189. </copy>
  190. <!-- Build jar -->
  191. <mx:jar destfile="${go.release.dir}/gitblit.jar" includeresources="true">
  192. <mainclass name="com.gitblit.GitBlitServer" />
  193. </mx:jar>
  194. <!-- Generate the docs for the GO build -->
  195. <generateDocs toDir="${go.release.dir}/docs" />
  196. <!-- Create GO Windows Zip deployment -->
  197. <mx:zip basedir="${go.dir}">
  198. <!-- LICENSE and NOTICE -->
  199. <zipfileset dir="${basedir}" prefix="${release.name}">
  200. <include name="LICENSE" />
  201. <include name="NOTICE" />
  202. </zipfileset>
  203. <!-- Windows distrib files -->
  204. <zipfileset dir="${project.distrib.dir}/win" prefix="${release.name}"/>
  205. <!-- Gitblit Authority data -->
  206. <zipfileset dir="${project.distrib.dir}/data/certs" prefix="${release.name}/data/certs" />
  207. <!-- include all dependencies -->
  208. <dependencies prefix="${release.name}/ext" />
  209. </mx:zip>
  210. <!-- Create GO Linux/OSX tar.gz deployment -->
  211. <mx:tar basedir="${go.dir}" longfile="gnu" compression="gzip">
  212. <!-- LICENSE and NOTICE -->
  213. <zipfileset dir="${basedir}" prefix="${release.name}">
  214. <include name="LICENSE" />
  215. <include name="NOTICE" />
  216. </zipfileset>
  217. <!-- Linux/OSX distrib files -->
  218. <tarfileset dir="${project.distrib.dir}/linux" filemode="755" prefix="${release.name}"/>
  219. <!-- Gitblit Authority data -->
  220. <zipfileset dir="${project.distrib.dir}/data/certs" prefix="${release.name}/data/certs" />
  221. <!-- include all dependencies -->
  222. <dependencies prefix="${release.name}/ext" />
  223. </mx:tar>
  224. </target>
  225. <!--
  226. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  227. Build Gitblit WAR
  228. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  229. -->
  230. <target name="buildWAR" depends="compile" description="Build Gitblit WAR">
  231. <echo>Building Gitblit WAR ${project.version}</echo>
  232. <local name="war.dir" />
  233. <property name="war.dir" value="${project.outputDirectory}/war" />
  234. <delete dir="${war.dir}" />
  235. <local name="webinf" />
  236. <property name="webinf" value="${war.dir}/WEB-INF" />
  237. <!-- Generate the docs for the WAR build -->
  238. <generateDocs toDir="${webinf}/docs" />
  239. <!-- Prepare the data directory -->
  240. <prepareDataDirectory toDir="${webinf}/data" />
  241. <!-- Build the WAR web.xml from the prototype web.xml -->
  242. <mx:webxml sourcefile="${project.src.dir}/WEB-INF/web.xml" destfile="${webinf}/web.xml">
  243. <replace token="@gb.version@" value="${project.version}" />
  244. </mx:webxml>
  245. <!-- Gitblit jar -->
  246. <mx:jar destfile="${webinf}/lib/gitblit-${project.version}.jar" includeresources="false" />
  247. <!-- Build the WAR file -->
  248. <mx:zip basedir="${war.dir}" destfile="${project.targetDirectory}/${distribution.warfile}" compress="true" >
  249. <!-- Resources in root -->
  250. <fileset dir="${project.resources.dir}">
  251. <exclude name="thumbs.db" />
  252. <exclude name="*.mkd" />
  253. </fileset>
  254. <!-- WEB-INF directory -->
  255. <zipfileset prefix="WEB-INF" dir="${basedir}" >
  256. <include name="LICENSE" />
  257. <include name="NOTICE" />
  258. </zipfileset>
  259. <zipfileset prefix="WEB-INF" file="${project.compileOutputDirectory}/WEB-INF/weblogic.xml" />
  260. <!-- include "war" tagged dependencies -->
  261. <dependencies prefix="WEB-INF/lib" tag="war" />
  262. </mx:zip>
  263. </target>
  264. <!--
  265. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  266. Build the stand-alone, command-line Gitblit Federation Client
  267. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  268. -->
  269. <target name="buildFederationClient" depends="compile" description="Builds the stand-alone Gitblit federation client">
  270. <echo>Building Gitblit Federation Client ${project.version}</echo>
  271. <!-- generate jar by traversing the class hierarchy of the specified
  272. classes, exclude any classes in classpath jars -->
  273. <mx:genjar tag="" includeresources="false" excludeClasspathJars="true"
  274. destfile="${project.targetDirectory}/fedclient.jar"
  275. excludes="**/.class, **/*.java, **/Thumbs.db, **/*.mkd, **/*.md, **/*.css, com/gitblit/wicket/**">
  276. <mainclass name="com.gitblit.FederationClient" />
  277. <class name="com.gitblit.Keys" />
  278. <resource file="${project.compileOutputDirectory}/log4j.properties" />
  279. </mx:genjar>
  280. <!-- Build the federation client zip file -->
  281. <mx:zip destfile="${project.targetDirectory}/${fedclient.zipfile}">
  282. <fileset dir="${basedir}">
  283. <include name="LICENSE" />
  284. <include name="NOTICE" />
  285. </fileset>
  286. <fileset dir="${project.targetDirectory}">
  287. <include name="fedclient.jar" />
  288. </fileset>
  289. <fileset dir="${project.distrib.dir}">
  290. <include name="federation.properties" />
  291. </fileset>
  292. <!-- include "fedclient" tagged dependencies -->
  293. <dependencies prefix="ext" tag="fedclient" />
  294. </mx:zip>
  295. <!-- Cleanup -->
  296. <delete file="${project.targetDirectory}/fedclient.jar" />
  297. </target>
  298. <!--
  299. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  300. Build the stand-alone, Gitblit Manager
  301. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  302. -->
  303. <target name="buildManager" depends="compile" description="Builds the stand-alone Gitblit Manager">
  304. <echo>Building Gitblit Manager ${project.version}</echo>
  305. <!-- generate jar by traversing the class hierarchy of the specified
  306. classes, exclude any classes in classpath jars -->
  307. <mx:genjar tag="" includeResources="false" excludeClasspathJars="true"
  308. destfile="${project.targetDirectory}/manager.jar"
  309. excludes="**/.class, **/*.java, **/Thumbs.db, **/*.mkd, **/*.md, **/*.css, com/gitblit/wicket/**">
  310. <resource file="${project.src.dir}/com/gitblit/client/splash.png" />
  311. <resource file="${project.resources.dir}/gitblt-favicon.png" />
  312. <resource file="${project.resources.dir}/gitweb-favicon.png" />
  313. <resource file="${project.resources.dir}/git-orange-16x16.png" />
  314. <resource file="${project.resources.dir}/user_16x16.png" />
  315. <resource file="${project.resources.dir}/users_16x16.png" />
  316. <resource file="${project.resources.dir}/settings_16x16.png" />
  317. <resource file="${project.resources.dir}/lock_go_16x16.png" />
  318. <resource file="${project.resources.dir}/lock_pull_16x16.png" />
  319. <resource file="${project.resources.dir}/shield_16x16.png" />
  320. <resource file="${project.resources.dir}/federated_16x16.png" />
  321. <resource file="${project.resources.dir}/cold_16x16.png" />
  322. <resource file="${project.resources.dir}/book_16x16.png" />
  323. <resource file="${project.resources.dir}/bug_16x16.png" />
  324. <resource file="${project.resources.dir}/health_16x16.png" />
  325. <resource file="${project.resources.dir}/feed_16x16.png" />
  326. <resource file="${project.resources.dir}/bullet_feed.png" />
  327. <resource file="${project.resources.dir}/search-icon.png" />
  328. <resource file="${project.resources.dir}/commit_changes_16x16.png" />
  329. <resource file="${project.resources.dir}/commit_merge_16x16.png" />
  330. <resource file="${project.resources.dir}/commit_divide_16x16.png" />
  331. <resource file="${project.resources.dir}/star_16x16.png" />
  332. <resource file="${project.resources.dir}/mirror_16x16.png" />
  333. <resource file="${project.resources.dir}/blank.png" />
  334. <resource file="${project.src.dir}/log4j.properties" />
  335. <resource>
  336. <!-- inlcude all translations -->
  337. <fileset dir="${project.src.dir}/com/gitblit/wicket">
  338. <include name="*.properties" />
  339. </fileset>
  340. </resource>
  341. <mainclass name="com.gitblit.client.GitblitManager" />
  342. <class name="com.gitblit.Keys" />
  343. <class name="com.gitblit.client.GitblitClient" />
  344. <class name="com.gitblit.models.FederationModel" />
  345. <class name="com.gitblit.models.FederationProposal" />
  346. <class name="com.gitblit.models.FederationSet" />
  347. <manifest>
  348. <attribute name="SplashScreen-Image" value="splash.png" />
  349. </manifest>
  350. </mx:genjar>
  351. <!-- Build Manager Zip file -->
  352. <mx:zip destfile="${project.targetDirectory}/${manager.zipfile}">
  353. <fileset dir="${basedir}">
  354. <include name="LICENSE" />
  355. <include name="NOTICE" />
  356. </fileset>
  357. <fileset dir="${project.targetDirectory}">
  358. <include name="manager.jar" />
  359. </fileset>
  360. <!-- include "manager" tagged dependencies -->
  361. <dependencies prefix="ext" tag="manager" />
  362. </mx:zip>
  363. <!-- Cleanup -->
  364. <delete file="${project.targetDirectory}/manager.jar" />
  365. </target>
  366. <!--
  367. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  368. Build the Gitblit API client library
  369. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  370. -->
  371. <target name="buildApiLibrary" depends="compile" description="Builds the Gitblit RPC client library">
  372. <echo>Building Gitblit API Library ${project.version}</echo>
  373. <local name="javadoc.dir" />
  374. <property name="javadoc.dir" value="${project.outputDirectory}/javadoc" />
  375. <delete dir="${javadoc.dir}" />
  376. <!-- Build API Library jar -->
  377. <mx:genjar tag="" includeResources="false" excludeClasspathJars="true"
  378. destfile="${project.targetDirectory}/gbapi-${project.version}.jar"
  379. excludes="**/.class, **/*.java, **/Thumbs.db, **/*.mkd, **/*.md, **/*.css, com/gitblit/wicket/**">
  380. <mainclass name="com.gitblit.client.GitblitClient" />
  381. <class name="com.gitblit.Keys" />
  382. <class name="com.gitblit.models.FederationModel" />
  383. <class name="com.gitblit.models.FederationProposal" />
  384. <class name="com.gitblit.models.FederationSet" />
  385. </mx:genjar>
  386. <!-- Build API sources jar -->
  387. <zip destfile="${project.targetDirectory}/gbapi-${project.version}-sources.jar">
  388. <fileset dir="${project.src.dir}" defaultexcludes="yes">
  389. <include name="com/gitblit/Constants.java"/>
  390. <include name="com/gitblit/GitBlitException.java"/>
  391. <include name="com/gitblit/Keys.java"/>
  392. <include name="com/gitblit/client/**/*.java"/>
  393. <include name="com/gitblit/models/**/*.java"/>
  394. <include name="com/gitblit/utils/**/*.java"/>
  395. </fileset>
  396. </zip>
  397. <!-- Build API JavaDoc jar -->
  398. <mx:javadoc destdir="${javadoc.dir}" charset="utf-8" encoding="utf-8" docencoding="utf-8" redirect="true">
  399. <fileset dir="${project.src.dir}" defaultexcludes="yes">
  400. <include name="com/gitblit/Constants.java"/>
  401. <include name="com/gitblit/GitBlitException.java"/>
  402. <include name="com/gitblit/Keys.java"/>
  403. <include name="com/gitblit/client/**/*.java"/>
  404. <include name="com/gitblit/models/**/*.java"/>
  405. <include name="com/gitblit/utils/**/*.java"/>
  406. </fileset>
  407. </mx:javadoc>
  408. <zip destfile="${project.targetDirectory}/gbapi-${project.version}-javadoc.jar">
  409. <fileset dir="${javadoc.dir}" />
  410. </zip>
  411. <!-- Build the API library zip file -->
  412. <mx:zip destfile="${project.targetDirectory}/${gbapi.zipfile}">
  413. <fileset dir="${basedir}">
  414. <include name="LICENSE" />
  415. <include name="NOTICE" />
  416. </fileset>
  417. <fileset dir="${project.targetDirectory}">
  418. <include name="gbapi-${project.version}.jar" />
  419. <include name="gbapi-${project.version}-sources.jar" />
  420. <include name="gbapi-${project.version}-javadoc.jar" />
  421. </fileset>
  422. <!-- include "api" tagged dependencies -->
  423. <dependencies prefix="ext" tag="api" />
  424. </mx:zip>
  425. <!-- Cleanup -->
  426. <delete>
  427. <fileset dir="${project.targetDirectory}">
  428. <include name="javadoc/**" />
  429. </fileset>
  430. </delete>
  431. </target>
  432. <!--
  433. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  434. Build the Gitblit Website
  435. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  436. -->
  437. <target name="buildSite" depends="prepare" description="Build the Gitblit website">
  438. <echo>Building Gitblit Website ${project.version}</echo>
  439. <!-- Build Site -->
  440. <mx:doc googleanalyticsid="UA-24377072-1"
  441. minify="true" customless="custom.less">
  442. <structure>
  443. <menu name="about">
  444. <page name="overview" src="siteindex.mkd" out="index.html" headerLinks="false" />
  445. <page name="features" src="features.mkd" />
  446. <page name="screenshots" src="screenshots.mkd" />
  447. </menu>
  448. <menu name="documentation" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  449. <menu name="Gitblit GO" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  450. <page name="setup GO" src="setup_go.mkd" />
  451. <page name="upgrade GO" src="upgrade_go.mkd" />
  452. </menu>
  453. <divider />
  454. <menu name="Gitblit WAR" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  455. <page name="setup WAR" src="setup_war.mkd" />
  456. <page name="upgrade WAR" src="upgrade_war.mkd" />
  457. </menu>
  458. <divider />
  459. <menu name="Server Configuration" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  460. <page name="administration" src="administration.mkd" />
  461. <page name="authentication" src="setup_authentication.mkd" />
  462. <page name="push hooks" src="setup_hooks.mkd" />
  463. <page name="lucene indexing" src="setup_lucene.mkd" />
  464. <page name="reverse proxies" src="setup_proxy.mkd" />
  465. <page name="client app menus" src="setup_clientmenus.mkd" />
  466. <page name="bugtraq" src="setup_bugtraq.mkd" />
  467. <page name="mirrors" src="setup_mirrors.mkd" />
  468. <page name="scaling" src="setup_scaling.mkd" />
  469. <page name="fail2ban" src="setup_fail2ban.mkd" />
  470. <page name="filestore (Git LFS)" src="setup_filestore.mkd" />
  471. <divider />
  472. <page name="Gitblit as a viewer" src="setup_viewer.mkd" />
  473. </menu>
  474. <divider />
  475. <menu name="Client Usage" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  476. <page name="using HTTP/HTTPS" src="setup_transport_http.mkd" />
  477. <page name="using SSH" src="setup_transport_ssh.mkd" />
  478. <page name="using the Eclipse plugin" src="eclipse_plugin.mkd" />
  479. </menu>
  480. <divider />
  481. <menu name="Tickets" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  482. <page name="overview" src="tickets_overview.mkd" />
  483. <page name="using" src="tickets_using.mkd" />
  484. <page name="barnum" src="tickets_barnum.mkd" />
  485. <page name="setup" src="tickets_setup.mkd" />
  486. <page name="replication &amp; advanced administration" src="tickets_replication.mkd" />
  487. </menu>
  488. <divider />
  489. <menu name="Plugins" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  490. <page name="overview" src="plugins_overview.mkd" />
  491. <page name="extension points" src="plugins_extensions.mkd" />
  492. </menu>
  493. <divider />
  494. <page name="federation" src="federation.mkd" />
  495. <divider />
  496. <page name="settings" src="properties.mkd" />
  497. <page name="faq" src="faq.mkd" />
  498. <divider />
  499. <page name="design" src="design.mkd" />
  500. <page name="rpc" src="rpc.mkd" />
  501. </menu>
  502. <menu name="releases">
  503. <page name="release notes" out="releasenotes.html">
  504. <template src="releasecurrent.ftl" data="${releaselog}" />
  505. </page>
  506. <page name="release history" out="releases.html">
  507. <template src="releasehistory.ftl" data="${releaselog}" />
  508. </page>
  509. </menu>
  510. <menu name="downloads">
  511. <link name="Gitblit GO (Windows)" src="${gc.url}${currentRelease.tag}/gitblit-${project.releaseVersion}.zip" />
  512. <link name="Gitblit GO (Linux/OSX)" src="${gc.url}${currentRelease.tag}/gitblit-${project.releaseVersion}.tar.gz" />
  513. <link name="Gitblit WAR" src="${gc.url}${currentRelease.tag}/gitblit-${project.releaseVersion}.war" />
  514. <divider />
  515. <link name="Gitblit GO (Docker)" src="${docker.url}" />
  516. <divider />
  517. <link name="Plugins Registry" src="http://plugins.gitblit.com" />
  518. <divider />
  519. <link name="Gitblit Manager" src="${gc.url}${currentRelease.tag}/manager-${project.releaseVersion}.zip" />
  520. <link name="Federation Client" src="${gc.url}${currentRelease.tag}/fedclient-${project.releaseVersion}.zip" />
  521. <divider />
  522. <link name="API Library" src="${gc.url}${currentRelease.tag}/gbapi-${project.releaseVersion}.zip" />
  523. <divider />
  524. <link name="GitHub (1.9.0+)" src="https://github.com/${gh.org}/gitblit/releases" />
  525. <link name="Cloudsmith (1.3.0-1.8.0)" src="https://cloudsmith.io/~gitblit/repos/gitblit/groups/" />
  526. <divider />
  527. <link name="Maven Repository" src="${project.mavenUrl}" />
  528. </menu>
  529. <menu name="links">
  530. <link name="dev.gitblit.com (self-hosted)" src="https://dev.gitblit.com" />
  531. <divider />
  532. <link name="Plugins Registry" src="http://plugins.gitblit.com" />
  533. <divider />
  534. <link name="Github" src="${project.scmUrl}" />
  535. <link name="Issues" src="${project.issuesUrl}" />
  536. <link name="Discussion" src="${project.forumUrl}" />
  537. <link name="Twitter" src="https://twitter.com/gitblit" />
  538. <link name="OpenHub" src="https://www.openhub.net/p/gitblit" />
  539. <divider />
  540. <link name="Gitblit Tickets screencast" src="https://vimeo.com/86164723" />
  541. <link name="Gitblit SSH and Plugin Management asciicast" src="https://asciinema.org/a/9342" />
  542. <link name="GitMinutes #29: James Moger on Gitblit" src="http://episodes.gitminutes.com/2014/05/gitminutes-29-james-moger-on-gitblit.html" />
  543. <divider />
  544. <link name="@JamesMoger" src="https://twitter.com/JamesMoger" />
  545. </menu>
  546. <divider />
  547. </structure>
  548. <replace token="%GCURL%" value="${gc.url}${currentRelease.tag}/" />
  549. <replace token="%DOCKERURL%" value="${docker.url}" />
  550. <replace token="%GBLOG4JURL%" value="${gh.url}/${gh.repo}/blob/master/src/main/java/log4j.properties" />
  551. <properties token="%PROPERTIES%" file="${project.distrib.dir}/data/defaults.properties" />
  552. <regex searchPattern="\b(commit)(\s*[#]?|-){0,1}([0-9a-fA-F]{5,})\b" replacePattern="&lt;a href='https://github.com/gitblit-org/gitblit/commit/$3'&gt;commit $3&lt;/a&gt;" />
  553. <regex searchPattern="\b(issue)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='https://github.com/gitblit-org/gitblit/issues/$3'&gt;issue $3&lt;/a&gt;" />
  554. <regex searchPattern="\b(pr|pull request)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='https://github.com/gitblit-org/gitblit/pull/$3'&gt;pull request #$3&lt;/a&gt;" />
  555. <regex searchPattern="\b(ticket)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='https://dev.gitblit.com/tickets/gitblit.git/$3'&gt;ticket $3&lt;/a&gt;" />
  556. <!-- Set the logo from the mx:doc resources -->
  557. <logo file="${project.resources.dir}/gitblt_25_white.png" />
  558. <favicon file="${project.resources.dir}/gitblt-favicon.png" />
  559. <resource>
  560. <fileset dir="${project.resources.dir}">
  561. <include name="lock_go_16x16.png" />
  562. <include name="lock_pull_16x16.png" />
  563. <include name="shield_16x16.png" />
  564. <include name="cold_16x16.png" />
  565. <include name="bug_16x16.png" />
  566. <include name="book_16x16.png" />
  567. <include name="blank.png" />
  568. <include name="federated_16x16.png" />
  569. <include name="arrow_page.png" />
  570. </fileset>
  571. </resource>
  572. </mx:doc>
  573. <!-- Copy Fancybox -->
  574. <mkdir dir="${project.siteTargetDirectory}/fancybox" />
  575. <copy todir="${project.siteTargetDirectory}/fancybox">
  576. <fileset dir="${project.siteSourceDirectory}/fancybox">
  577. <exclude name="thumbs.db" />
  578. </fileset>
  579. </copy>
  580. <!-- Generate thumbnails of screenshots -->
  581. <mx:thumbs input="png" output="png" maximumDimension="250"
  582. sourceDir="${project.siteSourceDirectory}/screenshots"
  583. destDir="${project.siteTargetDirectory}/thumbs" />
  584. <!-- Copy screenshots -->
  585. <mkdir dir="${project.siteTargetDirectory}/screenshots" />
  586. <copy todir="${project.siteTargetDirectory}/screenshots">
  587. <fileset dir="${project.siteSourceDirectory}/screenshots">
  588. <include name="*.png" />
  589. </fileset>
  590. </copy>
  591. </target>
  592. <!--
  593. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  594. Package and deploy RELEASE artifacts to the Maven repository
  595. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  596. -->
  597. <target name="buildMavenArtifacts" depends="buildApiLibrary">
  598. <mx:package />
  599. <mx:deploy basedir="${maven.directory}" allowsnapshots="false" />
  600. <mx:deploy basedir="${maven.directory}" allowsnapshots="false"
  601. name="Gitblit API" description="Gitblit JSON/RSS API client library"
  602. tags="api" artifactid="gbapi" />
  603. </target>
  604. <!--
  605. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  606. Build all binaries and site
  607. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  608. -->
  609. <target name="buildAll" depends="buildGO,buildWAR,buildFederationClient,buildManager,buildApiLibrary,buildSite" />
  610. <!--
  611. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  612. Update the gh-pages branch with the current site
  613. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  614. -->
  615. <target name="updateGhPages" depends="prepare">
  616. <!-- Build gh-pages branch -->
  617. <mx:ghpages repositorydir="${basedir}" obliterate="true">
  618. <keep>
  619. <file name="CNAME"/>
  620. </keep>
  621. </mx:ghpages>
  622. </target>
  623. <!--
  624. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  625. Publish binaries to Bintray
  626. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  627. -->
  628. <target name="publishBinaries" depends="prepare" description="Publish the Gitblit binaries to Bintray">
  629. <echo>Uploading Gitblit ${project.version} binaries</echo>
  630. <!-- Upload Gitblit GO Windows ZIP file -->
  631. <bintrayUpload
  632. source="${project.targetDirectory}/${distribution.zipfile}"
  633. target="gitblit-${project.version}.zip" />
  634. <!-- Upload Gitblit GO Linux/Unix tar.gz file -->
  635. <bintrayUpload
  636. source="${project.targetDirectory}/${distribution.tgzfile}"
  637. target="gitblit-${project.version}.tar.gz" />
  638. <!-- Upload Gitblit WAR file -->
  639. <bintrayUpload
  640. source="${project.targetDirectory}/${distribution.warfile}"
  641. target="gitblit-${project.version}.war" />
  642. <!-- Upload Gitblit FedClient -->
  643. <bintrayUpload
  644. source="${project.targetDirectory}/${fedclient.zipfile}"
  645. target="fedclient-${project.version}.zip" />
  646. <!-- Upload Gitblit Manager -->
  647. <bintrayUpload
  648. source="${project.targetDirectory}/${manager.zipfile}"
  649. target="manager-${project.version}.zip" />
  650. <!-- Upload Gitblit API Library -->
  651. <bintrayUpload
  652. source="${project.targetDirectory}/${gbapi.zipfile}"
  653. target="gbapi-${project.version}.zip" />
  654. </target>
  655. <!--
  656. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  657. Publish binaries to GitHub release
  658. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  659. -->
  660. <target name="releaseBinaries" depends="prepare" description="Publish the Gitblit binaries to a GitHub release">
  661. <ghReleaseDraft
  662. releaselog="${releaselog}"
  663. releasetag="${release.tag}"/>
  664. <echo>Uploading Gitblit ${project.version} binaries</echo>
  665. <!-- Upload Gitblit GO Windows ZIP file -->
  666. <githubUpload
  667. source="${project.targetDirectory}/${distribution.zipfile}"
  668. target="gitblit-${project.version}.zip" />
  669. <!-- Upload Gitblit GO Linux/Unix tar.gz file -->
  670. <githubUpload
  671. source="${project.targetDirectory}/${distribution.tgzfile}"
  672. target="gitblit-${project.version}.tar.gz" />
  673. <!-- Upload Gitblit WAR file -->
  674. <githubUpload
  675. source="${project.targetDirectory}/${distribution.warfile}"
  676. target="gitblit-${project.version}.war" />
  677. <!-- Upload Gitblit FedClient -->
  678. <githubUpload
  679. source="${project.targetDirectory}/${fedclient.zipfile}"
  680. target="fedclient-${project.version}.zip" />
  681. <!-- Upload Gitblit Manager -->
  682. <githubUpload
  683. source="${project.targetDirectory}/${manager.zipfile}"
  684. target="manager-${project.version}.zip" />
  685. <!-- Upload Gitblit API Library -->
  686. <githubUpload
  687. source="${project.targetDirectory}/${gbapi.zipfile}"
  688. target="gbapi-${project.version}.zip" />
  689. </target>
  690. <!--
  691. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  692. Publish GH release draft
  693. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  694. -->
  695. <target name="publishRelease" depends="prepare" description="Publish the GitHub release draft" >
  696. <echo>Publishing Gitblit ${project.version} release draft on GitHub for tag ${release.tag}</echo>
  697. <ghGetReleaseId
  698. releaseVersion="${project.version}"/>
  699. <exec executable="bash" logError="true" >
  700. <arg value="-c" />
  701. <arg value="${octokit} -q edit_release ${gh.org} ${gh.repo} ${ghrelease.id} tag_name='${release.tag}'"></arg>
  702. </exec>
  703. <ghPublishReleaseDraft
  704. releaseid="${ghrelease.id}"/>
  705. </target>
  706. <!--
  707. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  708. Build site and update GH pages for publishing
  709. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  710. -->
  711. <target name="updateSite" depends="buildSite,updateGhPages" description="Update the Gitblit pages site" >
  712. </target>
  713. <!--
  714. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  715. Publish site to site hosting service
  716. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  717. -->
  718. <target name="publishSite" depends="clean,buildSite,updateGhPages" description="Publish the Gitblit site to a host" >
  719. <echo>Uploading Gitblit ${project.version} website</echo>
  720. <mx:ftp server="${ftp.server}"
  721. userid="${ftp.user}"
  722. password="${ftp.password}"
  723. remotedir="${ftp.dir}"
  724. passive="true"
  725. verbose="yes">
  726. <fileset dir="${project.siteTargetDirectory}" />
  727. </mx:ftp>
  728. </target>
  729. <!--
  730. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  731. Determine the release version and tag name.
  732. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  733. -->
  734. <target name="determineReleaseVersion" depends="prepare" description="determine the release version and tag name">
  735. <exec executable="bash" logError="true" outputproperty="determined_release.version">
  736. <arg value="-c" />
  737. <arg value="grep '^version:' build.moxie | sed -e 's/version: *//' -e 's/-SNAPSHOT//'"></arg>
  738. </exec>
  739. <property name="determined_release.tag" value="v${determined_release.version}" />
  740. <echo>Release version: ${determined_release.version}</echo>
  741. <echo>Release tag: ${determined_release.tag}</echo>
  742. <!-- output version information for other scripts/programs to pick up -->
  743. <mx:if>
  744. <and>
  745. <isset property="versionInfo" />
  746. <not><equals arg1="${versionInfo}" arg2="" trim="true"/></not>
  747. </and>
  748. <then>
  749. <echo file="${basedir}/${versionInfo}">
  750. GBLT_RELEASE_VERSION=${determined_release.version}
  751. GBLT_RELEASE_TAG=${determined_release.tag}
  752. </echo>
  753. </then>
  754. </mx:if>
  755. </target>
  756. <!--
  757. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  758. Tag a new version and prepare for the next development cycle.
  759. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  760. -->
  761. <target name="tagRelease" depends="prepare" description="tag a new version and prepare for the next development cycle">
  762. <!-- release -->
  763. <property name="dryrun" value="false" />
  764. <mx:version stage="release" dryrun="${dryrun}" />
  765. <property name="project.tag" value="v${project.version}" />
  766. <!-- commit build.moxie & releases.moxie (automatic) -->
  767. <mx:commit showtitle="no">
  768. <message>Prepare ${project.version} release</message>
  769. <tag name="${project.tag}">
  770. <message>${project.name} ${project.version} release</message>
  771. </tag>
  772. </mx:commit>
  773. <!-- output version information for other scripts/programs to pick up -->
  774. <mx:if>
  775. <and>
  776. <isset property="versionInfo" />
  777. <not><equals arg1="${versionInfo}" arg2="" trim="true"/></not>
  778. </and>
  779. <then>
  780. <echo file="${basedir}/${versionInfo}">
  781. GBLT_RELEASE_VERSION=${project.version}
  782. GBLT_RELEASE_TAG=${project.tag}
  783. </echo>
  784. </then>
  785. </mx:if>
  786. <!-- create the release process script -->
  787. <createReleaseScript
  788. projectVersion="${project.version}"
  789. projectTag="${project.tag}"
  790. projectCommitId="${project.commitId}" />
  791. </target>
  792. <!--
  793. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  794. Create the release process script from the template.
  795. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  796. -->
  797. <target name="releaseScript" depends="prepare" description="create the release process script for a release version">
  798. <!-- create the release process script -->
  799. <createReleaseScript
  800. projectVersion="${project.version}"
  801. projectTag="${release.tag}"
  802. projectCommitId="${release.tag}" />
  803. </target>
  804. <!--
  805. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  806. Prepare for the next point release development cycle.
  807. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  808. -->
  809. <target name="nextPointReleaseCycle" depends="prepare" description="prepare for the next point release development cycle">
  810. <!-- next cycle -->
  811. <mx:version stage="snapshot" incrementNumber="incremental" dryrun="${dryrun}" />
  812. <mx:commit showtitle="no">
  813. <message>Reset build identifiers for next point release cycle</message>
  814. </mx:commit>
  815. </target>
  816. <!--
  817. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  818. Prepare for the next minor release development cycle.
  819. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  820. -->
  821. <target name="nextMinorReleaseCycle" depends="prepare" description="prepare for the next minor release development cycle">
  822. <!-- next cycle -->
  823. <mx:version stage="snapshot" incrementNumber="minor" dryrun="${dryrun}" />
  824. <mx:commit showtitle="no">
  825. <message>Reset build identifiers for next minor release cycle</message>
  826. </mx:commit>
  827. </target>
  828. <!--
  829. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  830. Create the release process script from the template.
  831. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  832. -->
  833. <macrodef name="createReleaseScript">
  834. <attribute name="projectVersion" />
  835. <attribute name="projectTag" />
  836. <attribute name="projectCommitId" />
  837. <sequential>
  838. <mx:if>
  839. <os family="windows" />
  840. <then>
  841. <!-- Windows PowerShell script -->
  842. <!-- set-executionpolicy remotesigned -->
  843. <property name="recipe" value="release_@{projectVersion}.ps1" />
  844. </then>
  845. <else>
  846. <!-- Bash script -->
  847. <property name="recipe" value="release_@{projectVersion}.sh" />
  848. </else>
  849. </mx:if>
  850. <delete file="${recipe}" failonerror="false" quiet="true" verbose="false" />
  851. <!-- Work-around for lack of proper ant property substitution in copy -->
  852. <property name="dollar" value="$"/>
  853. <copy file="release.template" tofile="${recipe}">
  854. <filterset begintoken="${dollar}{" endtoken="}">
  855. <filter token="project.version" value="@{projectVersion}" />
  856. <filter token="project.commitId" value="@{projectCommitId}" />
  857. <filter token="project.tag" value="@{projectTag}" />
  858. <filter token="project.directory" value="${basedir}" />
  859. <filter token="maven.directory" value="${maven.directory}" />
  860. </filterset>
  861. </copy>
  862. <chmod file="${recipe}" perm="ugo+rx" />
  863. </sequential>
  864. </macrodef>
  865. <!--
  866. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  867. Build Gitblit Docs
  868. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  869. -->
  870. <macrodef name="generateDocs">
  871. <attribute name="toDir"/>
  872. <sequential>
  873. <mx:doc toDir="@{toDir}" minify="true" customless="custom.less">
  874. <structure>
  875. <menu name="about">
  876. <page name="overview" src="siteindex.mkd" out="index.html" headerLinks="false" />
  877. <page name="features" src="features.mkd" />
  878. </menu>
  879. <menu name="documentation">
  880. <menu name="Gitblit GO" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  881. <page name="setup GO" src="setup_go.mkd" />
  882. <page name="upgrade GO" src="upgrade_go.mkd" />
  883. </menu>
  884. <divider />
  885. <menu name="Gitblit WAR" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  886. <page name="setup WAR" src="setup_war.mkd" />
  887. <page name="upgrade WAR" src="upgrade_war.mkd" />
  888. </menu>
  889. <divider />
  890. <menu name="Server Configuration" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  891. <page name="administration" src="administration.mkd" />
  892. <page name="authentication" src="setup_authentication.mkd" />
  893. <page name="push hooks" src="setup_hooks.mkd" />
  894. <page name="lucene indexing" src="setup_lucene.mkd" />
  895. <page name="reverse proxies" src="setup_proxy.mkd" />
  896. <page name="client app menus" src="setup_clientmenus.mkd" />
  897. <page name="bugtraq" src="setup_bugtraq.mkd" />
  898. <page name="mirrors" src="setup_mirrors.mkd" />
  899. <page name="scaling" src="setup_scaling.mkd" />
  900. <page name="fail2ban" src="setup_fail2ban.mkd" />
  901. <page name="filestore (Git LFS)" src="setup_filestore.mkd" />
  902. <divider />
  903. <page name="Gitblit as a viewer" src="setup_viewer.mkd" />
  904. </menu>
  905. <divider />
  906. <menu name="Client Usage" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  907. <page name="using HTTP/HTTPS" src="setup_transport_http.mkd" />
  908. <page name="using SSH" src="setup_transport_ssh.mkd" />
  909. <page name="using the Eclipse plugin" src="eclipse_plugin.mkd" />
  910. </menu>
  911. <divider />
  912. <menu name="Tickets" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  913. <page name="overview" src="tickets_overview.mkd" />
  914. <page name="using" src="tickets_using.mkd" />
  915. <page name="barnum" src="tickets_barnum.mkd" />
  916. <page name="setup" src="tickets_setup.mkd" />
  917. <page name="replication &amp; advanced administration" src="tickets_replication.mkd" />
  918. </menu>
  919. <divider />
  920. <menu name="Plugins" pager="true" pagerPlacement="bottom" pagerLayout="justified">
  921. <page name="overview" src="plugins_overview.mkd" />
  922. <page name="extension points" src="plugins_extensions.mkd" />
  923. </menu>
  924. <divider />
  925. <page name="federation" src="federation.mkd" />
  926. <divider />
  927. <page name="settings" src="properties.mkd" />
  928. <page name="faq" src="faq.mkd" />
  929. <divider />
  930. <page name="design" src="design.mkd" />
  931. <page name="rpc" src="rpc.mkd" />
  932. </menu>
  933. <menu name="changelog">
  934. <page name="current release" out="releasenotes.html">
  935. <template src="releasecurrent.ftl" data="${releaselog}" />
  936. </page>
  937. <page name="all releases" out="releases.html">
  938. <template src="releasehistory.ftl" data="${releaselog}" />
  939. </page>
  940. </menu>
  941. <menu name="links">
  942. <link name="dev.gitblit.com (self-hosted)" src="https://dev.gitblit.com" />
  943. <divider />
  944. <link name="Plugins Registry" src="http://plugins.gitblit.com" />
  945. <divider />
  946. <link name="Github" src="${project.scmUrl}" />
  947. <link name="Issues" src="${project.issuesUrl}" />
  948. <link name="Discussion" src="${project.forumUrl}" />
  949. <link name="Twitter" src="https://twitter.com/gitblit" />
  950. <link name="OpenHub" src="https://www.openhub.net/p/gitblit" />
  951. </menu>
  952. </structure>
  953. <replace token="%GCURL%" value="${gc.url}${currentRelease.tag}/" />
  954. <replace token="%DOCKERURL%" value="${docker.url}" />
  955. <replace token="%GBLOG4JURL%" value="${gh.url}/${gh.repo}/blob/master/src/main/java/log4j.properties" />
  956. <properties token="%PROPERTIES%" file="${project.distrib.dir}/data/defaults.properties" />
  957. <regex searchPattern="\b(commit)(\s*[#]?|-){0,1}([0-9a-fA-F]{5,})\b" replacePattern="&lt;a href='https://github.com/gitblit-org/gitblit/commit/$3'&gt;commit $3&lt;/a&gt;" />
  958. <regex searchPattern="\b(issue)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='https://github.com/gitblit-org/gitblit/issues/$3'&gt;issue $3&lt;/a&gt;" />
  959. <regex searchPattern="\b(pr|pull request)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='https://github.com/gitblit-org/gitblit/pull/$3'&gt;pull request #$3&lt;/a&gt;" />
  960. <regex searchPattern="\b(ticket)(\s*[#]?|-){0,1}(\d+)\b" replacePattern="&lt;a href='https://dev.gitblit.com/tickets/gitblit.git/$3'&gt;ticket $3&lt;/a&gt;" />
  961. <!-- Set the logo from the mx:doc resources -->
  962. <logo file="${project.resources.dir}/gitblt_25_white.png" />
  963. <favicon file="${project.resources.dir}/gitblt-favicon.png" />
  964. <resource>
  965. <fileset dir="${project.resources.dir}">
  966. <include name="lock_go_16x16.png" />
  967. <include name="lock_pull_16x16.png" />
  968. <include name="shield_16x16.png" />
  969. <include name="cold_16x16.png" />
  970. <include name="bug_16x16.png" />
  971. <include name="book_16x16.png" />
  972. <include name="blank.png" />
  973. <include name="federated_16x16.png" />
  974. <include name="arrow_page.png" />
  975. </fileset>
  976. </resource>
  977. </mx:doc>
  978. </sequential>
  979. </macrodef>
  980. <!--
  981. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  982. Macro to create a pristine data directory for the target build
  983. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  984. -->
  985. <macrodef name="prepareDataDirectory">
  986. <attribute name="toDir"/>
  987. <sequential>
  988. <mkdir dir="@{toDir}" />
  989. <copy todir="@{toDir}" overwrite="false">
  990. <fileset dir="${project.distrib.dir}/data">
  991. <include name="users.conf" />
  992. <include name="projects.conf" />
  993. <include name="defaults.properties" />
  994. <include name="gitblit.properties" />
  995. </fileset>
  996. </copy>
  997. <mkdir dir="@{toDir}/git" />
  998. <copy todir="@{toDir}/git" overwrite="false">
  999. <fileset dir="${project.distrib.dir}/data/git">
  1000. <include name="project.mkd" />
  1001. </fileset>
  1002. </copy>
  1003. <mkdir dir="@{toDir}/groovy" />
  1004. <copy todir="@{toDir}/groovy">
  1005. <fileset dir="${project.distrib.dir}/data/groovy">
  1006. <include name="sendmail.groovy" />
  1007. <include name="sendmail-html.groovy" />
  1008. <include name="jenkins.groovy" />
  1009. <include name="protect-refs.groovy" />
  1010. <include name="blockpush.groovy" />
  1011. <include name="localclone.groovy" />
  1012. <include name="fogbugz.groovy" />
  1013. <include name="thebuggenie.groovy" />
  1014. <include name="fisheye.groovy" />
  1015. <include name="redmine-fetch.groovy" />
  1016. <include name="subgit.groovy" />
  1017. </fileset>
  1018. </copy>
  1019. <mkdir dir="@{toDir}/gitignore" />
  1020. <copy todir="@{toDir}/gitignore">
  1021. <fileset dir="${project.distrib.dir}/data/gitignore">
  1022. <include name="*.gitignore" />
  1023. </fileset>
  1024. </copy>
  1025. </sequential>
  1026. </macrodef>
  1027. <!--
  1028. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1029. Macro to upload binaries to Bintray
  1030. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1031. -->
  1032. <macrodef name="bintrayUpload">
  1033. <attribute name="source"/>
  1034. <attribute name="target"/>
  1035. <sequential>
  1036. <echo>uploading @{source} to Bintray</echo>
  1037. <exec executable="curl">
  1038. <arg line="--silent --show-error -T @{source} -u${bintray.username}:${bintray.apikey} https://api.bintray.com/content/gitblit/releases/gitblit/${project.version}/@{target}"></arg>
  1039. </exec>
  1040. </sequential>
  1041. </macrodef>
  1042. <!--
  1043. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1044. Macro to create release draft on GitHub
  1045. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1046. -->
  1047. <macrodef name="ghReleaseDraft">
  1048. <attribute name="releaselog" />
  1049. <attribute name="releasetag" />
  1050. <sequential>
  1051. <mx:if>
  1052. <isset property="updateRelease" />
  1053. <then>
  1054. <echo>updating release @{releasetag} draft on GitHub</echo>
  1055. <exec executable="bash" logError="true" failonerror="true" outputproperty="ghrelease.id">
  1056. <arg value="-c" />
  1057. <arg value="${octokit} list_releases ${gh.org} ${gh.repo} _filter='.[] | &quot;\(.name)\t\(.id)&quot;' | grep ${project.version} | cut -f2"></arg>
  1058. </exec>
  1059. </then>
  1060. <else>
  1061. <echo>creating release @{releasetag} draft on GitHub</echo>
  1062. <exec executable="bash" logError="true" failonerror="true" outputproperty="ghrelease.id">
  1063. <arg value="-c" />
  1064. <arg value="${octokit} create_release ${gh.org} ${gh.repo} @{releasetag} name=${project.version} draft=true | cut -f2"></arg>
  1065. </exec>
  1066. </else>
  1067. </mx:if>
  1068. <exec executable="bash" logError="true" failonerror="true" outputproperty="ghrelease.upldUrl">
  1069. <arg value="-c" />
  1070. <arg value="${octokit} release ${gh.org} ${gh.repo} ${ghrelease.id} _filter=.upload_url | sed 's/{.*$/?name=/'"></arg>
  1071. </exec>
  1072. <exec executable="bash" logError="true" failonerror="true" outputproperty="ghrelease.notes">
  1073. <arg value="-c" />
  1074. <arg value="cat @{releaselog} | awk -f ${relnoawk} protect=true"></arg>
  1075. </exec>
  1076. <exec executable="bash" logError="true" >
  1077. <arg value="-c" />
  1078. <arg value="${octokit} -q edit_release ${gh.org} ${gh.repo} ${ghrelease.id} tag_name='@{releasetag}' body='${ghrelease.notes}'"></arg>
  1079. </exec>
  1080. </sequential>
  1081. </macrodef>
  1082. <!--
  1083. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1084. Macro to upload binaries to GitHub
  1085. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1086. -->
  1087. <macrodef name="githubUpload">
  1088. <attribute name="source"/>
  1089. <attribute name="target"/>
  1090. <sequential>
  1091. <mx:if>
  1092. <isset property="updateRelease" />
  1093. <then>
  1094. <echo>removing @{target} on GitHub from release ${ghrelease.id}</echo>
  1095. <exec executable="bash" logError="true" failonerror="true">
  1096. <arg value="-c" />
  1097. <arg value="${octokit} release_assets ${gh.org} ${gh.repo} ${ghrelease.id} | grep @{target} | cut -f1 | xargs -L1 ${octokit} -y delete_asset ${gh.org} ${gh.repo}"></arg>
  1098. </exec>
  1099. </then>
  1100. <else>
  1101. </else>
  1102. </mx:if>
  1103. <echo>uploading @{source} to GitHub release ${ghrelease.id}</echo>
  1104. <exec executable="bash" logError="true" failonerror="true" >
  1105. <arg value="-c" />
  1106. <arg value="${octokit} upload_asset ${ghrelease.upldUrl}@{target} @{source}"></arg>
  1107. </exec>
  1108. </sequential>
  1109. </macrodef>
  1110. <!--
  1111. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1112. Macro to publish release draft on GitHub
  1113. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1114. -->
  1115. <macrodef name="ghPublishReleaseDraft">
  1116. <attribute name="releaseid"/>
  1117. <sequential>
  1118. <echo>publishing GitHub release draft @{releaseid}</echo>
  1119. <exec executable="bash" logError="true" >
  1120. <arg value="-c" />
  1121. <arg value="${octokit} -q edit_release ${gh.org} ${gh.repo} @{releaseid} draft=false"></arg>
  1122. </exec>
  1123. </sequential>
  1124. </macrodef>
  1125. <!--
  1126. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1127. Macro to publish release draft on GitHub
  1128. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1129. -->
  1130. <macrodef name="ghGetReleaseId">
  1131. <attribute name="releaseVersion"/>
  1132. <sequential>
  1133. <exec executable="bash" logError="true" failonerror="true" outputproperty="ghrelease.id">
  1134. <arg value="-c" />
  1135. <arg value="${octokit} list_releases ${gh.org} ${gh.repo} _filter='.[] | &quot;\(.name)\t\(.tag_name)\t\(.id)&quot;' | grep @{releaseVersion} | cut -f3"></arg>
  1136. </exec>
  1137. </sequential>
  1138. </macrodef>
  1139. <!--
  1140. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1141. Install Gitblit JAR for usage as Maven module
  1142. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1143. -->
  1144. <target name="installMaven" depends="compile" description="Install Gitblit JAR as Maven module">
  1145. <local name="project.jar" />
  1146. <property name="project.jar" value="${project.outputDirectory}/${project.artifactId}.jar" />
  1147. <property name="resourceFolderPrefix" value="" />
  1148. <mx:jar destfile="${project.jar}" packageSources="true" includeresources="true" resourceFolderPrefix="${resourceFolderPrefix}" />
  1149. <!-- Install Binary jar -->
  1150. <exec executable="mvn">
  1151. <arg value="install:install-file" />
  1152. <arg value="-Dfile=${project.jar}" />
  1153. <arg value="-DpomFile=${basedir}/pom.xml" />
  1154. <arg value="-DcreateChecksum=true" />
  1155. </exec>
  1156. <!-- Install Sources jar -->
  1157. <exec executable="mvn">
  1158. <arg value="install:install-file" />
  1159. <arg value="-Dfile=${project.outputDirectory}/${project.artifactId}-sources.jar" />
  1160. <arg value="-Dclassifier=sources" />
  1161. <arg value="-DpomFile=${basedir}/pom.xml" />
  1162. <arg value="-DcreateChecksum=true" />
  1163. </exec>
  1164. </target>
  1165. <!--
  1166. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1167. Upload Gitblit JAR to remote Maven repository
  1168. build.properties:
  1169. project.maven.repo.url = http://whatever.com/maven2
  1170. project.maven.repo.id = whateverId
  1171. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1172. -->
  1173. <target name="uploadMaven" depends="compile" description="Upload Gitblit JAR to remote Maven repository">
  1174. <local name="project.jar" />
  1175. <property name="project.jar" value="${project.outputDirectory}/gitblit.jar" />
  1176. <mx:jar destfile="${project.jar}" packageSources="true" includeresources="true" />
  1177. <exec executable="mvn">
  1178. <arg value="deploy:deploy-file" />
  1179. <arg value="-Dfile=${project.jar}" />
  1180. <arg value="-DpomFile=${basedir}/pom.xml" />
  1181. <arg value="-Durl=${project.maven.repo.url}" />
  1182. <arg value="-DrepositoryId=${project.maven.repo.id}" />
  1183. <arg value="-DcreateChecksum=true" />
  1184. </exec>
  1185. </target>
  1186. <!--
  1187. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1188. Install Gitblit JAR for usage as Moxie artifact
  1189. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1190. -->
  1191. <target name="installMoxie" depends="compile" description="Install Gitblit JAR as a Moxie artifact">
  1192. <local name="project.jar" />
  1193. <property name="project.jar" value="${project.targetDirectory}/${project.artifactId}-${project.version}.jar" />
  1194. <property name="resourceFolderPrefix" value="" />
  1195. <mx:jar destfile="${project.jar}" packageSources="true" includeresources="true" resourceFolderPrefix="${resourceFolderPrefix}" />
  1196. <mx:install />
  1197. </target>
  1198. <!--
  1199. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1200. Build Gitblit UI via npm
  1201. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1202. -->
  1203. <target name="buildUI" description="Build Gitblit UI via npm">
  1204. <exec executable="npm" dir="src/main/js/" failonerror="true" vmlauncher="false" searchpath="true" >
  1205. <arg value="install" />
  1206. </exec>
  1207. <exec executable="npm" dir="src/main/js/" failonerror="true" vmlauncher="false" searchpath="true" >
  1208. <arg value="run" />
  1209. <arg value="build" />
  1210. </exec>
  1211. </target>
  1212. </project>