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

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