build.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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}-macos.zip" property="build_macos.sha" algorithm="SHA-256" />
  29. <length file="${preName}-${VERSION}-macos.zip" property="length_macos"/>
  30. <script language="javascript">
  31. <![CDATA[
  32. var length_macos_bytes = project.getProperty("length_macos");
  33. var length_macos_kbytes = Math.round((length_macos_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  34. var length_macos_mbytes = Math.round((length_macos_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  35. project.setNewProperty("length_macos_mb", length_macos_mbytes);
  36. ]]>
  37. </script>
  38. <checksum file="${preName}-${VERSION}-aix.zip" property="build_aix.sha" algorithm="SHA-256" />
  39. <length file="${preName}-${VERSION}-aix.zip" property="length_aix"/>
  40. <script language="javascript">
  41. <![CDATA[
  42. var length_aix_bytes = project.getProperty("length_aix");
  43. var length_aix_kbytes = Math.round((length_aix_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  44. var length_aix_mbytes = Math.round((length_aix_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  45. project.setNewProperty("length_aix_mb", length_aix_mbytes);
  46. ]]>
  47. </script>
  48. <checksum file="${preName}-${VERSION}-raspi.zip" property="build_raspi.sha" algorithm="SHA-256" />
  49. <length file="${preName}-${VERSION}-raspi.zip" property="length_raspi"/>
  50. <script language="javascript">
  51. <![CDATA[
  52. var length_raspi_bytes = project.getProperty("length_raspi");
  53. var length_raspi_kbytes = Math.round((length_raspi_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  54. var length_raspi_mbytes = Math.round((length_raspi_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  55. project.setNewProperty("length_raspi_mb", length_raspi_mbytes);
  56. ]]>
  57. </script>
  58. <checksum file="${preName}-${VERSION}-linux-mips.zip" property="build_mips.sha" algorithm="SHA-256" />
  59. <length file="${preName}-${VERSION}-linux-mips.zip" property="length_mips"/>
  60. <script language="javascript">
  61. <![CDATA[
  62. var length_mips_bytes = project.getProperty("length_mips");
  63. var length_mips_kbytes = Math.round((length_mips_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  64. var length_mips_mbytes = Math.round((length_mips_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  65. project.setNewProperty("length_mips_mb", length_mips_mbytes);
  66. ]]>
  67. </script>
  68. <checksum file="${preName}-${VERSION}-linux-arm.zip" property="build_arm.sha" algorithm="SHA-256" />
  69. <length file="${preName}-${VERSION}-linux-arm.zip" property="length_arm"/>
  70. <script language="javascript">
  71. <![CDATA[
  72. var length_arm_bytes = project.getProperty("length_arm");
  73. var length_arm_kbytes = Math.round((length_arm_bytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  74. var length_arm_mbytes = Math.round((length_arm_kbytes / 1024) * Math.pow(10,2))/ Math.pow(10,2);
  75. project.setNewProperty("length_arm_mb", length_arm_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. "macos": {
  102. "system": "macos",
  103. "name": "o2server-${VERSION}-macos",
  104. "fileName": "o2server-${VERSION}-macos.zip",
  105. "fileSize": "${length_macos_mb}MB",
  106. "updateTime": "${TODAY}",
  107. "url": "/download/o2server-${VERSION}-macos.zip",
  108. "sha256": "${build_macos.sha}"
  109. },
  110. "aix": {
  111. "system": "aix",
  112. "name": "o2server-${VERSION}-aix",
  113. "fileName": "o2server-${VERSION}-aix.zip",
  114. "fileSize": "${length_aix_mb}MB",
  115. "updateTime": "${TODAY}",
  116. "url": "/download/o2server-${VERSION}-aix.zip",
  117. "sha256": "${build_aix.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. "jvm_windows": {}
  147. }
  148. )</echo>
  149. <echo file="download-pro.json">{
  150. "title": "O2OA V${VERSION}",
  151. "publishTime": "${TODAY}",
  152. "windows": {
  153. "system": "windows",
  154. "name": "o2server-${VERSION}-windows-x64",
  155. "fileName": "o2server-${VERSION}-windows-x64.zip",
  156. "fileSize": "${length_win_mb}MB",
  157. "updateTime": "${TODAY}",
  158. "url": "/download/o2server-${VERSION}-windows-x64.zip",
  159. "sha256": "${build_win.sha}"
  160. },
  161. "linux": {
  162. "system": "linux",
  163. "name": "o2server-${VERSION}-linux-x64",
  164. "fileName": "o2server-${VERSION}-linux-x64.zip",
  165. "fileSize": "${length_linux_mb}MB",
  166. "updateTime": "${TODAY}",
  167. "url": "/download/o2server-${VERSION}-linux-x64.zip",
  168. "sha256": "${build_linux.sha}"
  169. },
  170. "macos": {
  171. "system": "macos",
  172. "name": "o2server-${VERSION}-macos",
  173. "fileName": "o2server-${VERSION}-macos.zip",
  174. "fileSize": "${length_macos_mb}MB",
  175. "updateTime": "${TODAY}",
  176. "url": "/download/o2server-${VERSION}-macos.zip",
  177. "sha256": "${build_macos.sha}"
  178. },
  179. "aix": {
  180. "system": "aix",
  181. "name": "o2server-${VERSION}-aix",
  182. "fileName": "o2server-${VERSION}-aix.zip",
  183. "fileSize": "${length_aix_mb}MB",
  184. "updateTime": "${TODAY}",
  185. "url": "/download/o2server-${VERSION}-aix.zip",
  186. "sha256": "${build_aix.sha}"
  187. },
  188. "raspi": {
  189. "system": "raspi",
  190. "name": "o2server-${VERSION}-raspi.zip",
  191. "fileName": "o2server-${VERSION}-raspi.zip",
  192. "fileSize": "${length_raspi_mb}MB",
  193. "updateTime": "${TODAY}",
  194. "url": "/download/o2server-${VERSION}-raspi.zip",
  195. "sha256": "${build_raspi.sha}"
  196. },
  197. "mips": {
  198. "system": "mips",
  199. "name": "o2server-${VERSION}-linux-mips",
  200. "fileName": "o2server-${VERSION}-linux-mips.zip",
  201. "fileSize": "${length_mips_mb}MB",
  202. "updateTime": "${TODAY}",
  203. "url": "/download/o2server-${VERSION}-linux-mips.zip",
  204. "sha256": "${build_mips.sha}"
  205. },
  206. "arm": {
  207. "system": "arm",
  208. "name": "o2server-${VERSION}-linux-arm",
  209. "fileName": "o2server-${VERSION}-linux-arm.zip",
  210. "fileSize": "${length_arm_mb}MB",
  211. "updateTime": "${TODAY}",
  212. "url": "/download/o2server-${VERSION}-linux-arm.zip",
  213. "sha256": "${build_arm.sha}"
  214. },
  215. "source":{
  216. "name":"o2oa-master",
  217. "updateTime":"${TODAY}",
  218. "fileSize":"990MB",
  219. "url":"https://github.com/o2oa/o2oa"
  220. }
  221. }</echo>
  222. </target>
  223. <target name="default_zip" depends="version_o2,zip_windows,zip_linux,zip_macos,zip_aix,zip_raspi,zip_mips,zip_arm" />
  224. <target name="version_o2">
  225. <tstamp>
  226. <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
  227. </tstamp>
  228. <echo file="${targetdir}/o2server/version.o2">{"version":"${VERSION}","date":"${TODAY}"}</echo>
  229. </target>
  230. <target name="zip_windows">
  231. <zip encoding="utf-8" destfile="${preName}-${VERSION}-windows-x64.zip" update="false">
  232. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  233. <include name="commons/"/>
  234. <exclude name="commons/ext/" />
  235. <include name="configSample/"/>
  236. <include name="localSample/"/>
  237. <include name="servers/"/>
  238. <include name="store/"/>
  239. <include name="console.jar"/>
  240. <include name="index.html"/>
  241. <include name="version.o2"/>
  242. <include name="console.jar"/>
  243. <include name="jvm/windows_java11/"/>
  244. <include name="service_windows.bat"/>
  245. <include name="start_windows.bat"/>
  246. <include name="start_windows_debug.bat"/>
  247. <include name="console_windows.bat"/>
  248. <include name="stop_windows.bat"/>
  249. </zipfileset>
  250. </zip>
  251. </target>
  252. <target name="zip_linux">
  253. <zip encoding="utf-8" destfile="${preName}-${VERSION}-linux-x64.zip" update="false">
  254. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  255. <include name="commons/"/>
  256. <exclude name="commons/ext/" />
  257. <include name="configSample/"/>
  258. <include name="localSample/"/>
  259. <include name="servers/"/>
  260. <include name="store/"/>
  261. <include name="console.jar"/>
  262. <include name="index.html"/>
  263. <include name="version.o2"/>
  264. <include name="console.jar"/>
  265. <include name="jvm/linux_java11/"/>
  266. <include name="start_linux.sh"/>
  267. <include name="start_linux_min.sh"/>
  268. <include name="start_linux_debug.sh"/>
  269. <include name="start_linux_min.sh"/>
  270. <include name="console_linux.sh"/>
  271. <include name="stop_linux.sh"/>
  272. <include name="service_linux.sh"/>
  273. </zipfileset>
  274. </zip>
  275. </target>
  276. <target name="zip_macos">
  277. <zip encoding="utf-8" destfile="${preName}-${VERSION}-macos.zip" update="false">
  278. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  279. <include name="commons/"/>
  280. <exclude name="commons/ext/" />
  281. <include name="configSample/"/>
  282. <include name="localSample/"/>
  283. <include name="servers/"/>
  284. <include name="store/"/>
  285. <include name="console.jar"/>
  286. <include name="index.html"/>
  287. <include name="version.o2"/>
  288. <include name="console.jar"/>
  289. <include name="jvm/macos_java11/"/>
  290. <include name="start_macos.sh"/>
  291. <include name="start_macos_debug.sh"/>
  292. <include name="console_macos.sh"/>
  293. <include name="stop_macos.sh"/>
  294. </zipfileset>
  295. </zip>
  296. </target>
  297. <target name="zip_aix">
  298. <zip encoding="utf-8" destfile="${preName}-${VERSION}-aix.zip" update="false">
  299. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  300. <include name="commons/"/>
  301. <exclude name="commons/ext/" />
  302. <include name="configSample/"/>
  303. <include name="localSample/"/>
  304. <include name="servers/"/>
  305. <include name="store/"/>
  306. <include name="console.jar"/>
  307. <include name="index.html"/>
  308. <include name="version.o2"/>
  309. <include name="console.jar"/>
  310. <include name="jvm/aix_java11/"/>
  311. <include name="start_aix.sh"/>
  312. <include name="start_aix_debug.sh"/>
  313. <include name="console_aix.sh"/>
  314. <include name="stop_aix.sh"/>
  315. </zipfileset>
  316. </zip>
  317. </target>
  318. <target name="zip_raspi">
  319. <zip encoding="utf-8" destfile="${preName}-${VERSION}-raspi.zip" update="false">
  320. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  321. <include name="commons/"/>
  322. <exclude name="commons/ext/" />
  323. <include name="configSample/"/>
  324. <include name="localSample/"/>
  325. <include name="servers/"/>
  326. <include name="store/"/>
  327. <include name="console.jar"/>
  328. <include name="index.html"/>
  329. <include name="version.o2"/>
  330. <include name="console.jar"/>
  331. <include name="jvm/raspi_java11/"/>
  332. <include name="start_raspi.sh"/>
  333. <include name="start_raspi_debug.sh"/>
  334. <include name="console_raspi.sh"/>
  335. <include name="stop_raspi.sh"/>
  336. </zipfileset>
  337. </zip>
  338. </target>
  339. <target name="zip_mips">
  340. <zip encoding="utf-8" destfile="${preName}-${VERSION}-linux-mips.zip" update="false">
  341. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  342. <include name="commons/"/>
  343. <exclude name="commons/ext/" />
  344. <include name="configSample/"/>
  345. <include name="localSample/"/>
  346. <include name="servers/"/>
  347. <include name="store/"/>
  348. <include name="console.jar"/>
  349. <include name="index.html"/>
  350. <include name="version.o2"/>
  351. <include name="console.jar"/>
  352. <include name="jvm/mips_java11/"/>
  353. <include name="start_mips.sh"/>
  354. <include name="start_mips_debug.sh"/>
  355. <include name="console_mips.sh"/>
  356. <include name="stop_mips.sh"/>
  357. </zipfileset>
  358. </zip>
  359. </target>
  360. <target name="zip_arm">
  361. <zip encoding="utf-8" destfile="${preName}-${VERSION}-linux-arm.zip" update="false">
  362. <zipfileset dir="${targetdir}/o2server" filemode="777" dirmode="777" encoding="utf-8" prefix="o2server">
  363. <include name="commons/"/>
  364. <exclude name="commons/ext/" />
  365. <include name="configSample/"/>
  366. <include name="localSample/"/>
  367. <include name="servers/"/>
  368. <include name="store/"/>
  369. <include name="console.jar"/>
  370. <include name="index.html"/>
  371. <include name="version.o2"/>
  372. <include name="console.jar"/>
  373. <include name="jvm/arm_java11/"/>
  374. <include name="start_arm.sh"/>
  375. <include name="start_arm_debug.sh"/>
  376. <include name="console_arm.sh"/>
  377. <include name="stop_arm.sh"/>
  378. </zipfileset>
  379. </zip>
  380. </target>
  381. </project>