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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  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. </target>
  81. <!--
  82. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  83. Compile
  84. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  85. -->
  86. <target name="compile" depends="buildinfo" description="Retrieves dependencies and compiles Gitblit from source">
  87. <!-- copy required distribution files to project folder -->
  88. <copy todir="${basedir}" overwrite="false">
  89. <fileset dir="${basedir}/distrib">
  90. <include name="gitblit.properties" />
  91. <include name="users.properties" />
  92. </fileset>
  93. </copy>
  94. <!-- Compile the build tool and execute it.
  95. This downloads missing compile-time dependencies from Maven. -->
  96. <delete dir="${project.build.dir}" />
  97. <mkdir dir="${project.build.dir}" />
  98. <javac debug="true" srcdir="${basedir}/src" destdir="${project.build.dir}">
  99. <include name="com/gitblit/build/Build.java" />
  100. <include name="com/gitblit/Constants.java" />
  101. <include name="com/gitblit/utils/StringUtils.java" />
  102. </javac>
  103. <java classpath="${project.build.dir}" classname="com.gitblit.build.Build" />
  104. <!-- Compile Project -->
  105. <path id="master-classpath">
  106. <fileset dir="${basedir}/ext">
  107. <include name="*.jar" />
  108. </fileset>
  109. <pathelement path="${project.build.dir}" />
  110. </path>
  111. <javac debug="true" destdir="${project.build.dir}" failonerror="false">
  112. <src path="${basedir}/src" />
  113. <classpath refid="master-classpath" />
  114. </javac>
  115. <copy todir="${project.build.dir}">
  116. <fileset dir="${basedir}/src" excludes="**/*.java,**/thumbs.db" />
  117. </copy>
  118. </target>
  119. <!--
  120. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  121. Build Gitblit GO
  122. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  123. -->
  124. <target name="buildGO" depends="compile" description="Build Gitblit GO distribution">
  125. <echo>Building Gitblit GO ${gb.version}</echo>
  126. <!-- Delete the deploy folder -->
  127. <delete dir="${project.deploy.dir}" />
  128. <!-- Create deployment folder structure -->
  129. <mkdir dir="${project.deploy.dir}" />
  130. <copy todir="${project.deploy.dir}">
  131. <fileset dir="${basedir}/distrib">
  132. <include name="**/*" />
  133. <exclude name="federation.properties" />
  134. </fileset>
  135. <fileset dir="${basedir}">
  136. <include name="LICENSE" />
  137. <include name="NOTICE" />
  138. </fileset>
  139. </copy>
  140. <!-- Build jar -->
  141. <jar jarfile="${project.deploy.dir}/${project.jar}">
  142. <fileset dir="${project.build.dir}">
  143. <include name="**/*" />
  144. </fileset>
  145. <fileset dir="${project.resources.dir}">
  146. <exclude name="thumbs.db" />
  147. </fileset>
  148. <manifest>
  149. <attribute name="Main-Class" value="${project.mainclass}" />
  150. </manifest>
  151. </jar>
  152. <!-- Build the docs for the deploy -->
  153. <antcall target="buildDocs" inheritall="true" inheritrefs="true">
  154. <param name="docs.output.dir" value="${project.deploy.dir}/docs" />
  155. </antcall>
  156. <!-- Create Zip deployment -->
  157. <zip destfile="${distribution.zipfile}">
  158. <fileset dir="${project.deploy.dir}">
  159. <include name="**/*" />
  160. </fileset>
  161. </zip>
  162. </target>
  163. <!--
  164. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  165. Build Gitblit Docs which are bundled with GO and WAR downloads
  166. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  167. -->
  168. <target name="buildDocs">
  169. <!-- Build Docs -->
  170. <mkdir dir="${docs.output.dir}" />
  171. <copy todir="${docs.output.dir}">
  172. <!-- Copy selected Gitblit resources -->
  173. <fileset dir="${project.resources.dir}">
  174. <include name="bootstrap.130.css" />
  175. <include name="bootstrap.gb.css" />
  176. <include name="markdown.css" />
  177. <include name="gitblt_25_white.png" />
  178. <include name="gitblt-favicon.png" />
  179. <include name="lock_go_16x16.png" />
  180. <include name="lock_pull_16x16.png" />
  181. <include name="shield_16x16.png" />
  182. <include name="cold_16x16.png" />
  183. <include name="bug_16x16.png" />
  184. <include name="book_16x16.png" />
  185. <include name="blank.png" />
  186. <include name="federated_16x16.png" />
  187. <include name="arrow_page.png" />
  188. </fileset>
  189. <!-- Copy Doc images -->
  190. <fileset dir="${basedir}/docs">
  191. <include name="*.png" />
  192. </fileset>
  193. </copy>
  194. <!-- Copy google-code-prettify -->
  195. <mkdir dir="${docs.output.dir}/prettify" />
  196. <copy todir="${docs.output.dir}/prettify">
  197. <fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
  198. <exclude name="thumbs.db" />
  199. </fileset>
  200. </copy>
  201. <!-- Build deployment doc pages -->
  202. <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildSite">
  203. <classpath refid="master-classpath" />
  204. <arg value="--sourceFolder" />
  205. <arg value="${basedir}/docs" />
  206. <arg value="--outputFolder" />
  207. <arg value="${docs.output.dir}" />
  208. <arg value="--pageHeader" />
  209. <arg value="${basedir}/docs/doc_header.html" />
  210. <arg value="--pageFooter" />
  211. <arg value="${basedir}/docs/doc_footer.html" />
  212. <arg value="--skip" />
  213. <arg value="screenshots" />
  214. <arg value="--skip" />
  215. <arg value="releases" />
  216. <arg value="--alias" />
  217. <arg value="index=overview" />
  218. <arg value="--alias" />
  219. <arg value="properties=gitblit.properties" />
  220. <arg value="--substitute" />
  221. <arg value="%VERSION%=${gb.version}" />
  222. <arg value="--substitute" />
  223. <arg value="%GO%=${distribution.zipfile}" />
  224. <arg value="--substitute" />
  225. <arg value="%WAR%=${distribution.warfile}" />
  226. <arg value="--substitute" />
  227. <arg value="%FEDCLIENT%=${fedclient.zipfile}" />
  228. <arg value="--substitute" />
  229. <arg value="%MANAGER%=${manager.zipfile}" />
  230. <arg value="--substitute" />
  231. <arg value="%BUILDDATE%=${gb.versionDate}" />
  232. <arg value="--substitute" />
  233. <arg value="%JGIT%=${jgit.version}" />
  234. <arg value="--properties" />
  235. <arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
  236. <arg value="--nomarkdown" />
  237. <arg value="%BEGINCODE%:%ENDCODE%" />
  238. <arg value="--substitute" />
  239. <arg value="&quot;%BEGINCODE%=&lt;pre class='prettyprint lang-java'&gt;&quot;" />
  240. <arg value="--substitute" />
  241. <arg value="%ENDCODE%=&lt;/pre&gt;" />
  242. <arg value="--regex" />
  243. <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;" />
  244. </java>
  245. </target>
  246. <!--
  247. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  248. Build Gitblit WAR
  249. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  250. -->
  251. <target name="buildWAR" depends="compile" description="Build Gitblit WAR">
  252. <echo>Building Gitblit WAR ${gb.version}</echo>
  253. <delete dir="${project.war.dir}" />
  254. <!-- Copy web.xml and users.properties to WEB-INF -->
  255. <copy todir="${project.war.dir}/WEB-INF">
  256. <fileset dir="${basedir}/distrib">
  257. <include name="users.properties" />
  258. </fileset>
  259. <fileset dir="${basedir}/src/WEB-INF">
  260. <include name="web.xml" />
  261. </fileset>
  262. <fileset dir="${basedir}">
  263. <include name="LICENSE" />
  264. <include name="NOTICE" />
  265. </fileset>
  266. </copy>
  267. <!-- Build the docs for the WAR build -->
  268. <antcall target="buildDocs" inheritall="true" inheritrefs="true">
  269. <param name="docs.output.dir" value="${project.war.dir}/WEB-INF/docs" />
  270. </antcall>
  271. <!-- Build the WAR web.xml from the prototype web.xml and gitblit.properties -->
  272. <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildWebXml">
  273. <classpath refid="master-classpath" />
  274. <arg value="--sourceFile" />
  275. <arg value="${basedir}/src/WEB-INF/web.xml" />
  276. <arg value="--destinationFile" />
  277. <arg value="${project.war.dir}/WEB-INF/web.xml" />
  278. <arg value="--propertiesFile" />
  279. <arg value="${basedir}/distrib/gitblit.properties" />
  280. </java>
  281. <!-- Gitblit resources -->
  282. <copy todir="${project.war.dir}">
  283. <fileset dir="${project.resources.dir}">
  284. <exclude name="thumbs.db" />
  285. </fileset>
  286. </copy>
  287. <!-- Gitblit library dependencies -->
  288. <mkdir dir="${project.war.dir}/WEB-INF/lib"/>
  289. <copy todir="${project.war.dir}/WEB-INF/lib">
  290. <fileset dir="${basedir}/ext">
  291. <exclude name="*-sources.jar" />
  292. <exclude name="*-javadoc.jar" />
  293. <exclude name="jcommander*.jar" />
  294. <exclude name="jetty*.jar" />
  295. <exclude name="junit*.jar" />
  296. <exclude name="servlet*.jar" />
  297. </fileset>
  298. </copy>
  299. <!-- Gitblit classes -->
  300. <mkdir dir="${project.war.dir}/WEB-INF/classes"/>
  301. <copy todir="${project.war.dir}/WEB-INF/classes">
  302. <fileset dir="${project.build.dir}">
  303. <exclude name="WEB-INF/web.xml" />
  304. <exclude name="com/gitblit/tests/" />
  305. <exclude name="com/gitblit/build/**" />
  306. <exclude name="com/gitblit/GitBlitServer*.class" />
  307. <exclude name="com/gitblit/Launcher*.class" />
  308. <exclude name="com/gitblit/MakeCertificate*.class" />
  309. </fileset>
  310. </copy>
  311. <!-- Build the WAR file -->
  312. <jar basedir="${project.war.dir}" destfile="${distribution.warfile}" compress="true" />
  313. </target>
  314. <!--
  315. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  316. Build the stand-alone, command-line Gitblit Federation Client
  317. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  318. -->
  319. <target name="buildFederationClient" depends="compile" description="Builds the stand-alone Gitblit federation client">
  320. <echo>Building Gitblit Federation Client ${gb.version}</echo>
  321. <genjar jarfile="fedclient.jar">
  322. <class name="com.gitblit.FederationClientLauncher" />
  323. <resource file="${project.build.dir}/log4j.properties" />
  324. <classfilter>
  325. <exclude name="org.apache." />
  326. <exclude name="org.bouncycastle." />
  327. <exclude name="org.eclipse." />
  328. <exclude name="org.slf4j." />
  329. <exclude name="com.beust." />
  330. <exclude name="com.google." />
  331. </classfilter>
  332. <classpath refid="master-classpath" />
  333. <manifest>
  334. <attribute name="Main-Class" value="com.gitblit.FederationClientLauncher" />
  335. <attribute name="Specification-Version" value="${gb.version}" />
  336. <attribute name="Release-Date" value="${gb.versionDate}" />
  337. </manifest>
  338. </genjar>
  339. <!-- Build the federation client zip file -->
  340. <zip destfile="${fedclient.zipfile}">
  341. <fileset dir="${basedir}">
  342. <include name="fedclient.jar" />
  343. </fileset>
  344. <fileset dir="${basedir}/distrib">
  345. <include name="federation.properties" />
  346. </fileset>
  347. </zip>
  348. </target>
  349. <!--
  350. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  351. Build the stand-alone, Gitblit Manager
  352. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  353. -->
  354. <target name="buildManager" depends="compile" description="Builds the stand-alone Gitblit Manager">
  355. <echo>Building Gitblit Manager ${gb.version}</echo>
  356. <genjar jarfile="manager.jar">
  357. <resource file="${basedir}/src/com/gitblit/client/splash.png" />
  358. <resource file="${basedir}/resources/gitblt-favicon.png" />
  359. <resource file="${basedir}/resources/lock_go_16x16.png" />
  360. <resource file="${basedir}/resources/lock_pull_16x16.png" />
  361. <resource file="${basedir}/resources/shield_16x16.png" />
  362. <resource file="${basedir}/resources/federated_16x16.png" />
  363. <resource file="${basedir}/resources/cold_16x16.png" />
  364. <resource file="${basedir}/resources/book_16x16.png" />
  365. <resource file="${basedir}/resources/bug_16x16.png" />
  366. <resource file="${basedir}/resources/blank.png" />
  367. <resource file="${basedir}/src/com/gitblit/wicket/GitBlitWebApp.properties" />
  368. <class name="com.gitblit.client.GitblitManagerLauncher" />
  369. <classfilter>
  370. <exclude name="org.apache." />
  371. <exclude name="org.bouncycastle." />
  372. <exclude name="org.eclipse." />
  373. <exclude name="org.slf4j." />
  374. <exclude name="com.beust." />
  375. <exclude name="com.google." />
  376. </classfilter>
  377. <classpath refid="master-classpath" />
  378. <manifest>
  379. <attribute name="Main-Class" value="com.gitblit.client.GitblitManagerLauncher" />
  380. <attribute name="SplashScreen-Image" value="splash.png" />
  381. <attribute name="Specification-Version" value="${gb.version}" />
  382. <attribute name="Release-Date" value="${gb.versionDate}" />
  383. </manifest>
  384. </genjar>
  385. <!-- Build the Manager zip file -->
  386. <zip destfile="${manager.zipfile}">
  387. <fileset dir="${basedir}">
  388. <include name="manager.jar" />
  389. </fileset>
  390. </zip>
  391. </target>
  392. <!--
  393. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  394. Build the Gitblit Website
  395. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  396. -->
  397. <target name="buildSite" depends="compile" description="Build the Gitblit website">
  398. <echo>Building Gitblit Website ${gb.version}</echo>
  399. <!-- Build Site -->
  400. <delete dir="${project.site.dir}" />
  401. <mkdir dir="${project.site.dir}" />
  402. <copy todir="${project.site.dir}">
  403. <!-- Copy selected Gitblit resources -->
  404. <fileset dir="${project.resources.dir}">
  405. <include name="bootstrap.130.css" />
  406. <include name="bootstrap.gb.css" />
  407. <include name="markdown.css" />
  408. <include name="gitblt_25_white.png" />
  409. <include name="gitblt-favicon.png" />
  410. <include name="lock_go_16x16.png" />
  411. <include name="lock_pull_16x16.png" />
  412. <include name="shield_16x16.png" />
  413. <include name="cold_16x16.png" />
  414. <include name="bug_16x16.png" />
  415. <include name="book_16x16.png" />
  416. <include name="blank.png" />
  417. <include name="federated_16x16.png" />
  418. <include name="arrow_page.png" />
  419. </fileset>
  420. <!-- Copy Doc images -->
  421. <fileset dir="${basedir}/docs">
  422. <include name="*.png" />
  423. <include name="*.js" />
  424. </fileset>
  425. </copy>
  426. <!-- Copy Fancybox -->
  427. <mkdir dir="${project.site.dir}/fancybox" />
  428. <copy todir="${project.site.dir}/fancybox">
  429. <fileset dir="${basedir}/docs/fancybox">
  430. <exclude name="thumbs.db" />
  431. </fileset>
  432. </copy>
  433. <!-- Copy google-code-prettify -->
  434. <mkdir dir="${basedir}/src/com/gitblit/wicket/pages/prettify" />
  435. <copy todir="${project.site.dir}/prettify">
  436. <fileset dir="${basedir}/src/com/gitblit/wicket/pages/prettify">
  437. <exclude name="thumbs.db" />
  438. </fileset>
  439. </copy>
  440. <!-- Generate thumbnails of screenshots -->
  441. <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildThumbnails">
  442. <classpath refid="master-classpath" />
  443. <arg value="--sourceFolder" />
  444. <arg value="${basedir}/docs/screenshots" />
  445. <arg value="--destinationFolder" />
  446. <arg value="${project.site.dir}/thumbs" />
  447. <arg value="--maximumDimension" />
  448. <arg value="250" />
  449. </java>
  450. <!-- Copy screenshots -->
  451. <mkdir dir="${project.site.dir}/screenshots" />
  452. <copy todir="${project.site.dir}/screenshots">
  453. <fileset dir="${basedir}/docs/screenshots">
  454. <include name="*.png" />
  455. </fileset>
  456. </copy>
  457. <!-- Build site pages -->
  458. <java classpath="${project.build.dir}" classname="com.gitblit.build.BuildSite">
  459. <classpath refid="master-classpath" />
  460. <arg value="--sourceFolder" />
  461. <arg value="${basedir}/docs" />
  462. <arg value="--outputFolder" />
  463. <arg value="${project.site.dir}" />
  464. <arg value="--pageHeader" />
  465. <arg value="${basedir}/docs/site_header.html" />
  466. <arg value="--pageFooter" />
  467. <arg value="${basedir}/docs/site_footer.html" />
  468. <arg value="--analyticsSnippet" />
  469. <arg value="${basedir}/docs/site_analytics.html" />
  470. <arg value="--adSnippet" />
  471. <arg value="${basedir}/docs/site_ads.html" />
  472. <arg value="--alias" />
  473. <arg value="index=overview" />
  474. <arg value="--alias" />
  475. <arg value="properties=gitblit.properties" />
  476. <arg value="--substitute" />
  477. <arg value="%VERSION%=${gb.version}" />
  478. <arg value="--substitute" />
  479. <arg value="%GO%=${distribution.zipfile}" />
  480. <arg value="--substitute" />
  481. <arg value="%WAR%=${distribution.warfile}" />
  482. <arg value="--substitute" />
  483. <arg value="%FEDCLIENT%=${fedclient.zipfile}" />
  484. <arg value="--substitute" />
  485. <arg value="%MANAGER%=${manager.zipfile}" />
  486. <arg value="--substitute" />
  487. <arg value="%BUILDDATE%=${gb.versionDate}" />
  488. <arg value="--substitute" />
  489. <arg value="%JGIT%=${jgit.version}" />
  490. <arg value="--properties" />
  491. <arg value="%PROPERTIES%=${basedir}/distrib/gitblit.properties" />
  492. <arg value="--nomarkdown" />
  493. <arg value="%BEGINCODE%:%ENDCODE%" />
  494. <arg value="--substitute" />
  495. <arg value="&quot;%BEGINCODE%=&lt;pre class='prettyprint lang-java'&gt;&quot;" />
  496. <arg value="--substitute" />
  497. <arg value="%ENDCODE%=&lt;/pre&gt;" />
  498. <arg value="--regex" />
  499. <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;" />
  500. </java>
  501. </target>
  502. <!--
  503. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  504. Compile from source, publish binaries, and build & deploy site
  505. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  506. -->
  507. <target name="buildAll" depends="buildGO,buildWAR,buildFederationClient,buildManager,buildSite">
  508. <!-- Cleanup -->
  509. <delete dir="${project.build.dir}" />
  510. <delete dir="${project.war.dir}" />
  511. <delete dir="${project.deploy.dir}" />
  512. </target>
  513. <!--
  514. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  515. Publish binaries to Google Code
  516. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  517. -->
  518. <target name="publishBinaries" depends="buildGO,buildWAR,buildFederationClient,buildManager" description="Publish the Gitblit binaries to Google Code">
  519. <echo>Uploading Gitblit ${gb.version} binaries</echo>
  520. <!-- Upload ZIP file -->
  521. <gcupload
  522. username="${googlecode.user}"
  523. password="${googlecode.password}"
  524. projectname="gitblit"
  525. filename="${distribution.zipfile}"
  526. targetfilename="gitblit-${gb.version}.zip"
  527. summary="Gitblit GO v${gb.version} (standalone, integrated Gitblit server)"
  528. labels="Featured, Type-Package, OpSys-All" />
  529. <!-- Upload WAR file -->
  530. <gcupload
  531. username="${googlecode.user}"
  532. password="${googlecode.password}"
  533. projectname="gitblit"
  534. filename="${distribution.warfile}"
  535. targetfilename="gitblit-${gb.version}.war"
  536. summary="Gitblit WAR v${gb.version} (standard WAR webapp for servlet containers)"
  537. labels="Featured, Type-Package, OpSys-All" />
  538. <!-- Upload FedClient -->
  539. <gcupload
  540. username="${googlecode.user}"
  541. password="${googlecode.password}"
  542. projectname="gitblit"
  543. filename="${fedclient.zipfile}"
  544. targetfilename="fedclient-${gb.version}.zip"
  545. summary="Gitblit Federation Client v${gb.version} (command-line tool to clone data from federated Gitblit instances)"
  546. labels="Featured, Type-Package, OpSys-All" />
  547. <!-- Upload Manager -->
  548. <gcupload
  549. username="${googlecode.user}"
  550. password="${googlecode.password}"
  551. projectname="gitblit"
  552. filename="${manager.zipfile}"
  553. targetfilename="manager-${gb.version}.zip"
  554. summary="Gitblit Manager v${gb.version} (Swing tool to remotely administer a Gitblit server)"
  555. labels="Featured, Type-Package, OpSys-All" />
  556. </target>
  557. <!--
  558. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  559. Publish site to hosting service
  560. You must add ext/commons-net-1.4.0.jar to your ANT classpath.
  561. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  562. -->
  563. <target name="publishSite" depends="buildSite" description="Publish the Gitblit site to a webserver (requires ext/commons-net-1.4.0.jar)" >
  564. <echo>Uploading Gitblit ${gb.version} website</echo>
  565. <ftp server="${ftp.server}"
  566. userid="${ftp.user}"
  567. password="${ftp.password}"
  568. remotedir="${ftp.dir}"
  569. passive="true"
  570. verbose="yes">
  571. <fileset dir="${project.site.dir}" />
  572. </ftp>
  573. </target>
  574. <!--
  575. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  576. Compile from source, publish binaries, and build & deploy site
  577. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  578. -->
  579. <target name="publishAll" depends="publishBinaries,publishSite">
  580. <!-- Cleanup -->
  581. <delete dir="${project.build.dir}" />
  582. <delete dir="${project.war.dir}" />
  583. <delete dir="${project.deploy.dir}" />
  584. </target>
  585. </project>