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

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