build.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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="preName" value="o2server"/>
  5. <property name="targetdir" value="target"/>
  6. <target name="default" depends="md5code" />
  7. <target name="md5code" depends="default_zip">
  8. <checksum file="${preName}-${VERSION}-windows-x64.zip" property="build_win.sha" algorithm="SHA-256" />
  9. <length file="${preName}-${VERSION}-windows-x64.zip" property="length_win"/>
  10. <script language="javascript">
  11. <![CDATA[
  12. var length_win_bytes = project.getProperty("length_win");
  13. var length_win_kbytes = Math.round((length_win_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  14. var length_win_mbytes = Math.round((length_win_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  15. project.setNewProperty("length_win_mb", length_win_mbytes);
  16. ]]>
  17. </script>
  18. <checksum file="${preName}-${VERSION}-linux-x64.zip" property="build_linux.sha" algorithm="SHA-256" />
  19. <length file="${preName}-${VERSION}-linux-x64.zip" property="length_linux"/>
  20. <script language="javascript">
  21. <![CDATA[
  22. var length_linux_bytes = project.getProperty("length_linux");
  23. var length_linux_kbytes = Math.round((length_linux_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  24. var length_linux_mbytes = Math.round((length_linux_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  25. project.setNewProperty("length_linux_mb", length_linux_mbytes);
  26. ]]>
  27. </script>
  28. <checksum file="${preName}-${VERSION}-macosx64.zip" property="build_macosx64.sha" algorithm="SHA-256" />
  29. <length file="${preName}-${VERSION}-macosx64.zip" property="length_macosx64"/>
  30. <script language="javascript">
  31. <![CDATA[
  32. var length_macosx64_bytes = project.getProperty("length_macosx64");
  33. var length_macosx64_kbytes = Math.round((length_macosx64_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  34. var length_macosx64_mbytes = Math.round((length_macosx64_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  35. project.setNewProperty("length_macosx64_mb", length_macosx64_mbytes);
  36. ]]>
  37. </script>
  38. <checksum file="${preName}-${VERSION}-macosarm.zip" property="build_macosarm.sha" algorithm="SHA-256" />
  39. <length file="${preName}-${VERSION}-macosarm.zip" property="length_macosarm"/>
  40. <script language="javascript">
  41. <![CDATA[
  42. var length_macosarm_bytes = project.getProperty("length_macosarm");
  43. var length_macosarm_kbytes = Math.round((length_macosarm_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  44. var length_macosarm_mbytes = Math.round((length_macosarm_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  45. project.setNewProperty("length_macosarm_mb", length_macosarm_mbytes);
  46. ]]>
  47. </script>
  48. <checksum file="${preName}-${VERSION}-linux-mips.zip" property="build_mips.sha" algorithm="SHA-256" />
  49. <length file="${preName}-${VERSION}-linux-mips.zip" property="length_mips"/>
  50. <script language="javascript">
  51. <![CDATA[
  52. var length_mips_bytes = project.getProperty("length_mips");
  53. var length_mips_kbytes = Math.round((length_mips_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  54. var length_mips_mbytes = Math.round((length_mips_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  55. project.setNewProperty("length_mips_mb", length_mips_mbytes);
  56. ]]>
  57. </script>
  58. <checksum file="${preName}-${VERSION}-linux-arm.zip" property="build_arm.sha" algorithm="SHA-256" />
  59. <length file="${preName}-${VERSION}-linux-arm.zip" property="length_arm"/>
  60. <script language="javascript">
  61. <![CDATA[
  62. var length_arm_bytes = project.getProperty("length_arm");
  63. var length_arm_kbytes = Math.round((length_arm_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  64. var length_arm_mbytes = Math.round((length_arm_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  65. project.setNewProperty("length_arm_mb", length_arm_mbytes);
  66. ]]>
  67. </script>
  68. <checksum file="${preName}-${VERSION}-sw.zip" property="build_sw.sha" algorithm="SHA-256" />
  69. <length file="${preName}-${VERSION}-sw.zip" property="length_sw"/>
  70. <script language="javascript">
  71. <![CDATA[
  72. var length_sw_bytes = project.getProperty("length_sw");
  73. var length_sw_kbytes = Math.round((length_sw_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  74. var length_sw_mbytes = Math.round((length_sw_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  75. project.setNewProperty("length_sw_mb", length_sw_mbytes);
  76. ]]>
  77. </script>
  78. <tstamp>
  79. <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
  80. </tstamp>
  81. <echo file="download_preview.jsonp">callback(
  82. {
  83. "windows": {
  84. "system": "windows",
  85. "name": "o2server-${VERSION}-windows-x64",
  86. "fileName": "o2server-${VERSION}-windows-x64.zip",
  87. "fileSize": "${length_win_mb}MB",
  88. "updateTime": "${TODAY}",
  89. "url": "/download/o2server-${VERSION}-windows-x64.zip",
  90. "sha256": "${build_win.sha}"
  91. },
  92. "linux": {
  93. "system": "linux",
  94. "name": o2server-${VERSION}-linux-x64",
  95. "fileName": "o2server-${VERSION}-linux-x64.zip",
  96. "fileSize": "${length_linux_mb}MB",
  97. "updateTime": "${TODAY}",
  98. "url": "/download/o2server-${VERSION}-linux-x64.zip",
  99. "sha256": "${build_linux.sha}"
  100. },
  101. "macosx64": {
  102. "system": "macosx64",
  103. "name": "o2server-${VERSION}-macosx64",
  104. "fileName": "o2server-${VERSION}-macosx64.zip",
  105. "fileSize": "${length_macosx64_mb}MB",
  106. "updateTime": "${TODAY}",
  107. "url": "/download/o2server-${VERSION}-macosx64.zip",
  108. "sha256": "${build_macosx64.sha}"
  109. },
  110. "macosarm": {
  111. "system": "macosarm",
  112. "name": "o2server-${VERSION}-macosarm",
  113. "fileName": "o2server-${VERSION}-macosarm.zip",
  114. "fileSize": "${length_macosarm_mb}MB",
  115. "updateTime": "${TODAY}",
  116. "url": "/download/o2server-${VERSION}-macosarm.zip",
  117. "sha256": "${build_macosarm.sha}"
  118. },
  119. "raspi": {
  120. "system": "raspberrypi",
  121. "name": "o2server-${VERSION}-raspi.zip",
  122. "fileName": "o2server-${VERSION}-raspi.zip",
  123. "fileSize": "${length_raspberrypi_mb}MB",
  124. "updateTime": "${TODAY}",
  125. "url": "/download/o2server-${VERSION}-raspi.zip",
  126. "sha256": "${build_raspi.sha}"
  127. },
  128. "mips": {
  129. "system": "mips",
  130. "name": "o2server-${VERSION}-linux-mips",
  131. "fileName": "o2server-${VERSION}-linux-mips.zip",
  132. "fileSize": "${length_mips_mb}MB",
  133. "updateTime": "${TODAY}",
  134. "url": "/download/o2server-${VERSION}-linux-mips.zip",
  135. "sha256": "${build_mips.sha}"
  136. },
  137. "arm": {
  138. "system": "arm",
  139. "name": "o2server-${VERSION}-linux-arm",
  140. "fileName": "o2server-${VERSION}-linux-arm.zip",
  141. "fileSize": "${length_arm_mb}MB",
  142. "updateTime": "${TODAY}",
  143. "url": "/download/o2server-${VERSION}-linux-arm.zip",
  144. "sha256": "${build_arm.sha}"
  145. },
  146. "sw": {
  147. "system": "sw",
  148. "name": "o2server-${VERSION}-sw",
  149. "fileName": "o2server-${VERSION}-sw.zip",
  150. "fileSize": "${length_sw_mb}MB",
  151. "updateTime": "${TODAY}",
  152. "url": "/download/o2server-${VERSION}-sw.zip",
  153. "sha256": "${build_sw.sha}"
  154. },
  155. "jvm_windows": {}
  156. }
  157. )</echo>
  158. <echo file="download-pro.json">{
  159. "title": "O2OA V${VERSION}",
  160. "publishTime": "${TODAY}",
  161. "windows": {
  162. "system": "windows",
  163. "name": "o2server-${VERSION}-windows-x64",
  164. "fileName": "o2server-${VERSION}-windows-x64.zip",
  165. "fileSize": "${length_win_mb}MB",
  166. "updateTime": "${TODAY}",
  167. "url": "/download/o2server-${VERSION}-windows-x64.zip",
  168. "sha256": "${build_win.sha}"
  169. },
  170. "linux": {
  171. "system": "linux",
  172. "name": "o2server-${VERSION}-linux-x64",
  173. "fileName": "o2server-${VERSION}-linux-x64.zip",
  174. "fileSize": "${length_linux_mb}MB",
  175. "updateTime": "${TODAY}",
  176. "url": "/download/o2server-${VERSION}-linux-x64.zip",
  177. "sha256": "${build_linux.sha}"
  178. },
  179. "macosx64": {
  180. "system": "macosx64",
  181. "name": "o2server-${VERSION}-macosx64",
  182. "fileName": "o2server-${VERSION}-macosx64.zip",
  183. "fileSize": "${length_macosx64_mb}MB",
  184. "updateTime": "${TODAY}",
  185. "url": "/download/o2server-${VERSION}-macosx64.zip",
  186. "sha256": "${build_macosx64.sha}"
  187. },
  188. "macosarm": {
  189. "system": "macosarm",
  190. "name": "o2server-${VERSION}-macosarm",
  191. "fileName": "o2server-${VERSION}-macosarm.zip",
  192. "fileSize": "${length_macosarm_mb}MB",
  193. "updateTime": "${TODAY}",
  194. "url": "/download/o2server-${VERSION}-macosarm.zip",
  195. "sha256": "${build_macosarm.sha}"
  196. },
  197. "raspi": {
  198. "system": "raspi",
  199. "name": "o2server-${VERSION}-raspi.zip",
  200. "fileName": "o2server-${VERSION}-raspi.zip",
  201. "fileSize": "${length_raspi_mb}MB",
  202. "updateTime": "${TODAY}",
  203. "url": "/download/o2server-${VERSION}-raspi.zip",
  204. "sha256": "${build_raspi.sha}"
  205. },
  206. "mips": {
  207. "system": "mips",
  208. "name": "o2server-${VERSION}-linux-mips",
  209. "fileName": "o2server-${VERSION}-linux-mips.zip",
  210. "fileSize": "${length_mips_mb}MB",
  211. "updateTime": "${TODAY}",
  212. "url": "/download/o2server-${VERSION}-linux-mips.zip",
  213. "sha256": "${build_mips.sha}"
  214. },
  215. "arm": {
  216. "system": "arm",
  217. "name": "o2server-${VERSION}-linux-arm",
  218. "fileName": "o2server-${VERSION}-linux-arm.zip",
  219. "fileSize": "${length_arm_mb}MB",
  220. "updateTime": "${TODAY}",
  221. "url": "/download/o2server-${VERSION}-linux-arm.zip",
  222. "sha256": "${build_arm.sha}"
  223. },
  224. "sw": {
  225. "system": "sw",
  226. "name": "o2server-${VERSION}-sw",
  227. "fileName": "o2server-${VERSION}-sw.zip",
  228. "fileSize": "${length_sw_mb}MB",
  229. "updateTime": "${TODAY}",
  230. "url": "/download/o2server-${VERSION}-sw.zip",
  231. "sha256": "${build_sw.sha}"
  232. },
  233. "source":{
  234. "name":"o2oa-master",
  235. "updateTime":"${TODAY}",
  236. "fileSize":"990MB",
  237. "url":"https://github.com/o2oa/o2oa"
  238. }
  239. }</echo>
  240. </target>
  241. <target name="default_zip" depends="version_o2,zip_windows,zip_linux,zip_macosx64,zip_macosarm,zip_raspi,zip_mips,zip_arm,zip_sw" />
  242. <target name="version_o2">
  243. <tstamp>
  244. <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
  245. </tstamp>
  246. <echo file="${targetdir}/o2server/version.o2">{"version":"${VERSION}","date":"${TODAY}"}</echo>
  247. </target>
  248. <target name="zip_windows">
  249. <zip encoding="utf-8" destfile="${preName}-${VERSION}-windows-x64.zip" update="false">
  250. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  251. <include name="commons/"/>
  252. <exclude name="commons/ext/" />
  253. <include name="configSample/"/>
  254. <include name="localSample/"/>
  255. <include name="servers/"/>
  256. <include name="store/"/>
  257. <include name="console.jar"/>
  258. <include name="index.html"/>
  259. <include name="version.o2"/>
  260. <include name="jvm/windows_java11/"/>
  261. <include name="service_windows.bat"/>
  262. <include name="start_windows.bat"/>
  263. <include name="start_windows_debug.bat"/>
  264. <include name="console_windows.bat"/>
  265. <include name="stop_windows.bat"/>
  266. </zipfileset>
  267. </zip>
  268. </target>
  269. <target name="zip_linux">
  270. <zip encoding="utf-8" destfile="${preName}-${VERSION}-linux-x64.zip" update="false">
  271. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  272. <include name="commons/"/>
  273. <exclude name="commons/ext/" />
  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="jvm/linux_java11/"/>
  282. <include name="start_linux.sh"/>
  283. <include name="start_linux_min.sh"/>
  284. <include name="start_linux_debug.sh"/>
  285. <include name="console_linux.sh"/>
  286. <include name="stop_linux.sh"/>
  287. <include name="service_linux.sh"/>
  288. </zipfileset>
  289. </zip>
  290. </target>
  291. <target name="zip_macosx64">
  292. <zip encoding="utf-8" destfile="${preName}-${VERSION}-macosx64.zip" update="false">
  293. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  294. <include name="commons/"/>
  295. <exclude name="commons/ext/" />
  296. <include name="configSample/"/>
  297. <include name="localSample/"/>
  298. <include name="servers/"/>
  299. <include name="store/"/>
  300. <include name="console.jar"/>
  301. <include name="index.html"/>
  302. <include name="version.o2"/>
  303. <include name="jvm/macosx64_java11/"/>
  304. <include name="start_macosx64.sh"/>
  305. <include name="start_macosx64_debug.sh"/>
  306. <include name="console_macosx64.sh"/>
  307. <include name="stop_macosx64.sh"/>
  308. </zipfileset>
  309. </zip>
  310. </target>
  311. <target name="zip_macosarm">
  312. <zip encoding="utf-8" destfile="${preName}-${VERSION}-macosarm.zip" update="false">
  313. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  314. <include name="commons/"/>
  315. <exclude name="commons/ext/" />
  316. <include name="configSample/"/>
  317. <include name="localSample/"/>
  318. <include name="servers/"/>
  319. <include name="store/"/>
  320. <include name="console.jar"/>
  321. <include name="index.html"/>
  322. <include name="version.o2"/>
  323. <include name="jvm/macosarm_java11/"/>
  324. <include name="start_macosarm.sh"/>
  325. <include name="start_macosarm_debug.sh"/>
  326. <include name="console_macosarm.sh"/>
  327. <include name="stop_macosarm.sh"/>
  328. </zipfileset>
  329. </zip>
  330. </target>
  331. <target name="zip_raspi">
  332. <zip encoding="utf-8" destfile="${preName}-${VERSION}-raspi.zip" update="false">
  333. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  334. <include name="commons/"/>
  335. <exclude name="commons/ext/" />
  336. <include name="configSample/"/>
  337. <include name="localSample/"/>
  338. <include name="servers/"/>
  339. <include name="store/"/>
  340. <include name="console.jar"/>
  341. <include name="index.html"/>
  342. <include name="version.o2"/>
  343. <include name="jvm/raspi_java11/"/>
  344. <include name="start_raspi.sh"/>
  345. <include name="start_raspi_debug.sh"/>
  346. <include name="console_raspi.sh"/>
  347. <include name="stop_raspi.sh"/>
  348. </zipfileset>
  349. </zip>
  350. </target>
  351. <target name="zip_mips">
  352. <zip encoding="utf-8" destfile="${preName}-${VERSION}-linux-mips.zip" update="false">
  353. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  354. <include name="commons/"/>
  355. <exclude name="commons/ext/" />
  356. <include name="configSample/"/>
  357. <include name="localSample/"/>
  358. <include name="servers/"/>
  359. <include name="store/"/>
  360. <include name="console.jar"/>
  361. <include name="index.html"/>
  362. <include name="version.o2"/>
  363. <include name="jvm/mips_java11/"/>
  364. <include name="start_mips.sh"/>
  365. <include name="start_mips_debug.sh"/>
  366. <include name="console_mips.sh"/>
  367. <include name="stop_mips.sh"/>
  368. </zipfileset>
  369. </zip>
  370. </target>
  371. <target name="zip_arm">
  372. <zip encoding="utf-8" destfile="${preName}-${VERSION}-linux-arm.zip" update="false">
  373. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  374. <include name="commons/"/>
  375. <exclude name="commons/ext/" />
  376. <include name="configSample/"/>
  377. <include name="localSample/"/>
  378. <include name="servers/"/>
  379. <include name="store/"/>
  380. <include name="console.jar"/>
  381. <include name="index.html"/>
  382. <include name="version.o2"/>
  383. <include name="jvm/arm_java11/"/>
  384. <include name="start_arm.sh"/>
  385. <include name="start_arm_debug.sh"/>
  386. <include name="console_arm.sh"/>
  387. <include name="stop_arm.sh"/>
  388. </zipfileset>
  389. </zip>
  390. </target>
  391. <target name="zip_sw">
  392. <zip encoding="utf-8" destfile="${preName}-${VERSION}-sw.zip" update="false">
  393. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  394. <include name="commons/"/>
  395. <exclude name="commons/ext/" />
  396. <include name="configSample/"/>
  397. <include name="localSample/"/>
  398. <include name="servers/"/>
  399. <include name="store/"/>
  400. <include name="console.jar"/>
  401. <include name="index.html"/>
  402. <include name="version.o2"/>
  403. <include name="jvm/sw_java11/"/>
  404. <include name="start_sw.sh"/>
  405. <include name="start_sw_debug.sh"/>
  406. <include name="console_sw.sh"/>
  407. <include name="stop_sw.sh"/>
  408. </zipfileset>
  409. </zip>
  410. </target>
  411. </project>