build.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project basedir="." name="main" default="default">
  3. <property name="VERSION" value="4.3.6" />
  4. <property name="targetdir" value="target"/>
  5. <target name="default" depends="md5code" />
  6. <target name="md5code" depends="default_zip">
  7. <checksum file="o2server-windows-${VERSION}.zip" property="build_win.sha" algorithm="SHA-256" />
  8. <length file="o2server-windows-${VERSION}.zip" property="length_win"/>
  9. <script language="javascript">
  10. <![CDATA[
  11. var length_win_bytes = project.getProperty("length_win");
  12. var length_win_kbytes = Math.round((length_win_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  13. var length_win_mbytes = Math.round((length_win_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  14. project.setNewProperty("length_win_mb", length_win_mbytes);
  15. ]]>
  16. </script>
  17. <checksum file="o2server-linux-${VERSION}.zip" property="build_linux.sha" algorithm="SHA-256" />
  18. <length file="o2server-linux-${VERSION}.zip" property="length_linux"/>
  19. <script language="javascript">
  20. <![CDATA[
  21. var length_linux_bytes = project.getProperty("length_linux");
  22. var length_linux_kbytes = Math.round((length_linux_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  23. var length_linux_mbytes = Math.round((length_linux_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  24. project.setNewProperty("length_linux_mb", length_linux_mbytes);
  25. ]]>
  26. </script>
  27. <checksum file="o2server-macos-${VERSION}.zip" property="build_macos.sha" algorithm="SHA-256" />
  28. <length file="o2server-macos-${VERSION}.zip" property="length_macos"/>
  29. <script language="javascript">
  30. <![CDATA[
  31. var length_macos_bytes = project.getProperty("length_macos");
  32. var length_macos_kbytes = Math.round((length_macos_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  33. var length_macos_mbytes = Math.round((length_macos_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  34. project.setNewProperty("length_macos_mb", length_macos_mbytes);
  35. ]]>
  36. </script>
  37. <checksum file="o2server-aix-${VERSION}.zip" property="build_aix.sha" algorithm="SHA-256" />
  38. <length file="o2server-aix-${VERSION}.zip" property="length_aix"/>
  39. <script language="javascript">
  40. <![CDATA[
  41. var length_aix_bytes = project.getProperty("length_aix");
  42. var length_aix_kbytes = Math.round((length_aix_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  43. var length_aix_mbytes = Math.round((length_aix_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  44. project.setNewProperty("length_aix_mb", length_aix_mbytes);
  45. ]]>
  46. </script>
  47. <checksum file="o2server-raspberrypi-${VERSION}.zip" property="build_raspberrypi.sha" algorithm="SHA-256" />
  48. <length file="o2server-raspberrypi-${VERSION}.zip" property="length_raspberrypi"/>
  49. <script language="javascript">
  50. <![CDATA[
  51. var length_raspberrypi_bytes = project.getProperty("length_raspberrypi");
  52. var length_raspberrypi_kbytes = Math.round((length_raspberrypi_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  53. var length_raspberrypi_mbytes = Math.round((length_raspberrypi_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  54. project.setNewProperty("length_raspberrypi_mb", length_raspberrypi_mbytes);
  55. ]]>
  56. </script>
  57. <checksum file="o2server-neokylin-loongson-${VERSION}.zip" property="build_neokylin-loongson.sha" algorithm="SHA-256" />
  58. <length file="o2server-neokylin-loongson-${VERSION}.zip" property="length_neokylin-loongson"/>
  59. <script language="javascript">
  60. <![CDATA[
  61. var length_neokylin_loongson_bytes = project.getProperty("length_neokylin-loongson");
  62. var length_neokylin_loongson_kbytes = Math.round((length_neokylin_loongson_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  63. var length_neokylin_loongson_mbytes = Math.round((length_neokylin_loongson_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  64. project.setNewProperty("length_neokylin-loongson_mb", length_neokylin_loongson_mbytes);
  65. ]]>
  66. </script>
  67. <checksum file="o2server-kylinos-phytium-${VERSION}.zip" property="build_kylinos_phytium.sha" algorithm="SHA-256" />
  68. <length file="o2server-kylinos-phytium-${VERSION}.zip" property="length_kylinos_phytium"/>
  69. <script language="javascript">
  70. <![CDATA[
  71. var length_kylinos_phytium_bytes = project.getProperty("length_kylinos_phytium");
  72. var length_kylinos_phytium_kbytes = Math.round((length_kylinos_phytium_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  73. var length_kylinos_phytium_mbytes = Math.round((length_kylinos_phytium_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  74. project.setNewProperty("length_kylinos_phytium_mb", length_kylinos_phytium_mbytes);
  75. ]]>
  76. </script>
  77. <tstamp>
  78. <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
  79. </tstamp>
  80. <echo file="download_preview.jsonp">callback(
  81. {
  82. "windows": {
  83. "system": "windows",
  84. "name": "o2server-windows-${VERSION}",
  85. "fileName": "o2server-windows-${VERSION}.zip",
  86. "fileSize": "${length_win_mb}MB",
  87. "updateTime": "${TODAY}",
  88. "url": "/download/o2server-windows-${VERSION}.zip",
  89. "sha256": "${build_win.sha}"
  90. },
  91. "linux": {
  92. "system": "linux",
  93. "name": "o2server-linux-${VERSION}",
  94. "fileName": "o2server-linux-${VERSION}.zip",
  95. "fileSize": "${length_linux_mb}MB",
  96. "updateTime": "${TODAY}",
  97. "url": "/download/o2server-linux-${VERSION}.zip",
  98. "sha256": "${build_linux.sha}"
  99. },
  100. "macos": {
  101. "system": "macos",
  102. "name": "o2server-macos-${VERSION}",
  103. "fileName": "o2server-macos-${VERSION}.zip",
  104. "fileSize": "${length_macos_mb}MB",
  105. "updateTime": "${TODAY}",
  106. "url": "/download/o2server-macos-${VERSION}.zip",
  107. "sha256": "${build_macos.sha}"
  108. },
  109. "aix": {
  110. "system": "aix",
  111. "name": "o2server-aix-${VERSION}",
  112. "fileName": "o2server-aix-${VERSION}.zip",
  113. "fileSize": "${length_aix_mb}MB",
  114. "updateTime": "${TODAY}",
  115. "url": "/download/o2server-aix-${VERSION}.zip",
  116. "sha256": "${build_aix.sha}"
  117. },
  118. "raspberrypi": {
  119. "system": "raspberrypi",
  120. "name": "o2server-raspberrypi-${VERSION}",
  121. "fileName": "o2server-raspberrypi-${VERSION}.zip",
  122. "fileSize": "${length_raspberrypi_mb}MB",
  123. "updateTime": "${TODAY}",
  124. "url": "/download/o2server-raspberrypi-${VERSION}.zip",
  125. "sha256": "${build_raspberrypi.sha}"
  126. },
  127. "neokylin_loongson": {
  128. "system": "neokylin_loongson",
  129. "name": "o2server-neokylin-loongson-${VERSION}",
  130. "fileName": "o2server-neokylin-loongson-${VERSION}.zip",
  131. "fileSize": "${length_neokylin-loongson_mb}MB",
  132. "updateTime": "${TODAY}",
  133. "url": "/download/o2server-neokylin-loongson-${VERSION}.zip",
  134. "sha256": "${build_neokylin-loongson.sha}"
  135. },
  136. "kylinos_phytium": {
  137. "system": "kylinos_phytium",
  138. "name": "o2server-kylinos-phytium-${VERSION}",
  139. "fileName": "o2server-kylinos-phytium-${VERSION}.zip",
  140. "fileSize": "${length_kylinos_phytium_mb}MB",
  141. "updateTime": "${TODAY}",
  142. "url": "/download/o2server-kylinos-phytium-${VERSION}.zip",
  143. "sha256": "${build_kylinos_phytium.sha}"
  144. },
  145. "jvm_windows": {}
  146. }
  147. )</echo>
  148. <echo file="download-pro.json">{
  149. "title": "O2OA V${VERSION}",
  150. "publishTime": "${TODAY}",
  151. "windows": {
  152. "system": "windows",
  153. "name": "o2server-windows-${VERSION}",
  154. "fileName": "o2server-windows-${VERSION}.zip",
  155. "fileSize": "${length_win_mb}MB",
  156. "updateTime": "${TODAY}",
  157. "url": "/download/o2server-windows-${VERSION}.zip",
  158. "sha256": "${build_win.sha}"
  159. },
  160. "linux": {
  161. "system": "linux",
  162. "name": "o2server-linux-${VERSION}",
  163. "fileName": "o2server-linux-${VERSION}.zip",
  164. "fileSize": "${length_linux_mb}MB",
  165. "updateTime": "${TODAY}",
  166. "url": "/download/o2server-linux-${VERSION}.zip",
  167. "sha256": "${build_linux.sha}"
  168. },
  169. "macos": {
  170. "system": "macos",
  171. "name": "o2server-macos-${VERSION}",
  172. "fileName": "o2server-macos-${VERSION}.zip",
  173. "fileSize": "${length_macos_mb}MB",
  174. "updateTime": "${TODAY}",
  175. "url": "/download/o2server-macos-${VERSION}.zip",
  176. "sha256": "${build_macos.sha}"
  177. },
  178. "aix": {
  179. "system": "aix",
  180. "name": "o2server-aix-${VERSION}",
  181. "fileName": "o2server-aix-${VERSION}.zip",
  182. "fileSize": "${length_aix_mb}MB",
  183. "updateTime": "${TODAY}",
  184. "url": "/download/o2server-aix-${VERSION}.zip",
  185. "sha256": "${build_aix.sha}"
  186. },
  187. "raspberrypi": {
  188. "system": "raspberrypi",
  189. "name": "o2server-raspberrypi-${VERSION}",
  190. "fileName": "o2server-raspberrypi-${VERSION}.zip",
  191. "fileSize": "${length_raspberrypi_mb}MB",
  192. "updateTime": "${TODAY}",
  193. "url": "/download/o2server-raspberrypi-${VERSION}.zip",
  194. "sha256": "${build_raspberrypi.sha}"
  195. },
  196. "neokylin_loongson": {
  197. "system": "neokylin_loongson",
  198. "name": "o2server-neokylin-loongson-${VERSION}",
  199. "fileName": "o2server-neokylin-loongson-${VERSION}.zip",
  200. "fileSize": "${length_neokylin-loongson_mb}MB",
  201. "updateTime": "${TODAY}",
  202. "url": "/download/o2server-neokylin-loongson-${VERSION}.zip",
  203. "sha256": "${build_neokylin-loongson.sha}"
  204. },
  205. "kylinos_phytium": {
  206. "system": "kylinos_phytium",
  207. "name": "o2server-kylinos-phytium-${VERSION}",
  208. "fileName": "o2server-kylinos-phytium-${VERSION}.zip",
  209. "fileSize": "${length_kylinos_phytium_mb}MB",
  210. "updateTime": "${TODAY}",
  211. "url": "/download/o2server-kylinos-phytium-${VERSION}.zip",
  212. "sha256": "${build_kylinos_phytium.sha}"
  213. },
  214. "source":{
  215. "name":"o2oa-master",
  216. "updateTime":"${TODAY}",
  217. "fileSize":"990MB",
  218. "url":"https://github.com/o2oa/o2oa"
  219. }
  220. }</echo>
  221. </target>
  222. <target name="default_zip" depends="version_o2,zip_windows,zip_linux,zip_macos,zip_aix,zip_raspberrypi,zip_neokylin_loongson,zip_kylinos_phytium" />
  223. <target name="version_o2">
  224. <tstamp>
  225. <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
  226. </tstamp>
  227. <echo file="${targetdir}/version.o2">{"version":"${VERSION}","date":"${TODAY}"}</echo>
  228. </target>
  229. <target name="zip_windows">
  230. <zip encoding="utf-8" destfile="o2server-windows-${VERSION}.zip" update="false">
  231. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  232. <include name="commons/"/>
  233. <include name="configSample/"/>
  234. <include name="localSample/"/>
  235. <include name="servers/"/>
  236. <include name="store/"/>
  237. <include name="console.jar"/>
  238. <include name="index.html"/>
  239. <include name="version.o2"/>
  240. <include name="console.jar"/>
  241. <include name="jvm/windows/"/>
  242. <include name="service_windows.bat"/>
  243. <include name="start_windows.bat"/>
  244. <include name="start_windows_debug.bat"/>
  245. <include name="console_windows.bat"/>
  246. <include name="stop_windows.bat"/>
  247. </zipfileset>
  248. </zip>
  249. </target>
  250. <target name="zip_linux">
  251. <zip encoding="utf-8" destfile="o2server-linux-${VERSION}.zip" update="false">
  252. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  253. <include name="commons/"/>
  254. <include name="configSample/"/>
  255. <include name="localSample/"/>
  256. <include name="servers/"/>
  257. <include name="store/"/>
  258. <include name="console.jar"/>
  259. <include name="index.html"/>
  260. <include name="version.o2"/>
  261. <include name="console.jar"/>
  262. <include name="jvm/linux/"/>
  263. <include name="start_linux.sh"/>
  264. <include name="start_linux_debug.sh"/>
  265. <include name="console_linux.sh"/>
  266. <include name="stop_linux.sh"/>
  267. </zipfileset>
  268. </zip>
  269. </target>
  270. <target name="zip_macos">
  271. <zip encoding="utf-8" destfile="o2server-macos-${VERSION}.zip" update="false">
  272. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  273. <include name="commons/"/>
  274. <include name="configSample/"/>
  275. <include name="localSample/"/>
  276. <include name="servers/"/>
  277. <include name="store/"/>
  278. <include name="console.jar"/>
  279. <include name="index.html"/>
  280. <include name="version.o2"/>
  281. <include name="console.jar"/>
  282. <include name="jvm/macos/"/>
  283. <include name="start_macos.sh"/>
  284. <include name="start_macos_debug.sh"/>
  285. <include name="console_macos.sh"/>
  286. <include name="stop_macos.sh"/>
  287. </zipfileset>
  288. </zip>
  289. </target>
  290. <target name="zip_aix">
  291. <zip encoding="utf-8" destfile="o2server-aix-${VERSION}.zip" update="false">
  292. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  293. <include name="commons/"/>
  294. <include name="configSample/"/>
  295. <include name="localSample/"/>
  296. <include name="servers/"/>
  297. <include name="store/"/>
  298. <include name="console.jar"/>
  299. <include name="index.html"/>
  300. <include name="version.o2"/>
  301. <include name="console.jar"/>
  302. <include name="jvm/aix/"/>
  303. <include name="start_aix.sh"/>
  304. <include name="start_aix_debug.sh"/>
  305. <include name="console_aix.sh"/>
  306. <include name="stop_aix.sh"/>
  307. </zipfileset>
  308. </zip>
  309. </target>
  310. <target name="zip_raspberrypi">
  311. <zip encoding="utf-8" destfile="o2server-raspberrypi-${VERSION}.zip" update="false">
  312. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  313. <include name="commons/"/>
  314. <include name="configSample/"/>
  315. <include name="localSample/"/>
  316. <include name="servers/"/>
  317. <include name="store/"/>
  318. <include name="console.jar"/>
  319. <include name="index.html"/>
  320. <include name="version.o2"/>
  321. <include name="console.jar"/>
  322. <include name="jvm/raspberrypi/"/>
  323. <include name="start_raspberrypi.sh"/>
  324. <include name="start_raspberrypi_debug.sh"/>
  325. <include name="console_raspberrypi.sh"/>
  326. <include name="stop_raspberrypi.sh"/>
  327. </zipfileset>
  328. </zip>
  329. </target>
  330. <target name="zip_neokylin_loongson">
  331. <zip encoding="utf-8" destfile="o2server-neokylin-loongson-${VERSION}.zip" update="false">
  332. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  333. <include name="commons/"/>
  334. <include name="configSample/"/>
  335. <include name="localSample/"/>
  336. <include name="servers/"/>
  337. <include name="store/"/>
  338. <include name="console.jar"/>
  339. <include name="index.html"/>
  340. <include name="version.o2"/>
  341. <include name="console.jar"/>
  342. <include name="jvm/neokylin_loongson/"/>
  343. <include name="start_neokylin_loongson.sh"/>
  344. <include name="start_neokylin_loongson_debug.sh"/>
  345. <include name="console_neokylin_loongson.sh"/>
  346. <include name="stop_neokylin_loongson.sh"/>
  347. </zipfileset>
  348. </zip>
  349. </target>
  350. <target name="zip_kylinos_phytium">
  351. <zip encoding="utf-8" destfile="o2server-kylinos-phytium-${VERSION}.zip" update="false">
  352. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  353. <include name="commons/"/>
  354. <include name="configSample/"/>
  355. <include name="localSample/"/>
  356. <include name="servers/"/>
  357. <include name="store/"/>
  358. <include name="console.jar"/>
  359. <include name="index.html"/>
  360. <include name="version.o2"/>
  361. <include name="console.jar"/>
  362. <include name="jvm/kylinos_phytium/"/>
  363. <include name="start_kylinos_phytium.sh"/>
  364. <include name="start_kylinos_phytium_debug.sh"/>
  365. <include name="console_kylinos_phytium.sh"/>
  366. <include name="stop_kylinos_phytium.sh"/>
  367. </zipfileset>
  368. </zip>
  369. </target>
  370. </project>