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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  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.site.dir" value="${basedir}/site" />
  15. <property name="project.resources.dir" value="${basedir}/resources" />
  16. <available property="hasBuildProps" file="${basedir}/build.properties"/>
  17. <!--
  18. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  19. Load build.properties, if available
  20. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  21. -->
  22. <target name="buildprops" if="hasBuildProps">
  23. <!-- Load publication servers, paths, and credentials -->
  24. <loadproperties>
  25. <file file="${basedir}/build.properties" />
  26. </loadproperties>
  27. </target>
  28. <!--
  29. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  30. Scrape the version info from code and setup the build properties
  31. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  32. -->
  33. <target name="buildinfo" depends="buildprops">
  34. <!-- extract Gitblit version number from source code -->
  35. <loadfile property="gb.version" srcfile="${basedir}/src/com/gitblit/Constants.java">
  36. <filterchain>
  37. <linecontains>
  38. <contains value="public static final String VERSION = " />
  39. </linecontains>
  40. <striplinebreaks />
  41. <tokenfilter>
  42. <replacestring from="public static final String VERSION = &quot;" to="" />
  43. <replacestring from="&quot;;" to="" />
  44. <trim />
  45. </tokenfilter>
  46. </filterchain>
  47. </loadfile>
  48. <!-- extract Gitblit version date from source code -->
  49. <loadfile property="gb.versionDate" srcfile="${basedir}/src/com/gitblit/Constants.java">
  50. <filterchain>
  51. <linecontains>
  52. <contains value="public static final String VERSION_DATE = " />
  53. </linecontains>
  54. <striplinebreaks />
  55. <tokenfilter>
  56. <replacestring from="public static final String VERSION_DATE = &quot;" to="" />
  57. <replacestring from="&quot;;" to="" />
  58. <trim />
  59. </tokenfilter>
  60. </filterchain>
  61. </loadfile>
  62. <!-- extract JGit version number from source code -->
  63. <loadfile property="jgit.version" srcfile="${basedir}/src/com/gitblit/Constants.java">
  64. <filterchain>
  65. <linecontains>
  66. <contains value="public static final String JGIT_VERSION = " />
  67. </linecontains>
  68. <striplinebreaks />
  69. <tokenfilter>
  70. <replacestring from="public static final String JGIT_VERSION = &quot;" to="" />
  71. <replacestring from="&quot;;" to="" />
  72. <trim />
  73. </tokenfilter>
  74. </filterchain>
  75. </loadfile>
  76. <property name="distribution.zipfile" value="gitblit-${gb.version}.zip" />
  77. <property name="distribution.warfile" value="gitblit-${gb.version}.war" />
  78. <property name="fedclient.zipfile" value="fedclient-${gb.version}.zip" />
  79. <property name="manager.zipfile" value="manager-${gb.version}.zip" />
  80. <property name="gbapi.zipfile" value="gbapi-${gb.version}.zip" />
  81. </target>
  82. <!--
  83. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  84. Compile
  85. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  86. -->
  87. <target name="compile" depends="buildinfo" description="Retrieves dependencies and compiles Gitblit from source">
  88. <!-- copy required distribution files to project folder -->
  89. <copy todir="${basedir}" overwrite="false">
  90. <fileset dir="${basedir}/distrib">
  91. <include name="gitblit.properties" />
  92. <include name="users.properties" />
  93. </fileset>
  94. </copy>
  95. <!-- copy gitblit.properties to the WEB-INF folder.
  96. this file is only used for parsing setting descriptions. -->
  97. <copy tofile="${basedir}/src/WEB-INF/reference.properties" overwrite="true"
  98. file="${basedir}/distrib/gitblit.properties" />
  99. <!-- Compile the build tool and execute it.
  100. This downloads missing compile-time dependencies from Maven. -->
  101. <delete dir="${project.build.dir}" />
  102. <mkdir dir="${project.build.dir}" />
  103. <javac debug="true" srcdir="${basedir}/src" destdir="${project.build.dir}">
  104. <include name="com/gitblit/build/Build.java" />
  105. <include name="com/gitblit/Constants.java" />
  106. <include name="com/gitblit/utils/StringUtils.java" />
  107. </javac>
  108. <java classpath="${project.build.dir}" classname="com.gitblit.build.Build" />
  109. <!-- Compile Project -->
  110. <path id="master-classpath">
  111. <fileset dir="${basedir}/ext">
  112. <include name="*.jar" />
  113. </fileset>
  114. <pathelement path="${project.build.dir}" />
  115. </path>
  116. <javac debug="true" destdir="${project.build.dir}" failonerror="false">
  117. <src path="${basedir}/src" />
  118. <classpath refid="master-classpath" />
  119. </javac>
  120. <copy todir="${project.build.dir}">
  121. <fileset dir="${basedir}/src" excludes="**/*.java,**/thumbs.db" />
  122. </copy>
  123. </target>
  124. <!--
  125. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  126. Build Gitblit GO
  127. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  128. -->
  129. <target name="buildGO" depends="compile" description="Build Gitblit GO distribution">
  130. <echo>Building Gitblit GO ${gb.version}</echo>
  131. <!-- Delete the deploy folder -->
  132. <delete dir="${project.deploy.dir}" />
  133. <!-- Create deployment folder structure -->
  134. <mkdir dir="${project.deploy.dir}" />
  135. <copy todir="${project.deploy.dir}">
  136. <fileset dir="${basedir}/distrib">
  137. <include name="**/*" />
  138. <exclude name="federation.properties" />
  139. </fileset>
  140. <fileset dir="${basedir}">
  141. <include name="LICENSE" />
  142. <include name="NOTICE" />
  143. </fileset>
  144. </copy>
  145. <!-- Build jar -->
  146. <jar jarfile="${project.deploy.dir}/${project.jar}">
  147. <fileset dir="${project.build.dir}">
  148. <include name="**/*" />
  149. <exclude name="com/gitblit/client/**" />
  150. </fileset>
  151. <fileset dir="${project.resources.dir}">
  152. <exclude name="thumbs.db" />
  153. </fileset>
  154. <manifest>
  155. <attribute name="Main-Class" value="${project.mainclass}" />
  156. </manifest>
  157. </jar>
  158. <!-- Build the docs for the deploy -->
  159. <antcall target="buildDocs" inheritall="true" inheritrefs="true">
  160. <param name="docs.output.dir" value="${project.deploy.dir}/docs" />
  161. </antcall>
  162. <!-- Create Zip deployment -->
  163. <zip destfile="${distribution.zipfile}">
  164. <fileset dir="${project.deploy.dir}">
  165. <include name="**/*" />
  166. </fileset>
  167. </zip>
  168. </target>
  169. <!--
  170. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  171. Build Gitblit Docs which are bundled with GO and WAR downloads
  172. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  173. -->
  174. <target name="buildDocs">
  175. <!-- Build Docs -->
  176. <mkdir dir="${docs.output.dir}" />
  177. <copy todir="${docs.output.dir}">
  178. <!-- Copy selected Gitblit resources -->
  179. <fileset dir="${project.resources.dir}">
  180. <include name="bootstrap.130.css" />
  181. <include name="bootstrap.gb.css" />
  182. <include name="markdown.css" />
  183. <include name="gitblt_25_white.png" />
  184. <include name="gitblt-favicon.png" />
  185. <include name="lock_go_16x16.png" />
  186. <include name="lock_pull_16x16.png" />
  187. <include name="shield_16x16.png" />
  188. <include name="cold_16x16.png" />
  189. <include name="bug_16x16.png" />
  190. <include name="book_16x16.png" />
  191. <include name="blank.png" />
  192. <include name="federated_16x16.png" />
  193. <include name="arrow_page.png" />
  194. </fileset>
  195. <!-- Copy Doc images -->
  196. <fileset dir="${basedir}/docs">
  197. <include name="*.png" />
  198. </fileset>
  199. </copy>
  200. <!-- Copy google-code-prettify -->
  201. <mkdir dir="${docs.output.dir}/prettify" />
  202. <copy todir="${docs.output.dir}/prettify">
  203. <fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
  204. <exclude name="thumbs.db" />
  205. </fileset>
  206. </copy>
  207. <!-- Build deployment doc pages -->
  208. <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildSite">
  209. <classpath refid="master-classpath" />
  210. <arg value="--sourceFolder" />
  211. <arg value="${basedir}/docs" />
  212. <arg value="--outputFolder" />
  213. <arg value="${docs.output.dir}" />
  214. <arg value="--pageHeader" />
  215. <arg value="${basedir}/docs/doc_header.html" />
  216. <arg value="--pageFooter" />
  217. <arg value="${basedir}/docs/doc_footer.html" />
  218. <arg value="--skip" />
  219. <arg value="screenshots" />
  220. <arg value="--skip" />
  221. <arg value="releases" />
  222. <arg value="--alias" />
  223. <arg value="index=overview" />
  224. <arg value="--alias" />
  225. <arg value="properties=settings" />
  226. <arg value="--substitute" />
  227. <arg value="%VERSION%=${gb.version}" />
  228. <arg value="--substitute" />
  229. <arg value="%GO%=${distribution.zipfile}" />
  230. <arg value="--substitute" />
  231. <arg value="%WAR%=${distribution.warfile}" />
  232. <arg value="--substitute" />
  233. <arg value="%FEDCLIENT%=${fedclient.zipfile}" />
  234. <arg value="--substitute" />
  235. <arg value="%MANAGER%=${manager.zipfile}" />
  236. <arg value="--substitute" />
  237. <arg value="%API%=${gbapi.zipfile}" />
  238. <arg value="--substitute" />
  239. <arg value="%BUILDDATE%=${gb.versionDate}" />
  240. <arg value="--substitute" />
  241. <arg value="%JGIT%=${jgit.version}" />
  242. <arg value="--properties" />
  243. <arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
  244. <arg value="--nomarkdown" />
  245. <arg value="%BEGINCODE%:%ENDCODE%" />
  246. <arg value="--substitute" />
  247. <arg value="&quot;%BEGINCODE%=&lt;pre class='prettyprint lang-java'&gt;&quot;" />
  248. <arg value="--substitute" />
  249. <arg value="%ENDCODE%=&lt;/pre&gt;" />
  250. <arg value="--regex" />
  251. <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;" />
  252. </java>
  253. </target>
  254. <!--
  255. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  256. Build Gitblit WAR
  257. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  258. -->
  259. <target name="buildWAR" depends="compile" description="Build Gitblit WAR">
  260. <echo>Building Gitblit WAR ${gb.version}</echo>
  261. <delete dir="${project.war.dir}" />
  262. <!-- Copy web.xml and users.properties to WEB-INF -->
  263. <copy todir="${project.war.dir}/WEB-INF">
  264. <fileset dir="${basedir}/distrib">
  265. <include name="users.properties" />
  266. </fileset>
  267. <fileset dir="${basedir}/src/WEB-INF">
  268. <include name="web.xml" />
  269. </fileset>
  270. <fileset dir="${basedir}">
  271. <include name="LICENSE" />
  272. <include name="NOTICE" />
  273. </fileset>
  274. </copy>
  275. <!-- Copy gitblit.properties as reference.properties -->
  276. <copy tofile="${project.war.dir}/WEB-INF/reference.properties"
  277. file="${basedir}/distrib/gitblit.properties"/>
  278. <!-- Build the docs for the WAR build -->
  279. <antcall target="buildDocs" inheritall="true" inheritrefs="true">
  280. <param name="docs.output.dir" value="${project.war.dir}/WEB-INF/docs" />
  281. </antcall>
  282. <!-- Build the WAR web.xml from the prototype web.xml and gitblit.properties -->
  283. <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildWebXml">
  284. <classpath refid="master-classpath" />
  285. <arg value="--sourceFile" />
  286. <arg value="${basedir}/src/WEB-INF/web.xml" />
  287. <arg value="--destinationFile" />
  288. <arg value="${project.war.dir}/WEB-INF/web.xml" />
  289. <arg value="--propertiesFile" />
  290. <arg value="${basedir}/distrib/gitblit.properties" />
  291. </java>
  292. <!-- Gitblit resources -->
  293. <copy todir="${project.war.dir}">
  294. <fileset dir="${project.resources.dir}">
  295. <exclude name="thumbs.db" />
  296. </fileset>
  297. </copy>
  298. <!-- Gitblit library dependencies -->
  299. <mkdir dir="${project.war.dir}/WEB-INF/lib"/>
  300. <copy todir="${project.war.dir}/WEB-INF/lib">
  301. <fileset dir="${basedir}/ext">
  302. <exclude name="*-sources.jar" />
  303. <exclude name="*-javadoc.jar" />
  304. <exclude name="jcommander*.jar" />
  305. <exclude name="jetty*.jar" />
  306. <exclude name="junit*.jar" />
  307. <exclude name="servlet*.jar" />
  308. </fileset>
  309. </copy>
  310. <!-- Gitblit classes -->
  311. <mkdir dir="${project.war.dir}/WEB-INF/classes"/>
  312. <copy todir="${project.war.dir}/WEB-INF/classes">
  313. <fileset dir="${project.build.dir}">
  314. <exclude name="WEB-INF/web.xml" />
  315. <exclude name="com/gitblit/tests/" />
  316. <exclude name="com/gitblit/build/**" />
  317. <exclude name="com/gitblit/client/**" />
  318. <exclude name="com/gitblit/GitBlitServer*.class" />
  319. <exclude name="com/gitblit/Launcher*.class" />
  320. <exclude name="com/gitblit/MakeCertificate*.class" />
  321. </fileset>
  322. </copy>
  323. <!-- Build the WAR file -->
  324. <jar basedir="${project.war.dir}" destfile="${distribution.warfile}" compress="true" />
  325. </target>
  326. <!--
  327. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  328. Build the stand-alone, command-line Gitblit Federation Client
  329. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  330. -->
  331. <target name="buildFederationClient" depends="compile" description="Builds the stand-alone Gitblit federation client">
  332. <echo>Building Gitblit Federation Client ${gb.version}</echo>
  333. <genjar jarfile="fedclient.jar">
  334. <class name="com.gitblit.FederationClientLauncher" />
  335. <resource file="${project.build.dir}/log4j.properties" />
  336. <classfilter>
  337. <exclude name="org.apache." />
  338. <exclude name="org.bouncycastle." />
  339. <exclude name="org.eclipse." />
  340. <exclude name="org.slf4j." />
  341. <exclude name="com.beust." />
  342. <exclude name="com.google." />
  343. </classfilter>
  344. <classpath refid="master-classpath" />
  345. <manifest>
  346. <attribute name="Main-Class" value="com.gitblit.FederationClientLauncher" />
  347. <attribute name="Specification-Version" value="${gb.version}" />
  348. <attribute name="Release-Date" value="${gb.versionDate}" />
  349. </manifest>
  350. </genjar>
  351. <!-- Build the federation client zip file -->
  352. <zip destfile="${fedclient.zipfile}">
  353. <fileset dir="${basedir}">
  354. <include name="fedclient.jar" />
  355. <include name="LICENSE" />
  356. <include name="NOTICE" />
  357. </fileset>
  358. <fileset dir="${basedir}/distrib">
  359. <include name="federation.properties" />
  360. </fileset>
  361. </zip>
  362. </target>
  363. <!--
  364. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  365. Build the stand-alone, Gitblit Manager
  366. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  367. -->
  368. <target name="buildManager" depends="compile" description="Builds the stand-alone Gitblit Manager">
  369. <echo>Building Gitblit Manager ${gb.version}</echo>
  370. <genjar jarfile="maanager-${gb.version}.jar">
  371. <resource file="${basedir}/src/com/gitblit/client/splash.png" />
  372. <resource file="${basedir}/resources/gitblt-favicon.png" />
  373. <resource file="${basedir}/resources/gitweb-favicon.png" />
  374. <resource file="${basedir}/resources/user_16x16.png" />
  375. <resource file="${basedir}/resources/settings_16x16.png" />
  376. <resource file="${basedir}/resources/lock_go_16x16.png" />
  377. <resource file="${basedir}/resources/lock_pull_16x16.png" />
  378. <resource file="${basedir}/resources/shield_16x16.png" />
  379. <resource file="${basedir}/resources/federated_16x16.png" />
  380. <resource file="${basedir}/resources/cold_16x16.png" />
  381. <resource file="${basedir}/resources/book_16x16.png" />
  382. <resource file="${basedir}/resources/bug_16x16.png" />
  383. <resource file="${basedir}/resources/health_16x16.png" />
  384. <resource file="${basedir}/resources/feed_16x16.png" />
  385. <resource file="${basedir}/resources/bullet_feed.png" />
  386. <resource file="${basedir}/resources/search-icon.png" />
  387. <resource file="${basedir}/resources/commit_changes_16x16.png" />
  388. <resource file="${basedir}/resources/commit_merge_16x16.png" />
  389. <resource file="${basedir}/resources/blank.png" />
  390. <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp.properties" />
  391. <class name="com.gitblit.client.GitblitManagerLauncher" />
  392. <classfilter>
  393. <exclude name="org.apache." />
  394. <exclude name="org.bouncycastle." />
  395. <exclude name="org.eclipse." />
  396. <exclude name="org.slf4j." />
  397. <exclude name="com.beust." />
  398. <exclude name="com.google." />
  399. </classfilter>
  400. <classpath refid="master-classpath" />
  401. <manifest>
  402. <attribute name="Main-Class" value="com.gitblit.client.GitblitManagerLauncher" />
  403. <attribute name="SplashScreen-Image" value="splash.png" />
  404. <attribute name="Specification-Version" value="${gb.version}" />
  405. <attribute name="Release-Date" value="${gb.versionDate}" />
  406. </manifest>
  407. </genjar>
  408. <!-- Build Manager Zip file -->
  409. <zip destfile="${manager.zipfile}">
  410. <fileset dir="${basedir}">
  411. <include name="manager-${gb.version}.jar" />
  412. <include name="LICENSE" />
  413. <include name="NOTICE" />
  414. </fileset>
  415. </zip>
  416. </target>
  417. <!--
  418. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  419. Build the Gitblit API client library
  420. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  421. -->
  422. <target name="buildApiLibrary" depends="compile" description="Builds the Gitblit RPC client library">
  423. <echo>Building Gitblit API Library ${gb.version}</echo>
  424. <!-- Build API Library jar -->
  425. <genjar jarfile="gbapi-${gb.version}.jar">
  426. <class name="com.gitblit.Keys" />
  427. <class name="com.gitblit.client.GitblitClient" />
  428. <classpath refid="master-classpath" />
  429. <classfilter>
  430. <exclude name="com.google.gson." />
  431. <exclude name="com.sun.syndication." />
  432. </classfilter>
  433. <manifest>
  434. <attribute name="Specification-Version" value="${gb.version}" />
  435. <attribute name="Release-Date" value="${gb.versionDate}" />
  436. </manifest>
  437. </genjar>
  438. <!-- Build API sources jar -->
  439. <zip destfile="gbapi-${gb.version}-sources.jar">
  440. <fileset dir="${basedir}/src" defaultexcludes="yes">
  441. <include name="com/gitblit/Constants.java"/>
  442. <include name="com/gitblit/GitBlitException.java"/>
  443. <include name="com/gitblit/Keys.java"/>
  444. <include name="com/gitblit/client/**/*.java"/>
  445. <include name="com/gitblit/models/**/*.java"/>
  446. <include name="com/gitblit/utils/**/*.java"/>
  447. </fileset>
  448. </zip>
  449. <!-- Build API JavaDoc jar -->
  450. <javadoc destdir="${basedir}/javadoc">
  451. <fileset dir="${basedir}/src" defaultexcludes="yes">
  452. <include name="com/gitblit/Constants.java"/>
  453. <include name="com/gitblit/GitBlitException.java"/>
  454. <include name="com/gitblit/Keys.java"/>
  455. <include name="com/gitblit/client/**/*.java"/>
  456. <include name="com/gitblit/models/**/*.java"/>
  457. <include name="com/gitblit/utils/**/*.java"/>
  458. </fileset>
  459. </javadoc>
  460. <zip destfile="gbapi-${gb.version}-javadoc.jar">
  461. <fileset dir="${basedir}/javadoc" />
  462. </zip>
  463. <!-- Build the API library zip file -->
  464. <zip destfile="${gbapi.zipfile}">
  465. <fileset dir="${basedir}">
  466. <include name="gbapi-${gb.version}.jar" />
  467. <include name="gbapi-${gb.version}-sources.jar" />
  468. <include name="gbapi-${gb.version}-javadoc.jar" />
  469. <include name="LICENSE" />
  470. <include name="NOTICE" />
  471. </fileset>
  472. <fileset dir="${basedir}/ext">
  473. <include name="gson*.jar" />
  474. <exclude name="gson*-sources.jar" />
  475. <exclude name="gson*-javadoc.jar" />
  476. <include name="rome*.jar" />
  477. <exclude name="rome*-sources.jar" />
  478. <exclude name="rome*-javadoc.jar" />
  479. </fileset>
  480. </zip>
  481. </target>
  482. <!--
  483. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  484. Build the Gitblit Website
  485. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  486. -->
  487. <target name="buildSite" depends="compile" description="Build the Gitblit website">
  488. <echo>Building Gitblit Website ${gb.version}</echo>
  489. <!-- Build Site -->
  490. <delete dir="${project.site.dir}" />
  491. <mkdir dir="${project.site.dir}" />
  492. <copy todir="${project.site.dir}">
  493. <!-- Copy selected Gitblit resources -->
  494. <fileset dir="${project.resources.dir}">
  495. <include name="bootstrap.130.css" />
  496. <include name="bootstrap.gb.css" />
  497. <include name="markdown.css" />
  498. <include name="gitblt_25_white.png" />
  499. <include name="gitblt-favicon.png" />
  500. <include name="lock_go_16x16.png" />
  501. <include name="lock_pull_16x16.png" />
  502. <include name="shield_16x16.png" />
  503. <include name="cold_16x16.png" />
  504. <include name="bug_16x16.png" />
  505. <include name="book_16x16.png" />
  506. <include name="blank.png" />
  507. <include name="federated_16x16.png" />
  508. <include name="arrow_page.png" />
  509. </fileset>
  510. <!-- Copy Doc images -->
  511. <fileset dir="${basedir}/docs">
  512. <include name="*.png" />
  513. <include name="*.js" />
  514. </fileset>
  515. </copy>
  516. <!-- Copy Fancybox -->
  517. <mkdir dir="${project.site.dir}/fancybox" />
  518. <copy todir="${project.site.dir}/fancybox">
  519. <fileset dir="${basedir}/docs/fancybox">
  520. <exclude name="thumbs.db" />
  521. </fileset>
  522. </copy>
  523. <!-- Copy google-code-prettify -->
  524. <mkdir dir="${basedir}/src/com/gitblit/wicket/pages/prettify" />
  525. <copy todir="${project.site.dir}/prettify">
  526. <fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
  527. <exclude name="thumbs.db" />
  528. </fileset>
  529. </copy>
  530. <!-- Generate thumbnails of screenshots -->
  531. <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildThumbnails">
  532. <classpath refid="master-classpath" />
  533. <arg value="--sourceFolder" />
  534. <arg value="${basedir}/docs/screenshots" />
  535. <arg value="--destinationFolder" />
  536. <arg value="${project.site.dir}/thumbs" />
  537. <arg value="--maximumDimension" />
  538. <arg value="250" />
  539. </java>
  540. <!-- Copy screenshots -->
  541. <mkdir dir="${project.site.dir}/screenshots" />
  542. <copy todir="${project.site.dir}/screenshots">
  543. <fileset dir="${basedir}/docs/screenshots">
  544. <include name="*.png" />
  545. </fileset>
  546. </copy>
  547. <!-- Build site pages -->
  548. <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildSite">
  549. <classpath refid="master-classpath" />
  550. <arg value="--sourceFolder" />
  551. <arg value="${basedir}/docs" />
  552. <arg value="--outputFolder" />
  553. <arg value="${project.site.dir}" />
  554. <arg value="--pageHeader" />
  555. <arg value="${basedir}/docs/site_header.html" />
  556. <arg value="--pageFooter" />
  557. <arg value="${basedir}/docs/site_footer.html" />
  558. <arg value="--analyticsSnippet" />
  559. <arg value="${basedir}/docs/site_analytics.html" />
  560. <arg value="--adSnippet" />
  561. <arg value="${basedir}/docs/site_ads.html" />
  562. <arg value="--alias" />
  563. <arg value="index=overview" />
  564. <arg value="--alias" />
  565. <arg value="properties=settings" />
  566. <arg value="--substitute" />
  567. <arg value="%VERSION%=${gb.version}" />
  568. <arg value="--substitute" />
  569. <arg value="%GO%=${distribution.zipfile}" />
  570. <arg value="--substitute" />
  571. <arg value="%WAR%=${distribution.warfile}" />
  572. <arg value="--substitute" />
  573. <arg value="%FEDCLIENT%=${fedclient.zipfile}" />
  574. <arg value="--substitute" />
  575. <arg value="%MANAGER%=${manager.zipfile}" />
  576. <arg value="--substitute" />
  577. <arg value="%API%=${gbapi.zipfile}" />
  578. <arg value="--substitute" />
  579. <arg value="%BUILDDATE%=${gb.versionDate}" />
  580. <arg value="--substitute" />
  581. <arg value="%JGIT%=${jgit.version}" />
  582. <arg value="--properties" />
  583. <arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
  584. <arg value="--nomarkdown" />
  585. <arg value="%BEGINCODE%:%ENDCODE%" />
  586. <arg value="--substitute" />
  587. <arg value="&quot;%BEGINCODE%=&lt;pre class='prettyprint lang-java'&gt;&quot;" />
  588. <arg value="--substitute" />
  589. <arg value="%ENDCODE%=&lt;/pre&gt;" />
  590. <arg value="--regex" />
  591. <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;" />
  592. </java>
  593. </target>
  594. <!--
  595. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  596. Compile from source, publish binaries, and build & deploy site
  597. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  598. -->
  599. <target name="buildAll" depends="buildGO,buildWAR,buildFederationClient,buildManager,buildApiLibrary,buildSite">
  600. <!-- Cleanup -->
  601. <delete dir="${project.build.dir}" />
  602. <delete dir="${project.war.dir}" />
  603. <delete dir="${project.deploy.dir}" />
  604. </target>
  605. <!--
  606. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  607. Publish binaries to Google Code
  608. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  609. -->
  610. <target name="publishBinaries" depends="buildGO,buildWAR,buildFederationClient,buildManager" description="Publish the Gitblit binaries to Google Code">
  611. <echo>Uploading Gitblit ${gb.version} binaries</echo>
  612. <!-- Upload Gitblit GO ZIP file -->
  613. <gcupload
  614. username="${googlecode.user}"
  615. password="${googlecode.password}"
  616. projectname="gitblit"
  617. filename="${distribution.zipfile}"
  618. targetfilename="gitblit-${gb.version}.zip"
  619. summary="Gitblit GO v${gb.version} (standalone, integrated Gitblit server)"
  620. labels="Featured, Type-Package, OpSys-All" />
  621. <!-- Upload Gitblit WAR file -->
  622. <gcupload
  623. username="${googlecode.user}"
  624. password="${googlecode.password}"
  625. projectname="gitblit"
  626. filename="${distribution.warfile}"
  627. targetfilename="gitblit-${gb.version}.war"
  628. summary="Gitblit WAR v${gb.version} (standard WAR webapp for servlet containers)"
  629. labels="Featured, Type-Package, OpSys-All" />
  630. <!-- Upload Gitblit FedClient -->
  631. <gcupload
  632. username="${googlecode.user}"
  633. password="${googlecode.password}"
  634. projectname="gitblit"
  635. filename="${fedclient.zipfile}"
  636. targetfilename="fedclient-${gb.version}.zip"
  637. summary="Gitblit Federation Client v${gb.version} (command-line tool to clone data from federated Gitblit instances)"
  638. labels="Featured, Type-Package, OpSys-All" />
  639. <!-- Upload Gitblit Manager -->
  640. <gcupload
  641. username="${googlecode.user}"
  642. password="${googlecode.password}"
  643. projectname="gitblit"
  644. filename="${manager.zipfile}"
  645. targetfilename="manager-${gb.version}.zip"
  646. summary="Gitblit Manager v${gb.version} (Swing tool to remotely administer a Gitblit server)"
  647. labels="Featured, Type-Package, OpSys-All" />
  648. <!-- Upload Gitblit API Library -->
  649. <gcupload
  650. username="${googlecode.user}"
  651. password="${googlecode.password}"
  652. projectname="gitblit"
  653. filename="${gbapi.zipfile}"
  654. targetfilename="gbapi-${gb.version}.zip"
  655. summary="Gitblit API Library v${gb.version} (JSON RPC library to integrate with your software)"
  656. labels="Featured, Type-Package, OpSys-All" />
  657. </target>
  658. <!--
  659. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  660. Publish site to hosting service
  661. You must add ext/commons-net-1.4.0.jar to your ANT classpath.
  662. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  663. -->
  664. <target name="publishSite" depends="buildSite" description="Publish the Gitblit site to a webserver (requires ext/commons-net-1.4.0.jar)" >
  665. <echo>Uploading Gitblit ${gb.version} website</echo>
  666. <ftp server="${ftp.server}"
  667. userid="${ftp.user}"
  668. password="${ftp.password}"
  669. remotedir="${ftp.dir}"
  670. passive="true"
  671. verbose="yes">
  672. <fileset dir="${project.site.dir}" />
  673. </ftp>
  674. </target>
  675. <!--
  676. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  677. Compile from source, publish binaries, and build & deploy site
  678. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  679. -->
  680. <target name="publishAll" depends="publishBinaries,publishSite">
  681. <!-- Cleanup -->
  682. <delete dir="${project.build.dir}" />
  683. <delete dir="${project.war.dir}" />
  684. <delete dir="${project.deploy.dir}" />
  685. </target>
  686. </project>