mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
Compare commits
2045 Commits
v5.5.99.19
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 55f811af62 | |||
| 057f0bbbf6 | |||
| 67060cc66e | |||
| c5f6c2e02b | |||
| 71b912e7e6 | |||
| 6e7fd50583 | |||
| cf39498098 | |||
| 1f4e593943 | |||
| 3dfd22c735 | |||
| f92fc0f617 | |||
| 0402a5a07a | |||
| dea91ca6f6 | |||
| 4be0e0cbe2 | |||
| 1e8825e15e | |||
| 9d17f87811 | |||
| 2fff3a7391 | |||
| c0bdb1d62b | |||
| 7c97a9b326 | |||
| b33d92a32e | |||
| d480266a5a | |||
| 98af1ed74b | |||
| 9428ce8b33 | |||
| c1dbdc39f1 | |||
| 5d99680cc4 | |||
| 930b11f19e | |||
| 62aa75d82c | |||
| f926970677 | |||
| 4f6908154c | |||
| 151c4e7d2f | |||
| 8adc9021e4 | |||
| 9b97de22df | |||
| 997734860b | |||
| 4473fd7cf9 | |||
| 923d839483 | |||
| 39b1c1e22c | |||
| 849d78fea0 | |||
| 49619cdb40 | |||
| 9bdb69dfa3 | |||
| ceda5ea658 | |||
| ec2d587993 | |||
| 10118f4c68 | |||
| 3cdc164d7f | |||
| b9c9811b9e | |||
| 70bbdfbd43 | |||
| 5dbf27a039 | |||
| 39fb488af8 | |||
| 4866786097 | |||
| 07b1eadc0a | |||
| 9db40b2505 | |||
| 42b57d6b40 | |||
| 506fbd056a | |||
| def11f3134 | |||
| 3285a3e3c5 | |||
| bdcdfa89e7 | |||
| 1835e3ad28 | |||
| 1b33175880 | |||
| 4629471d5b | |||
| a4b29c6acc | |||
| 621b34ffde | |||
| 29ceaa34bf | |||
| 50addf9d18 | |||
| 7269dda75e | |||
| 3f54aec7f8 | |||
| 2d059101ee | |||
| 4dda7dfa7a | |||
| b6d3392571 | |||
| 4001a636db | |||
| cf4c2fc02f | |||
| f94a95df22 | |||
| 7cbaa00356 | |||
| 71cd913944 | |||
| 76fd5a0d37 | |||
| db1b2c01fc | |||
| 9cc6e0b749 | |||
| 8912b82d1f | |||
| d6e215595f | |||
| 6f59b470a3 | |||
| 9241aa8a9b | |||
| 87a7c2922b | |||
| 211348776c | |||
| b2f6b6e2c3 | |||
| 4ea37abdf3 | |||
| ee324a764e | |||
| cee13fbcbe | |||
| 453786b595 | |||
| 9eb7651e84 | |||
| 7b37cc9f83 | |||
| c2a38839dd | |||
| be9f90d220 | |||
| 91937f3d77 | |||
| e70acf9822 | |||
| 243a14ddb9 | |||
| fd7cf76aea | |||
| e48534d14c | |||
| 055ff85f68 | |||
| 12a1765ca0 | |||
| 763dea4889 | |||
| 38a3863213 | |||
| c860de3721 | |||
| 3ce6a41dce | |||
| c69158af8f | |||
| b47b412529 | |||
| 355ae98932 | |||
| 4d812fa6d2 | |||
| ef8153c053 | |||
| 430a9878e5 | |||
| 561c648069 | |||
| f99bcd2ed0 | |||
| df1c566005 | |||
| d548d731ae | |||
| 4e1cfb10b4 | |||
| 4d767c127b | |||
| 71d9e34164 | |||
| d3a2f05945 | |||
| 97b4421e3c | |||
| 73576ff817 | |||
| b4ba33bb69 | |||
| e04df1ba9a | |||
| dd148a105e | |||
| acf75749c2 | |||
| 354e4a6a04 | |||
| b85fb9c07c | |||
| 40b95455a0 | |||
| eef1d728b5 | |||
| cc24ee8e85 | |||
| 62ab1f9935 | |||
| dd26863a2b | |||
| c02a387a64 | |||
| 0fd6852fe8 | |||
| 0dbf009c6b | |||
| 44b6d2d64f | |||
| b2ce2bbcad | |||
| 133192df35 | |||
| c45cf77747 | |||
| 9f898d6873 | |||
| 61bf2d9413 | |||
| 0c8b3e5919 | |||
| 6fd500e55d | |||
| 10f7dcee17 | |||
| 2fcdef2e00 | |||
| 2ec27065f8 | |||
| 4f804ba0e6 | |||
| 7fb05a51f9 | |||
| 30e3202fd5 | |||
| b6b09d17f4 | |||
| 8a70f3d14a | |||
| aaa5096526 | |||
| 668aa88c6e | |||
| ec544ca9ab | |||
| 17ee00a04c | |||
| bc4daa9546 | |||
| 099003b250 | |||
| 4ca5e4bcb5 | |||
| ee4469885e | |||
| 1350955f67 | |||
| de36280085 | |||
| 0399ea1cb1 | |||
| 41ed9824ab | |||
| 842df5ffd0 | |||
| d0e3f36313 | |||
| 2378bb91fd | |||
| 18605dc68f | |||
| 5004a30908 | |||
| 33e41ed704 | |||
| 1f4c88a489 | |||
| 283977f014 | |||
| e71e0bee74 | |||
| fe9847f246 | |||
| f79bfd099b | |||
| 3ec9b4dba5 | |||
| 0c7348fc89 | |||
| 97b615c36a | |||
| 59f95f52ce | |||
| ba04810793 | |||
| aea03d8554 | |||
| 09247281ef | |||
| 7b31d85c7c | |||
| 3ad5b9d05d | |||
| 894f23b292 | |||
| 125d0112e4 | |||
| b46d6075e4 | |||
| c535c411da | |||
| 599db1f8be | |||
| 10ff21a974 | |||
| c60dc81694 | |||
| 6de1859441 | |||
| 70a50da160 | |||
| 3ca2efeb30 | |||
| 496594e77f | |||
| 8ebc7dba86 | |||
| 7da1a18753 | |||
| c16242f25f | |||
| 2f43d90ab9 | |||
| 6f242eee81 | |||
| f19a406ad2 | |||
| cfe69c6bcd | |||
| dcbeec9562 | |||
| 954e3b1ee8 | |||
| d5666b1152 | |||
| c4fa19a1c8 | |||
| 7d9444a727 | |||
| 3646a2560a | |||
| 2f877e0a4c | |||
| 434d6cc33c | |||
| 31386ad676 | |||
| 0d917471a7 | |||
| 4d91ac47ec | |||
| 44e346210b | |||
| e349f3dba2 | |||
| 2ffc1b9347 | |||
| 7a58da1af1 | |||
| f703663342 | |||
| af9db63711 | |||
| 7e9d9051aa | |||
| 73b41a5588 | |||
| 1ab43f0551 | |||
| 79c4fa5042 | |||
| 944caac250 | |||
| 7fe4ade155 | |||
| 3d51a5e648 | |||
| d6af99141d | |||
| 568e84275c | |||
| de5e5fe938 | |||
| 152b524197 | |||
| 142e6541c7 | |||
| 357db616f7 | |||
| 8fc50cc0f2 | |||
| 1feed69b71 | |||
| 6b03a77791 | |||
| 31b4e29e37 | |||
| 08d8a02166 | |||
| e69a5135da | |||
| e768f17744 | |||
| 4e9251e45b | |||
| 2ec2173cad | |||
| 72d6298bbc | |||
| a00302ad1d | |||
| 56c93f97af | |||
| a7432a6b4b | |||
| 75faf391b6 | |||
| 9cefa13362 | |||
| 8f9835a7bd | |||
| 41a4e81c5a | |||
| 83374aa635 | |||
| 4e6b45043a | |||
| 72124a2305 | |||
| b4b84dc462 | |||
| 6cd690d6b6 | |||
| b4f863f00f | |||
| 88d0c54040 | |||
| 46a18695fa | |||
| 05f2f636df | |||
| 506f558eed | |||
| 38cd4e6e77 | |||
| f86376fbc2 | |||
| 3943237a64 | |||
| 37d256acda | |||
| 9cad51e611 | |||
| 3571e02abf | |||
| 123af8265a | |||
| 4f55f8cc90 | |||
| 9a3642572c | |||
| b93773ec78 | |||
| d2eb9b20af | |||
| f2cb4e6a51 | |||
| 5cdb4dae39 | |||
| 9102284b80 | |||
| 1f009d0942 | |||
| 566367daa5 | |||
| c36a390292 | |||
| 4a947d2a3c | |||
| 9b104f358e | |||
| c8a72c53b8 | |||
| 6a3d29bd00 | |||
| 97c8a33e5d | |||
| 39ff7e7692 | |||
| 4f9040d73b | |||
| 9579394788 | |||
| ea8a7bf52e | |||
| a1af0a6804 | |||
| 65e6f05385 | |||
| 08145c0d79 | |||
| c1f60e27c8 | |||
| 5168e20918 | |||
| 0968ca2566 | |||
| e461da3a1e | |||
| c6176a95f4 | |||
| 224db5eb54 | |||
| a6c315302b | |||
| ae3bc78b29 | |||
| 4c48514402 | |||
| e4bc6492be | |||
| 23a526f3a1 | |||
| df87cafbdb | |||
| 595e2eaa86 | |||
| 559837ee13 | |||
| 9440fc3494 | |||
| e700a98963 | |||
| 9635b8c08f | |||
| 56e2042711 | |||
| 30167dbf76 | |||
| 5a403cb3ac | |||
| f22bda85e4 | |||
| 4f09833650 | |||
| d435dd496b | |||
| 252a5c306d | |||
| 9710a074f8 | |||
| e4b91f1b24 | |||
| 6b3f100e7e | |||
| 573612c1c5 | |||
| ba31642a46 | |||
| 00c37bc9dd | |||
| 878057972b | |||
| 1f7a7fc452 | |||
| a8ab257faf | |||
| fc9d060a78 | |||
| a640943c60 | |||
| 6c700fe492 | |||
| afb9b8b61a | |||
| 38c49f70e5 | |||
| bdc40e1572 | |||
| 73bf068cb0 | |||
| 6a4d3bff53 | |||
| dc3ceb6ef8 | |||
| a0cc2123bf | |||
| c71e5c5bde | |||
| 1f84a604d2 | |||
| 648dc2119e | |||
| 4f746cb484 | |||
| 853c760cc4 | |||
| 972bcc8064 | |||
| 2b6557f0ec | |||
| 053c0c2fe9 | |||
| caf79933d8 | |||
| debe284664 | |||
| d4231e0efa | |||
| de99e3f62e | |||
| 16858aa7c2 | |||
| 8beb8b3c84 | |||
| 8cf076aff8 | |||
| 55ddce5904 | |||
| aa5d06a1ec | |||
| 031a1119d6 | |||
| 316c3cec26 | |||
| 584513fb15 | |||
| 9203d68ed8 | |||
| 41abb6b09c | |||
| 7bb5e65810 | |||
| 49ede6a10b | |||
| ac394d8de6 | |||
| abde837a74 | |||
| 834fab5fc7 | |||
| d357abcfc9 | |||
| 119b5f6d33 | |||
| 8a70714eeb | |||
| 90903009f4 | |||
| 6f256be099 | |||
| 5568b7da2e | |||
| 0f89ba4247 | |||
| 4cefdc38fb | |||
| d1481021a7 | |||
| d7eaef6503 | |||
| 0c7b8a2b1c | |||
| 9b5b3eb77c | |||
| 9e31770bfa | |||
| 4d6b9f9463 | |||
| d2c79bb78d | |||
| e0aa6184d6 | |||
| 9c80b95dbe | |||
| bfd3bb009f | |||
| 7ef302fac1 | |||
| fece05de0b | |||
| 71a2981ae8 | |||
| de1d437576 | |||
| 2e179644b3 | |||
| c4551af253 | |||
| 28ca6676a5 | |||
| 31f679a050 | |||
| 64c32043cc | |||
| ea52e70a6d | |||
| 1d721e3e3e | |||
| 3e3b0127a6 | |||
| dcc9f8e669 | |||
| 67c454b469 | |||
| 1cc0528b11 | |||
| c3dce4bc91 | |||
| 990382512b | |||
| b6985ce27e | |||
| 65e36cd01a | |||
| caaebde240 | |||
| 7c130faac2 | |||
| 7ff5d2f40d | |||
| a353e89871 | |||
| c9151cd09d | |||
| 03f99c526d | |||
| 34a54bf88f | |||
| b40c0a0d74 | |||
| 519ea3fb6c | |||
| e4cc090bfd | |||
| c6138b3902 | |||
| 8ec240dcee | |||
| fa589c9523 | |||
| 5f2d8be5dc | |||
| 829228d28c | |||
| a7c9f3a0ce | |||
| e676ebcffd | |||
| 6fe22b14c6 | |||
| d50b171b54 | |||
| 19fc33b7f5 | |||
| d6cbfcbfe3 | |||
| 23db442c82 | |||
| e40f8c9a7e | |||
| 4d4d1612ce | |||
| ded3dfa63c | |||
| 6a2db3d59e | |||
| 48c8a635a8 | |||
| 1ac83e0ffd | |||
| ef6ecbbebd | |||
| f51b841320 | |||
| 7c0099c57e | |||
| 8f49dce1ed | |||
| a9bad0d5b7 | |||
| 702a83c010 | |||
| 227ecbde99 | |||
| ee52dbe5c4 | |||
| 0f0e0a0e52 | |||
| d288d6326c | |||
| b87e305c06 | |||
| 8516b163b4 | |||
| 4460d6ed13 | |||
| ab3165fdaf | |||
| 1539c187e3 | |||
| 78df8eb494 | |||
| eebbd513d3 | |||
| 2ab7616132 | |||
| 3be471b472 | |||
| a151375339 | |||
| ed2ab2d80b | |||
| 35f99ac3a0 | |||
| 836a0401ed | |||
| b8024df7d3 | |||
| 74c02f9d50 | |||
| 25a1e16824 | |||
| 7ee66bbafd | |||
| 2b07d1aa4d | |||
| c6acd6cdcd | |||
| cee122afa5 | |||
| 4c76406f8c | |||
| 6fd89057ec | |||
| ae8b77628e | |||
| 959d919d9e | |||
| bf7df0b45a | |||
| 3589ea0f60 | |||
| ad23ee2803 | |||
| bc59f739f5 | |||
| b8e42184f8 | |||
| 50c312513c | |||
| 427ae97dd2 | |||
| d80f1f1b0f | |||
| 520d779f04 | |||
| c4b938b7db | |||
| 9435cdc99b | |||
| cf90a5ce21 | |||
| 3f4d0cefa8 | |||
| 12ce537781 | |||
| 12d824fe2d | |||
| 8dcf0277ac | |||
| 6664051127 | |||
| 019f10ee86 | |||
| a7ee5d5679 | |||
| 7c31890fc0 | |||
| ad9258710b | |||
| 626dd37312 | |||
| b4d95ccbb9 | |||
| 0d0ae2b5e6 | |||
| d7b3b7f120 | |||
| 7a864171b3 | |||
| 8cfb8f3d84 | |||
| 2f39454d31 | |||
| de33755900 | |||
| d3d1080c89 | |||
| 539597f07c | |||
| 6e87116634 | |||
| 029b16ca68 | |||
| 40b11e192d | |||
| 72cc19f346 | |||
| efb22f741f | |||
| 2458673d3c | |||
| 3881a6659e | |||
| a567cc2222 | |||
| 6a9b2bac4a | |||
| 87542f4a56 | |||
| 32b47cd21e | |||
| bf75e1c062 | |||
| 97fccfa34b | |||
| 1ed32fe71c | |||
| 3ce8f251a1 | |||
| e2ad38f297 | |||
| 993303bfa4 | |||
| 50d9460f63 | |||
| 4b02b57c07 | |||
| 1fc9382ce9 | |||
| ea43e67fe8 | |||
| dd28a41e17 | |||
| b11a273d65 | |||
| d4ee25b004 | |||
| a2b7719100 | |||
| 1e6cde4d98 | |||
| 34f627d146 | |||
| 54accd4394 | |||
| 63557fba56 | |||
| 7a4be158c2 | |||
| 810e12bd22 | |||
| 066f7ad8c1 | |||
| e52a654731 | |||
| 370879f636 | |||
| 170a511654 | |||
| 679afe1bc4 | |||
| 8b5cfff24a | |||
| 27de97031e | |||
| 8ee874da14 | |||
| 11c783f088 | |||
| a3cb31291f | |||
| 6a43b86912 | |||
| 21bb535ee0 | |||
| 9ea948b825 | |||
| fe2fad9378 | |||
| d566ffd9fa | |||
| 370b23f38f | |||
| 253ee696be | |||
| e08c6f79bc | |||
| 4240319fef | |||
| e1aaa2415b | |||
| e71eb56630 | |||
| 38496f2971 | |||
| d1c7d8d9f6 | |||
| 36fdfd672f | |||
| 55c0f61189 | |||
| 053e317850 | |||
| 38296bf292 | |||
| f0ba4564cc | |||
| 21ec70214d | |||
| 6d1a8376ba | |||
| 0ca83fe152 | |||
| 2301c407a2 | |||
| d6096431bd | |||
| d7532d5b83 | |||
| c7d805f8df | |||
| d78ab30cdf | |||
| c123f77195 | |||
| a60bc78e23 | |||
| 78ee107e85 | |||
| 12c3310451 | |||
| d525d8f603 | |||
| 337d1095dc | |||
| fab40cb6b3 | |||
| f4cdc1aecd | |||
| f702e3245a | |||
| d890ba4f43 | |||
| d929ed411f | |||
| 55daa28d74 | |||
| 2bab12aad1 | |||
| 80fb376132 | |||
| 1d557f1065 | |||
| 30df3df8cf | |||
| 02b4655a16 | |||
| debf0158d4 | |||
| 0f730c1948 | |||
| fa7e324fe0 | |||
| e2313e6a3d | |||
| 2ce8c42323 | |||
| 684e65adaa | |||
| a8fc3fb2f1 | |||
| 68bcdb2f88 | |||
| af3627bccb | |||
| 4cbe032363 | |||
| 5e4b3cf0d2 | |||
| 593af1048b | |||
| ae00ecb773 | |||
| da83e42172 | |||
| 2895d53f8e | |||
| 10d1f22ec3 | |||
| 4ed1e64a61 | |||
| 6402936285 | |||
| e01e5c145a | |||
| 56f6d82c8f | |||
| 3e79cf0c12 | |||
| efc09657a8 | |||
| 64390c3e01 | |||
| 513edb802d | |||
| 52c35b8e3c | |||
| cf1c25031c | |||
| 7b9f18867a | |||
| 0985b4dbe8 | |||
| 772fb721ae | |||
| 1ef1c795c1 | |||
| 6d956566c5 | |||
| edec5bb25f | |||
| 3534f65f0e | |||
| 6fbea9c8a4 | |||
| 18bba5da3d | |||
| 952270e1ba | |||
| adc353cdcc | |||
| 0c180e6ee5 | |||
| fdd9c329b1 | |||
| 5b80459b37 | |||
| 1b646a6e00 | |||
| cf970efbec | |||
| 4020cdac69 | |||
| 2415c2ffe8 | |||
| d41502ea19 | |||
| f5d0ef4005 | |||
| c4a89ecf61 | |||
| 71eb25e561 | |||
| 486a6683fd | |||
| 2175d8d87c | |||
| f463bff49e | |||
| a817e2b046 | |||
| 3539e36bde | |||
| 6930a9ffe1 | |||
| e0a44502b1 | |||
| 19e1bd5586 | |||
| ea65ba02f1 | |||
| 8406e48009 | |||
| a8f1d11cbc | |||
| f245a4a9c6 | |||
| 597529a16d | |||
| 9b9dba05c2 | |||
| 2d0bbc824f | |||
| fa523c673f | |||
| da1a4ba393 | |||
| e9c9712e52 | |||
| 78561ca659 | |||
| 1ad87383e3 | |||
| c29ac1549f | |||
| f09eeb19e5 | |||
| 4b7b2c78a2 | |||
| 414af6bdb0 | |||
| df7288b275 | |||
| ce80953086 | |||
| d1344dab71 | |||
| 4f2ba4ae76 | |||
| 6bd525c3b4 | |||
| 341671a612 | |||
| 9161aa1556 | |||
| 70e9fbabce | |||
| a2c00deba2 | |||
| 9b4ef9d1d7 | |||
| 3baee0c14e | |||
| 0508bf43d1 | |||
| bd279d1ad7 | |||
| 4d55a66307 | |||
| 9481e01581 | |||
| fe91bf9620 | |||
| d812ba379b | |||
| e1cc7f3c83 | |||
| f50d5d2cd1 | |||
| b3987b0ad5 | |||
| 243946a189 | |||
| 63fbbc5603 | |||
| fcb857df69 | |||
| dabbc31c09 | |||
| 997bfa3dd5 | |||
| 50eca8aab5 | |||
| 6e4a2e4d5e | |||
| 40e9938885 | |||
| 5bc8ca2266 | |||
| 4cdbfbfb86 | |||
| 01575d1f2e | |||
| 8f75c75b80 | |||
| ebc084f9ea | |||
| 626efaf5cf | |||
| 096ce99588 | |||
| 9ce103b31b | |||
| 13cbd84b58 | |||
| a8912dff41 | |||
| 8b773614ba | |||
| d04f04f382 | |||
| 9a44dae4f9 | |||
| 07665dd93e | |||
| eeca17e78b | |||
| f91264bc94 | |||
| 0983e67f21 | |||
| 8e7db87554 | |||
| 9d000b2284 | |||
| e29fd0ca09 | |||
| dcfde5b5e7 | |||
| 871750d6ae | |||
| d6b5dc0830 | |||
| e99a3e8978 | |||
| 13db6d3155 | |||
| f8845d4fc5 | |||
| efcfb00239 | |||
| 1727313e54 | |||
| f6d55d07c1 | |||
| 331bbadaad | |||
| f012c604b8 | |||
| a8f6b0c599 | |||
| e46d73869c | |||
| 6bf413a008 | |||
| 10b7f63f9f | |||
| f2dff2d173 | |||
| 963c3bf212 | |||
| f7071569d9 | |||
| 4e5eadbf82 | |||
| 113e2e7821 | |||
| 21c8c699dd | |||
| db36b7dc40 | |||
| 38522989d3 | |||
| aa49605ac4 | |||
| 3af65bf276 | |||
| 0a51c3bdea | |||
| ba6c3a8f38 | |||
| 66e196b5ec | |||
| d4a49d7137 | |||
| 1cca8af54f | |||
| 7e925fd931 | |||
| 45448171d4 | |||
| 64ae3d9029 | |||
| edccac17f6 | |||
| 1d36cad17e | |||
| 08e6d5ba53 | |||
| 6505ee1b35 | |||
| 709612090a | |||
| 1af5c373e4 | |||
| 8181d187dd | |||
| 4b448e3305 | |||
| fd579511ae | |||
| e166237e5d | |||
| b934429e41 | |||
| d61c1da666 | |||
| 8f633771d9 | |||
| 684f478c54 | |||
| cb0099d746 | |||
| a72ead91dc | |||
| fd7c3c6cf3 | |||
| 5ef8abacfa | |||
| a01221ffc6 | |||
| cbd4ab2e15 | |||
| e70152b85b | |||
| 8a9c9a587e | |||
| 29c15d9acd | |||
| bf6773f666 | |||
| bba0ff87da | |||
| c9de5278ea | |||
| 6f5a791a1f | |||
| 1e7a720e74 | |||
| 10a7080928 | |||
| 7349c64253 | |||
| 88649507c7 | |||
| cc503473f9 | |||
| 10fcec1dd8 | |||
| 0679c0f6d7 | |||
| a1a69bdbab | |||
| da02b358e2 | |||
| 60dcea6ff4 | |||
| b5796d5e6c | |||
| 6338fd58c3 | |||
| 39b6841557 | |||
| f3a20e8e59 | |||
| 830df65573 | |||
| 2aeb9e1315 | |||
| 696c48c251 | |||
| dcf02e7e93 | |||
| 581091591b | |||
| 0e6f1a064d | |||
| 70975098e2 | |||
| 5b27f9843f | |||
| 71e29a6599 | |||
| 6fd43a4b18 | |||
| 11f207fbe2 | |||
| 6559d589dd | |||
| b7e9acc242 | |||
| bfd1cd0555 | |||
| 590dffdb78 | |||
| 0205dd6853 | |||
| cd03a42c1b | |||
| c1a8d181d2 | |||
| a17d5e04bb | |||
| e719ae24f0 | |||
| b4922e6899 | |||
| d8c2505fb8 | |||
| 02426e413f | |||
| bd05971ebb | |||
| 4e12692325 | |||
| f7ea69acc9 | |||
| 3640cea64d | |||
| f5ac8ac39d | |||
| f801e77208 | |||
| 2a8c5ea9eb | |||
| 181a42e344 | |||
| a0511ca3ac | |||
| 0b48f3a67f | |||
| 15727e83cc | |||
| 7d06432a76 | |||
| 761c47e26d | |||
| edc6a38dfb | |||
| 2b79e127c4 | |||
| 449875d5b8 | |||
| bbdb9e0107 | |||
| 0a613734f7 | |||
| ff2aa0434a | |||
| 2fa22ca2b3 | |||
| 25473c1b5c | |||
| 7c087e20b7 | |||
| 7250b59f19 | |||
| e54e7ad6ec | |||
| 4a2fd9fb72 | |||
| afd5f2b3be | |||
| d468b93e9f | |||
| 188ad0057f | |||
| bde91e3dbf | |||
| 3e9b233ecb | |||
| 1f6a3010b5 | |||
| fa15db70c9 | |||
| b74c359523 | |||
| 6d7e67820a | |||
| 3d884963a7 | |||
| 265cac6474 | |||
| 96ff18b45c | |||
| 8eb2d689fd | |||
| d2888db960 | |||
| 5d7de5a7ba | |||
| 4d3e9c39b1 | |||
| a2639afd7a | |||
| 6d8f89deba | |||
| b3a2493767 | |||
| 5d3cbbe194 | |||
| fd2e480e17 | |||
| 342556b763 | |||
| 1dd67ac7a9 | |||
| 2311c55319 | |||
| eb80d0d6c1 | |||
| c629596198 | |||
| 3fe86f753f | |||
| 031e5a74d7 | |||
| b26baed61e | |||
| a311f41f0c | |||
| 07c3fb05a8 | |||
| 0625ad2652 | |||
| ed3e4082a1 | |||
| b187130c34 | |||
| 3c56477f3a | |||
| 8c15ed7887 | |||
| 1f46c647f9 | |||
| 8791ddf547 | |||
| 04679efe76 | |||
| 9197d31552 | |||
| 47977e3b37 | |||
| e358689181 | |||
| 4cda4793bc | |||
| 7b470fa1f8 | |||
| 33b14d8848 | |||
| 01f6464a71 | |||
| c0c0755505 | |||
| 5bccf567fd | |||
| 670235480b | |||
| bfab104961 | |||
| 658ce63a04 | |||
| 208b602c97 | |||
| 49c65d9f64 | |||
| afdd241116 | |||
| 241748308a | |||
| fc0e0adbc7 | |||
| ce648a2649 | |||
| 92602510a5 | |||
| 2429745cc0 | |||
| 98f70179ef | |||
| bd167f6258 | |||
| 88423908f2 | |||
| 23a4c4b0b5 | |||
| 879b6b2810 | |||
| 3a3652e753 | |||
| e79079f4d4 | |||
| 3660eb62ec | |||
| c6d41ba35d | |||
| c9fb306823 | |||
| 6d9a9032b2 | |||
| fab8edef79 | |||
| df60f1c273 | |||
| fc0e3972a3 | |||
| 3ff6c327f9 | |||
| c22b067e30 | |||
| 6d6eff662d | |||
| 48ecc3915e | |||
| 8c87ead486 | |||
| 66cffd6722 | |||
| eadad135e2 | |||
| 9a44988707 | |||
| d9b2f92e64 | |||
| a8cb907b71 | |||
| 633c176e50 | |||
| 91e8c60036 | |||
| 9c1398814d | |||
| 672d1dc800 | |||
| fca666825a | |||
| dac76abd74 | |||
| e8ad53b990 | |||
| 002504fca3 | |||
| 16c36d346e | |||
| 18142fc257 | |||
| 72d3244dcb | |||
| 34ee246673 | |||
| 3ea1cff8de | |||
| a9de3f6f0e | |||
| a54bf745ae | |||
| 8ee547cad7 | |||
| 325a68877b | |||
| fd13759a79 | |||
| 283ac31f9b | |||
| ea253634d2 | |||
| 426c24ac52 | |||
| 15f7a39997 | |||
| 69107bb48c | |||
| 681e9deafd | |||
| 62911b8490 | |||
| 4e760a2a38 | |||
| 8a1a2b93c6 | |||
| 102458d9c8 | |||
| 2a75912ca4 | |||
| 81c6410394 | |||
| d8b759841e | |||
| d66d9a03ec | |||
| 1894c5c971 | |||
| 5012e4e9bd | |||
| b9ccd9849a | |||
| 898f961e2a | |||
| 88843a1f2d | |||
| 8ea37f2b03 | |||
| 162b5dcb00 | |||
| 2889258304 | |||
| 7770a41f08 | |||
| 0ba4a6a968 | |||
| c2d39b1357 | |||
| 415d47658b | |||
| a3e58605a5 | |||
| 7936c3d097 | |||
| d4da415e4d | |||
| 3197700bc0 | |||
| 285b99a5ac | |||
| fac40064ce | |||
| 4c4ef3ad64 | |||
| 73bfa8e069 | |||
| 2b9b254aaf | |||
| 69edb29412 | |||
| a1deadc40c | |||
| 495aa71860 | |||
| 2cf672ed17 | |||
| 95770429ef | |||
| 724b42f938 | |||
| 010f1f7a77 | |||
| 9e96f3e9bd | |||
| c68437cce8 | |||
| 3f0385d469 | |||
| 1d37344d01 | |||
| a5e412ee85 | |||
| a4b920b1ce | |||
| bdd1d765bf | |||
| 0f66ce9343 | |||
| 68de1c72e7 | |||
| 2062bd0b92 | |||
| 0ea1b6c527 | |||
| 0f1dcb88d4 | |||
| 12500bbd70 | |||
| a2a40d122e | |||
| 7bc15e05d6 | |||
| 84a8032233 | |||
| 67a4ab0dfe | |||
| eff25a9245 | |||
| b0c09da0bc | |||
| 5497cb527b | |||
| 9e6010f650 | |||
| 8d4ff54463 | |||
| a3f2ec8161 | |||
| a02f6b0276 | |||
| 570a433826 | |||
| e811ce765c | |||
| c17037ef65 | |||
| bd3682f4f1 | |||
| 28767c0f2d | |||
| f70431f7a5 | |||
| 26448858e8 | |||
| fc2d4a45ca | |||
| 478f4b86e7 | |||
| 5e8f7aa52d | |||
| c9b9cb5846 | |||
| 06a1b12069 | |||
| 815adb0856 | |||
| ef22f84ab1 | |||
| 596e7bf617 | |||
| a19609f5b1 | |||
| 2ad21f9cd0 | |||
| e91c9f06dd | |||
| d8e1cfe702 | |||
| 4949a8d464 | |||
| 121c624026 | |||
| 0ba5118b5e | |||
| 80d3824150 | |||
| 5bf74fda13 | |||
| a9cbfe93d0 | |||
| e4d30cb842 | |||
| 9b81677fbf | |||
| ce9762da73 | |||
| cb96902786 | |||
| 750d5efc0e | |||
| 929ebf6e0e | |||
| 3d446a5d30 | |||
| 978fe74291 | |||
| 04a5f4667a | |||
| 095bbc9d19 | |||
| 2478eb6873 | |||
| d1b490b59a | |||
| 01158bb16a | |||
| dd583cb908 | |||
| 702952740f | |||
| 99741d0805 | |||
| fcec89bf9c | |||
| d2aa0f521f | |||
| dab33a829b | |||
| dc08890d4c | |||
| 40c5192c1c | |||
| 06c0ef6dde | |||
| cb1ad31c86 | |||
| 8fbf7485dc | |||
| c03aa9cbfd | |||
| 063ffc6ece | |||
| b5881ef5b4 | |||
| 91582bc164 | |||
| c11b53bba9 | |||
| 362d82e32c | |||
| a024ff4899 | |||
| fb3dda807e | |||
| 98a4dbddfc | |||
| e2f0d4b643 | |||
| ad67f0de2c | |||
| 6df78fb8c0 | |||
| b75f9cc039 | |||
| 776b50945f | |||
| 6bdfc8a141 | |||
| 88fc4a26ed | |||
| 904fee3f53 | |||
| 784a9928cd | |||
| 493b79a18c | |||
| 503ae7679f | |||
| 873b1f3774 | |||
| e9e7e7a4c7 | |||
| e508edb680 | |||
| 334ad55548 | |||
| d14816d18e | |||
| 204f9fbe51 | |||
| 6d8b407872 | |||
| 0f5dab8095 | |||
| e1271a62cf | |||
| 549e182867 | |||
| 59f8e39092 | |||
| 5ff3c615e9 | |||
| 00300d80c2 | |||
| 7dd97a8490 | |||
| f39cfe8a22 | |||
| 3251c1125f | |||
| a7f0f1611f | |||
| cf1f0bdb63 | |||
| b7808a8fa6 | |||
| 7184016b62 | |||
| cb137bb28a | |||
| 5309911e2b | |||
| 101949ba1c | |||
| 1431d3a541 | |||
| c04ef86daf | |||
| f780bef0a9 | |||
| 014b74bb1d | |||
| 2578d22b93 | |||
| b91cbf1233 | |||
| 55955b7731 | |||
| 484c9dc910 | |||
| c235a78634 | |||
| 09bf6684d3 | |||
| ea0a80e4d1 | |||
| 52e706d212 | |||
| 55f8633cce | |||
| 11fa48d1b0 | |||
| a3d7c0bbcd | |||
| 32af7d10c6 | |||
| 1241e7e868 | |||
| 0a8601ca79 | |||
| 8fa8424f24 | |||
| c7465ba9ee | |||
| 604e627233 | |||
| 7c1f957275 | |||
| ad762c667b | |||
| 25148a4ccc | |||
| 803fa4781b | |||
| d1133a01a8 | |||
| 63cdb366ba | |||
| 585d1bfba9 | |||
| fb9d1e69a4 | |||
| 98f84e8740 | |||
| 75d975f91d | |||
| 0cebd3646f | |||
| 7633022d82 | |||
| 045747f625 | |||
| 8f146582a4 | |||
| 59bb27998f | |||
| d45cd9932b | |||
| 58b6a91f65 | |||
| 942875d1a1 | |||
| bcb38f8731 | |||
| ad53559b4f | |||
| 6b740baf73 | |||
| 1ada97c409 | |||
| 89caa5f87c | |||
| 1badc69477 | |||
| 6769ade9a9 | |||
| 0e783f0413 | |||
| 577ab77f1d | |||
| 7ee44be072 | |||
| fa7bbaf98b | |||
| 672fcfdb6d | |||
| fc01b4ad8a | |||
| ca7f0f5951 | |||
| f003ad3277 | |||
| dc6f59943f | |||
| ee51adb675 | |||
| 5406c24771 | |||
| d9c768c2d0 | |||
| d876c4d100 | |||
| 894aaa9fa9 | |||
| 010f22ea3b | |||
| 0a560c9594 | |||
| 7e53c18f5b | |||
| f0a3325ab8 | |||
| a18b226ea2 | |||
| 4112c88c1b | |||
| abda397c9f | |||
| ba0c7173c9 | |||
| 0c40287764 | |||
| 05902d88a7 | |||
| 228b00d5c7 | |||
| 6c2ce95b0e | |||
| fcb7ece378 | |||
| 65ef84179f | |||
| 0811018560 | |||
| c37f8153c0 | |||
| 1a70ce90f9 | |||
| cd011035ff | |||
| b7aa164ed8 | |||
| cecf304ace | |||
| ce60b83e65 | |||
| 892ddc8a79 | |||
| de237fb4af | |||
| d60fc52e74 | |||
| 1c8e702399 | |||
| c2dc35e857 | |||
| 2067e12bdf | |||
| 7764d4ba30 | |||
| 719a198e55 | |||
| 8eac35df75 | |||
| 975972885a | |||
| 056da4b782 | |||
| 0de3c26200 | |||
| f5539cf79f | |||
| a0bdca62b5 | |||
| ad996d39d2 | |||
| d393b9ea90 | |||
| 3ae37d764b | |||
| 6b15d7fca2 | |||
| d8167ea9dd | |||
| 6efb0cfccf | |||
| 19ac16ff62 | |||
| 1710df79f2 | |||
| 72cf0a5837 | |||
| 468f1788b8 | |||
| 36b5e1b5d7 | |||
| 03d371d9fc | |||
| 4b50455a22 | |||
| 5250de602c | |||
| ffb88cdf57 | |||
| 06773a22c9 | |||
| 6ddcbc7c18 | |||
| 1cdc9142df | |||
| 3bc88c4bf3 | |||
| c4b21c554f | |||
| 151c691af2 | |||
| 9f00f08c30 | |||
| 3e2c03d3a3 | |||
| cd1c420fae | |||
| c4d592be20 | |||
| 808e470b27 | |||
| f7bbe2d9f7 | |||
| 92760b2835 | |||
| 379718dbf9 | |||
| 787d690c41 | |||
| 32f124517a | |||
| f501a6ebac | |||
| 2f632a0f8d | |||
| 597b8a67e2 | |||
| f21689f8dd | |||
| 9bd3f170e5 | |||
| 34e9c614b8 | |||
| 960db59935 | |||
| d57efcf0fe | |||
| 306703e677 | |||
| 256edf489c | |||
| 655837f8cd | |||
| ef43e6a9a4 | |||
| d8ac434e7e | |||
| 6907fadce3 | |||
| 8fa222a9b9 | |||
| fc05ba6f4d | |||
| 3c6d7edea0 | |||
| 908f2efd43 | |||
| 0e90989998 | |||
| 329ba4a62d | |||
| dd9a8b9df5 | |||
| feac842b8a | |||
| 2916e4e625 | |||
| d758cd1e7d | |||
| b8bee2a9fe | |||
| 25b6af331e | |||
| 65e9994963 | |||
| cd8ced38f2 | |||
| f6e35f7250 | |||
| 29299704aa | |||
| ad83a772a1 | |||
| ba5a532da0 | |||
| ab838ae3ba | |||
| 4dedb18137 | |||
| 0c18cbc758 | |||
| c012a8045f | |||
| 536b64a63d | |||
| 6b6b91c083 | |||
| d4cd2d83d4 | |||
| 606b73d92f | |||
| 75543fe126 | |||
| 41e5f53c45 | |||
| 626efceaee | |||
| 9d0596089d | |||
| 9d17f14fbb | |||
| 1ad42f671a | |||
| 2c407117dd | |||
| b3ab757416 | |||
| 6667c03ff6 | |||
| 91b75fcae5 | |||
| 048a54716f | |||
| 694d562a80 | |||
| a12f5dba9f | |||
| 65571cfa06 | |||
| 7841606a41 | |||
| cf67d1cb77 | |||
| 255ecd64b2 | |||
| 96913b568f | |||
| 9c046cf10f | |||
| 68367474d0 | |||
| ab77f6d936 | |||
| 8dadf0dada | |||
| f074914f1b | |||
| 110981066e | |||
| 4fd5d6a814 | |||
| c68c365261 | |||
| 6195485cc7 | |||
| f13471428c | |||
| d2d7dc0717 | |||
| 55f1a05d17 | |||
| 173b81c288 | |||
| 1269d0234d | |||
| 62a8e2f72a | |||
| e50a0e84f2 | |||
| 0307890bf3 | |||
| 998daaa8d0 | |||
| 0b4faf9c80 | |||
| bafeadd809 | |||
| ecab59b715 | |||
| 0edb21a44b | |||
| 652fa57245 | |||
| 108f7bd8f7 | |||
| fce06d28a2 | |||
| 62169f91db | |||
| 2d2f1ec7d1 | |||
| 3a60d08eb3 | |||
| 04f8f175b9 | |||
| c687a4ae5b | |||
| c19c692ace | |||
| 8e71fa736b | |||
| e76fc53e85 | |||
| dc548da9eb | |||
| c618c0a6c3 | |||
| 6e4c75144a | |||
| c1f7e8f471 | |||
| fe098a7ee7 | |||
| aced6c5119 | |||
| abe9b200c9 | |||
| 8b542376c5 | |||
| b59df7faec | |||
| c9c516daf2 | |||
| 94cd21189e | |||
| 4e07941e7a | |||
| a2fcf85e3b | |||
| e830cb9141 | |||
| 9bf3985fb2 | |||
| 59ad11b0f4 | |||
| ca7d92703e | |||
| 75109ea476 | |||
| cd040fc148 | |||
| 6b62d86151 | |||
| 56c6ff289e | |||
| 30d331b16e | |||
| 7f41b96e07 | |||
| f8216e4f6a | |||
| 2e9a66c70c | |||
| 41d2dfce6a | |||
| 0a712e3a68 | |||
| 7455472856 | |||
| 0eca5a6fba | |||
| 8ab3f20eb8 | |||
| 634119f66a | |||
| 28718191d6 | |||
| f5f40c4746 | |||
| f6f832a7dd | |||
| e50882881d | |||
| 2937163371 | |||
| 0e6af8fc1b | |||
| 4da15cc3bd | |||
| 96312f29e3 | |||
| 32e2956346 | |||
| be820dc843 | |||
| 1a31d76034 | |||
| 73f0fb77bf | |||
| 263c857ca2 | |||
| 21e2a8f72e | |||
| 762eec7bf2 | |||
| ad388af712 | |||
| 6b46c5d2b2 | |||
| 370fa31c11 | |||
| 29f5c6e111 | |||
| 0e4134b5f8 | |||
| 9e6cd77650 | |||
| 101bbebbe6 | |||
| 2c27efe936 | |||
| 6404e71e22 | |||
| 575f835475 | |||
| ad2cdeebd8 | |||
| 66591ea617 | |||
| e5f4ee1555 | |||
| b1576abb74 | |||
| 35aa3e8ee2 | |||
| 9b0c7a1008 | |||
| ebccbfbbe2 | |||
| 48cc6e7f5a | |||
| e921585baa | |||
| 9662f10652 | |||
| 9b374f2683 | |||
| a5eceac4c5 | |||
| 1d26beacfb | |||
| e0352bdc4a | |||
| 1d50755d9b | |||
| 200a3c698a | |||
| 3b3fa59307 | |||
| 7530a20cd8 | |||
| 9ac28dfb65 | |||
| 5b265245a4 | |||
| 9e974d30db | |||
| f3145e0d06 | |||
| 72a9c18b94 | |||
| 7b8f8184b0 | |||
| 254b413617 | |||
| efdd2ce743 | |||
| 14522ee010 | |||
| b917e0b8d5 | |||
| d3d53b983a | |||
| 2a3b6d0ebb | |||
| 042bbb364f | |||
| 2bc9e29e4b | |||
| d7b3d00e82 | |||
| 7116d8b916 | |||
| cc84676070 | |||
| 206c1da862 | |||
| e575effb05 | |||
| f01c20dee1 | |||
| 0f2a340c78 | |||
| be58f39505 | |||
| 9976df1185 | |||
| 6140cec905 | |||
| 53f5910f9b | |||
| 7db4a48565 | |||
| afbe93c5cb | |||
| 6c7b08606d | |||
| 75886ff835 | |||
| dfd74fbd72 | |||
| e0a597fc4c | |||
| ae28bd21d6 | |||
| e1ef29d9a6 | |||
| 554e6489e5 | |||
| 25030391ed | |||
| be06b3c2c8 | |||
| 5ab1995a23 | |||
| 287d0e3612 | |||
| 421ba72564 | |||
| bb6ad49a1c | |||
| aef52e14b5 | |||
| 582d8f54f4 | |||
| 9543f3fced | |||
| 6207b46e4f | |||
| c7ddae7a62 | |||
| 7e9823614f | |||
| e93ad56f5b | |||
| 2dc02a5bbf | |||
| bfcc577df1 | |||
| ae65dff284 | |||
| 773fca881b | |||
| a8a3487749 | |||
| 1505f17d6e | |||
| 874d749901 | |||
| b1a433f267 | |||
| e31c77d42c | |||
| c6e7679c63 | |||
| 4cb42515c7 | |||
| 43a5557200 | |||
| 1dec5f5b9a | |||
| 140b418b1e | |||
| e06a076e30 | |||
| e421a16469 | |||
| c01e200a89 | |||
| b339a50057 | |||
| 64425cc1e1 | |||
| 82187cf17b | |||
| bc3a6cd4e9 | |||
| 5b54f203b6 | |||
| 60a01bd455 | |||
| 623d1a7223 | |||
| d6facc48bf | |||
| 902505bf64 | |||
| d2a12e0445 | |||
| ca2c87f366 | |||
| fc4ffca529 | |||
| 9b8d7f94d5 | |||
| ad1c0d559f | |||
| 3d793be2a2 | |||
| 41122103ee | |||
| 6d1d674d5a | |||
| 89a5ad9498 | |||
| fb4f80589e | |||
| f3688dd303 | |||
| 0ba0f82141 | |||
| 0e876386e0 | |||
| 7a115ed3b4 | |||
| a497049352 | |||
| 43e0545287 | |||
| 4f7b992e64 | |||
| 83a842037b | |||
| c836ff9bd5 | |||
| 91e0b2089b | |||
| 11c80866c3 | |||
| 203fa4a554 | |||
| c8351fdb89 | |||
| 27ac97d2e0 | |||
| 0afe45b296 | |||
| 18f705ba7b | |||
| 77c25b06dc | |||
| fdcfc9f872 | |||
| bc005c4e5f | |||
| 1ae3df953c | |||
| 26f17b832a | |||
| 56cc1e505e | |||
| a06b1a3eae | |||
| 1008de5dcf | |||
| 7e5a509c32 | |||
| 927ed626a2 | |||
| 2dd8142b9d | |||
| 74c15af762 | |||
| 72ae1f18fd | |||
| f5dfc7f03b | |||
| 50b3fac2d2 | |||
| b5ad4ae8a7 | |||
| e1132269e5 | |||
| 2c43b6e49a | |||
| 2599806cb1 | |||
| 00d31b2354 | |||
| 9d1d24811b | |||
| cf4cac9482 | |||
| 3537d7c05d | |||
| f2022f2607 | |||
| e58fe4dfa1 | |||
| 3abd32c3db | |||
| 2a48cd4f0b | |||
| a77f59cb91 | |||
| fc4b093d9a | |||
| 4808e770d0 | |||
| 2a34edb488 | |||
| 67f356c388 | |||
| e57e8414ac | |||
| 104c02c61a | |||
| 747ed92e7f | |||
| 23d96dbd4d | |||
| a651981b61 | |||
| d162d24acd | |||
| fa0f24be09 | |||
| 6376218441 | |||
| cff2f7256a | |||
| a7c6f1f81a | |||
| fa23cb1efe | |||
| 74ecbb2bf0 | |||
| 5a32e54b4d | |||
| c090bb7c27 | |||
| 2c6a2e81ec | |||
| 084ca7db1e | |||
| a3da3c0e3b | |||
| 4ec18f6707 | |||
| cf0f2feb29 | |||
| 331291010a | |||
| b35ba7f6d5 | |||
| fefbca490f | |||
| 65eef0eda8 | |||
| 659ef4b804 | |||
| 1e922f0a57 | |||
| 610fb0e711 | |||
| 10b1e1e917 | |||
| d641c85aea | |||
| 0a4aaa0583 | |||
| 5b4ba91288 | |||
| d6e85aa352 | |||
| 156ede73c7 | |||
| 6e0908eb52 | |||
| 1ee486e7e6 | |||
| 191c895d6b | |||
| 1acd5bf8bb | |||
| 86a3dcedd9 | |||
| 1a4e6aa5ab | |||
| bdd4b7ee45 | |||
| 9924fa55dc | |||
| fd24c14da4 | |||
| e15a138ff7 | |||
| 4389f35509 | |||
| 8b2c7cac42 | |||
| b2f22ff710 | |||
| 2edf26d70a | |||
| e0d2229b16 | |||
| cec0423b14 | |||
| c2646afd40 | |||
| 03cf7e26b7 | |||
| 4649f8b854 | |||
| 0d81353be1 | |||
| 0fb05dd5e8 | |||
| a38d97c302 | |||
| c0ead7a4c7 | |||
| 7a142c714f | |||
| e1f0b3bdcc | |||
| c4cf3710a7 | |||
| 22666b8bba | |||
| 811a82a211 | |||
| 84b81d2df0 | |||
| 05fa273558 | |||
| 8b23a074a3 | |||
| c6cc482b92 | |||
| 9ccad7a417 | |||
| 71e4b7b2ef | |||
| 39dd4e3aa4 | |||
| 1a35214b2b | |||
| 0d1f975687 | |||
| 418d8f74cf | |||
| 92f7db0a50 | |||
| e93317ebb2 | |||
| d922e03c95 | |||
| c218aebea6 | |||
| cedb7af539 | |||
| 0b0277923f | |||
| 6e69de0acc | |||
| 54838d542b | |||
| a3a7289d42 | |||
| 130933db36 | |||
| 8030ac6beb | |||
| f8091afb69 | |||
| 0a41abdff7 | |||
| 8381ef6c24 | |||
| 880dc8450b | |||
| 8de2dec4e1 | |||
| fc3013a066 | |||
| dfcde3fef9 | |||
| 278bcb6136 | |||
| 105d69337c | |||
| fc2e7b5382 | |||
| 9a69116d8f | |||
| d5bf7cff40 | |||
| a00f198a33 | |||
| 3d9870e8a3 | |||
| 070c77f11a | |||
| b34e11cfdf | |||
| 25a453fa1e | |||
| 830b01114a | |||
| 48f2d54676 | |||
| c3ab2959bd | |||
| 4e5fe85e6d | |||
| 730b2e5adb | |||
| c28c329085 | |||
| 1e933cefcb | |||
| 5217b7c342 | |||
| ee22cbca1b | |||
| c1e21f9884 | |||
| 74a6da2f57 | |||
| c25c28333a | |||
| fc80745b8d | |||
| b361128ec4 | |||
| fa7dfa2e96 | |||
| f4d6c67431 | |||
| 8fe758e14a | |||
| bb58688b49 | |||
| 676b519f46 | |||
| 626a121eb0 | |||
| c89a54ccf4 | |||
| 23a7b9cc87 | |||
| 351192378d | |||
| aa978f56d1 | |||
| a8b9d2ce3e | |||
| 6e1db8eb00 | |||
| df98984a40 | |||
| 661041b1df | |||
| ff1c0c9b41 | |||
| 0c111433c8 | |||
| e0754402d8 | |||
| 1af7d31285 | |||
| 1fd9566702 | |||
| dd3f9410cb | |||
| 3942c2f69a | |||
| 8c93a0ebae | |||
| e9359c86d2 | |||
| 0519981d24 | |||
| e86f2b3e9f | |||
| d9df09ceec | |||
| afde46bbae | |||
| ee9fed8fe8 | |||
| d26eee685a | |||
| 68a2eb8742 | |||
| d582343874 | |||
| a6c4dcaad3 | |||
| ac071bd62b | |||
| b6260f100a | |||
| 61ac320826 | |||
| 64dce5a060 | |||
| 71692df973 | |||
| e1b94bf226 | |||
| c895e4da83 | |||
| 98f211bd4b | |||
| b41a1b8a67 | |||
| 83cc90fbbd | |||
| 5dac0c57cb | |||
| 4aef611665 | |||
| da28605e63 | |||
| 2a6c42eb1f | |||
| 46fc1d8142 | |||
| aa2df4f6df | |||
| 9ca7fea042 | |||
| 9661121b38 | |||
| e6b8396d2c | |||
| 0df4b93182 | |||
| c20656897d | |||
| 1540675db7 | |||
| 0fb4a31c3c | |||
| f4a3c8dc0f | |||
| c61ba0cb77 | |||
| 407db1a1ae | |||
| 345af89c97 | |||
| bd3568eba0 | |||
| 9486e8ef1c | |||
| 9cb14b295b | |||
| 686b576588 | |||
| 00cad780a9 | |||
| 1f4748afc4 | |||
| 2abdf201df | |||
| 8a61529d41 | |||
| 46202ce1c7 | |||
| 50d0e4dc61 | |||
| 1cf2095e98 | |||
| faf5d1904f | |||
| 807f5a6bab | |||
| cf5b322852 | |||
| d52d724e66 | |||
| 42ac2b9907 | |||
| 95c41f4a6a | |||
| 0a832f3e5f | |||
| c2550f7f91 | |||
| 917165cc86 | |||
| 12c18895e9 | |||
| 832147f4d2 | |||
| a9ad740efe | |||
| 0b33ff68bf | |||
| d685720dd6 | |||
| c305cf4684 | |||
| 66aa92eab9 | |||
| f254b46efc | |||
| 83bdcb6ada | |||
| b627457c98 | |||
| a739db1854 | |||
| 7e20b9eaa2 | |||
| 8e1ccbf685 | |||
| 5389dffc35 | |||
| 5631c9825e | |||
| 9ff45e3e3c | |||
| 11487b4fd2 | |||
| a8e7b74393 | |||
| 7bb5eba0ea | |||
| 284b7e2f90 | |||
| 4f61bed415 | |||
| c3622cf784 | |||
| 5639a0d5dd | |||
| c07fad0be6 | |||
| efdd77bdf5 | |||
| e16341be8b | |||
| 89061f939e | |||
| 9c956d4703 | |||
| 6c05fd2010 | |||
| aca55603db | |||
| 6e68833d10 | |||
| b3b23e4d47 | |||
| 68030465f7 | |||
| 4c3d162440 | |||
| f09cd28ba3 | |||
| 7cd507d023 | |||
| 68cfbf067d | |||
| 9538741b11 | |||
| 7219c65dcb | |||
| 938019d26f | |||
| c4b81dc438 | |||
| 46bbbd1bc0 | |||
| bb690328a8 | |||
| 043b77e06a | |||
| 9da9dde15b | |||
| 5e7b22b6d7 | |||
| ba83513fa3 | |||
| b20c55aab5 | |||
| c2de074c55 | |||
| 8b8380f4dd | |||
| fe7e3e5af7 | |||
| d75a63d007 | |||
| dcef9dfe25 | |||
| d524938599 | |||
| 4a4e8b7568 | |||
| e37c9bce92 | |||
| 073e60d040 | |||
| 66badba0a2 | |||
| 9e09b2737a | |||
| 6dc374c6bf | |||
| 26ce05f76c | |||
| 1f3f801124 | |||
| 63a6ecd17f | |||
| 55448fcb73 | |||
| 6364de594f | |||
| 119dc6af77 | |||
| 251a5923f2 | |||
| 602f78ab2a | |||
| 4ee720333d | |||
| b403f04bb6 | |||
| dd8145083e | |||
| d17eec062c | |||
| 7e59c568d5 | |||
| e7d609f85c | |||
| 344bf5152a | |||
| e116b9d6f4 | |||
| fc2db8dd7e | |||
| ce748fa881 | |||
| 27e7cc2253 | |||
| 22d8c377df | |||
| ad12cc9a54 | |||
| a9aead5547 | |||
| 1a2d610039 | |||
| 9ec7f2e29a | |||
| baee5f58b8 | |||
| f5d4abd5ac | |||
| 3f72bebfb1 | |||
| 14f857d3a8 | |||
| d95ca411ae | |||
| ebb29f3dd0 | |||
| 6988327dbc | |||
| 4f3694ddb9 | |||
| ff32728095 | |||
| 55a580eb00 | |||
| 7e02786cd3 | |||
| 2a7f301f45 | |||
| 8cba53e8b5 | |||
| e69b69a616 | |||
| 20907e7cab | |||
| b77f139fd2 | |||
| 78ad21d89d | |||
| 88e63978e9 | |||
| e9954f3a47 | |||
| 0861578c14 | |||
| d0738a3585 | |||
| 72b3baf36d | |||
| a8eacdad02 | |||
| 276b2f9c6c | |||
| 8e2b57ea21 | |||
| e49e5a8cc2 | |||
| a18547c771 | |||
| c3eb2e6c9d | |||
| fb6e5efa8b | |||
| 149e928a8c | |||
| fd746856cd | |||
| 410516bf8e | |||
| f8ce636d1a | |||
| 09806db27f | |||
| 4cc0bd8696 | |||
| 25dc0d8937 | |||
| f6105aabd9 | |||
| 827b2d384a | |||
| 62dc58387a | |||
| d78d457064 | |||
| be1368d0df | |||
| 8cccfb95d3 | |||
| fa46b0a8d2 | |||
| 275c1cf63b | |||
| d8522fba35 | |||
| 4ccf7afdac | |||
| 6eab11335c | |||
| c4c2bf341d | |||
| 9085b1965b | |||
| 43142b56b5 | |||
| 3686e77360 | |||
| 15c8159b8d | |||
| b918b0e179 | |||
| 670d255de1 | |||
| af2af9dfc8 | |||
| 8719ac760b | |||
| 82e3a81d72 | |||
| 97d9bbbd1d | |||
| 88ade05b03 | |||
| c1a54ffa7a | |||
| d5813b4506 | |||
| 479db29d51 | |||
| 3461f8c86e | |||
| 87f67c2ed1 | |||
| 0f065be011 | |||
| bc56a130ff | |||
| 2a4bdd43bc | |||
| 08cb8dbe59 | |||
| fe0f63a085 | |||
| 36f326896c | |||
| f284c9951a | |||
| 8f3fcdfc04 | |||
| de24cdf87c | |||
| 798c1d4c8a | |||
| c0ed15331e | |||
| 02b032e8b8 | |||
| 685a9378f4 | |||
| bb5e60c285 | |||
| 13e9224483 | |||
| 0600e328b2 | |||
| 41a03cedc4 | |||
| d25257abfd | |||
| 23b8c73979 | |||
| cd02fe3ce5 | |||
| 04fb01ac86 | |||
| 0af070e895 | |||
| d62cc2aa74 | |||
| 1ce5f56063 | |||
| 8dcc1e16b4 | |||
| f22853785a | |||
| 0786d40aa3 | |||
| b5deccb8c3 | |||
| e2b83924f2 | |||
| a57f3e7a6e | |||
| 2ceca89488 | |||
| 7ed37328ea | |||
| 4d34ef329e | |||
| 88a9f44409 | |||
| bcb0261944 | |||
| 76ea37dcef | |||
| 632d572dcc | |||
| 0a3415ab9b | |||
| 2213252489 | |||
| 9ab087bb80 | |||
| aee17a98ee | |||
| dd0dec49f8 | |||
| c5fa42edb9 | |||
| 041782b2d9 | |||
| e3f5ee7ed1 | |||
| 001f921199 | |||
| fdb35262d5 | |||
| d3f2a22225 | |||
| 5fed163fad | |||
| 53fff2bbba | |||
| 1c6c44644b | |||
| 619e8004af | |||
| 53a039fcc2 | |||
| f35172aced | |||
| e620f2fd0e | |||
| 3db780f641 | |||
| 42e5be64b0 | |||
| 8b21c54892 | |||
| 53120f9e54 | |||
| a1f19d41dc | |||
| f5bf8c1743 | |||
| c6e9dded78 | |||
| f9d7ad4a14 | |||
| 205f1cac11 | |||
| d2ef744fe0 | |||
| 84a55eee4e | |||
| 50e8402dd2 | |||
| f961e91196 | |||
| bf3c8be37d | |||
| e5797432c2 | |||
| 10983f5ba5 | |||
| 5788b5e0e9 | |||
| 7b925419e6 | |||
| 787aae5038 | |||
| b37a57d9c1 | |||
| 0225c5030e | |||
| 60b1a52394 | |||
| d8e1fa0bc4 | |||
| 2d3208ee1f | |||
| 70d30f4db3 | |||
| 1aba51fcc1 | |||
| c7fc998779 | |||
| c2a5b124e2 | |||
| 90da8d975c | |||
| cf4a1b9545 | |||
| f144f286ca | |||
| 47fb1a4a74 | |||
| 82a728f183 | |||
| b3b2def10c | |||
| f5117abc3f | |||
| be0b236b1d | |||
| 64fb225c90 | |||
| 2f08f7e413 | |||
| c3461c229e | |||
| 9c3a764001 | |||
| 8b60ddfdda | |||
| ffddb2015f | |||
| b562870211 | |||
| e8d77c24f9 | |||
| da75209683 | |||
| 68545075fb | |||
| 4ecd580213 | |||
| e52d3ae4a8 | |||
| 786b62081b | |||
| 7c4c5be2c7 | |||
| bb344b2d15 | |||
| b8d95c9cd3 | |||
| 3d86491a94 | |||
| 3dece370dd | |||
| e92bc04456 | |||
| 79719df0f8 | |||
| 0fe2bfeb8e | |||
| 38479b6329 | |||
| 03e67c7cc6 | |||
| 143012f1f7 | |||
| 2342a0e57f | |||
| 7be19f6e21 | |||
| 7887d09fbb | |||
| b8475b7560 | |||
| a8b072c830 | |||
| c604cf8357 | |||
| 8fa9a78798 | |||
| c578f94b8a | |||
| 1f645a69f2 | |||
| 42fd3f4247 | |||
| c60a92759a | |||
| 355bfc8d4b | |||
| cbc1a52c83 | |||
| 19b55d018e | |||
| 83cddce9dd | |||
| 089a8dfe97 | |||
| f011fc2707 | |||
| e50c6baa66 | |||
| a3c0f75db5 | |||
| bc33b765ba | |||
| 8a0ee8bdd7 | |||
| 4e64d49c88 | |||
| dd76036a34 | |||
| e72c742dcd | |||
| b2657d70fd | |||
| 6bb915f62e | |||
| f545523496 | |||
| cbbfc33ea9 | |||
| 8e6c400568 | |||
| 7e3055d7f8 | |||
| a34d1cd413 | |||
| 66d6ff1c44 | |||
| 86f6e3d195 | |||
| 10765ca23f | |||
| 2a1d7725d8 | |||
| fb09f6799d | |||
| 8e95232846 | |||
| 90e03e5acb | |||
| be2ec1de9b | |||
| 53e3cb9059 | |||
| 905e8b79d1 | |||
| 14723fa269 | |||
| 4b8d49d669 | |||
| 6e0026a32b | |||
| 92d43ef0c5 | |||
| 2abcb662f6 | |||
| b72f183a59 | |||
| 6176859c84 | |||
| 1cccf35968 | |||
| 467ec757ca | |||
| 1a45031d25 | |||
| 03823fe084 | |||
| 0db3ed96da | |||
| ac501c0c02 | |||
| 8d99ef637d | |||
| d58584465d | |||
| 6a8a7ec49e | |||
| 098e9b89f2 | |||
| 03f38dd855 | |||
| 5e00274a6f | |||
| e2436b8c03 | |||
| c954b83e43 | |||
| 21056ecfcb | |||
| 2ce4c7c324 | |||
| 2b253f748d | |||
| 4f733e9747 | |||
| 1cb9b8e752 | |||
| 75d650e821 | |||
| b4f0c739dc | |||
| 99be69b3dc | |||
| 4416954c49 | |||
| 7171050a47 | |||
| 8a77cab24c | |||
| d5e0c1b8b5 | |||
| 6326937f65 | |||
| b1cd780e3b | |||
| 3484100531 | |||
| 5f317481ed | |||
| 98c8173422 | |||
| aea8e9b766 | |||
| f8cb1a8a9b | |||
| 2e7bb55c8d | |||
| 0a8cc77a4c | |||
| 872dc6ef67 | |||
| 5307d0008f | |||
| d3e224b6ec | |||
| eee179f017 | |||
| c5b1557834 | |||
| b189c2fd20 | |||
| 3060674c25 | |||
| 6be789a4d9 | |||
| 9ccb704e46 | |||
| a3e8920f31 | |||
| 0146cdf57c | |||
| 33069098ef | |||
| aa77004088 | |||
| 60b77d48a0 | |||
| 18091aba3a | |||
| b4952a4f38 | |||
| aa4af4a114 | |||
| 7144159de3 | |||
| 4996f372ae |
25
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
25
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Report an issue with build_tools you've discovered.
|
||||
---
|
||||
|
||||
# Describe your problem:
|
||||
|
||||
*Be clear in your description of the problem.
|
||||
Open an issue with a descriptive title and a summary in complete sentences.*
|
||||
|
||||
*Use the template below when reporting bugs. Please, make sure that
|
||||
you're fetched latest master of build_tools and that the problem you're reporting
|
||||
hasn't been reported (and potentially fixed) already.*
|
||||
|
||||
*Before filing the ticket you should replace all cursive text with your own words.*
|
||||
|
||||
**Steps to reproduce the problem**:
|
||||
|
||||
*Please make sure your error can be reproduced, Docker can be a great help*
|
||||
|
||||
**build_tools base repo version**:
|
||||
|
||||
**Operating system**:
|
||||
|
||||
**Compiler version**:
|
||||
24
.github/workflows/check.yml
vendored
Normal file
24
.github/workflows/check.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
name: Markdown Lint
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
paths:
|
||||
- '*.md'
|
||||
- 'develop/*.md'
|
||||
- 'scripts/**.md'
|
||||
- '.markdownlint.jsonc'
|
||||
|
||||
jobs:
|
||||
markdownlint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v16
|
||||
with:
|
||||
globs: |
|
||||
*.md
|
||||
develop/*.md
|
||||
scripts/**.md
|
||||
88
.github/workflows/git-operations.yml
vendored
Normal file
88
.github/workflows/git-operations.yml
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
name: Git Operations
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
operation:
|
||||
description: 'Operation to perform'
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- create
|
||||
- remove
|
||||
default: 'create'
|
||||
|
||||
branch_name:
|
||||
description: 'Branch name to create or remove'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
base_branch:
|
||||
description: 'Base branch to work from (for create operation)'
|
||||
required: false
|
||||
type: string
|
||||
default: 'develop'
|
||||
|
||||
branding:
|
||||
description: 'Branding name'
|
||||
required: false
|
||||
type: string
|
||||
default: 'onlyoffice'
|
||||
|
||||
branding_url:
|
||||
description: 'Branding repository URL (relative to git host)'
|
||||
required: false
|
||||
type: string
|
||||
default: 'ONLYOFFICE/onlyoffice.git'
|
||||
|
||||
jobs:
|
||||
git-operations:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: ONLYOFFICE/build_tools
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
# Install any Python dependencies if requirements.txt exists
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --global user.name "GitHub Actions Bot"
|
||||
git config --global user.email "actions@github.com"
|
||||
|
||||
- name: Run Git Operations
|
||||
run: |
|
||||
cd ONLYOFFICE/build_tools/scripts/develop
|
||||
python git_operations.py ${{ inputs.operation }} "${{ inputs.branch_name }}" \
|
||||
--base-branch="${{ inputs.base_branch }}" \
|
||||
--branding="${{ inputs.branding }}" \
|
||||
--branding-url="${{ inputs.branding_url }}" \
|
||||
--modules="${{ inputs.modules }}"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Operation Summary
|
||||
run: |
|
||||
echo "## Git Operations Summary" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Operation**: ${{ inputs.operation }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Branch Name**: ${{ inputs.branch_name }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Base Branch**: ${{ inputs.base_branch }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Branding**: ${{ inputs.branding }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Branding URL**: ${{ inputs.branding_url }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Modules**: ${{ inputs.modules }}" >> $GITHUB_STEP_SUMMARY
|
||||
if [ "${{ inputs.operation }}" = "remove" ] && [ "${{ inputs.force_remove }}" = "true" ]; then
|
||||
echo "- **Force Remove**: Yes" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
30
.github/workflows/update-version.yml
vendored
Normal file
30
.github/workflows/update-version.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
name: Update hard-coded version
|
||||
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
update-version:
|
||||
if: >-
|
||||
${{ contains(github.ref, 'refs/heads/hotfix/v') ||
|
||||
contains(github.ref, 'refs/heads/release/v') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.PUSH_TOKEN }}
|
||||
|
||||
- name: Set version
|
||||
run: >-
|
||||
echo "${{ github.ref_name }}" |
|
||||
awk '{gsub(/.+\/v/,"version=");print;}' >> $GITHUB_ENV
|
||||
|
||||
- name: Save version
|
||||
run: echo "${{ env.version }}" > version
|
||||
|
||||
- name: Commit & push changes
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
author_name: github-actions[bot]
|
||||
author_email: github-actions[bot]@users.noreply.github.com
|
||||
message: Update hard-coded version to ${{ env.version }}
|
||||
add: version
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@ -7,3 +7,11 @@ config
|
||||
*.*~
|
||||
**~
|
||||
*.DS_Store
|
||||
.idea
|
||||
scripts/license_checker/reports
|
||||
tests/puppeteer/node_modules
|
||||
tests/puppeteer/work_directory
|
||||
tests/puppeteer/package.json
|
||||
tests/puppeteer/package-lock.json
|
||||
scripts/sdkjs_common/jsdoc/node_modules
|
||||
scripts/sdkjs_common/jsdoc/package-lock.json
|
||||
|
||||
5
.markdownlint.jsonc
Normal file
5
.markdownlint.jsonc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"line-length": {
|
||||
"code_block_line_length": 300
|
||||
}
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
language: node_js
|
||||
node_js: 12
|
||||
jobs:
|
||||
include:
|
||||
- stage: markdownlint
|
||||
script:
|
||||
- npm install -g markdownlint-cli
|
||||
- markdownlint *.md
|
||||
44
Dockerfile
44
Dockerfile
@ -1,9 +1,45 @@
|
||||
FROM ubuntu:14.04
|
||||
FROM ubuntu:24.04
|
||||
|
||||
RUN apt-get -y update
|
||||
ENV TZ=Etc/UTC
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN echo 'keyboard-configuration keyboard-configuration/layoutcode string us' | debconf-set-selections && \
|
||||
echo 'keyboard-configuration keyboard-configuration/modelcode string pc105' | debconf-set-selections
|
||||
|
||||
RUN apt-get -y update && \
|
||||
apt-get -y install sudo \
|
||||
git \
|
||||
git-lfs \
|
||||
curl \
|
||||
wget \
|
||||
p7zip-full
|
||||
|
||||
ADD . /build_tools
|
||||
WORKDIR /build_tools
|
||||
|
||||
CMD cd tools/linux && \
|
||||
python3 ./automate.py
|
||||
# Install local Python
|
||||
RUN cd tools/linux && \
|
||||
./python.sh
|
||||
|
||||
# Fetch Qt binaries
|
||||
RUN cd tools/linux && \
|
||||
./python3/bin/python3 ./qt_binary_fetch.py amd64
|
||||
|
||||
# Install system dependencies
|
||||
RUN cd tools/linux && \
|
||||
./python3/bin/python3 ./deps.py
|
||||
|
||||
# Install CMake
|
||||
RUN cd tools/linux && \
|
||||
./cmake.sh
|
||||
|
||||
# Fetch sysroot
|
||||
RUN cd tools/linux/sysroot && \
|
||||
../python3/bin/python3 ./fetch.py amd64
|
||||
|
||||
ARG BRANCH=master
|
||||
ENV BRANCH=${BRANCH}
|
||||
|
||||
CMD ["sh", "-c", "./tools/linux/python3/bin/python3 ./configure.py --sysroot \"1\" --clean \"0\" --update-light \"1\" --branch \"${BRANCH}\" --update \"1\" --module \"desktop server builder\" --qt-dir \"$(pwd)/tools/linux/qt_build/Qt-5.9.9\" && ./tools/linux/python3/bin/python3 ./make.py"]
|
||||
661
LICENSE.txt
Normal file
661
LICENSE.txt
Normal file
@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
394
README.md
394
README.md
@ -1,226 +1,218 @@
|
||||
# build_tools
|
||||
<h1>ONLYOFFICE Build Tools</h1>
|
||||
|
||||
## Overview
|
||||
Welcome to the ```build_tools``` repository! This powerful toolkit simplifies the process of compiling [ONLYOFFICE](https://github.com/ONLYOFFICE) products from source on Linux.
|
||||
|
||||
**build_tools** allow you to automatically get and install all the components
|
||||
necessary for the compilation process, all the dependencies required for the
|
||||
**ONLYOFFICE Document Server**, **Document Builder** and **Desktop Editors**
|
||||
correct work, as well as to get the latest version of
|
||||
**ONLYOFFICE products** source code and build all their components.
|
||||
It automatically fetches all the required dependencies and source code to build the latest versions of:
|
||||
|
||||
**Important!** We can only guarantee the correct work of the products built from
|
||||
the `master` branch.
|
||||
* [Docs (Document Server)](https://www.onlyoffice.com/docs?utm_source=github&utm_medium=cpc&utm_campaign=GitHubBuildTools)
|
||||
* [Desktop Editors](https://www.onlyoffice.com/desktop?utm_source=github&utm_medium=cpc&utm_campaign=GitHubBuildTools)
|
||||
* [Document Builder](https://www.onlyoffice.com/document-builder?utm_source=github&utm_medium=cpc&utm_campaign=GitHubBuildTools)
|
||||
|
||||
## How to use - Linux
|
||||
**A quick note:** For the most stable and reliable builds, we strongly recommend compiling from the ```master``` branch of this repository.
|
||||
|
||||
**Note**: The solution has been tested on **Ubuntu 14.04**.
|
||||
## **How do I use it on Linux? 🐧**
|
||||
|
||||
### Installing dependencies
|
||||
>This guide has been tested and verified on **Ubuntu 16.04**.
|
||||
|
||||
You might need to install **Python**, depending on your version of Ubuntu:
|
||||
### **Step 1: Install dependencies**
|
||||
|
||||
First, let's make sure you have **Python** installed, as it's needed to run the build scripts.
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y python
|
||||
```
|
||||
|
||||
### Building ONLYOFFICE products source code
|
||||
### **Step 2: Build the source code**
|
||||
|
||||
1. Clone the build_tools repository:
|
||||
Now, you're ready to build the ONLYOFFICE products.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/ONLYOFFICE/build_tools.git
|
||||
1. **Clone the build_tools repository:**
|
||||
|
||||
This command downloads the build tools to your machine using Git:
|
||||
```bash
|
||||
git clone https://github.com/ONLYOFFICE/build_tools.git
|
||||
```
|
||||
|
||||
2. **Navigate to the scripts directory:**
|
||||
```bash
|
||||
cd build_tools/tools/linux
|
||||
```
|
||||
3. **Run the automation script:**
|
||||
|
||||
This is where the magic happens! Running the script without any options will build all three products: Document Server, Document Builder, and Desktop Editors.
|
||||
|
||||
```bash
|
||||
./automate.py
|
||||
```
|
||||
You can also build ONLYOFFICE products separately. Just run the script with the parameter corresponding to the necessary product. For example, to build *Desktop Editors* and *Document Server*
|
||||
```bash
|
||||
./automate.py desktop server
|
||||
```
|
||||
|
||||
**Perfect!** Once the script finishes, you will find the compiled products in the ```./out``` directory.
|
||||
|
||||
## **Advanced options & different workflows 🚀**
|
||||
|
||||
### **How to use Docker**
|
||||
|
||||
If you prefer using Docker, you can build all products inside a container. This is a great way to keep your local system clean.
|
||||
|
||||
1. **Create an output directory:**
|
||||
|
||||
```bash
|
||||
mkdir out
|
||||
```
|
||||
|
||||
2. Go to the `build_tools/tools/linux` directory:
|
||||
2. **Build the Docker image:**
|
||||
|
||||
```bash
|
||||
cd build_tools/tools/linux
|
||||
```bash
|
||||
docker build --tag onlyoffice-document-editors-builder .
|
||||
```
|
||||
|
||||
3. **Run the container to start the build:**
|
||||
|
||||
This command mounts your local out directory into the container, so the final build files will appear on your machine.
|
||||
|
||||
```bash
|
||||
docker run -v $PWD/out:/build_tools/out onlyoffice-document-editors-builder
|
||||
```
|
||||
|
||||
3. Run the `automate.py` script:
|
||||
You've done it! The results will be in the ```./out``` directory you created.
|
||||
|
||||
```bash
|
||||
./automate.py
|
||||
```
|
||||
## **How to build and run the products separately ▶️**
|
||||
|
||||
If you run the script without any parameters this allows to build **ONLYOFFICE
|
||||
Document Server**, **Document Builder** and **Desktop Editors**.
|
||||
Don't need everything? You can save time by building only the products you need. Just add the product name as an argument to the script.
|
||||
|
||||
The result will be available in the `./out` directory.
|
||||
### Need just the [Document Builder](https://github.com/ONLYOFFICE/DocumentBuilder)❓
|
||||
* How to build
|
||||
|
||||
To build **ONLYOFFICE** products separately run the script with the parameter
|
||||
corresponding to the necessary product.
|
||||
```bash
|
||||
./automate.py builder
|
||||
```
|
||||
* How to run
|
||||
```bash
|
||||
cd ../../out/linux_64/onlyoffice/documentbuilder
|
||||
./docbuilder
|
||||
```
|
||||
|
||||
It’s also possible to build several products at once as shown in the example
|
||||
below.
|
||||
### Need just the [Desktop Editors](https://github.com/ONLYOFFICE/DesktopEditors)❓
|
||||
|
||||
**Example**: Building **Desktop Editors** and **Document Server**
|
||||
* How to build
|
||||
```bash
|
||||
./automate.py desktop
|
||||
```
|
||||
* How to run
|
||||
```bash
|
||||
cd ../../out/linux_64/onlyoffice/desktopeditors
|
||||
LD_LIBRARY_PATH=./ ./DesktopEditors
|
||||
```
|
||||
|
||||
### Need just the [Docs (Document Server)](https://github.com/ONLYOFFICE/DocumentServer)❓
|
||||
* How to build
|
||||
```bash
|
||||
./automate.py server
|
||||
```
|
||||
* How to run
|
||||
|
||||
Running the Document Server is a multi-step process because it relies on a few background services. Let's break it down step by step.
|
||||
|
||||
#### **Step 1. Set up dependencies**
|
||||
|
||||
The Document Server needs a few things to run correctly:
|
||||
|
||||
* **NGINX**: Acts as a web server to handle requests.
|
||||
* **PostgreSQL**: Used as the database to store information.
|
||||
* **RabbitMQ**: A message broker that helps different parts of the server communicate.
|
||||
|
||||
Here are the commands to install and configure them.
|
||||
|
||||
#### **Install and configure NGINX**
|
||||
|
||||
1. Install NGINX
|
||||
```bash
|
||||
sudo apt-get install nginx
|
||||
```
|
||||
2. Disable the default NGINX site
|
||||
```bash
|
||||
sudo rm -f /etc/nginx/sites-enabled/default
|
||||
```
|
||||
3. Set up the new website. To do that create the ```/etc/nginx/sites-available/onlyoffice-documentserver``` file with the following contents:
|
||||
|
||||
```bash
|
||||
./automate.py desktop server
|
||||
map $http_host $this_host {
|
||||
"" $host;
|
||||
default $http_host;
|
||||
}
|
||||
map $http_x_forwarded_proto $the_scheme {
|
||||
default $http_x_forwarded_proto;
|
||||
"" $scheme;
|
||||
}
|
||||
map $http_x_forwarded_host $the_host {
|
||||
default $http_x_forwarded_host;
|
||||
"" $this_host;
|
||||
}
|
||||
map $http_upgrade $proxy_connection {
|
||||
default upgrade;
|
||||
"" close;
|
||||
}
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $proxy_connection;
|
||||
proxy_set_header X-Forwarded-Host $the_host;
|
||||
proxy_set_header X-Forwarded-Proto $the_scheme;
|
||||
server {
|
||||
listen 0.0.0.0:80;
|
||||
listen [::]:80 default_server;
|
||||
server_tokens off;
|
||||
rewrite ^\/OfficeWeb(\/apps\/.*)$ /web-apps$1 redirect;
|
||||
location / {
|
||||
proxy_pass http://localhost:8000;
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Using Docker
|
||||
|
||||
You can also build all **ONLYOFFICE products** at once using Docker.
|
||||
Build the `onlyoffice-document-editors-builder` Docker image using the
|
||||
provided `Dockerfile` and run the corresponding Docker container.
|
||||
|
||||
4. Enable the new site by creating a symbolic link
|
||||
```bash
|
||||
mkdir out
|
||||
docker build --tag onlyoffice-document-editors-builder .
|
||||
docker run -v $PWD/out:/build_tools/out onlyoffice-document-editors-builder
|
||||
sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver
|
||||
```
|
||||
|
||||
The result will be available in the `./out` directory.
|
||||
|
||||
### Building and running ONLYOFFICE products separately
|
||||
|
||||
#### Document Builder
|
||||
|
||||
##### Building Document Builder
|
||||
|
||||
5. Restart NGINX to apply the changes
|
||||
```bash
|
||||
./automate.py builder
|
||||
sudo nginx -s reload
|
||||
```
|
||||
#### **Install and configure PostgreSQL**
|
||||
|
||||
##### Running Document Builder
|
||||
|
||||
```bash
|
||||
cd ../../out/linux_64/onlyoffice/documentbuilder
|
||||
./docbuilder
|
||||
```
|
||||
|
||||
#### Desktop Editors
|
||||
|
||||
##### Building Desktop Editors
|
||||
|
||||
```bash
|
||||
./automate.py desktop
|
||||
```
|
||||
|
||||
##### Running Desktop Editors
|
||||
|
||||
```bash
|
||||
cd ../../out/linux_64/onlyoffice/desktopeditors
|
||||
LD_LIBRARY_PATH=./ ./DesktopEditors
|
||||
```
|
||||
|
||||
#### Document Server
|
||||
|
||||
##### Building Document Server
|
||||
|
||||
```bash
|
||||
./automate.py server
|
||||
```
|
||||
|
||||
##### Installing and configuring Document Server dependencies
|
||||
|
||||
**Document Server** uses **NGINX** as a web server and **PostgreSQL** as a database.
|
||||
**RabbitMQ** is also required for **Document Server** to work correctly.
|
||||
|
||||
###### Installing and configuring NGINX
|
||||
|
||||
1. Install NGINX:
|
||||
|
||||
```bash
|
||||
sudo apt-get install nginx
|
||||
```
|
||||
|
||||
2. Disable the default website:
|
||||
|
||||
```bash
|
||||
sudo rm -f /etc/nginx/sites-enabled/default
|
||||
```
|
||||
|
||||
3. Set up the new website. To do that create the `/etc/nginx/sites-available/onlyoffice-documentserver`
|
||||
file with the following contents:
|
||||
|
||||
```bash
|
||||
map $http_host $this_host {
|
||||
"" $host;
|
||||
default $http_host;
|
||||
}
|
||||
map $http_x_forwarded_proto $the_scheme {
|
||||
default $http_x_forwarded_proto;
|
||||
"" $scheme;
|
||||
}
|
||||
map $http_x_forwarded_host $the_host {
|
||||
default $http_x_forwarded_host;
|
||||
"" $this_host;
|
||||
}
|
||||
map $http_upgrade $proxy_connection {
|
||||
default upgrade;
|
||||
"" close;
|
||||
}
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $proxy_connection;
|
||||
proxy_set_header X-Forwarded-Host $the_host;
|
||||
proxy_set_header X-Forwarded-Proto $the_scheme;
|
||||
server {
|
||||
listen 0.0.0.0:80;
|
||||
listen [::]:80 default_server;
|
||||
server_tokens off;
|
||||
rewrite ^\/OfficeWeb(\/apps\/.*)$ /web-apps$1 redirect;
|
||||
location / {
|
||||
proxy_pass http://localhost:8000;
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
location /spellchecker/ {
|
||||
proxy_pass http://localhost:8080/;
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
4. Add the symlink to the newly created website to the
|
||||
`/etc/nginx/sites-available` directory:
|
||||
|
||||
```bash
|
||||
sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver
|
||||
```
|
||||
|
||||
5. Restart NGINX to apply the changes:
|
||||
|
||||
```bash
|
||||
sudo nginx -s reload
|
||||
```
|
||||
|
||||
###### Installing and configuring PostgreSQL
|
||||
|
||||
1. Install PostgreSQL:
|
||||
|
||||
1. Install PostgreSQL
|
||||
```bash
|
||||
sudo apt-get install postgresql
|
||||
```
|
||||
|
||||
2. Create the PostgreSQL database and user:
|
||||
|
||||
**Note**: The created database must have **onlyoffice** both for user and password.
|
||||
2. Create a database and user.
|
||||
|
||||
**Note**: The user and password must both be **'onlyoffice'.**
|
||||
```bash
|
||||
sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice;"
|
||||
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
|
||||
sudo -i -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
|
||||
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH PASSWORD 'onlyoffice';"
|
||||
sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice OWNER onlyoffice;"
|
||||
```
|
||||
|
||||
3. Configure the database:
|
||||
|
||||
3. Configure the database:
|
||||
```bash
|
||||
psql -hlocalhost -Uonlyoffice -d onlyoffice -f ../../out/linux_64/onlyoffice/documentserver/server/schema/postgresql/createdb.sql
|
||||
```
|
||||
|
||||
**Note**: Upon that, you will be asked to provide a password for the **onlyoffice**
|
||||
PostgreSQL user. Please enter the **onlyoffice** password.
|
||||
|
||||
###### Installing RabbitMQ
|
||||
Upon that, you will be asked to provide a password for the onlyoffice PostgreSQL user. Please enter the **onlyoffice** password.
|
||||
|
||||
#### **Install RabbitMQ**
|
||||
```bash
|
||||
sudo apt-get install rabbitmq-server
|
||||
```
|
||||
|
||||
###### Generate fonts data
|
||||
Now that you have all the dependencies installed, it's time to generate server files.
|
||||
#### **Step 2. Generate server files**
|
||||
|
||||
Before running the server, you need to generate font and theme data.
|
||||
|
||||
##### **Generate fonts data**
|
||||
|
||||
```bash
|
||||
cd out/linux_64/onlyoffice/documentserver/
|
||||
@ -235,8 +227,7 @@ LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allfontsgen \
|
||||
--use-system="true"
|
||||
```
|
||||
|
||||
###### Generate presentation themes
|
||||
|
||||
##### **Generate presentation themes**
|
||||
```bash
|
||||
cd out/linux_64/onlyoffice/documentserver/
|
||||
LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allthemesgen \
|
||||
@ -245,36 +236,39 @@ LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allthemesgen \
|
||||
--output="${PWD}/sdkjs/common/Images"
|
||||
```
|
||||
|
||||
##### Running Document Server
|
||||
#### **Step 3. Run the Document Server services**
|
||||
|
||||
**Note**: All **Document Server** components run as foreground processes. Thus
|
||||
you need separate terminal consoles to run them or specific tools which will
|
||||
allow to run foreground processes in background mode.
|
||||
All Document Server components run as foreground processes. Thus you need separate terminal consoles to run them or specific tools which will allow to run foreground processes in background mode.
|
||||
|
||||
1. Start the **FileConverter** service:
|
||||
* **Start the FileConverter service:**
|
||||
```bash
|
||||
cd out/linux_64/onlyoffice/documentserver/server/FileConverter
|
||||
LD_LIBRARY_PATH=$PWD/bin \
|
||||
NODE_ENV=development-linux \
|
||||
NODE_CONFIG_DIR=$PWD/../Common/config \
|
||||
./converter
|
||||
```
|
||||
|
||||
```bash
|
||||
cd out/linux_64/onlyoffice/documentserver/server/FileConverter
|
||||
LD_LIBRARY_PATH=$PWD/bin \
|
||||
NODE_ENV=development-linux \
|
||||
NODE_CONFIG_DIR=$PWD/../Common/config \
|
||||
./converter
|
||||
```
|
||||
* **Start the DocService service:**
|
||||
```bash
|
||||
cd out/linux_64/onlyoffice/documentserver/server/DocService
|
||||
NODE_ENV=development-linux \
|
||||
NODE_CONFIG_DIR=$PWD/../Common/config \
|
||||
./docservice
|
||||
```
|
||||
|
||||
2. Start the **SpellChecker** service:
|
||||
## And it's a wrap! 🎉
|
||||
Congratulations! You have successfully used the ```build_tools``` to compile your desired ONLYOFFICE products from the latest source code.
|
||||
|
||||
```bash
|
||||
cd out/linux_64/onlyoffice/documentserver/server/SpellChecker
|
||||
NODE_ENV=development-linux \
|
||||
NODE_CONFIG_DIR=$PWD/../Common/config \
|
||||
./spellchecker
|
||||
```
|
||||
Everything is now set up. You can go ahead and run your brand-new, self-compiled ONLYOFFICE applications.
|
||||
|
||||
3. Start the **DocService** service:
|
||||
## Need help or have an idea? 💡
|
||||
|
||||
```bash
|
||||
cd out/linux_64/onlyoffice/documentserver/server/DocService
|
||||
NODE_ENV=development-linux \
|
||||
NODE_CONFIG_DIR=$PWD/../Common/config \
|
||||
./docservice
|
||||
```
|
||||
* **🐞 Found a bug?** Please report it by creating an [issue](https://github.com/ONLYOFFICE/build_tools/issues).
|
||||
* **❓ Have a question?** Ask our community and developers on the [ONLYOFFICE Forum](https://community.onlyoffice.com).
|
||||
* **💡 Want to suggest a feature?** Share your ideas on our [feedback platform](https://feedback.onlyoffice.com/forums/966080-your-voice-matters).
|
||||
* **🧑💻 Need help for developers?** Check our [API documentation](https://api.onlyoffice.com/?utm_source=github&utm_medium=cpc&utm_campaign=GitHubBuildTools).
|
||||
|
||||
---
|
||||
|
||||
<p align="center"> Made with ❤️ by the ONLYOFFICE Team </p>
|
||||
|
||||
24
Rakefile
Normal file
24
Rakefile
Normal file
@ -0,0 +1,24 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
desc 'Cleanup old build files'
|
||||
task :clean do
|
||||
archive_name_pattern = 'build_tools*.tar.gz'
|
||||
sh('sudo rm -rf out')
|
||||
sh("rm #{archive_name_pattern}") unless Dir.glob(archive_name_pattern).empty?
|
||||
end
|
||||
|
||||
desc 'Build version anew'
|
||||
task build: :clean do
|
||||
sh('mkdir out')
|
||||
sh('docker build --tag onlyoffice-document-editors-builder .')
|
||||
sh("docker run -v #{Dir.pwd}/out:/build_tools/out onlyoffice-document-editors-builder")
|
||||
end
|
||||
|
||||
desc 'Archive current build version'
|
||||
task :archive do
|
||||
commit_hash = `git rev-parse --short HEAD`.strip
|
||||
branch = `git rev-parse --abbrev-ref HEAD`.gsub('/', '_').strip
|
||||
current_data = Time.now.strftime('%Y.%m.%d-%H.%M')
|
||||
archive_name = "build_tools-#{branch}-#{commit_hash}-#{current_data}.tar.gz"
|
||||
sh("tar -zcvf #{archive_name} out")
|
||||
end
|
||||
352
build.pro
352
build.pro
@ -1,352 +0,0 @@
|
||||
TEMPLATE = subdirs
|
||||
|
||||
ROOT_DIR=$$PWD/..
|
||||
DEPLOY_DIR=$$PWD/deploy
|
||||
CORE_ROOT_DIR=$$ROOT_DIR/core
|
||||
|
||||
include($$CORE_ROOT_DIR/Common/base.pri)
|
||||
|
||||
MAKEFILE=makefiles/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX
|
||||
PRO_SUFFIX=$$CORE_BUILDS_PLATFORM_PREFIX
|
||||
|
||||
core_debug {
|
||||
MAKEFILE=$$join(MAKEFILE, MAKEFILE, "", "_debug_")
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, PRO_SUFFIX, "", "_debug_")
|
||||
}
|
||||
build_xp {
|
||||
MAKEFILE=$$join(MAKEFILE, MAKEFILE, "", "_xp")
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, PRO_SUFFIX, "", "_xp")
|
||||
}
|
||||
OO_BRANDING_SUFFIX = $$(OO_BRANDING)
|
||||
!isEmpty(OO_BRANDING_SUFFIX) {
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, PRO_SUFFIX, "", "$$OO_BRANDING_SUFFIX")
|
||||
MAKEFILE=$$join(MAKEFILE, MAKEFILE, "", "$$OO_BRANDING_SUFFIX")
|
||||
}
|
||||
|
||||
CONFIG += ordered
|
||||
|
||||
core_windows {
|
||||
CONFIG += core_and_multimedia
|
||||
}
|
||||
core_linux {
|
||||
CONFIG += core_and_multimedia
|
||||
}
|
||||
core_mac {
|
||||
CONFIG += no_use_htmlfileinternal
|
||||
CONFIG += no_desktop_apps
|
||||
}
|
||||
build_xp {
|
||||
CONFIG += no_use_htmlfileinternal
|
||||
}
|
||||
core_ios {
|
||||
CONFIG += no_use_htmlfileinternal
|
||||
CONFIG += no_use_common_binary
|
||||
CONFIG += no_desktop_apps
|
||||
}
|
||||
core_android {
|
||||
CONFIG += no_use_htmlfileinternal
|
||||
CONFIG += no_use_common_binary
|
||||
CONFIG += no_desktop_apps
|
||||
}
|
||||
|
||||
SUBDIRS = \
|
||||
cryptopp \
|
||||
\
|
||||
kernel \
|
||||
unicodeconverter \
|
||||
graphics \
|
||||
pdfwriter \
|
||||
djvufile \
|
||||
xpsfile \
|
||||
htmlrenderer \
|
||||
pdfreader \
|
||||
htmlfile \
|
||||
doctrenderer
|
||||
|
||||
!no_x2t {
|
||||
SUBDIRS += \
|
||||
docxformat \
|
||||
pptxformat \
|
||||
docxfile \
|
||||
txtxmlformat \
|
||||
rtfformat \
|
||||
pptformat \
|
||||
docformat \
|
||||
odffilereader \
|
||||
odffilewriter \
|
||||
xlsformat \
|
||||
x2t
|
||||
}
|
||||
|
||||
!no_use_htmlfileinternal {
|
||||
SUBDIRS += htmlfileinternal
|
||||
}
|
||||
|
||||
!no_use_common_binary {
|
||||
SUBDIRS += \
|
||||
allfontsgen \
|
||||
allthemesgen \
|
||||
docbuilder
|
||||
}
|
||||
|
||||
core_ios:CONFIG += no_tests
|
||||
core_android:CONFIG += no_tests
|
||||
!no_tests {
|
||||
SUBDIRS += standardtester
|
||||
}
|
||||
|
||||
core_and_multimedia {
|
||||
SUBDIRS += \
|
||||
videoplayer
|
||||
}
|
||||
|
||||
desktop {
|
||||
message(desktop)
|
||||
|
||||
SUBDIRS += \
|
||||
hunspell \
|
||||
ooxmlsignature \
|
||||
documentscore \
|
||||
documentscore_helper
|
||||
|
||||
!core_mac {
|
||||
SUBDIRS += qtdocumentscore
|
||||
}
|
||||
|
||||
!no_desktop_apps {
|
||||
core_windows:SUBDIRS += projicons
|
||||
SUBDIRS += desktopapp
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ordered {
|
||||
# remove all makefiles
|
||||
|
||||
defineTest(removeFile) {
|
||||
file = $$1
|
||||
win32:file ~= s,/,\\,g
|
||||
core_windows {
|
||||
system(if exist $$shell_quote($$file) $$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
|
||||
} else {
|
||||
system($$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
|
||||
}
|
||||
}
|
||||
|
||||
removeFile($$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/Makefile.cryptopp$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/Common/Makefile.kernel$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/UnicodeConverter/Makefile.UnicodeConverter$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/DesktopEditor/graphics/pro/Makefile.graphics$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/PdfWriter/Makefile.PdfWriter$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/DjVuFile/Makefile.DjVuFile$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/XpsFile/Makefile.XpsFile$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/HtmlRenderer/Makefile.htmlrenderer$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/PdfReader/Makefile.PdfReader$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/HtmlFile/Makefile.HtmlFile$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/DesktopEditor/doctrenderer/Makefile.doctrenderer$$PRO_SUFFIX)
|
||||
removeFile($$ROOT_DIR/desktop-sdk/HtmlFile/Internal/Makefile.Internal$$PRO_SUFFIX)
|
||||
|
||||
removeFile($$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/Makefile.AllFontsGen$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/DesktopEditor/allthemesgen/Makefile.allthemesgen$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/Makefile.docbuilder$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/Test/Applications/StandardTester/Makefile.standardtester$$PRO_SUFFIX)
|
||||
|
||||
removeFile($$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/Makefile.DocxFormatLib$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/Makefile.PPTXFormatLib$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/Makefile.ASCOfficeDocxFile2Lib$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/Makefile.TxtXmlFormatLib$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/Makefile.RtfFormatLib$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/Makefile.PPTFormatLib$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/Makefile.DocFormatLib$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/Makefile.OdfFileReaderLib$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/Makefile.OdfFileWriterLib$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/Makefile.XlsFormatLib$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/X2tConverter/build/Qt/Makefile.X2tConverter$$PRO_SUFFIX)
|
||||
|
||||
removeFile($$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt/Makefile.hunspell$$PRO_SUFFIX)
|
||||
removeFile($$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/Makefile.ooxmlsignature$$PRO_SUFFIX)
|
||||
removeFile($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/Makefile.ascdocumentscore$$PRO_SUFFIX)
|
||||
removeFile($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/Makefile.ascdocumentscore_helper$$PRO_SUFFIX)
|
||||
removeFile($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/Makefile.qtascdocumentscore$$PRO_SUFFIX)
|
||||
removeFile($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/Makefile.videoplayerlib$$PRO_SUFFIX)
|
||||
removeFile($$ROOT_DIR/desktop-apps/win-linux/extras/projicons/Makefile.ProjIcons$$PRO_SUFFIX)
|
||||
removeFile($$ROOT_DIR/desktop-apps/win-linux/Makefile.ASCDocumentEditor$$PRO_SUFFIX)
|
||||
}
|
||||
|
||||
# PROJECTS
|
||||
cryptopp.file = $$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/cryptopp.pro
|
||||
cryptopp.makefile = $$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/Makefile.cryptopp$$PRO_SUFFIX
|
||||
|
||||
kernel.file = $$CORE_ROOT_DIR/Common/kernel.pro
|
||||
kernel.makefile = $$CORE_ROOT_DIR/Common/Makefile.kernel$$PRO_SUFFIX
|
||||
|
||||
unicodeconverter.file = $$CORE_ROOT_DIR/UnicodeConverter/UnicodeConverter.pro
|
||||
unicodeconverter.makefile = $$CORE_ROOT_DIR/UnicodeConverter/Makefile.UnicodeConverter$$PRO_SUFFIX
|
||||
|
||||
graphics.file = $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/graphics.pro
|
||||
graphics.makefile = $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/Makefile.graphics$$PRO_SUFFIX
|
||||
|
||||
pdfwriter.file = $$CORE_ROOT_DIR/PdfWriter/PdfWriter.pro
|
||||
pdfwriter.makefile = $$CORE_ROOT_DIR/PdfWriter/Makefile.PdfWriter$$PRO_SUFFIX
|
||||
|
||||
djvufile.file = $$CORE_ROOT_DIR/DjVuFile/DjVuFile.pro
|
||||
djvufile.makefile = $$CORE_ROOT_DIR/DjVuFile/Makefile.DjVuFile$$PRO_SUFFIX
|
||||
|
||||
xpsfile.file = $$CORE_ROOT_DIR/XpsFile/XpsFile.pro
|
||||
xpsfile.makefile = $$CORE_ROOT_DIR/XpsFile/Makefile.XpsFile$$PRO_SUFFIX
|
||||
|
||||
htmlrenderer.file = $$CORE_ROOT_DIR/HtmlRenderer/htmlrenderer.pro
|
||||
htmlrenderer.makefile = $$CORE_ROOT_DIR/HtmlRenderer/Makefile.htmlrenderer$$PRO_SUFFIX
|
||||
|
||||
pdfreader.file = $$CORE_ROOT_DIR/PdfReader/PdfReader.pro
|
||||
pdfreader.makefile = $$CORE_ROOT_DIR/PdfReader/Makefile.PdfReader$$PRO_SUFFIX
|
||||
|
||||
htmlfile.file = $$CORE_ROOT_DIR/HtmlFile/HtmlFile.pro
|
||||
htmlfile.makefile = $$CORE_ROOT_DIR/HtmlFile/Makefile.HtmlFile$$PRO_SUFFIX
|
||||
|
||||
doctrenderer.file = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/doctrenderer.pro
|
||||
doctrenderer.makefile = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/Makefile.doctrenderer$$PRO_SUFFIX
|
||||
|
||||
!no_use_htmlfileinternal {
|
||||
htmlfileinternal.file = $$ROOT_DIR/desktop-sdk/HtmlFile/Internal/Internal.pro
|
||||
htmlfileinternal.makefile = $$ROOT_DIR/desktop-sdk/HtmlFile/Internal/Makefile.Internal$$PRO_SUFFIX
|
||||
}
|
||||
|
||||
!no_use_common_binary {
|
||||
allfontsgen.file = $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/AllFontsGen.pro
|
||||
allfontsgen.makefile = $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/Makefile.AllFontsGen$$PRO_SUFFIX
|
||||
|
||||
allthemesgen.file = $$CORE_ROOT_DIR/DesktopEditor/allthemesgen/allthemesgen.pro
|
||||
allthemesgen.makefile = $$CORE_ROOT_DIR/DesktopEditor/allthemesgen/Makefile.allthemesgen$$PRO_SUFFIX
|
||||
|
||||
docbuilder.file = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/docbuilder.pro
|
||||
docbuilder.makefile = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/Makefile.docbuilder$$PRO_SUFFIX
|
||||
}
|
||||
|
||||
!no_tests {
|
||||
standardtester.file = $$CORE_ROOT_DIR/Test/Applications/StandardTester/standardtester.pro
|
||||
standardtester.makefile = $$CORE_ROOT_DIR/Test/Applications/StandardTester/Makefile.standardtester$$PRO_SUFFIX
|
||||
}
|
||||
|
||||
!no_x2t {
|
||||
docxformat.file = $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro
|
||||
docxformat.makefile = $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/Makefile.DocxFormatLib$$PRO_SUFFIX
|
||||
|
||||
pptxformat.file = $$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro
|
||||
pptxformat.makefile = $$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/Makefile.PPTXFormatLib$$PRO_SUFFIX
|
||||
|
||||
docxfile.file = $$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro
|
||||
docxfile.makefile = $$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/Makefile.ASCOfficeDocxFile2Lib$$PRO_SUFFIX
|
||||
|
||||
txtxmlformat.file = $$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/TxtXmlFormatLib.pro
|
||||
txtxmlformat.makefile = $$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/Makefile.TxtXmlFormatLib$$PRO_SUFFIX
|
||||
|
||||
rtfformat.file = $$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/RtfFormatLib.pro
|
||||
rtfformat.makefile = $$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/Makefile.RtfFormatLib$$PRO_SUFFIX
|
||||
|
||||
pptformat.file = $$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro
|
||||
pptformat.makefile = $$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/Makefile.PPTFormatLib$$PRO_SUFFIX
|
||||
|
||||
docformat.file = $$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/DocFormatLib.pro
|
||||
docformat.makefile = $$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/Makefile.DocFormatLib$$PRO_SUFFIX
|
||||
|
||||
odffilereader.file = $$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/OdfFileReaderLib.pro
|
||||
odffilereader.makefile = $$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/Makefile.OdfFileReaderLib$$PRO_SUFFIX
|
||||
|
||||
odffilewriter.file = $$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro
|
||||
odffilewriter.makefile = $$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/Makefile.OdfFileWriterLib$$PRO_SUFFIX
|
||||
|
||||
xlsformat.file = $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro
|
||||
xlsformat.makefile = $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/Makefile.XlsFormatLib$$PRO_SUFFIX
|
||||
|
||||
x2t.file = $$CORE_ROOT_DIR/X2tConverter/build/Qt/X2tConverter.pro
|
||||
x2t.makefile = $$CORE_ROOT_DIR/X2tConverter/build/Qt/Makefile.X2tConverter$$PRO_SUFFIX
|
||||
}
|
||||
|
||||
desktop {
|
||||
hunspell.file = $$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt/hunspell.pro
|
||||
hunspell.makefile = $$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt/Makefile.hunspell$$PRO_SUFFIX
|
||||
|
||||
ooxmlsignature.file = $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/ooxmlsignature.pro
|
||||
ooxmlsignature.makefile = $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/Makefile.ooxmlsignature$$PRO_SUFFIX
|
||||
|
||||
documentscore.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore.pro
|
||||
documentscore.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/Makefile.ascdocumentscore$$PRO_SUFFIX
|
||||
|
||||
documentscore_helper.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore_helper.pro
|
||||
documentscore_helper.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/Makefile.ascdocumentscore_helper$$PRO_SUFFIX
|
||||
|
||||
!core_mac {
|
||||
qtdocumentscore.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/qtascdocumentscore.pro
|
||||
qtdocumentscore.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/Makefile.qtascdocumentscore$$PRO_SUFFIX
|
||||
}
|
||||
|
||||
!no_desktop_apps {
|
||||
core_windows {
|
||||
projicons.file = $$ROOT_DIR/desktop-apps/win-linux/extras/projicons/ProjIcons.pro
|
||||
projicons.makefile = $$ROOT_DIR/desktop-apps/win-linux/extras/projicons/Makefile.ProjIcons$$PRO_SUFFIX
|
||||
}
|
||||
desktopapp.file = $$ROOT_DIR/desktop-apps/win-linux/ASCDocumentEditor.pro
|
||||
desktopapp.makefile = $$ROOT_DIR/desktop-apps/win-linux/Makefile.ASCDocumentEditor$$PRO_SUFFIX
|
||||
}
|
||||
}
|
||||
|
||||
core_and_multimedia {
|
||||
videoplayer.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/videoplayerlib.pro
|
||||
videoplayer.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/Makefile.videoplayerlib$$PRO_SUFFIX
|
||||
}
|
||||
|
||||
# DEPENDS
|
||||
kernel.depends = cryptopp
|
||||
graphics.depends = kernel unicodeconverter
|
||||
pdfwriter.depends = kernel unicodeconverter graphics
|
||||
djvufile.depends = kernel unicodeconverter graphics pdfwriter
|
||||
xpsfile.depends = kernel unicodeconverter graphics pdfwriter
|
||||
htmlrenderer.depends = kernel unicodeconverter graphics pdfwriter
|
||||
pdfreader.depends = kernel unicodeconverter graphics pdfwriter htmlrenderer
|
||||
htmlfile.depends = kernel unicodeconverter graphics
|
||||
doctrenderer.depends = kernel unicodeconverter graphics
|
||||
|
||||
!no_use_htmlfileinternal {
|
||||
htmlfileinternal.depends = kernel unicodeconverter graphics
|
||||
}
|
||||
|
||||
!no_use_common_binary {
|
||||
allfontsgen.depends = kernel unicodeconverter graphics
|
||||
allthemesgen.depends = kernel unicodeconverter graphics
|
||||
|
||||
docbuilder.depends = kernel unicodeconverter graphics doctrenderer
|
||||
}
|
||||
|
||||
core_and_multimedia {
|
||||
videoplayer.depends = kernel unicodeconverter graphics
|
||||
}
|
||||
|
||||
desktop {
|
||||
ooxmlsignature.depends = kernel unicodeconverter graphics
|
||||
documentscore.depends = kernel unicodeconverter graphics hunspell ooxmlsignature htmlrenderer pdfwriter pdfreader djvufile xpsfile
|
||||
documentscore_helper.depends = documentscore
|
||||
|
||||
!core_mac {
|
||||
qtdocumentscore.depends = documentscore
|
||||
}
|
||||
|
||||
!no_desktop_apps {
|
||||
core_windows:projicons.depends = documentscore videoplayer
|
||||
desktopapp.depends = documentscore videoplayer
|
||||
}
|
||||
}
|
||||
|
||||
!no_x2t {
|
||||
x2t.depends = \
|
||||
docxformat \
|
||||
pptxformat \
|
||||
docxfile \
|
||||
txtxmlformat \
|
||||
rtfformat \
|
||||
pptformat \
|
||||
docformat \
|
||||
odffilereader \
|
||||
odffilewriter \
|
||||
xlsformat
|
||||
}
|
||||
69
common.pri
Normal file
69
common.pri
Normal file
@ -0,0 +1,69 @@
|
||||
# must setup CORE_ROOT_DIR before including
|
||||
|
||||
include($$CORE_ROOT_DIR/Common/base.pri)
|
||||
|
||||
MAKEFILE=makefiles/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX
|
||||
PRO_SUFFIX=$$CORE_BUILDS_PLATFORM_PREFIX
|
||||
|
||||
core_debug {
|
||||
MAKEFILE=$$join(MAKEFILE, , , "_debug_")
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, , , "_debug_")
|
||||
}
|
||||
build_xp {
|
||||
MAKEFILE=$$join(MAKEFILE, , , "_xp")
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, , , "_xp")
|
||||
}
|
||||
OO_BRANDING_SUFFIX = $$(OO_BRANDING)
|
||||
!isEmpty(OO_BRANDING_SUFFIX) {
|
||||
PRO_SUFFIX=$$join(PRO_SUFFIX, , , "$$OO_BRANDING_SUFFIX")
|
||||
MAKEFILE=$$join(MAKEFILE, , , "$$OO_BRANDING_SUFFIX")
|
||||
}
|
||||
|
||||
message(current_makefile)
|
||||
message($$MAKEFILE)
|
||||
|
||||
CONFIG += ordered
|
||||
|
||||
defineTest(removeFile) {
|
||||
file = $$1
|
||||
win32:file ~= s,/,\\,g
|
||||
core_windows {
|
||||
system(if exist $$shell_quote($$file) $$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
|
||||
} else {
|
||||
system($$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
|
||||
}
|
||||
}
|
||||
defineTest(qmakeClear) {
|
||||
dir = $$1
|
||||
name = $$2
|
||||
removeFile($$1/Makefile.$$2$$PRO_SUFFIX)
|
||||
removeFile($$1/.qmake.stash)
|
||||
}
|
||||
|
||||
# addSubProject() - adds project to SUBDIRS, creates variables associated with the project(file, makefile, depends)
|
||||
# Arg1 - Project name
|
||||
# Arg2 - Qmake file of project
|
||||
# Arg3(optional) - Project dependencies
|
||||
defineTest(addSubProject) {
|
||||
pro_name = $$1
|
||||
pro_file = $$2
|
||||
pro_depends = $$3
|
||||
isEmpty(pro_name):error(Sub-project name is not defined.)
|
||||
isEmpty(pro_file):error(Qmake file of sub-project \'$$pro_name\' is not defined.)
|
||||
!exists($$pro_file):error(Sub-project qmake file \'$$pro_file\' is not exists.)
|
||||
path = $$section(pro_file, /, 0, -2)
|
||||
ext_name = $$section(pro_file, /, -1, -1)
|
||||
name = $$section(ext_name, ., 0, 0)
|
||||
SUBDIRS += $$pro_name
|
||||
export(SUBDIRS)
|
||||
$${pro_name}.file = $$pro_file
|
||||
export($${pro_name}.file)
|
||||
$${pro_name}.makefile = $$path/Makefile.$$name$$PRO_SUFFIX
|
||||
export($${pro_name}.makefile)
|
||||
!isEmpty(pro_depends) {
|
||||
$${pro_name}.depends = $$pro_depends
|
||||
export($${pro_name}.depends)
|
||||
}
|
||||
# remove makefile
|
||||
qmakeClear($$path, $$name)
|
||||
}
|
||||
57
configure.py
57
configure.py
@ -7,26 +7,43 @@ import optparse
|
||||
arguments = sys.argv[1:]
|
||||
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option("--update", action="store", type="string", dest="update", default="1", help="is need update")
|
||||
parser.add_option("--update-light", action="store", type="string", dest="update-light", default="", help="is need light update (if not exist: clone & go to branch, else: pull)")
|
||||
parser.add_option("--branch", action="store", type="string", dest="branch", default="master", help="branch all repo [used only if update==1]")
|
||||
parser.add_option("--clean", action="store", type="string", dest="clean", default="1", help="clean build")
|
||||
parser.add_option("--module", action="store", type="string", dest="module", default="builder", help="list build modules [desktop | builder]")
|
||||
parser.add_option("--platform", action="store", type="string", dest="platform", default="native", help="destination platform build [all: windows(win_64, win_32, win_64_xp, win_32_xp), linux(linux_64, linux_32), mac(mac_64); combination: native | win_64 | win_32 | win_64_xp | win_32_xp | linux_64 | mac_64 | ios | android")
|
||||
parser.add_option("--config", action="store", type="string", dest="config", default="", help="qmake CONFIG addition")
|
||||
parser.add_option("--qt-dir", action="store", type="string", dest="qt-dir", default="", help="qt (qmake) directory")
|
||||
parser.add_option("--qt-dir-xp", action="store", type="string", dest="qt-dir-xp", default="", help="qt for Windows XP (qmake) directory")
|
||||
parser.add_option("--compiler", action="store", type="string", dest="compiler", default="", help="compiler name")
|
||||
parser.add_option("--no-apps", action="store", type="string", dest="no-apps", default="0", help="disable build desktop apps (qt)")
|
||||
parser.add_option("--themesparams", action="store", type="string", dest="themesparams", default="", help="presentation themes thumbnails additions")
|
||||
parser.add_option("--git-protocol", action="store", type="string", dest="git-protocol", default="https", help="presentation themes thumbnails additions")
|
||||
parser.add_option("--branding", action="store", type="string", dest="branding", default="", help="branding path")
|
||||
parser.add_option("--branding-name", action="store", type="string", dest="branding-name", default="", help="branding name")
|
||||
parser.add_option("--branding-url", action="store", type="string", dest="branding-url", default="", help="branding url")
|
||||
parser.add_option("--sdkjs-addon", action="append", type="string", dest="sdkjs-addons", default=[], help="sdkjs addons")
|
||||
parser.add_option("--server-addon", action="append", type="string", dest="server-addons", default=[], help="server addons")
|
||||
parser.add_option("--web-apps-addon", action="append", type="string", dest="web-apps-addons", default=[], help="web-apps addons")
|
||||
parser.add_option("--sdkjs-plugin", action="append", type="string", dest="sdkjs-plugin", default=[], help="web-apps addons")
|
||||
parser.add_option("--update", action="store", type="string", dest="update", default="1", help="defines whether it's necessary to update/clone repos. If it's set to true (1 === true), build_tools automatically get the necessary subrepos. If it's set to false (0 === false), you should define which ones to use")
|
||||
parser.add_option("--update-light", action="store", type="string", dest="update-light", default="", help="performs pull/clone without switching branches, can be used only if update is true.")
|
||||
parser.add_option("--branch", action="store", type="string", dest="branch", default="master", help="branch/tag name, used only if update is true and update_light is not used. Updates/clones all the repos and switches the branch to the proper one deleting all the local changes")
|
||||
parser.add_option("--clean", action="store", type="string", dest="clean", default="1", help="defines whether to build everything anew")
|
||||
parser.add_option("--module", action="store", type="string", dest="module", default="builder", help="defines what modules to build. You can specify several of them, e.g. --module 'core desktop builder server mobile'")
|
||||
parser.add_option("--develop", action="store", type="string", dest="develop", default="0", help="defines develop mode")
|
||||
parser.add_option("--beta", action="store", type="string", dest="beta", default="0", help="defines beta mode")
|
||||
parser.add_option("--platform", action="store", type="string", dest="platform", default="native", help="defines the destination platform for your build ['win_64', 'win_32', 'win_64_xp', 'win_32_xp', 'win_arm64', 'linux_64', 'linux_32', 'mac_64', 'ios', 'android_arm64_v8a', 'android_armv7', 'android_x86', 'android_x86_64'; combinations: 'native': your current system (windows/linux/mac only); 'all': all available systems; 'windows': win_64 win_32 win_64_xp win_32_xp; 'linux': linux_64 linux_32; 'mac': mac_64; 'android': android_arm64_v8a android_armv7 android_x86 android_x86_64]")
|
||||
parser.add_option("--config", action="store", type="string", dest="config", default="", help="provides ability to specify additional parameters for qmake")
|
||||
parser.add_option("--qt-dir", action="store", type="string", dest="qt-dir", default="", help="defines qmake directory path. qmake can be found in qt-dir/compiler/bin directory")
|
||||
parser.add_option("--qt-dir-xp", action="store", type="string", dest="qt-dir-xp", default="", help="defines qmake directory path for Windows XP. qmake can be found in 'qt-dir/compiler/bin directory")
|
||||
parser.add_option("--external-folder", action="store", type="string", dest="external-folder", default="", help="defines a directory with external folder")
|
||||
parser.add_option("--sql-type", action="store", type="string", dest="sql-type", default="postgres", help="defines the sql type wich will be used")
|
||||
parser.add_option("--db-port", action="store", type="string", dest="db-port", default="5432", help="defines the sql db-port wich will be used")
|
||||
parser.add_option("--db-name", action="store", type="string", dest="db-name", default="onlyoffice", help="defines the sql db-name wich will be used")
|
||||
parser.add_option("--db-user", action="store", type="string", dest="db-user", default="onlyoffice", help="defines the sql db-user wich will be used")
|
||||
parser.add_option("--db-pass", action="store", type="string", dest="db-pass", default="onlyoffice", help="defines the sql db-pass wich will be used")
|
||||
parser.add_option("--compiler", action="store", type="string", dest="compiler", default="", help="defines compiler name. It is not recommended to use it as it's defined automatically (msvc2015, msvc2015_64, gcc, gcc_64, clang, clang_64, etc)")
|
||||
parser.add_option("--no-apps", action="store", type="string", dest="no-apps", default="0", help="disables building desktop apps that use qt")
|
||||
parser.add_option("--themesparams", action="store", type="string", dest="themesparams", default="", help="provides settings for generating presentation themes thumbnails")
|
||||
parser.add_option("--git-protocol", action="store", type="string", dest="git-protocol", default="auto", help="can be used only if update is set to true - 'https', 'ssh'")
|
||||
parser.add_option("--branding", action="store", type="string", dest="branding", default="", help="provides branding path")
|
||||
parser.add_option("--branding-name", action="store", type="string", dest="branding-name", default="", help="provides branding name")
|
||||
parser.add_option("--branding-url", action="store", type="string", dest="branding-url", default="", help="provides branding url")
|
||||
parser.add_option("--sdkjs-addon", action="append", type="string", dest="sdkjs-addons", default=[], help="provides sdkjs addons")
|
||||
parser.add_option("--sdkjs-addon-desktop", action="append", type="string", dest="sdkjs-addons-desktop", default=[], help="provides sdkjs addons for desktop")
|
||||
parser.add_option("--server-addon", action="append", type="string", dest="server-addons", default=[], help="provides server addons")
|
||||
parser.add_option("--web-apps-addon", action="append", type="string", dest="web-apps-addons", default=[], help="provides web-apps addons")
|
||||
parser.add_option("--sdkjs-plugin", action="append", type="string", dest="sdkjs-plugin", default=["default"], help="provides plugins for server-based and desktop versions of the editors")
|
||||
parser.add_option("--sdkjs-plugin-server", action="append", type="string", dest="sdkjs-plugin-server", default=["default"], help="provides plugins for server-based version of the editors")
|
||||
parser.add_option("--features", action="store", type="string", dest="features", default="", help="native features (config addon)")
|
||||
parser.add_option("--vs-version", action="store", type="string", dest="vs-version", default="2015", help="version of visual studio")
|
||||
parser.add_option("--vs-path", action="store", type="string", dest="vs-path", default="", help="path to vcvarsall")
|
||||
parser.add_option("--siteUrl", action="store", type="string", dest="siteUrl", default="127.0.0.1", help="site url")
|
||||
parser.add_option("--multiprocess", action="store", type="string", dest="multiprocess", default="1", help="provides ability to specify single process for make")
|
||||
parser.add_option("--sysroot", action="store", type="string", dest="sysroot", default="0", help="provides ability to use sysroot (ubuntu 16.04) to build c++ code. If value is \"1\", then the sysroot from tools/linux/sysroot will be used, and if it is not there, it will download it and unpack it. You can also set value as the path to the your own sysroot (rarely used). Only for linux")
|
||||
parser.add_option("--qemu-win-arm64-dir", action="store", type="string", dest="qemu-win-arm64-dir", default="", help="dir to qemu virtual machine for win_arm64 cross build. It should contains start.bat. More info in tools/win/qemu.")
|
||||
|
||||
(options, args) = parser.parse_args(arguments)
|
||||
configOptions = vars(options)
|
||||
|
||||
3
defaults
Normal file
3
defaults
Normal file
@ -0,0 +1,3 @@
|
||||
sdkjs-plugin="ai, photoeditor, ocr, translator, thesaurus, youtube, highlightcode"
|
||||
sdkjs-plugin-server="speech, zotero, mendeley, speechrecognition"
|
||||
sdkjs-addons="sdkjs-forms"
|
||||
19
develop/Dockerfile
Normal file
19
develop/Dockerfile
Normal file
@ -0,0 +1,19 @@
|
||||
FROM onlyoffice/documentserver:latest
|
||||
RUN apt-get update -y && \
|
||||
apt-get install git -y \
|
||||
python3 -y \
|
||||
openjdk-11-jdk -y \
|
||||
bzip2 -y \
|
||||
npm -y && \
|
||||
npm install -g grunt grunt-cli -y && \
|
||||
ln -s /usr/bin/python3 /usr/bin/python && \
|
||||
ln -s /usr/bin/pip3 /usr/bin/pip && \
|
||||
git clone --depth 1 https://github.com/ONLYOFFICE/build_tools.git var/www/onlyoffice/documentserver/build_tools && \
|
||||
sed -i '/documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER}/d' /app/ds/run-document-server.sh && \
|
||||
#Set Up Debug Logging
|
||||
sed -i 's/WARN/ALL/g' /etc/onlyoffice/documentserver/log4js/production.json && \
|
||||
#Start test example
|
||||
if [ -s /etc/supervisor/conf.d/ds-example.conf ] ; then sed -i 's,autostart=false,autostart=true,' /etc/supervisor/conf.d/ds-example.conf; fi && \
|
||||
if [ -s /app/ds/setup/config/supervisor/ds/ds-example.conf ] ; then sed -i 's,autostart=false,autostart=true,' /app/ds/setup/config/supervisor/ds/ds-example.conf; fi && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
ENTRYPOINT python3 /var/www/onlyoffice/documentserver/build_tools/develop/run_build_js.py /var/www/onlyoffice/documentserver $@ && /bin/sh -c /app/ds/run-document-server.sh
|
||||
231
develop/README.md
Normal file
231
develop/README.md
Normal file
@ -0,0 +1,231 @@
|
||||
# Docker
|
||||
|
||||
This directory contains instructions for developers,
|
||||
who want to change something in sdkjs, web-apps, or the server module,
|
||||
but don't want to compile the complicated core product to make those changes.
|
||||
|
||||
## System requirements
|
||||
|
||||
### Windows
|
||||
|
||||
You need the latest
|
||||
[Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
|
||||
installed.
|
||||
|
||||
**Note**: Docker Desktop does not start automatically after installation.
|
||||
You should manually start the **Docker Desktop** application.
|
||||
|
||||
**Note**: If you have problems running Docker Desktop with the
|
||||
"Use WSL 2 instead of Hyper-V" installation option,
|
||||
try reinstalling it without this option.
|
||||
|
||||
### Linux or macOS
|
||||
|
||||
You need the latest
|
||||
[Docker](https://docs.docker.com/engine/install/)
|
||||
version installed.
|
||||
|
||||
## Create Development Docker Image
|
||||
|
||||
To create an image with the ability to include external non-minified sdkjs code,
|
||||
use the following commands:
|
||||
|
||||
### Clone development environment to the working directory
|
||||
|
||||
```bash
|
||||
git clone https://github.com/ONLYOFFICE/build_tools.git
|
||||
```
|
||||
|
||||
### Build Docker Image
|
||||
|
||||
**Note**: Do not prefix the docker command with sudo.
|
||||
[These instructions](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
|
||||
show how to use docker without sudo.
|
||||
|
||||
```bash
|
||||
cd build_tools/develop
|
||||
docker pull onlyoffice/documentserver
|
||||
docker build --no-cache -t documentserver-develop .
|
||||
```
|
||||
|
||||
**Note**: The dot at the end is required.
|
||||
|
||||
**Note**: Sometimes the build may fail due to network errors. Just restart it.
|
||||
|
||||
## Clone development modules
|
||||
|
||||
Clone development modules to the working directory.
|
||||
|
||||
* `sdkjs` repo is located [here](https://github.com/ONLYOFFICE/sdkjs/)
|
||||
* `web-apps` repo is located [here](https://github.com/ONLYOFFICE/web-apps/)
|
||||
* `server` repo is located [here](https://github.com/ONLYOFFICE/server/)
|
||||
|
||||
```bash
|
||||
git clone https://github.com/ONLYOFFICE/sdkjs.git
|
||||
git clone https://github.com/ONLYOFFICE/web-apps.git
|
||||
git clone https://github.com/ONLYOFFICE/server.git
|
||||
```
|
||||
|
||||
## Start server with external folders
|
||||
|
||||
To mount external folders to the container,
|
||||
you need to pass the "-v" parameter
|
||||
along with the relative paths to the required folders.
|
||||
The folders `sdkjs` and `web-apps` are required for proper development workflow.
|
||||
The folder `server` is optional.
|
||||
|
||||
**Note**: Run the command with the current working directory
|
||||
containing `sdkjs`, `web-apps`...
|
||||
|
||||
**Note**: ONLYOFFICE server uses port 80.
|
||||
Look for another application using port 80 and stop it.
|
||||
|
||||
**Note**: Starting the server with `sdkjs` and `web-apps` takes 15 minutes,
|
||||
or 20 minutes with `server`.
|
||||
|
||||
### docker run on Windows (PowerShell)
|
||||
|
||||
**Note**: Run PowerShell as administrator to fix EACCES error when installing
|
||||
node_modules.
|
||||
|
||||
Run with `sdkjs` and `web-apps`
|
||||
|
||||
```powershell
|
||||
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v $pwd/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $pwd/web-apps:/var/www/onlyoffice/documentserver/web-apps documentserver-develop
|
||||
```
|
||||
|
||||
Or run with `sdkjs`, `web-apps`, and `server`
|
||||
|
||||
```powershell
|
||||
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v $pwd/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $pwd/web-apps:/var/www/onlyoffice/documentserver/web-apps -v $pwd/server:/var/www/onlyoffice/documentserver/server documentserver-develop
|
||||
```
|
||||
|
||||
**Note**: If using Git Bash instead of PowerShell, you may need to quote the paths:
|
||||
|
||||
```bash
|
||||
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v "$(pwd)/sdkjs":/var/www/onlyoffice/documentserver/sdkjs -v "$(pwd)/web-apps":/var/www/onlyoffice/documentserver/web-apps documentserver-develop
|
||||
```
|
||||
|
||||
### docker run on Linux or macOS
|
||||
|
||||
Run with `sdkjs` and `web-apps`
|
||||
|
||||
```bash
|
||||
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v $(pwd)/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $(pwd)/web-apps:/var/www/onlyoffice/documentserver/web-apps documentserver-develop
|
||||
```
|
||||
|
||||
Or run with `sdkjs`, `web-apps`, and `server`
|
||||
|
||||
```bash
|
||||
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v $(pwd)/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $(pwd)/web-apps:/var/www/onlyoffice/documentserver/web-apps -v $(pwd)/server:/var/www/onlyoffice/documentserver/server documentserver-develop
|
||||
```
|
||||
|
||||
## Open editor
|
||||
|
||||
After the server starts successfully, you will see Docker log messages like this.
|
||||
|
||||
```text
|
||||
[Date] [WARN] [localhost] [docId] [userId] nodeJS
|
||||
```
|
||||
|
||||
To try the document editor, open a browser tab and type
|
||||
[http://localhost/example](http://localhost/example) into the URL bar.
|
||||
|
||||
**Note**: Disable **ad blockers** for the localhost page.
|
||||
They may block some scripts (like Analytics.js).
|
||||
|
||||
## Modify sources
|
||||
|
||||
### To change something in `sdkjs`, do the following steps
|
||||
|
||||
1) Edit the source file. Let's insert an image URL into each open document.
|
||||
The following command inserts (in case of problems, you can replace the URL)
|
||||
`this.AddImageUrl(['http://localhost/example/images/logo.png']);`
|
||||
after event
|
||||
`this.sendEvent('asc_onDocumentContentReady');`
|
||||
in file
|
||||
`sdkjs/common/apiBase.js`
|
||||
|
||||
**Windows (PowerShell):**
|
||||
```powershell
|
||||
(Get-Content sdkjs/common/apiBase.js) -replace "this\.sendEvent\('asc_onDocumentContentReady'\);", "this.sendEvent('asc_onDocumentContentReady');this.AddImageUrl(['http://localhost/example/images/logo.png']);" | Set-Content sdkjs/common/apiBase.js
|
||||
```
|
||||
|
||||
**Linux:**
|
||||
```bash
|
||||
sed -i "s,this.sendEvent('asc_onDocumentContentReady');,this.sendEvent('asc_onDocumentContentReady');this.AddImageUrl(['http://localhost/example/images/logo.png']);," sdkjs/common/apiBase.js
|
||||
```
|
||||
|
||||
**macOS:**
|
||||
```bash
|
||||
sed -i '' "s,this.sendEvent('asc_onDocumentContentReady');,this.sendEvent('asc_onDocumentContentReady');this.AddImageUrl(['http://localhost/example/images/logo.png']);," sdkjs/common/apiBase.js
|
||||
```
|
||||
|
||||
2) Clear the browser cache or hard reload the page (`Ctrl + Shift + R` or `Cmd + Shift + R` on macOS)
|
||||
|
||||
3) Open a new file in the browser
|
||||
|
||||
### To change something in `server`, do the following steps
|
||||
|
||||
1) Edit the source file. Let's send a `"Hello World!"`
|
||||
chat message every time a document is opened.
|
||||
The following command inserts
|
||||
`yield* onMessage(ctx, conn, {"message": "Hello World!"});`
|
||||
in function
|
||||
`sendAuthInfo`
|
||||
in file
|
||||
`server/DocService/sources/DocsCoServer.js`
|
||||
|
||||
**Windows (PowerShell):**
|
||||
```powershell
|
||||
(Get-Content server/DocService/sources/DocsCoServer.js) -replace 'opt_hasForgotten, opt_openedAt\) \{', 'opt_hasForgotten, opt_openedAt) {yield* onMessage(ctx, conn, {"message": "Hello World!"});' | Set-Content server/DocService/sources/DocsCoServer.js
|
||||
```
|
||||
|
||||
**Linux:**
|
||||
```bash
|
||||
sed -i 's#opt_hasForgotten, opt_openedAt) {#opt_hasForgotten, opt_openedAt) {yield* onMessage(ctx, conn, {"message": "Hello World!"});#' server/DocService/sources/DocsCoServer.js
|
||||
```
|
||||
|
||||
**macOS:**
|
||||
```bash
|
||||
sed -i '' 's#opt_hasForgotten, opt_openedAt) {#opt_hasForgotten, opt_openedAt) {yield* onMessage(ctx, conn, {"message": "Hello World!"});#' server/DocService/sources/DocsCoServer.js
|
||||
```
|
||||
|
||||
2) Restart the document server process
|
||||
|
||||
**Note**: Look for `CONTAINER_ID` in the result of `docker ps`.
|
||||
|
||||
```bash
|
||||
docker exec -it CONTAINER_ID supervisorctl restart all
|
||||
```
|
||||
|
||||
3) Open a new file in the browser
|
||||
|
||||
## Start server with additional functionality (addons)
|
||||
|
||||
To get additional functionality and branding, you need to connect a branding folder,
|
||||
additional addon folders, and pass command line arguments.
|
||||
|
||||
For example, run with `onlyoffice` branding and
|
||||
addons: `sdkjs-forms`, `sdkjs-ooxml`, `web-apps-mobile`.
|
||||
|
||||
### docker run on Windows (PowerShell) with branding
|
||||
|
||||
**Note**: Run PowerShell as administrator to fix EACCES error when installing
|
||||
node_modules.
|
||||
|
||||
```powershell
|
||||
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true `
|
||||
-v $pwd/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $pwd/web-apps:/var/www/onlyoffice/documentserver/web-apps `
|
||||
-v $pwd/onlyoffice:/var/www/onlyoffice/documentserver/onlyoffice -v $pwd/sdkjs-ooxml:/var/www/onlyoffice/documentserver/sdkjs-ooxml -v $pwd/sdkjs-forms:/var/www/onlyoffice/documentserver/sdkjs-forms -v $pwd/web-apps-mobile:/var/www/onlyoffice/documentserver/web-apps-mobile `
|
||||
documentserver-develop args --branding onlyoffice --branding-url 'https://github.com/ONLYOFFICE/onlyoffice.git' --siteUrl localhost
|
||||
```
|
||||
|
||||
### docker run on Linux or macOS with branding
|
||||
|
||||
```bash
|
||||
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true \
|
||||
-v $(pwd)/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $(pwd)/web-apps:/var/www/onlyoffice/documentserver/web-apps \
|
||||
-v $(pwd)/onlyoffice:/var/www/onlyoffice/documentserver/onlyoffice -v $(pwd)/sdkjs-ooxml:/var/www/onlyoffice/documentserver/sdkjs-ooxml -v $(pwd)/sdkjs-forms:/var/www/onlyoffice/documentserver/sdkjs-forms -v $(pwd)/web-apps-mobile:/var/www/onlyoffice/documentserver/web-apps-mobile \
|
||||
documentserver-develop args --branding onlyoffice --branding-url 'https://github.com/ONLYOFFICE/onlyoffice.git' --siteUrl localhost
|
||||
```
|
||||
57
develop/run_build_js.py
Normal file
57
develop/run_build_js.py
Normal file
@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
sys.path.append(sys.argv[1] + '/build_tools/scripts')
|
||||
sys.path.append(sys.argv[1] + '/build_tools/scripts/develop')
|
||||
import build_js
|
||||
import run_server
|
||||
import config
|
||||
import base
|
||||
|
||||
git_dir = sys.argv[1]
|
||||
|
||||
base.print_info('argv :'+' '.join(sys.argv))
|
||||
base.cmd_in_dir(git_dir + '/build_tools/', 'python3', ['configure.py', '--develop', '1'] + sys.argv[2:])
|
||||
|
||||
config.parse()
|
||||
config.parse_defaults()
|
||||
|
||||
if base.is_exist(git_dir + "/server/FileConverter/bin/fonts.log"):
|
||||
base.print_info('remove font cache to regenerate fonts in external sdkjs volume')
|
||||
base.delete_file(git_dir + "/server/FileConverter/bin/fonts.log")
|
||||
|
||||
# external server volume
|
||||
if base.is_exist(sys.argv[1] + '/server/DocService/package.json'):
|
||||
base.print_info('replace supervisor cfg to run docservice and converter from source')
|
||||
base.replaceInFileRE("/etc/supervisor/conf.d/ds-docservice.conf", "command=.*", "command=node " + git_dir + "/server/DocService/sources/server.js")
|
||||
base.replaceInFileRE("/app/ds/setup/config/supervisor/ds/ds-docservice.conf", "command=.*", "command=node " + git_dir + "/server/DocService/sources/server.js")
|
||||
base.replaceInFileRE("/etc/supervisor/conf.d/ds-converter.conf", "command=.*", "command=node " + git_dir + "/server/FileConverter/sources/convertermaster.js")
|
||||
base.replaceInFileRE("/app/ds/setup/config/supervisor/ds/ds-converter.conf", "command=.*", "command=node " + git_dir + "/server/FileConverter/sources/convertermaster.js")
|
||||
base.print_info('run_server.run_docker_server')
|
||||
run_server.run_docker_server()
|
||||
else:
|
||||
#Fix theme generation for external sdkjs volume
|
||||
if base.is_exist(git_dir + "/server/FileConverter/bin/DoctRenderer.config"):
|
||||
base.print_info('replace DoctRenderer.config for external sdkjs volume')
|
||||
base.generate_doctrenderer_config(git_dir + "/server/FileConverter/bin/DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/", "../../../dictionaries")
|
||||
|
||||
addons = {}
|
||||
addons.update(base.get_sdkjs_addons())
|
||||
addons.update(base.get_web_apps_addons())
|
||||
staticContent = ""
|
||||
for addon in addons:
|
||||
if (addon):
|
||||
staticContent += '"/' + addon + '": {"path": "/var/www/onlyoffice/documentserver/' + addon + '","options": {"maxAge": "7d"}},'
|
||||
|
||||
if staticContent:
|
||||
base.print_info('replace production-linux.json for addons'+staticContent)
|
||||
base.replaceInFileRE("/etc/onlyoffice/documentserver/production-linux.json", '"static_content": {.*', '"static_content": {' + staticContent)
|
||||
|
||||
base.print_info('replace supervisor cfg to run docservice and converter from pkg')
|
||||
base.replaceInFileRE("/etc/supervisor/conf.d/ds-docservice.conf", "command=node .*", "command=/var/www/onlyoffice/documentserver/server/DocService/docservice")
|
||||
base.replaceInFileRE("/app/ds/setup/config/supervisor/ds/ds-docservice.conf", "command=node .*", "command=/var/www/onlyoffice/documentserver/server/DocService/docservice")
|
||||
base.replaceInFileRE("/etc/supervisor/conf.d/ds-converter.conf", "command=node .*", "command=/var/www/onlyoffice/documentserver/server/FileConverter/converter")
|
||||
base.replaceInFileRE("/app/ds/setup/config/supervisor/ds/ds-converter.conf", "command=node .*", "command=/var/www/onlyoffice/documentserver/server/FileConverter/converter")
|
||||
base.print_info('run_server.run_docker_sdk_web_apps: ' + git_dir)
|
||||
run_server.run_docker_sdk_web_apps(git_dir)
|
||||
|
||||
66
linux-start.sh
Normal file
66
linux-start.sh
Normal file
@ -0,0 +1,66 @@
|
||||
sudo apt-get install git curl wget p7zip-full
|
||||
|
||||
sudo apt-get install git-lfs
|
||||
# for old system (ubuntu 16)
|
||||
#curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
|
||||
#sudo apt-get install git-lfs
|
||||
|
||||
# save login
|
||||
git config --global credential.helper store
|
||||
|
||||
# clone build_tools
|
||||
git clone https://git.onlyoffice.com/ONLYOFFICE/build_tools.git
|
||||
|
||||
# deps =========================================
|
||||
|
||||
cd ./build_tools/tools/linux
|
||||
|
||||
# python 3.10
|
||||
./python.sh
|
||||
|
||||
# qt
|
||||
#./python3/bin/python3 ./qt_binary_fetch.py amd64
|
||||
#./python3/bin/python3 ./qt_binary_fetch.py arm64
|
||||
./python3/bin/python3 ./qt_binary_fetch.py all
|
||||
|
||||
# deps
|
||||
./python3/bin/python3 ./deps.py
|
||||
|
||||
# cmake 3.30
|
||||
sudo ./cmake.sh
|
||||
|
||||
cd ../../
|
||||
|
||||
# ==============================================
|
||||
|
||||
# sysroots (IF NEEDED) =========================
|
||||
|
||||
cd ./build_tools/tools/linux/sysroot
|
||||
#./python3/bin/python3 ./fetch.py amd64
|
||||
#./python3/bin/python3 ./fetch.py arm64
|
||||
./../python3/bin/python3 ./fetch.py all
|
||||
cd ../../../
|
||||
|
||||
# ==============================================
|
||||
|
||||
|
||||
# configure ====================================
|
||||
|
||||
./tools/linux/python3/bin/python3 ./configure.py --clean "0" --update-light "1" --update "1" --branch "hotfix/v9.2.1" --module "desktop" --qt-dir "$(pwd)/tools/linux/qt_build/Qt-5.9.9"
|
||||
|
||||
# with sysroot: sysroot "1"
|
||||
|
||||
# ==============================================
|
||||
|
||||
# cross build linux_arm64
|
||||
sudo apt install qemu-user qemu-user-static binfmt-support
|
||||
sudo update-binfmts --enable qemu-aarch64
|
||||
|
||||
# 1) without sysroot
|
||||
#sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
||||
#sudo dpkg --add-architecture arm64
|
||||
#sudo apt update
|
||||
#... install all dev packages ...
|
||||
|
||||
# 2) official supported: with sysroot
|
||||
./tools/linux/python3/bin/python3 ./configure.py sysroot "1" #...
|
||||
83
make.py
83
make.py
@ -1,21 +1,37 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append('scripts')
|
||||
sys.path.append('scripts/core_common')
|
||||
sys.path.append('scripts/core_common/modules')
|
||||
__dir__name__ = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.append(__dir__name__ + '/scripts')
|
||||
sys.path.append(__dir__name__ + '/scripts/develop')
|
||||
sys.path.append(__dir__name__ + '/scripts/develop/vendor')
|
||||
sys.path.append(__dir__name__ + '/scripts/core_common')
|
||||
sys.path.append(__dir__name__ + '/scripts/core_common/modules')
|
||||
sys.path.append(__dir__name__ + '/scripts/core_common/modules/android')
|
||||
import config
|
||||
import base
|
||||
import build
|
||||
import build_sln
|
||||
import build_js
|
||||
import build_server
|
||||
import deploy
|
||||
import make_common
|
||||
import develop
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser(description="options")
|
||||
parser.add_argument("--build-only-branding", action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
if (args.build_only_branding):
|
||||
base.set_env("OO_BUILD_ONLY_BRANDING", "1")
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
base.check_python()
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
base.set_env("BUILD_PLATFORM", config.option("platform"))
|
||||
|
||||
# branding
|
||||
@ -29,9 +45,9 @@ if ("1" != base.get_env("OO_RUNNING_BRANDING")) and ("" != config.option("brandi
|
||||
base.cmd("git", ["clone", config.option("branding-url"), branding_dir])
|
||||
|
||||
base.cmd_in_dir(branding_dir, "git", ["fetch"], True)
|
||||
|
||||
|
||||
if not is_exist or ("1" != config.option("update-light")):
|
||||
base.cmd_in_dir(branding_dir, "git", ["checkout", "-f", config.option("branch")])
|
||||
base.cmd_in_dir(branding_dir, "git", ["checkout", "-f", config.option("branch")], True)
|
||||
|
||||
base.cmd_in_dir(branding_dir, "git", ["pull"], True)
|
||||
|
||||
@ -42,67 +58,42 @@ if ("1" != base.get_env("OO_RUNNING_BRANDING")) and ("" != config.option("brandi
|
||||
base.cmd_in_dir(branding_dir + "/build_tools", "python", ["make.py"])
|
||||
exit(0)
|
||||
|
||||
# correct defaults (the branding repo is already updated)
|
||||
config.parse_defaults()
|
||||
|
||||
base.check_build_version(base_dir)
|
||||
|
||||
# update
|
||||
if ("1" == config.option("update")):
|
||||
base.git_update("core")
|
||||
base.git_update("sdkjs")
|
||||
base.sdkjs_addons_checkout()
|
||||
base.sdkjs_plugins_checkout()
|
||||
base.git_update("web-apps")
|
||||
base.web_apps_addons_checkout()
|
||||
base.git_update("desktop-sdk")
|
||||
base.git_update("dictionaries")
|
||||
|
||||
if config.check_option("module", "builder"):
|
||||
base.git_update("DocumentBuilder")
|
||||
|
||||
if config.check_option("module", "desktop"):
|
||||
base.git_update("desktop-apps")
|
||||
|
||||
if (config.check_option("module", "develop") or config.check_option("module", "server")):
|
||||
base.git_update("server")
|
||||
base.server_addons_checkout()
|
||||
base.git_update("document-server-integration")
|
||||
|
||||
if (config.check_option("module", "develop") or config.check_option("module", "server") or config.check_option("platform", "ios")):
|
||||
base.git_update("core-fonts")
|
||||
repositories = base.get_repositories()
|
||||
base.update_repositories(repositories)
|
||||
|
||||
base.configure_common_apps()
|
||||
|
||||
# developing...
|
||||
if ("develop" == config.option("module")):
|
||||
build_js.build_js_develop(base_dir + "/..")
|
||||
deploy.make()
|
||||
exit(0)
|
||||
develop.make()
|
||||
|
||||
# check only js builds
|
||||
if ("1" == base.get_env("OO_ONLY_BUILD_JS")):
|
||||
build_js.make()
|
||||
exit(0)
|
||||
|
||||
#base.check_tools()
|
||||
|
||||
# core 3rdParty
|
||||
make_common.make()
|
||||
|
||||
# build updmodule for desktop (only for windows version)
|
||||
if ("windows" == base.host_platform()) and (config.check_option("module", "desktop")):
|
||||
config.extend_option("config", "updmodule")
|
||||
config.extend_option("qmake_addon", "LINK=https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.xml")
|
||||
if config.check_option("module", "desktop"):
|
||||
config.extend_option("qmake_addon", "URL_WEBAPPS_HELP=https://download.onlyoffice.com/install/desktop/editors/help/v" + base.get_env('PRODUCT_VERSION') + "/apps")
|
||||
|
||||
if not base.is_file(base_dir + "/tools/WinSparkle-0.7.0.zip"):
|
||||
base.cmd("curl.exe", ["https://d2ettrnqo7v976.cloudfront.net/winsparkle/WinSparkle-0.7.0.zip", "--output", base_dir + "/tools/WinSparkle-0.7.0.zip"])
|
||||
|
||||
if not base.is_dir(base_dir + "/tools/WinSparkle-0.7.0"):
|
||||
base.cmd("7z.exe", ["x", base_dir + "/tools/WinSparkle-0.7.0.zip", "-otools"])
|
||||
|
||||
base.create_dir(base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle")
|
||||
#base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/include", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/include")
|
||||
base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_32")
|
||||
base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/x64/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_64")
|
||||
if "windows" == base.host_platform():
|
||||
config.extend_option("config", "updmodule")
|
||||
base.set_env("DESKTOP_URL_UPDATES_MAIN_CHANNEL", "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.json")
|
||||
base.set_env("DESKTOP_URL_UPDATES_DEV_CHANNEL", "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcastdev.json")
|
||||
|
||||
# build
|
||||
build.make()
|
||||
build_sln.make()
|
||||
|
||||
# js
|
||||
build_js.make()
|
||||
|
||||
109
make_package.py
Executable file
109
make_package.py
Executable file
@ -0,0 +1,109 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
sys.path.append("scripts")
|
||||
import argparse
|
||||
import package_common as common
|
||||
import package_utils as utils
|
||||
|
||||
# parse
|
||||
parser = argparse.ArgumentParser(description="Build packages.")
|
||||
parser.add_argument("-P", "--platform", dest="platform", type=str,
|
||||
action="store", help="Defines platform", required=True)
|
||||
parser.add_argument("-T", "--targets", dest="targets", type=str, nargs="+",
|
||||
action="store", help="Defines targets", required=True)
|
||||
parser.add_argument("-V", "--version", dest="version", type=str,
|
||||
action="store", help="Defines version")
|
||||
parser.add_argument("-B", "--build", dest="build", type=str,
|
||||
action="store", help="Defines build")
|
||||
parser.add_argument("-H", "--branch", dest="branch", type=str,
|
||||
action="store", help="Defines branch")
|
||||
parser.add_argument("-R", "--branding", dest="branding", type=str,
|
||||
action="store", help="Provides branding path")
|
||||
args = parser.parse_args()
|
||||
|
||||
# vars
|
||||
common.os_family = utils.host_platform()
|
||||
common.platform = args.platform
|
||||
common.prefix = common.platformPrefixes[common.platform] if common.platform in common.platformPrefixes else ""
|
||||
common.targets = args.targets
|
||||
common.clean = "clean" in args.targets
|
||||
common.sign = "sign" in args.targets
|
||||
common.deploy = "deploy" in args.targets
|
||||
if args.version: common.version = args.version
|
||||
else: common.version = utils.get_env("PRODUCT_VERSION", "0.0.0")
|
||||
utils.set_env("PRODUCT_VERSION", common.version)
|
||||
utils.set_env("BUILD_VERSION", common.version)
|
||||
if args.build: common.build = args.build
|
||||
else: common.build = utils.get_env("BUILD_NUMBER", "0")
|
||||
utils.set_env("BUILD_NUMBER", common.build)
|
||||
if args.branch: common.branch = args.branch
|
||||
else: common.branch = utils.get_env("BRANCH_NAME", "null")
|
||||
utils.set_env("BRANCH_NAME", common.branch)
|
||||
common.branding = args.branding
|
||||
common.timestamp = utils.get_timestamp()
|
||||
common.workspace_dir = utils.get_abspath(utils.get_script_dir(__file__) + "/..")
|
||||
common.branding_dir = utils.get_abspath(common.workspace_dir + "/" + args.branding) if args.branding else common.workspace_dir
|
||||
common.summary = []
|
||||
utils.log("os_family: " + common.os_family)
|
||||
utils.log("platform: " + str(common.platform))
|
||||
utils.log("prefix: " + str(common.prefix))
|
||||
utils.log("targets: " + str(common.targets))
|
||||
utils.log("clean: " + str(common.clean))
|
||||
utils.log("sign: " + str(common.sign))
|
||||
utils.log("deploy: " + str(common.deploy))
|
||||
utils.log("version: " + common.version)
|
||||
utils.log("build: " + common.build)
|
||||
utils.log("branding: " + str(common.branding))
|
||||
utils.log("timestamp: " + common.timestamp)
|
||||
utils.log("workspace_dir: " + common.workspace_dir)
|
||||
utils.log("branding_dir: " + common.branding_dir)
|
||||
|
||||
# branding
|
||||
if common.branding is not None:
|
||||
sys.path.insert(-1, \
|
||||
utils.get_path("../" + common.branding + "/build_tools/scripts"))
|
||||
|
||||
import package_core
|
||||
import package_desktop
|
||||
import package_server
|
||||
import package_builder
|
||||
import package_mobile
|
||||
|
||||
# build
|
||||
utils.set_cwd(common.workspace_dir, verbose=True)
|
||||
if "core" in common.targets:
|
||||
package_core.make()
|
||||
if "closuremaps_sdkjs_opensource" in common.targets:
|
||||
package_core.deploy_closuremaps_sdkjs("opensource")
|
||||
if "closuremaps_sdkjs_commercial" in common.targets:
|
||||
package_core.deploy_closuremaps_sdkjs("commercial")
|
||||
if "closuremaps_webapps" in common.targets:
|
||||
package_core.deploy_closuremaps_webapps("opensource")
|
||||
if "desktop" in common.targets:
|
||||
package_desktop.make()
|
||||
if "builder" in common.targets:
|
||||
package_builder.make()
|
||||
if "server_community" in common.targets:
|
||||
package_server.make("community")
|
||||
if "server_enterprise" in common.targets:
|
||||
package_server.make("enterprise")
|
||||
if "server_developer" in common.targets:
|
||||
package_server.make("developer")
|
||||
if "server_prerequisites" in common.targets:
|
||||
package_server.make("prerequisites")
|
||||
if "mobile" in common.targets:
|
||||
package_mobile.make()
|
||||
|
||||
# summary
|
||||
utils.log_h1("Build summary")
|
||||
exitcode = 0
|
||||
for i in common.summary:
|
||||
if list(i.values())[0]:
|
||||
utils.log("[ OK ] " + list(i.keys())[0])
|
||||
else:
|
||||
utils.log("[FAILED] " + list(i.keys())[0])
|
||||
exitcode = 1
|
||||
|
||||
exit(exitcode)
|
||||
1712
scripts/base.py
1712
scripts/base.py
File diff suppressed because it is too large
Load Diff
@ -1,86 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
|
||||
# make build.pro
|
||||
def make():
|
||||
is_no_brandind_build = base.is_file("config")
|
||||
|
||||
platforms = config.option("platform").split()
|
||||
for platform in platforms:
|
||||
if not platform in config.platforms:
|
||||
continue
|
||||
|
||||
print("------------------------------------------")
|
||||
print("BUILD_PLATFORM: " + platform)
|
||||
print("------------------------------------------")
|
||||
old_env = os.environ.copy()
|
||||
|
||||
isAndroid = False if (-1 == platform.find("android")) else True
|
||||
if isAndroid:
|
||||
toolchain_platform = "linux-x86_64"
|
||||
if ("mac" == base.host_platform()):
|
||||
toolchain_platform = "darwin-x86_64"
|
||||
base.set_env("ANDROID_NDK_HOST", toolchain_platform)
|
||||
old_path = base.get_env("PATH")
|
||||
new_path = base.qt_setup(platform) + "/bin:"
|
||||
new_path += (base.get_env("ANDROID_NDK_ROOT") + "/toolchains/llvm/prebuilt/" + toolchain_platform + "/bin:")
|
||||
new_path += old_path
|
||||
base.set_env("PATH", new_path)
|
||||
if ("android_arm64_v8a" == platform):
|
||||
base.set_env("ANDROID_NDK_PLATFORM", "android-21")
|
||||
else:
|
||||
base.set_env("ANDROID_NDK_PLATFORM", "android-16")
|
||||
|
||||
# makefile suffix
|
||||
file_suff = platform
|
||||
if (config.check_option("config", "debug")):
|
||||
file_suff += "_debug_"
|
||||
file_suff += config.option("branding")
|
||||
|
||||
# setup qt
|
||||
qt_dir = base.qt_setup(platform)
|
||||
base.set_env("OS_DEPLOY", platform)
|
||||
|
||||
# qmake CONFIG+=...
|
||||
config_param = base.qt_config(platform)
|
||||
|
||||
# qmake ADDON
|
||||
qmake_addon = []
|
||||
if ("" != config.option("qmake_addon")):
|
||||
qmake_addon.append(config.option("qmake_addon"))
|
||||
|
||||
# non windows platform
|
||||
if not base.is_windows():
|
||||
if ("1" == config.option("clean")):
|
||||
base.cmd(base.app_make(), ["clean", "all", "-f", "makefiles/build.makefile_" + file_suff], True)
|
||||
base.cmd(base.app_make(), ["distclean", "-f", "makefiles/build.makefile_" + file_suff], True)
|
||||
|
||||
if base.is_file("makefiles/build.makefile_" + file_suff):
|
||||
base.delete_file("makefiles/build.makefile_" + file_suff)
|
||||
base.cmd(qt_dir + "/bin/qmake", ["-nocache", "build.pro", "CONFIG+=" + config_param] + qmake_addon)
|
||||
base.cmd(base.app_make(), ["-f", "makefiles/build.makefile_" + file_suff])
|
||||
else:
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + ("x86" if base.platform_is_32(platform) else "x64"))
|
||||
if ("1" == config.option("clean")):
|
||||
qmake_bat.append("call nmake clean all -f makefiles/build.makefile_" + file_suff)
|
||||
qmake_bat.append("call nmake distclean -f makefiles/build.makefile_" + file_suff)
|
||||
qmake_addon_string = ""
|
||||
if ("" != config.option("qmake_addon")):
|
||||
qmake_addon_string = " \"" + config.option("qmake_addon") + "\""
|
||||
qmake_bat.append("if exist ./makefiles/build.makefile_" + file_suff + " del /F ./makefiles/build.makefile_" + file_suff)
|
||||
qmake_bat.append("call \"" + qt_dir + "/bin/qmake\" -nocache build.pro \"CONFIG+=" + config_param + "\"" + qmake_addon_string)
|
||||
qmake_bat.append("call nmake -f makefiles/build.makefile_" + file_suff)
|
||||
base.run_as_bat(qmake_bat)
|
||||
|
||||
os.environ = old_env.copy()
|
||||
|
||||
base.delete_file(".qmake.stash")
|
||||
|
||||
if config.check_option("module", "builder") and base.is_windows() and is_no_brandind_build:
|
||||
base.bash("../core/DesktopEditor/doctrenderer/docbuilder.com/build")
|
||||
|
||||
return
|
||||
@ -2,51 +2,116 @@
|
||||
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
|
||||
def correct_sdkjs_licence(directory):
|
||||
branding = config.option("branding")
|
||||
if "" == branding or "onlyoffice" == branding:
|
||||
return
|
||||
license = base.readFileLicence(directory + "/word/sdk-all-min.js")
|
||||
base.replaceFileLicence(directory + "/common/Charts/ChartStyles.js", license)
|
||||
base.replaceFileLicence(directory + "/common/hash/hash/engine.js", license)
|
||||
base.replaceFileLicence(directory + "/common/hash/hash/engine_ie.js", license)
|
||||
base.replaceFileLicence(directory + "/common/Native/native.js", license)
|
||||
base.replaceFileLicence(directory + "/common/Native/native_graphics.js", license)
|
||||
base.replaceFileLicence(directory + "/common/spell/spell/spell.js", license)
|
||||
base.replaceFileLicence(directory + "/common/spell/spell/spell_ie.js", license)
|
||||
base.replaceFileLicence(directory + "/pdf/src/engine/drawingfile.js", license)
|
||||
base.replaceFileLicence(directory + "/pdf/src/engine/drawingfile_ie.js", license)
|
||||
base.replaceInFile(directory + "/word/sdk-all-min.js", "onlyoffice-spellchecker", "r7-spellchecker")
|
||||
base.replaceInFile(directory + "/slide/sdk-all-min.js", "onlyoffice-spellchecker", "r7-spellchecker")
|
||||
base.replaceInFile(directory + "/cell/sdk-all-min.js", "onlyoffice-spellchecker", "r7-spellchecker")
|
||||
return
|
||||
|
||||
# make build.pro
|
||||
def make():
|
||||
if ("1" == base.get_env("OO_NO_BUILD_JS")):
|
||||
return
|
||||
if ("core" == config.option("module")):
|
||||
if not base.is_need_build_js():
|
||||
return
|
||||
|
||||
base.set_env('NODE_ENV', 'production')
|
||||
|
||||
base_dir = base.get_script_dir() + "/.."
|
||||
out_dir = base_dir + "/out/js/";
|
||||
out_dir = base_dir + "/out/js/"
|
||||
branding = config.option("branding-name")
|
||||
if ("" == branding):
|
||||
branding = "onlyoffice"
|
||||
out_dir += branding
|
||||
base.create_dir(out_dir)
|
||||
|
||||
isOnlyMobile = False
|
||||
if (config.option("module") == "mobile"):
|
||||
isOnlyMobile = True
|
||||
|
||||
# builder
|
||||
build_interface(base_dir + "/../web-apps/build")
|
||||
build_sdk_builder(base_dir + "/../sdkjs/build")
|
||||
base.create_dir(out_dir + "/builder")
|
||||
base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/builder/web-apps")
|
||||
base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/builder/sdkjs")
|
||||
if not isOnlyMobile:
|
||||
base.cmd_in_dir(base_dir + "/../web-apps/translation", "python", ["merge_and_check.py"])
|
||||
build_interface(base_dir + "/../web-apps/build")
|
||||
build_sdk_builder(base_dir + "/../sdkjs/build")
|
||||
base.create_dir(out_dir + "/builder")
|
||||
base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/builder/web-apps")
|
||||
base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/builder/sdkjs")
|
||||
correct_sdkjs_licence(out_dir + "/builder/sdkjs")
|
||||
|
||||
# desktop
|
||||
build_sdk_desktop(base_dir + "/../sdkjs/build")
|
||||
if config.check_option("module", "desktop"):
|
||||
if config.check_option("module", "desktop") and not isOnlyMobile:
|
||||
build_sdk_desktop(base_dir + "/../sdkjs/build")
|
||||
base.create_dir(out_dir + "/desktop")
|
||||
base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/desktop/sdkjs")
|
||||
correct_sdkjs_licence(out_dir + "/desktop/sdkjs")
|
||||
base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/desktop/web-apps")
|
||||
base.delete_dir(out_dir + "/desktop/web-apps/apps/documenteditor/embed")
|
||||
base.delete_dir(out_dir + "/desktop/web-apps/apps/documenteditor/mobile")
|
||||
base.delete_dir(out_dir + "/desktop/web-apps/apps/presentationeditor/embed")
|
||||
base.delete_dir(out_dir + "/desktop/web-apps/apps/presentationeditor/mobile")
|
||||
base.delete_dir(out_dir + "/desktop/web-apps/apps/spreadsheeteditor/embed")
|
||||
base.delete_dir(out_dir + "/desktop/web-apps/apps/spreadsheeteditor/mobile")
|
||||
|
||||
deldirs = ['ie', 'mobile', 'embed']
|
||||
[base.delete_dir(root + "/" + d) for root, dirs, f in os.walk(out_dir + "/desktop/web-apps/apps") for d in dirs if d in deldirs]
|
||||
|
||||
base.copy_file(base_dir + "/../web-apps/apps/api/documents/index.html.desktop", out_dir + "/desktop/web-apps/apps/api/documents/index.html")
|
||||
|
||||
build_interface(base_dir + "/../desktop-apps/common/loginpage/build")
|
||||
base.copy_file(base_dir + "/../desktop-apps/common/loginpage/deploy/index.html", out_dir + "/desktop/index.html")
|
||||
base.copy_file(base_dir + "/../desktop-apps/common/loginpage/deploy/noconnect.html", out_dir + "/desktop/noconnect.html")
|
||||
|
||||
# mobile
|
||||
if config.check_option("module", "mobile"):
|
||||
build_sdk_native(base_dir + "/../sdkjs/build")
|
||||
base.create_dir(out_dir + "/mobile")
|
||||
base.create_dir(out_dir + "/mobile/sdkjs")
|
||||
vendor_dir_src = base_dir + "/../web-apps/vendor/"
|
||||
sdk_dir_src = base_dir + "/../sdkjs/deploy/sdkjs/"
|
||||
|
||||
prefix_js = [
|
||||
vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs-native/common/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"
|
||||
]
|
||||
|
||||
postfix_js = [
|
||||
base_dir + "/../sdkjs/common/libfont/engine/fonts_native.js",
|
||||
base_dir + "/../sdkjs/common/Charts/ChartStyles.js"
|
||||
]
|
||||
|
||||
base.join_scripts(prefix_js, out_dir + "/mobile/sdkjs/banners.js")
|
||||
|
||||
base.create_dir(out_dir + "/mobile/sdkjs/word")
|
||||
base.join_scripts([out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js"] + postfix_js, out_dir + "/mobile/sdkjs/word/script.bin")
|
||||
base.create_dir(out_dir + "/mobile/sdkjs/cell")
|
||||
base.join_scripts([out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js"] + postfix_js, out_dir + "/mobile/sdkjs/cell/script.bin")
|
||||
base.create_dir(out_dir + "/mobile/sdkjs/slide")
|
||||
base.join_scripts([out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js"] + postfix_js, out_dir + "/mobile/sdkjs/slide/script.bin")
|
||||
|
||||
base.delete_file(out_dir + "/mobile/sdkjs/banners.js")
|
||||
return
|
||||
|
||||
# JS build
|
||||
def _run_npm(directory):
|
||||
return base.cmd_in_dir(directory, "npm", ["install"])
|
||||
retValue = base.cmd_in_dir(directory, "npm", ["install"], True)
|
||||
if (0 != retValue):
|
||||
retValue = base.cmd_in_dir(directory, "npm", ["install", "--verbose"])
|
||||
return retValue
|
||||
|
||||
def _run_npm_ci(directory):
|
||||
return base.cmd_in_dir(directory, "npm", ["ci"])
|
||||
|
||||
def _run_npm_cli(directory):
|
||||
return base.cmd_in_dir(directory, "npm", ["install", "-g", "grunt-cli"])
|
||||
@ -56,27 +121,70 @@ def _run_grunt(directory, params=[]):
|
||||
|
||||
def build_interface(directory):
|
||||
_run_npm(directory)
|
||||
_run_grunt(directory, ["--force"] + base.web_apps_addons_param())
|
||||
_run_grunt(directory, ["--force", "--verbose"] + base.web_apps_addons_param())
|
||||
return
|
||||
|
||||
def get_build_param(minimize=True):
|
||||
minimize_scripts = minimize
|
||||
if config.check_option("jsminimize", "0"):
|
||||
minimize_scripts = False
|
||||
beta = "true" if config.check_option("beta", "1") else "false"
|
||||
params = ["--beta=" + beta]
|
||||
return params + (["--level=ADVANCED"] if minimize_scripts else ["--level=WHITESPACE_ONLY", "--formatting=PRETTY_PRINT"])
|
||||
|
||||
def build_sdk_desktop(directory):
|
||||
#_run_npm_cli(directory)
|
||||
_run_npm(directory)
|
||||
_run_grunt(directory, ["--level=ADVANCED", "--desktop=true"] + base.sdkjs_addons_param())
|
||||
_run_grunt(directory, get_build_param() + ["--desktop=true"] + base.sdkjs_addons_param() + base.sdkjs_addons_desktop_param())
|
||||
return
|
||||
|
||||
def build_sdk_builder(directory):
|
||||
#_run_npm_cli(directory)
|
||||
_run_npm(directory)
|
||||
_run_grunt(directory, ["--level=ADVANCED"] + base.sdkjs_addons_param())
|
||||
_run_grunt(directory, get_build_param() + base.sdkjs_addons_param() + ["--map"])
|
||||
return
|
||||
|
||||
def build_sdk_native(directory, minimize=True):
|
||||
#_run_npm_cli(directory)
|
||||
_run_npm(directory)
|
||||
addons = base.sdkjs_addons_param()
|
||||
if not config.check_option("sdkjs-addons", "sdkjs-native"):
|
||||
addons.append("--addon=sdkjs-native")
|
||||
_run_grunt(directory, get_build_param(minimize) + ["--mobile=true"] + addons)
|
||||
return
|
||||
|
||||
|
||||
def build_sdkjs_develop(root_dir):
|
||||
external_folder = config.option("--external-folder")
|
||||
if (external_folder != ""):
|
||||
external_folder = "/" + external_folder
|
||||
|
||||
_run_npm_ci(root_dir + external_folder + "/sdkjs/build")
|
||||
_run_grunt(root_dir + external_folder + "/sdkjs/build", get_build_param(False) + base.sdkjs_addons_param())
|
||||
_run_grunt(root_dir + external_folder + "/sdkjs/build", ["develop"] + base.sdkjs_addons_param())
|
||||
|
||||
|
||||
def build_js_develop(root_dir):
|
||||
#_run_npm_cli(root_dir + "/sdkjs/build")
|
||||
_run_npm(root_dir + "/sdkjs/build")
|
||||
_run_grunt(root_dir + "/sdkjs/build", ["--level=WHITESPACE_ONLY", "--formatting=PRETTY_PRINT"] + base.sdkjs_addons_param())
|
||||
_run_grunt(root_dir + "/sdkjs/build", ["develop"] + base.sdkjs_addons_param())
|
||||
_run_npm(root_dir + "/web-apps/build")
|
||||
_run_npm(root_dir + "/web-apps/build/sprites")
|
||||
_run_grunt(root_dir + "/web-apps/build/sprites", [])
|
||||
external_folder = config.option("--external-folder")
|
||||
if (external_folder != ""):
|
||||
external_folder = "/" + external_folder
|
||||
|
||||
build_sdkjs_develop(root_dir)
|
||||
|
||||
_run_npm(root_dir + external_folder + "/web-apps/build")
|
||||
_run_npm_ci(root_dir + external_folder + "/web-apps/build/sprites")
|
||||
_run_grunt(root_dir + external_folder + "/web-apps/build/sprites", [])
|
||||
base.cmd_in_dir(root_dir + external_folder + "/web-apps/translation", "python", ["merge_and_check.py"])
|
||||
|
||||
old_cur = os.getcwd()
|
||||
old_product_version = base.get_env("PRODUCT_VERSION")
|
||||
base.set_env("PRODUCT_VERSION", old_product_version + "d")
|
||||
os.chdir(root_dir + external_folder + "/web-apps/vendor/framework7-react")
|
||||
base.cmd("npm", ["ci"])
|
||||
base.cmd("npm", ["run", "deploy-word"])
|
||||
base.cmd("npm", ["run", "deploy-cell"])
|
||||
base.cmd("npm", ["run", "deploy-slide"])
|
||||
base.set_env("PRODUCT_VERSION", old_product_version)
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
85
scripts/build_js_native.py
Normal file
85
scripts/build_js_native.py
Normal file
@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import base
|
||||
import build_js
|
||||
import config
|
||||
import optparse
|
||||
import sys
|
||||
|
||||
arguments = sys.argv[1:]
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option("--output",
|
||||
action="store", type="string", dest="output",
|
||||
help="Directory for output the build result")
|
||||
parser.add_option("--write-version",
|
||||
action="store_true", dest="write_version", default=False,
|
||||
help="Create version file of build")
|
||||
parser.add_option("--minimize",
|
||||
action="store", type="string", dest="minimize", default="0",
|
||||
help="Is minimized version")
|
||||
(options, args) = parser.parse_args(arguments)
|
||||
|
||||
def write_version_files(output_dir):
|
||||
if (base.is_dir(output_dir)):
|
||||
last_version_tag = base.run_command('git describe --abbrev=0 --tags')['stdout']
|
||||
version_numbers=last_version_tag.replace('v', '').split('.')
|
||||
major=(version_numbers[0:1] or ('0',))[0]
|
||||
minor=(version_numbers[1:2] or ('0',))[0]
|
||||
maintenance=(version_numbers[2:3] or ('0',))[0]
|
||||
build=(version_numbers[3:4] or ('0',))[0]
|
||||
full_version='%s.%s.%s.%s' % (major, minor, maintenance, build)
|
||||
|
||||
for name in ['word', 'cell', 'slide']:
|
||||
base.writeFile(output_dir + '/%s/sdk.version' % name, full_version)
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
config.parse_defaults()
|
||||
|
||||
isMinimize = False
|
||||
if ("1" == options.minimize or "true" == options.minimize):
|
||||
isMinimize = True
|
||||
config.set_option("jsminimize", "disable")
|
||||
|
||||
branding = config.option("branding-name")
|
||||
if ("" == branding):
|
||||
branding = "onlyoffice"
|
||||
|
||||
base_dir = base.get_script_dir() + "/.."
|
||||
out_dir = base_dir + "/../native-sdk/examples/win-linux-mac/build/sdkjs"
|
||||
|
||||
if (options.output):
|
||||
out_dir = options.output
|
||||
|
||||
base.create_dir(out_dir)
|
||||
|
||||
build_js.build_sdk_native(base_dir + "/../sdkjs/build", isMinimize)
|
||||
vendor_dir_src = base_dir + "/../web-apps/vendor/"
|
||||
sdk_dir_src = base_dir + "/../sdkjs/deploy/sdkjs/"
|
||||
|
||||
prefix_js = [
|
||||
vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs-native/common/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"
|
||||
]
|
||||
|
||||
postfix_js = [
|
||||
base_dir + "/../sdkjs/common/libfont/engine/fonts_native.js",
|
||||
base_dir + "/../sdkjs/common/Charts/ChartStyles.js"
|
||||
]
|
||||
|
||||
base.join_scripts(prefix_js, out_dir + "/banners.js")
|
||||
|
||||
base.create_dir(out_dir + "/word")
|
||||
base.join_scripts([out_dir + "/banners.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js"] + postfix_js, out_dir + "/word/script.bin")
|
||||
base.create_dir(out_dir + "/cell")
|
||||
base.join_scripts([out_dir + "/banners.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js"] + postfix_js, out_dir + "/cell/script.bin")
|
||||
base.create_dir(out_dir + "/slide")
|
||||
base.join_scripts([out_dir + "/banners.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js"] + postfix_js, out_dir + "/slide/script.bin")
|
||||
|
||||
base.delete_file(out_dir + "/banners.js")
|
||||
|
||||
# Write sdk version mark file if needed
|
||||
if (options.write_version):
|
||||
write_version_files(out_dir)
|
||||
@ -11,13 +11,13 @@ def make():
|
||||
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
server_dir = base.get_script_dir() + "/../../server"
|
||||
server_admin_panel_dir = base.get_script_dir() + "/../../server-admin-panel"
|
||||
branding_dir = server_dir + "/branding"
|
||||
|
||||
if("" != config.option("branding")):
|
||||
branding_dir = git_dir + '/' + config.option("branding") + '/server'
|
||||
|
||||
base.cmd_in_dir(server_dir, "npm", ["install"])
|
||||
base.cmd_in_dir(server_dir, "grunt", ["--no-color", "-v"] + base.server_addons_param())
|
||||
build_server_with_addons()
|
||||
|
||||
#env variables
|
||||
product_version = base.get_env('PRODUCT_VERSION')
|
||||
@ -30,30 +30,49 @@ def make():
|
||||
|
||||
cur_date = datetime.date.today().strftime("%m/%d/%Y")
|
||||
|
||||
server_build_dir = server_dir + "/build/server"
|
||||
|
||||
base.replaceInFileRE(server_build_dir + "/Common/sources/commondefines.js", "const buildNumber = [0-9]*", "const buildNumber = " + build_number)
|
||||
base.replaceInFileRE(server_build_dir + "/Common/sources/license.js", "const buildDate = '[0-9-/]*'", "const buildDate = '" + cur_date + "'")
|
||||
base.replaceInFileRE(server_build_dir + "/Common/sources/commondefines.js", "const buildVersion = '[0-9.]*'", "const buildVersion = '" + product_version + "'")
|
||||
base.replaceInFileRE(server_dir + "/Common/sources/commondefines.js", "const buildNumber = [0-9]*", "const buildNumber = " + build_number)
|
||||
base.replaceInFileRE(server_dir + "/Common/sources/license.js", "const buildDate = '[0-9-/]*'", "const buildDate = '" + cur_date + "'")
|
||||
base.replaceInFileRE(server_dir + "/Common/sources/commondefines.js", "const buildVersion = '[0-9.]*'", "const buildVersion = '" + product_version + "'")
|
||||
|
||||
custom_public_key = branding_dir + '/debug.js'
|
||||
|
||||
if(base.is_exist(custom_public_key)):
|
||||
base.copy_file(custom_public_key, server_build_dir + '/Common/sources')
|
||||
base.copy_file(custom_public_key, server_dir + '/Common/sources')
|
||||
|
||||
pkg_target = "node10"
|
||||
#node22 packaging has issue https://github.com/yao-pkg/pkg/issues/87
|
||||
pkg_target = "node20"
|
||||
|
||||
if ("linux" == base.host_platform()):
|
||||
pkg_target += "-linux"
|
||||
if (-1 != config.option("platform").find("linux_arm64")):
|
||||
pkg_target += "-arm64"
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
pkg_target += "-win"
|
||||
|
||||
base.cmd_in_dir(server_build_dir + "/DocService", "pkg", [".", "-t", pkg_target, "--options", "max_old_space_size=4096", "-o", "docservice"])
|
||||
base.cmd_in_dir(server_build_dir + "/FileConverter", "pkg", [".", "-t", pkg_target, "-o", "converter"])
|
||||
base.cmd_in_dir(server_build_dir + "/Metrics", "pkg", [".", "-t", pkg_target, "-o", "metrics"])
|
||||
base.cmd_in_dir(server_build_dir + "/SpellChecker", "pkg", [".", "-t", pkg_target, "-o", "spellchecker"])
|
||||
base.cmd_in_dir(server_dir + "/DocService", "pkg", [".", "-t", pkg_target, "--options", "max_old_space_size=6144", "-o", "docservice"])
|
||||
base.cmd_in_dir(server_dir + "/FileConverter", "pkg", [".", "-t", pkg_target, "-o", "converter"])
|
||||
base.cmd_in_dir(server_dir + "/Metrics", "pkg", [".", "-t", pkg_target, "-o", "metrics"])
|
||||
if "server-admin-panel" in base.get_server_addons() and base.is_exist(server_admin_panel_dir):
|
||||
base.cmd_in_dir(server_admin_panel_dir + "/server", "pkg", [".", "-t", pkg_target, "-o", "adminpanel"])
|
||||
|
||||
example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs"
|
||||
base.cmd_in_dir(example_dir, "npm", ["install"])
|
||||
base.delete_dir(example_dir + "/node_modules")
|
||||
base.cmd_in_dir(example_dir, "npm", ["ci"])
|
||||
base.cmd_in_dir(example_dir, "pkg", [".", "-t", pkg_target, "-o", "example"])
|
||||
|
||||
def build_server_with_addons():
|
||||
addons = {}
|
||||
addons["server"] = [True, False]
|
||||
addons.update(base.get_server_addons())
|
||||
for addon in addons:
|
||||
if (addon):
|
||||
addon_dir = base.get_script_dir() + "/../../" + addon
|
||||
if (base.is_exist(addon_dir + "/package.json")):
|
||||
base.print_info("npm ci: " + addon)
|
||||
base.cmd_in_dir(addon_dir, "npm", ["ci"])
|
||||
base.print_info("npm run build: " + addon)
|
||||
base.cmd_in_dir(addon_dir, "npm", ["run", "build"])
|
||||
|
||||
def build_server_develop():
|
||||
build_server_with_addons()
|
||||
|
||||
75
scripts/build_sln.py
Normal file
75
scripts/build_sln.py
Normal file
@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.path.dirname(__file__) + "/..")
|
||||
import sln
|
||||
import qmake
|
||||
|
||||
# make solution
|
||||
def make(solution=""):
|
||||
platforms = config.option("platform").split()
|
||||
for platform in platforms:
|
||||
if not platform in config.platforms:
|
||||
continue
|
||||
|
||||
print("------------------------------------------")
|
||||
print("BUILD_PLATFORM: " + platform)
|
||||
print("------------------------------------------")
|
||||
|
||||
if ("" == solution):
|
||||
solution = "./sln.json"
|
||||
projects = sln.get_projects(solution, platform)
|
||||
|
||||
for pro in projects:
|
||||
qmake_main_addon = ""
|
||||
if (0 == platform.find("android")) and (-1 != pro.find("X2tConverter.pro")):
|
||||
if config.check_option("config", "debug") and not config.check_option("config", "disable_x2t_debug_strip"):
|
||||
print("[WARNING:] temporary enable strip for x2t library in debug")
|
||||
qmake_main_addon += "build_strip_debug"
|
||||
|
||||
qmake.make(platform, pro, qmake_main_addon)
|
||||
if config.check_option("platform", "ios") and config.check_option("config", "bundle_xcframeworks"):
|
||||
qmake.make(platform, pro, "xcframework_platform_ios_simulator")
|
||||
|
||||
if config.check_option("module", "builder") and base.is_windows() and "onlyoffice" == config.branding():
|
||||
# check branding libs
|
||||
if (config.option("branding-name") == "onlyoffice"):
|
||||
for platform in platforms:
|
||||
if not platform in config.platforms:
|
||||
continue
|
||||
core_lib_unbranding_dir = os.getcwd() + "/../core/build/lib/" + platform + base.qt_dst_postfix()
|
||||
if not base.is_dir(core_lib_unbranding_dir):
|
||||
base.create_dir(core_lib_unbranding_dir)
|
||||
core_lib_branding_dir = os.getcwd() + "/../core/build/onlyoffice/lib/" + platform + base.qt_dst_postfix()
|
||||
base.copy_file(core_lib_branding_dir + "/doctrenderer.dll", core_lib_unbranding_dir + "/doctrenderer.dll")
|
||||
base.copy_file(core_lib_branding_dir + "/doctrenderer.lib", core_lib_unbranding_dir + "/doctrenderer.lib")
|
||||
|
||||
# check replace
|
||||
directory_builder_branding = os.getcwd() + "/../core/DesktopEditor/doctrenderer"
|
||||
if base.is_dir(directory_builder_branding):
|
||||
new_replace_path = base.correctPathForBuilder(directory_builder_branding + "/docbuilder.com/src/docbuilder.h")
|
||||
if ("2019" == config.option("vs-version")):
|
||||
base.make_sln_project("../core/DesktopEditor/doctrenderer/docbuilder.com/src", "docbuilder.com_2019.sln")
|
||||
if (True):
|
||||
new_path_net = base.correctPathForBuilder(directory_builder_branding + "/docbuilder.net/src/docbuilder.net.cpp")
|
||||
base.make_sln_project("../core/DesktopEditor/doctrenderer/docbuilder.net/src", "docbuilder.net.sln")
|
||||
base.restorePathForBuilder(new_path_net)
|
||||
else:
|
||||
base.make_sln_project("../core/DesktopEditor/doctrenderer/docbuilder.com/src", "docbuilder.com.sln")
|
||||
base.restorePathForBuilder(new_replace_path)
|
||||
|
||||
# build Java docbuilder wrapper
|
||||
if config.check_option("module", "builder") and "onlyoffice" == config.branding():
|
||||
for platform in platforms:
|
||||
if not platform in config.platforms:
|
||||
continue
|
||||
|
||||
# build JNI library
|
||||
qmake.make(platform, base.get_script_dir() + "/../../core/DesktopEditor/doctrenderer/docbuilder.java/src/jni/docbuilder_jni.pro", "", True)
|
||||
# build Java code to JAR
|
||||
base.cmd_in_dir(base.get_script_dir() + "/../../core/DesktopEditor/doctrenderer/docbuilder.java", "python", ["make.py"])
|
||||
|
||||
return
|
||||
@ -24,9 +24,9 @@ def parse():
|
||||
|
||||
# all platforms
|
||||
global platforms
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp",
|
||||
"linux_64", "linux_32",
|
||||
"mac_64",
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "win_arm64",
|
||||
"linux_64", "linux_32", "linux_arm64",
|
||||
"mac_64", "mac_arm64",
|
||||
"ios",
|
||||
"android_arm64_v8a", "android_armv7", "android_x86", "android_x86_64"]
|
||||
|
||||
@ -53,37 +53,98 @@ def parse():
|
||||
else:
|
||||
options["platform"] += (" mac_" + bits)
|
||||
|
||||
if ("mac" == host_platform) and check_option("platform", "mac_arm64") and not base.is_os_arm():
|
||||
if not check_option("platform", "mac_64"):
|
||||
options["platform"] = "mac_64 " + options["platform"]
|
||||
|
||||
if (False):
|
||||
# use qemu on deploy for emulation
|
||||
if ("windows" == host_platform) and check_option("platform", "win_arm64") and not base.is_os_arm():
|
||||
if not check_option("platform", "win_64"):
|
||||
options["platform"] = "win_64 " + options["platform"]
|
||||
|
||||
if check_option("platform", "xp") and ("windows" == host_platform):
|
||||
options["platform"] += " win_64_xp win_32_xp"
|
||||
|
||||
if check_option("platform", "android"):
|
||||
options["platform"] += " android_arm64_v8a android_armv7 android_x86 android_x86_64"
|
||||
|
||||
# check vs-version
|
||||
if ("windows" == host_platform) and ("" == option("vs-version")):
|
||||
options["vs-version"] = "2019"
|
||||
if check_option("platform", "win_64_xp") or check_option("platform", "win_32_xp"):
|
||||
options["vs-version"] = "2015"
|
||||
|
||||
if ("windows" == host_platform) and ("2019" == option("vs-version")):
|
||||
extend_option("config", "vs2019")
|
||||
|
||||
# sysroot setup
|
||||
if "linux" != host_platform and "sysroot" in options:
|
||||
options["sysroot"] = ""
|
||||
|
||||
if "linux" == host_platform and "sysroot" in options:
|
||||
if options["sysroot"] == "0":
|
||||
options["sysroot"] = ""
|
||||
elif options["sysroot"] == "1":
|
||||
dst_dir = os.path.abspath(base.get_script_dir(__file__) + '/../tools/linux/sysroot')
|
||||
dst_dir_amd64 = dst_dir + "/ubuntu16-amd64-sysroot"
|
||||
dst_dir_arm64 = dst_dir + "/ubuntu16-arm64-sysroot"
|
||||
if not base.is_dir(dst_dir_amd64) or not base.is_dir(dst_dir_arm64):
|
||||
base.cmd_in_dir(dst_dir, "python3", ["./fetch.py", "all"])
|
||||
options["sysroot_linux_64"] = dst_dir_amd64
|
||||
options["sysroot_linux_arm64"] = dst_dir_arm64
|
||||
else:
|
||||
# specific sysroot => one platform for build!
|
||||
options["sysroot"] = "1"
|
||||
options["sysroot_linux_64"] = options["sysroot"]
|
||||
options["sysroot_linux_arm64"] = options["sysroot"]
|
||||
|
||||
if is_cef_107():
|
||||
extend_option("config", "cef_version_107")
|
||||
if is_v8_60():
|
||||
extend_option("config", "v8_version_60")
|
||||
|
||||
# check vs-path
|
||||
if ("windows" == host_platform):
|
||||
options["vs-path"] = base.get_env("ProgramFiles") + "/Microsoft Visual Studio 14.0/VC"
|
||||
if ("windows" == host_platform) and ("" == option("vs-path")):
|
||||
programFilesDir = base.get_env("ProgramFiles")
|
||||
if ("" != base.get_env("ProgramFiles(x86)")):
|
||||
options["vs-path"] = base.get_env("ProgramFiles(x86)") + "/Microsoft Visual Studio 14.0/VC"
|
||||
programFilesDir = base.get_env("ProgramFiles(x86)")
|
||||
if ("2015" == options["vs-version"]):
|
||||
options["vs-path"] = programFilesDir + "/Microsoft Visual Studio 14.0/VC"
|
||||
elif ("2019" == options["vs-version"]):
|
||||
if base.is_dir(programFilesDir + "/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build"):
|
||||
options["vs-path"] = programFilesDir + "/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build"
|
||||
elif base.is_dir(programFilesDir + "/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build"):
|
||||
options["vs-path"] = programFilesDir + "/Microsoft Visual Studio/2019/Professional/VC/Auxiliary/Build"
|
||||
else:
|
||||
options["vs-path"] = programFilesDir + "/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build"
|
||||
|
||||
# check sdkjs-plugins
|
||||
if (option("sdkjs-plugin") == ""):
|
||||
if not "sdkjs-plugin" in options:
|
||||
options["sdkjs-plugin"] = "default"
|
||||
options["sdkjs-plugin"] = options["sdkjs-plugin"].replace("default", "photoeditor, macros, ocr, translator, speech, thesaurus, youtube, highlightcode")
|
||||
if not "sdkjs-plugin-server" in options:
|
||||
options["sdkjs-plugin-server"] = "default"
|
||||
|
||||
global sdkjs_addons
|
||||
sdkjs_addons = {}
|
||||
sdkjs_addons["comparison"] = "sdkjs-comparison"
|
||||
sdkjs_addons["content-controls"] = "sdkjs-content-controls"
|
||||
sdkjs_addons["pivot-tables"] = "sdkjs-pivot-tables"
|
||||
if check_option("platform", "ios"):
|
||||
if not check_option("config", "no_bundle_xcframeworks"):
|
||||
if not check_option("config", "bundle_xcframeworks"):
|
||||
extend_option("config", "bundle_xcframeworks")
|
||||
|
||||
global server_addons
|
||||
server_addons = {}
|
||||
server_addons["license"] = "server-license"
|
||||
server_addons["lockstorage"] = "server-lockstorage"
|
||||
if check_option("config", "bundle_xcframeworks"):
|
||||
if not check_option("config", "bundle_dylibs"):
|
||||
extend_option("config", "bundle_dylibs")
|
||||
|
||||
global web_apps_addons
|
||||
web_apps_addons = {}
|
||||
web_apps_addons["mobile"] = "web-apps-mobile"
|
||||
if ("mac" == host_platform) and check_option("module", "desktop"):
|
||||
if not check_option("config", "bundle_dylibs"):
|
||||
extend_option("config", "bundle_dylibs")
|
||||
|
||||
if check_option("use-system-qt", "1"):
|
||||
base.cmd_in_dir(base.get_script_dir() + "/../tools/linux", "python", ["use_system_qt.py"])
|
||||
options["qt-dir"] = base.get_script_dir() + "/../tools/linux/system_qt"
|
||||
|
||||
# disable all warnings (enable if needed with core_enable_all_warnings options)
|
||||
if not check_option("config", "core_enable_all_warnings"):
|
||||
extend_option("config", "core_disable_all_warnings")
|
||||
|
||||
return
|
||||
|
||||
@ -98,11 +159,17 @@ def check_compiler(platform):
|
||||
return compiler
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
compiler["compiler"] = "msvc2015"
|
||||
compiler["compiler_64"] = "msvc2015_64"
|
||||
compiler["compiler"] = "msvc" + options["vs-version"]
|
||||
compiler["compiler_64"] = "msvc" + options["vs-version"] + "_64"
|
||||
if (0 == platform.find("win_arm")):
|
||||
compiler["compiler"] = "msvc" + options["vs-version"] + "_arm"
|
||||
compiler["compiler_64"] = "msvc" + options["vs-version"] + "_arm64"
|
||||
elif (0 == platform.find("linux")):
|
||||
compiler["compiler"] = "gcc"
|
||||
compiler["compiler_64"] = "gcc_64"
|
||||
if (0 == platform.find("linux_arm")) and not base.is_os_arm():
|
||||
compiler["compiler"] = "gcc_arm"
|
||||
compiler["compiler_64"] = "gcc_arm64"
|
||||
elif (0 == platform.find("mac")):
|
||||
compiler["compiler"] = "clang"
|
||||
compiler["compiler_64"] = "clang_64"
|
||||
@ -113,6 +180,12 @@ def check_compiler(platform):
|
||||
compiler["compiler"] = platform
|
||||
compiler["compiler_64"] = platform
|
||||
|
||||
if base.host_platform() == "mac":
|
||||
if not base.is_dir(options["qt-dir"] + "/" + compiler["compiler_64"]):
|
||||
if base.is_dir(options["qt-dir"] + "/macos"):
|
||||
compiler["compiler"] = "macos"
|
||||
compiler["compiler_64"] = "macos"
|
||||
|
||||
return compiler
|
||||
|
||||
def check_option(name, value):
|
||||
@ -134,8 +207,88 @@ def extend_option(name, value):
|
||||
else:
|
||||
options[name] = value
|
||||
|
||||
def set_option(name, value):
|
||||
options[name] = value
|
||||
|
||||
def branding():
|
||||
branding = option("branding-name")
|
||||
if ("" == branding):
|
||||
branding = "onlyoffice"
|
||||
return branding
|
||||
|
||||
def is_mobile_platform():
|
||||
all_platforms = option("platform")
|
||||
if (-1 != all_platforms.find("android")):
|
||||
return True
|
||||
if (-1 != all_platforms.find("ios")):
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_custom_sysroot_bin(platform):
|
||||
use_platform = platform
|
||||
if "linux_arm64" == platform and not base.is_os_arm():
|
||||
# use cross compiler
|
||||
use_platform = "linux_64"
|
||||
|
||||
return option("sysroot_" + use_platform) + "/usr/bin"
|
||||
|
||||
def get_custom_sysroot_lib(platform, isNatural=False):
|
||||
use_platform = platform
|
||||
if "linux_arm64" == platform and not base.is_os_arm() and not isNatural:
|
||||
# use cross compiler
|
||||
use_platform = "linux_64"
|
||||
|
||||
if ("linux_64" == use_platform):
|
||||
return option("sysroot_linux_64") + "/usr/lib/x86_64-linux-gnu"
|
||||
if ("linux_arm64" == use_platform):
|
||||
return option("sysroot_linux_arm64") + "/usr/lib/aarch64-linux-gnu"
|
||||
return ""
|
||||
|
||||
def parse_defaults():
|
||||
defaults_path = base.get_script_dir() + "/../defaults"
|
||||
if ("" != option("branding")):
|
||||
defaults_path_branding = base.get_script_dir() + "/../../" + option("branding") + "/build_tools/defaults"
|
||||
if base.is_file(defaults_path_branding):
|
||||
defaults_path = defaults_path_branding
|
||||
defaults_file = open(defaults_path, "r")
|
||||
defaults_options = {}
|
||||
for line in defaults_file:
|
||||
name, value = line.partition("=")[::2]
|
||||
k = name.strip()
|
||||
v = value.strip(" '\"\r\n")
|
||||
if ("true" == v.lower()):
|
||||
v = "1"
|
||||
if ("false" == v.lower()):
|
||||
v = "0"
|
||||
defaults_options[k] = v
|
||||
|
||||
for name in defaults_options:
|
||||
if name in options:
|
||||
options[name] = options[name].replace("default", defaults_options[name])
|
||||
else:
|
||||
options[name] = defaults_options[name]
|
||||
|
||||
if ("config_addon" in defaults_options):
|
||||
extend_option("config", defaults_options["config_addon"])
|
||||
|
||||
return
|
||||
|
||||
def is_cef_107():
|
||||
if ("linux" == base.host_platform()) and (5004 > base.get_gcc_version()) and not check_option("platform", "android"):
|
||||
return True
|
||||
return False
|
||||
|
||||
def is_v8_60():
|
||||
if check_option("platform", "linux_arm64"):
|
||||
return False
|
||||
|
||||
if ("linux" == base.host_platform()) and (5004 > base.get_gcc_version()) and not check_option("platform", "android"):
|
||||
return True
|
||||
|
||||
if ("windows" == base.host_platform()) and ("2015" == option("vs-version")):
|
||||
return True
|
||||
|
||||
#if check_option("config", "use_v8"):
|
||||
# return True
|
||||
|
||||
return False
|
||||
|
||||
44
scripts/core_common/make_common.py
Normal file → Executable file
44
scripts/core_common/make_common.py
Normal file → Executable file
@ -6,17 +6,61 @@ sys.path.append('..')
|
||||
|
||||
import config
|
||||
import base
|
||||
import glob
|
||||
|
||||
import boost
|
||||
import cef
|
||||
import icu
|
||||
import openssl
|
||||
import curl
|
||||
import websocket_all
|
||||
import v8
|
||||
import html2
|
||||
import iwork
|
||||
import md
|
||||
import hunspell
|
||||
import glew
|
||||
import harfbuzz
|
||||
import oo_brotli
|
||||
import hyphen
|
||||
import googletest
|
||||
import libvlc
|
||||
import heif
|
||||
|
||||
def check_android_ndk_macos_arm(dir):
|
||||
if base.is_dir(dir + "/darwin-x86_64") and not base.is_dir(dir + "/darwin-arm64"):
|
||||
print("copy toolchain... [" + dir + "]")
|
||||
base.copy_dir(dir + "/darwin-x86_64", dir + "/darwin-arm64")
|
||||
return
|
||||
|
||||
|
||||
def make():
|
||||
if (config.check_option("platform", "android")) and (base.host_platform() == "mac") and (base.is_os_arm()):
|
||||
for toolchain in glob.glob(base.get_env("ANDROID_NDK_ROOT") + "/toolchains/*"):
|
||||
if base.is_dir(toolchain):
|
||||
check_android_ndk_macos_arm(toolchain + "/prebuilt")
|
||||
|
||||
boost.make()
|
||||
cef.make()
|
||||
icu.make()
|
||||
openssl.make()
|
||||
v8.make()
|
||||
html2.make()
|
||||
iwork.make(False)
|
||||
md.make()
|
||||
hunspell.make(False)
|
||||
harfbuzz.make()
|
||||
glew.make()
|
||||
hyphen.make()
|
||||
googletest.make()
|
||||
oo_brotli.make()
|
||||
heif.make()
|
||||
|
||||
if config.check_option("build-libvlc", "1"):
|
||||
libvlc.make()
|
||||
|
||||
if config.check_option("module", "mobile"):
|
||||
if (config.check_option("platform", "android")):
|
||||
curl.make()
|
||||
websocket_all.make()
|
||||
return
|
||||
|
||||
163
scripts/core_common/modules/android/android_ndk.py
Executable file
163
scripts/core_common/modules/android/android_ndk.py
Executable file
@ -0,0 +1,163 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../../scripts')
|
||||
import base
|
||||
import os
|
||||
import re
|
||||
|
||||
def get_android_ndk_version():
|
||||
env_val = base.get_env("ANDROID_NDK_ROOT")
|
||||
if (env_val == ""):
|
||||
env_val = "21.1.6352462"
|
||||
return env_val.strip("/").split("/")[-1]
|
||||
|
||||
def get_android_ndk_version_major():
|
||||
val = get_android_ndk_version().split(".")[0]
|
||||
val = re.sub("[^0-9]", "", val)
|
||||
return int(val)
|
||||
|
||||
def get_sdk_api():
|
||||
if (23 > get_android_ndk_version_major()):
|
||||
return "21"
|
||||
return "23"
|
||||
|
||||
global archs
|
||||
archs = ["arm64", "arm", "x86_64", "x86"]
|
||||
|
||||
global platforms
|
||||
platforms = {
|
||||
"arm64" : {
|
||||
"abi" : "arm64-v8a",
|
||||
"target" : "aarch64-linux-android",
|
||||
"dst" : "arm64_v8a",
|
||||
"api" : get_sdk_api(),
|
||||
"old" : "aarch64-linux-android"
|
||||
},
|
||||
"arm" : {
|
||||
"abi" : "armeabi-v7a",
|
||||
"target" : "armv7a-linux-androideabi",
|
||||
"dst" : "armv7",
|
||||
"api" : get_sdk_api(),
|
||||
"old" : "arm-linux-android"
|
||||
},
|
||||
"x86_64" : {
|
||||
"arch" : "x86_64",
|
||||
"target" : "x86_64-linux-android",
|
||||
"dst" : "x86_64",
|
||||
"api" : get_sdk_api(),
|
||||
"old" : "x86_64-linux-android"
|
||||
},
|
||||
"x86" : {
|
||||
"arch" : "x86",
|
||||
"target" : "i686-linux-android",
|
||||
"dst" : "x86",
|
||||
"api" : get_sdk_api(),
|
||||
"old" : "i686-linux-android"
|
||||
}
|
||||
}
|
||||
|
||||
# todo: check arm host!
|
||||
global host
|
||||
|
||||
if ("linux" == base.host_platform()):
|
||||
host = {
|
||||
"name" : "linux",
|
||||
"arch" : "linux-x86_64"
|
||||
}
|
||||
else:
|
||||
host = {
|
||||
"name" : "darwin",
|
||||
"arch" : "darwin-x86_64"
|
||||
}
|
||||
|
||||
def get_options_dict_as_array(opts):
|
||||
value = []
|
||||
for key in opts:
|
||||
value.append(key + "=" + opts[key])
|
||||
return value
|
||||
|
||||
def get_options_array_as_string(opts):
|
||||
return " ".join(opts)
|
||||
|
||||
def ndk_dir():
|
||||
return base.get_env("ANDROID_NDK_ROOT")
|
||||
|
||||
def sdk_dir():
|
||||
ndk_path = ndk_dir()
|
||||
if (-1 != ndk_path.find("/ndk/")):
|
||||
return ndk_path + "/../.."
|
||||
return ndk_path + "/.."
|
||||
|
||||
def toolchain_dir():
|
||||
return ndk_dir() + "/toolchains/llvm/prebuilt/" + host["arch"]
|
||||
|
||||
def prepare_platform(arch, cpp_standard=11):
|
||||
target = platforms[arch]["target"]
|
||||
api = platforms[arch]["api"]
|
||||
|
||||
ndk_directory = ndk_dir()
|
||||
toolchain = toolchain_dir()
|
||||
|
||||
base.set_env("TARGET", target)
|
||||
base.set_env("TOOLCHAIN", toolchain)
|
||||
base.set_env("NDK_STANDARD_ROOT", toolchain)
|
||||
base.set_env("ANDROIDVER", api)
|
||||
base.set_env("ANDROID_API", api)
|
||||
|
||||
base.set_env("AR", toolchain + "/bin/llvm-ar")
|
||||
base.set_env("AS", toolchain + "/bin/llvm-as")
|
||||
base.set_env("LD", toolchain + "/bin/ld")
|
||||
base.set_env("RANLIB", toolchain + "/bin/llvm-ranlib")
|
||||
base.set_env("STRIP", toolchain + "/bin/llvm-strip")
|
||||
|
||||
base.set_env("CC", target + api + "-clang")
|
||||
base.set_env("CXX", target + api + "-clang++")
|
||||
|
||||
ld_flags = "-Wl,--gc-sections,-rpath-link=" + toolchain + "/sysroot/usr/lib/"
|
||||
if (23 > get_android_ndk_version_major()):
|
||||
ld_flags += (" -L" + toolchain + "/" + platforms[arch]["old"] + "/lib")
|
||||
ld_flags += (" -L" + toolchain + "/sysroot/usr/lib/" + platforms[arch]["old"] + "/" + api)
|
||||
|
||||
base.set_env("LDFLAGS", ld_flags)
|
||||
base.set_env("PATH", toolchain + "/bin" + os.pathsep + base.get_env("PATH"))
|
||||
|
||||
cflags = [
|
||||
"-Os",
|
||||
"-ffunction-sections",
|
||||
"-fdata-sections",
|
||||
"-fvisibility=hidden",
|
||||
|
||||
"-Wno-unused-function",
|
||||
|
||||
"-fPIC",
|
||||
|
||||
"-I" + toolchain + "/sysroot/usr/include",
|
||||
|
||||
"-D__ANDROID_API__=" + api,
|
||||
"-DANDROID"
|
||||
]
|
||||
|
||||
cflags_string = " ".join(cflags)
|
||||
cppflags_string = cflags_string
|
||||
|
||||
if (cpp_standard >= 11):
|
||||
cppflags_string += " -std=c++11"
|
||||
|
||||
base.set_env("CFLAGS", cflags_string)
|
||||
base.set_env("CXXFLAGS", cppflags_string)
|
||||
base.set_env("CPPPLAGS", cflags_string)
|
||||
return
|
||||
|
||||
def extend_cflags(params):
|
||||
base.set_env("CFLAGS", base.get_env("CFLAGS") + " " + params)
|
||||
base.set_env("CPPFLAGS", base.get_env("CFLAGS"))
|
||||
return
|
||||
|
||||
def extend_cxxflags(params):
|
||||
base.set_env("CXXFLAGS", base.get_env("CXXFLAGS") + " " + params)
|
||||
return
|
||||
|
||||
def extend_ldflags(params):
|
||||
base.set_env("LDFLAGS", base.get_env("LDFLAGS") + " " + params)
|
||||
return
|
||||
94
scripts/core_common/modules/android/curl_android.py
Executable file
94
scripts/core_common/modules/android/curl_android.py
Executable file
@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../../scripts')
|
||||
import base
|
||||
import os
|
||||
import android_ndk
|
||||
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/curl"
|
||||
current_dir = os.path.abspath(current_dir)
|
||||
if not current_dir.endswith("/"):
|
||||
current_dir += "/"
|
||||
|
||||
lib_version = "curl-7_68_0"
|
||||
lib_name = "curl-7.68.0"
|
||||
|
||||
def fetch():
|
||||
if not base.is_dir(current_dir + lib_name):
|
||||
base.cmd("curl", ["-L", "-s", "-o", current_dir + lib_name + ".tar.gz",
|
||||
"https://github.com/curl/curl/releases/download/" + lib_version + "/" + lib_name + ".tar.gz"])
|
||||
base.cmd("tar", ["xfz", current_dir + lib_name + ".tar.gz", "-C", current_dir])
|
||||
return
|
||||
|
||||
def build_host():
|
||||
return
|
||||
|
||||
def build_arch(arch):
|
||||
dst_dir = current_dir + "build/android/" + android_ndk.platforms[arch]["dst"]
|
||||
if base.is_dir(dst_dir):
|
||||
return
|
||||
|
||||
android_ndk.prepare_platform(arch)
|
||||
|
||||
ndk_dir = android_ndk.ndk_dir()
|
||||
toolchain = android_ndk.toolchain_dir()
|
||||
|
||||
base.set_env("ANDROID_NDK_HOME", ndk_dir)
|
||||
base.set_env("ANDROID_NDK", ndk_dir)
|
||||
|
||||
arch_build_dir = os.path.abspath(current_dir + "build/android/tmp")
|
||||
base.create_dir(arch_build_dir)
|
||||
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(current_dir + lib_name)
|
||||
|
||||
params = []
|
||||
if ("arm64" == arch):
|
||||
params.append("--host=aarch64-linux-android")
|
||||
elif ("arm" == arch):
|
||||
params.append("--host=arm-linux-androideabi")
|
||||
elif ("x86_64" == arch):
|
||||
params.append("--host=x86_64-linux-android")
|
||||
elif ("x86" == arch):
|
||||
params.append("--host=i686-linux-android")
|
||||
|
||||
openssl_dir = os.path.abspath(current_dir + "../openssl/build/android/" + android_ndk.platforms[arch]["dst"])
|
||||
|
||||
params.append("--enable-ipv6")
|
||||
params.append("--enable-static")
|
||||
params.append("--disable-shared")
|
||||
params.append("--prefix=" + arch_build_dir)
|
||||
params.append("--with-ssl=" + openssl_dir)
|
||||
|
||||
base.cmd("./configure", params)
|
||||
|
||||
base.cmd("make", ["clean"])
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"])
|
||||
|
||||
os.chdir(old_cur)
|
||||
|
||||
base.create_dir(dst_dir)
|
||||
base.copy_file(arch_build_dir + "/lib/libcurl.a", dst_dir)
|
||||
base.copy_dir(arch_build_dir + "/include", current_dir + "build/android/include")
|
||||
|
||||
base.delete_dir(arch_build_dir)
|
||||
return
|
||||
|
||||
def make():
|
||||
old_env = dict(os.environ)
|
||||
|
||||
fetch()
|
||||
|
||||
build_host()
|
||||
|
||||
for arch in android_ndk.archs:
|
||||
build_arch(arch)
|
||||
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
return
|
||||
|
||||
if __name__ == "__main__":
|
||||
make()
|
||||
142
scripts/core_common/modules/android/icu_android.py
Executable file
142
scripts/core_common/modules/android/icu_android.py
Executable file
@ -0,0 +1,142 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../../scripts')
|
||||
import base
|
||||
import os
|
||||
import android_ndk
|
||||
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu/android"
|
||||
current_dir = os.path.abspath(current_dir)
|
||||
if not current_dir.endswith("/"):
|
||||
current_dir += "/"
|
||||
|
||||
icu_major = "74"
|
||||
icu_minor = "2"
|
||||
|
||||
options = {
|
||||
"--enable-strict" : "no",
|
||||
"--enable-extras" : "no",
|
||||
"--enable-draft" : "yes",
|
||||
"--enable-samples" : "no",
|
||||
"--enable-tests" : "no",
|
||||
"--enable-renaming" : "yes",
|
||||
"--enable-icuio" : "no",
|
||||
"--enable-layoutex" : "no",
|
||||
"--with-library-bits" : "nochange",
|
||||
"--with-library-suffix" : "",
|
||||
"--enable-static" : "yes",
|
||||
"--enable-shared" : "no",
|
||||
"--with-data-packaging" : "archive"
|
||||
}
|
||||
|
||||
cpp_flags_base = [
|
||||
"-Os",
|
||||
"-ffunction-sections",
|
||||
"-fdata-sections",
|
||||
"-fvisibility=hidden",
|
||||
"-fPIC"
|
||||
]
|
||||
|
||||
cpp_flags = [
|
||||
"-fno-short-wchar",
|
||||
"-fno-short-enums",
|
||||
|
||||
"-DU_USING_ICU_NAMESPACE=0",
|
||||
"-DU_HAVE_NL_LANGINFO_CODESET=0",
|
||||
"-DU_TIMEZONE=0",
|
||||
"-DU_DISABLE_RENAMING=0",
|
||||
|
||||
"-DUCONFIG_NO_COLLATION=0",
|
||||
"-DUCONFIG_NO_FORMATTING=0",
|
||||
"-DUCONFIG_NO_REGULAR_EXPRESSIONS=0",
|
||||
"-DUCONFIG_NO_TRANSLITERATION=0",
|
||||
|
||||
"-DU_STATIC_IMPLEMENTATION"
|
||||
]
|
||||
|
||||
def fetch_icu(major, minor):
|
||||
if not base.is_dir(current_dir + "icu"):
|
||||
base.cmd("git", ["clone", "--depth", "1", "--branch", "release-" + major + "-" + minor, "https://github.com/unicode-org/icu.git", current_dir + "icu2"])
|
||||
base.copy_dir(current_dir + "icu2/icu4c", current_dir + "icu")
|
||||
base.delete_dir_with_access_error(current_dir + "icu2")
|
||||
return
|
||||
|
||||
def build_host():
|
||||
cross_build_dir = os.path.abspath(current_dir + "icu/cross_build")
|
||||
if not base.is_dir(cross_build_dir):
|
||||
base.create_dir(cross_build_dir)
|
||||
os.chdir(cross_build_dir)
|
||||
|
||||
ld_flags = "-pthread"
|
||||
if ("linux" == base.host_platform()):
|
||||
ld_flags += " -Wl,--gc-sections"
|
||||
else:
|
||||
# gcc on OSX does not support --gc-sections
|
||||
ld_flags += " -Wl,-dead_strip"
|
||||
|
||||
base.set_env("LDFLAGS", ld_flags)
|
||||
base.set_env("CPPFLAGS", android_ndk.get_options_array_as_string(cpp_flags_base + cpp_flags))
|
||||
|
||||
host_type = "Linux"
|
||||
if ("mac" == base.host_platform()):
|
||||
host_type = "MacOSX/GCC"
|
||||
|
||||
base.cmd("../source/runConfigureICU", [host_type, "--prefix=" + cross_build_dir] + android_ndk.get_options_dict_as_array(options))
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
|
||||
base.create_dir(current_dir + "build")
|
||||
base.copy_dir(cross_build_dir + "/include", current_dir + "build/include")
|
||||
|
||||
os.chdir(current_dir)
|
||||
return
|
||||
|
||||
def build_arch(arch):
|
||||
dst_dir = current_dir + "build/" + android_ndk.platforms[arch]["dst"]
|
||||
if base.is_dir(dst_dir):
|
||||
return
|
||||
|
||||
android_ndk.prepare_platform(arch)
|
||||
android_ndk.extend_cflags(" ".join(cpp_flags))
|
||||
|
||||
ndk_dir = android_ndk.ndk_dir()
|
||||
toolchain = android_ndk.toolchain_dir()
|
||||
|
||||
cross_build_dir = os.path.abspath(current_dir + "icu/cross_build")
|
||||
arch_build_dir = os.path.abspath(current_dir + "build/tmp")
|
||||
base.create_dir(arch_build_dir)
|
||||
|
||||
os.chdir(arch_build_dir)
|
||||
base.cmd("./../../icu/source/configure", ["--with-cross-build=" + cross_build_dir] +
|
||||
android_ndk.get_options_dict_as_array(options) + ["--host=" + android_ndk.platforms[arch]["target"], "--prefix=" + arch_build_dir])
|
||||
base.cmd("make", ["-j4"])
|
||||
os.chdir(current_dir)
|
||||
|
||||
base.create_dir(dst_dir)
|
||||
base.copy_file(arch_build_dir + "/lib/libicuuc.a", dst_dir)
|
||||
base.copy_file(arch_build_dir + "/stubdata/libicudata.a", dst_dir)
|
||||
base.copy_file(arch_build_dir + "/data/out/icudt" + icu_major + "l.dat", dst_dir)
|
||||
|
||||
base.delete_dir(arch_build_dir)
|
||||
return
|
||||
|
||||
def make():
|
||||
if not base.is_dir(current_dir):
|
||||
base.create_dir(current_dir)
|
||||
|
||||
old_env = dict(os.environ)
|
||||
|
||||
fetch_icu(icu_major, icu_minor)
|
||||
|
||||
build_host()
|
||||
|
||||
for arch in android_ndk.archs:
|
||||
build_arch(arch)
|
||||
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
return
|
||||
|
||||
if __name__ == "__main__":
|
||||
make()
|
||||
94
scripts/core_common/modules/android/openssl_android.py
Executable file
94
scripts/core_common/modules/android/openssl_android.py
Executable file
@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../../scripts')
|
||||
import base
|
||||
import os
|
||||
import android_ndk
|
||||
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/openssl"
|
||||
current_dir = os.path.abspath(current_dir)
|
||||
if not current_dir.endswith("/"):
|
||||
current_dir += "/"
|
||||
|
||||
lib_name="openssl-1.1.1t"
|
||||
|
||||
options = [
|
||||
"no-shared",
|
||||
"no-tests",
|
||||
"enable-ssl3",
|
||||
"enable-ssl3-method",
|
||||
"enable-md2",
|
||||
"no-asm"
|
||||
]
|
||||
|
||||
def fetch():
|
||||
if not base.is_dir(current_dir + lib_name):
|
||||
base.cmd("curl", ["-L", "-s", "-o", current_dir + lib_name + ".tar.gz",
|
||||
"https://www.openssl.org/source/" + lib_name + ".tar.gz"])
|
||||
base.cmd("tar", ["xfz", current_dir + lib_name + ".tar.gz", "-C", current_dir])
|
||||
return
|
||||
|
||||
def build_host():
|
||||
# not needed, just create directories
|
||||
if not base.is_dir(current_dir + "/build"):
|
||||
base.create_dir(current_dir + "/build")
|
||||
if not base.is_dir(current_dir + "/build/android"):
|
||||
base.create_dir(current_dir + "/build/android")
|
||||
return
|
||||
|
||||
def build_arch(arch):
|
||||
dst_dir = current_dir + "build/android/" + android_ndk.platforms[arch]["dst"]
|
||||
if base.is_dir(dst_dir):
|
||||
return
|
||||
|
||||
android_ndk.prepare_platform(arch)
|
||||
|
||||
ndk_dir = android_ndk.ndk_dir()
|
||||
toolchain = android_ndk.toolchain_dir()
|
||||
|
||||
base.set_env("ANDROID_NDK_HOME", ndk_dir)
|
||||
base.set_env("ANDROID_NDK", ndk_dir)
|
||||
|
||||
arch_build_dir = os.path.abspath(current_dir + "build/android/tmp")
|
||||
base.create_dir(arch_build_dir)
|
||||
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(current_dir + lib_name)
|
||||
|
||||
base.cmd("./Configure", ["android-" + arch, "--prefix=" + arch_build_dir, "-D__ANDROID_API__=" + android_ndk.platforms[arch]["api"]] + options)
|
||||
|
||||
base.replaceInFile("./Makefile", "LIB_CFLAGS=", "LIB_CFLAGS=-fvisibility=hidden ")
|
||||
base.replaceInFile("./Makefile", "LIB_CXXFLAGS=", "LIB_CXXFLAGS=-fvisibility=hidden ")
|
||||
|
||||
base.cmd("make", ["clean"])
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"])
|
||||
|
||||
os.chdir(old_cur)
|
||||
|
||||
base.create_dir(dst_dir)
|
||||
base.create_dir(dst_dir + "/lib")
|
||||
base.copy_file(arch_build_dir + "/lib/libcrypto.a", dst_dir + "/lib")
|
||||
base.copy_file(arch_build_dir + "/lib/libssl.a", dst_dir + "/lib")
|
||||
base.copy_dir(arch_build_dir + "/include", dst_dir + "/include")
|
||||
|
||||
base.delete_dir(arch_build_dir)
|
||||
return
|
||||
|
||||
def make():
|
||||
old_env = dict(os.environ)
|
||||
|
||||
fetch()
|
||||
|
||||
build_host()
|
||||
|
||||
for arch in android_ndk.archs:
|
||||
build_arch(arch)
|
||||
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
return
|
||||
|
||||
if __name__ == "__main__":
|
||||
make()
|
||||
@ -6,7 +6,7 @@ import config
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
import boost_android
|
||||
import boost_qt
|
||||
|
||||
def move_debug_libs_windows(dir):
|
||||
base.create_dir(dir + "/debug")
|
||||
@ -22,10 +22,10 @@ def move_debug_libs_windows(dir):
|
||||
|
||||
def clean():
|
||||
if base.is_dir("boost_1_58_0"):
|
||||
base.delete_dir_with_access_error("boost_1_58_0");
|
||||
base.delete_dir_with_access_error("boost_1_58_0")
|
||||
base.delete_dir("boost_1_58_0")
|
||||
if base.is_dir("boost_1_72_0"):
|
||||
base.delete_dir_with_access_error("boost_1_72_0");
|
||||
base.delete_dir_with_access_error("boost_1_72_0")
|
||||
base.delete_dir("boost_1_72_0")
|
||||
if base.is_dir("build"):
|
||||
base.delete_dir("build")
|
||||
@ -67,48 +67,90 @@ def make():
|
||||
# build
|
||||
if ("windows" == base.host_platform()):
|
||||
win_toolset = "msvc-14.0"
|
||||
if (-1 != config.option("platform").find("win_64")) and not base.is_dir("../build/win_64"):
|
||||
base.cmd("bootstrap.bat")
|
||||
win_boot_arg = "vc14"
|
||||
win_vs_version = "vc140"
|
||||
if (config.option("vs-version") == "2019"):
|
||||
win_toolset = "msvc-14.2"
|
||||
win_boot_arg = "vc142"
|
||||
win_vs_version = "vc142"
|
||||
|
||||
# add "define=_ITERATOR_DEBUG_LEVEL=0" to b2 args before install for disable _ITERATOR_DEBUG_LEVEL
|
||||
if (-1 != config.option("platform").find("win_64")) and not base.is_file("../build/win_64/lib/libboost_system-" + win_vs_version + "-mt-x64-1_72.lib"):
|
||||
base.cmd("bootstrap.bat", [win_boot_arg])
|
||||
base.cmd("b2.exe", ["headers"])
|
||||
base.cmd("b2.exe", ["--clean"])
|
||||
base.cmd("b2.exe", ["--prefix=./../build/win_64", "link=static", "--with-filesystem", "--with-system", "--with-date_time", "--with-regex", "--toolset=" + win_toolset, "address-model=64", "install"])
|
||||
if (-1 != config.option("platform").find("win_32")) and not base.is_dir("../build/win_32"):
|
||||
base.cmd("bootstrap.bat")
|
||||
if (-1 != config.option("platform").find("win_32")) and not base.is_file("../build/win_32/lib/libboost_system-" + win_vs_version + "-mt-x32-1_72.lib"):
|
||||
base.cmd("bootstrap.bat", [win_boot_arg])
|
||||
base.cmd("b2.exe", ["headers"])
|
||||
base.cmd("b2.exe", ["--clean"])
|
||||
base.cmd("b2.exe", ["--prefix=./../build/win_32", "link=static", "--with-filesystem", "--with-system", "--with-date_time", "--with-regex", "--toolset=" + win_toolset, "address-model=32", "install"])
|
||||
if (-1 != config.option("platform").find("win_arm64") and not base.is_file("../build/win_arm64/lib/libboost_system-" + win_vs_version + "-mt-a64-1_72.lib")):
|
||||
boost_bat = []
|
||||
boost_bat.append("call bootstrap.bat " + win_boot_arg) # first build b2 for win64, so vcvarsall_call with arm64 later
|
||||
vcvarsall_call = ("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + "x64_arm64")
|
||||
boost_bat.append(vcvarsall_call)
|
||||
boost_bat.append("call b2.exe headers")
|
||||
boost_bat.append("call b2.exe --clean")
|
||||
boost_bat.append("call b2.exe --prefix=./../build/win_arm64 architecture=arm link=static --with-filesystem --with-system --with-date_time --with-regex --toolset=" + win_toolset + " address-model=64 install")
|
||||
base.run_as_bat(boost_bat)
|
||||
correct_install_includes_win(base_dir, "win_64")
|
||||
correct_install_includes_win(base_dir, "win_32")
|
||||
correct_install_includes_win(base_dir, "win_32")
|
||||
correct_install_includes_win(base_dir, "win_arm64")
|
||||
|
||||
if (-1 != config.option("platform").find("linux")) and not base.is_dir("../build/linux_64"):
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex"])
|
||||
base.cmd("./b2", ["headers"])
|
||||
base.cmd("./b2", ["--clean"])
|
||||
base.cmd("./b2", ["--prefix=./../build/linux_64", "link=static", "cxxflags=-fPIC", "install"])
|
||||
if config.check_option("platform", "linux_64") and not base.is_dir("../build/linux_64"):
|
||||
if config.option("sysroot") == "":
|
||||
addon_config = []
|
||||
addon_compile = []
|
||||
if "1" == config.option("use-clang"):
|
||||
addon_config = ["--with-toolset=clang"]
|
||||
addon_compile = ["cxxflags=-stdlib=libc++", "linkflags=-stdlib=libc++", "define=_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION"]
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex"] + addon_config)
|
||||
base.cmd("./b2", ["headers"])
|
||||
base.cmd("./b2", ["--clean"])
|
||||
base.cmd("./b2", ["--prefix=./../build/linux_64", "link=static", "cxxflags=-fPIC"] + addon_compile + ["install"])
|
||||
else: # build via qmake when custom sysroot is needed
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "linux_64")
|
||||
directory_build = base_dir + "/build/linux_64/lib"
|
||||
base.delete_file(directory_build + "/libboost_system.a")
|
||||
base.delete_file(directory_build + "/libboost_system.dylib")
|
||||
base.copy_files(directory_build + "/linux_64/*.a", directory_build)
|
||||
# TODO: support x86
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
|
||||
clang_correct()
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex"])
|
||||
base.cmd("./b2", ["headers"])
|
||||
base.cmd("./b2", ["--clean"])
|
||||
base.cmd("./b2", ["--prefix=./../build/mac_64", "link=static", "install"])
|
||||
if config.check_option("platform", "linux_arm64") and not base.is_dir("../build/linux_arm64"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "linux_arm64")
|
||||
directory_build = base_dir + "/build/linux_arm64/lib"
|
||||
base.delete_file(directory_build + "/libboost_system.a")
|
||||
base.delete_file(directory_build + "/libboost_system.so")
|
||||
base.copy_files(directory_build + "/linux_arm64/*.a", directory_build)
|
||||
|
||||
if (-1 != config.option("platform").find("ios")) and not base.is_dir("../build/ios"):
|
||||
old_cur2 = os.getcwd()
|
||||
clang_correct()
|
||||
os.chdir("../")
|
||||
base.bash("./boost_ios")
|
||||
os.chdir(old_cur2)
|
||||
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
platforms = config.option("platform").split()
|
||||
for platform in platforms:
|
||||
if not platform in config.platforms:
|
||||
continue
|
||||
if (0 != platform.find("android")):
|
||||
continue
|
||||
if (base.is_dir("../build/" + platform)):
|
||||
continue
|
||||
boost_android.make(platform[8:])
|
||||
if (-1 != config.option("platform").find("ios")) and not base.is_dir("../build/ios_xcframework"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "ios_xcframework/ios_simulator", "xcframework_platform_ios_simulator")
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "ios_xcframework/ios")
|
||||
|
||||
if (-1 != config.option("platform").find("android")) and not base.is_dir("../build/android"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"])
|
||||
|
||||
if config.check_option("platform", "mac_64") and not base.is_dir("../build/mac_64"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "mac_64")
|
||||
directory_build = base_dir + "/build/mac_64/lib"
|
||||
base.delete_file(directory_build + "/libboost_system.a")
|
||||
base.delete_file(directory_build + "/libboost_system.dylib")
|
||||
base.copy_files(directory_build + "/mac_64/*.a", directory_build)
|
||||
|
||||
if config.check_option("platform", "mac_arm64") and not base.is_dir("../build/mac_arm64"):
|
||||
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "mac_arm64")
|
||||
directory_build = base_dir + "/build/mac_arm64/lib"
|
||||
base.delete_file(directory_build + "/libboost_system.a")
|
||||
base.delete_file(directory_build + "/libboost_system.dylib")
|
||||
base.copy_files(directory_build + "/mac_arm64/*.a", directory_build)
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
@ -1,108 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
|
||||
platforms = {
|
||||
"arm64_v8a" : {
|
||||
"name" : "arm64-v8a",
|
||||
"toolset" : "arm64v8a",
|
||||
"clang_triple" : "aarch64-linux-android21",
|
||||
"tool_triple" : "aarch64-linux-android",
|
||||
"abi" : "aapcs",
|
||||
"arch" : "arm",
|
||||
"address_model" : "64",
|
||||
"compiler_flags" : "",
|
||||
"linker_flags" : ""
|
||||
},
|
||||
"armv7" : {
|
||||
"name" : "armeabi-v7a",
|
||||
"toolset" : "armeabiv7a",
|
||||
"clang_triple" : "armv7a-linux-androideabi16",
|
||||
"tool_triple" : "arm-linux-androideabi",
|
||||
"abi" : "aapcs",
|
||||
"arch" : "arm",
|
||||
"address_model" : "32",
|
||||
"compiler_flags" : "-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp",
|
||||
"linker_flags" : "-Wl,--fix-cortex-a8"
|
||||
},
|
||||
"x86" : {
|
||||
"name" : "x86",
|
||||
"toolset" : "x86",
|
||||
"clang_triple" : "i686-linux-android16",
|
||||
"tool_triple" : "i686-linux-android",
|
||||
"abi" : "sysv",
|
||||
"arch" : "x86",
|
||||
"address_model" : "32",
|
||||
"compiler_flags" : "",
|
||||
"linker_flags" : ""
|
||||
},
|
||||
"x86_64" : {
|
||||
"name" : "x86_64",
|
||||
"toolset" : "x8664",
|
||||
"clang_triple" : "x86_64-linux-android21",
|
||||
"tool_triple" : "x86_64-linux-android",
|
||||
"abi" : "sysv",
|
||||
"arch" : "x86",
|
||||
"address_model" : "64",
|
||||
"compiler_flags" : "",
|
||||
"linker_flags" : ""
|
||||
}
|
||||
}
|
||||
|
||||
base_dir = base.get_script_dir()
|
||||
|
||||
def make(platform):
|
||||
tmp_build_dir = base_dir + "/core_common/modules/boost"
|
||||
if (base.is_dir(tmp_build_dir)):
|
||||
base.delete_dir(tmp_build_dir)
|
||||
base.copy_dir(base_dir + "/../tools/android/boost", tmp_build_dir)
|
||||
|
||||
current_platform = platforms[platform]
|
||||
|
||||
if (base.host_platform() == "mac"):
|
||||
source = "prebuilt/linux-x86_64"
|
||||
dest = "prebuilt/darwin-x86_64"
|
||||
base.replaceInFile(tmp_build_dir + "/user-config.jam", source, dest)
|
||||
base.replaceInFile(tmp_build_dir + "/bin/hide/as", source, dest)
|
||||
base.replaceInFile(tmp_build_dir + "/bin/hide/strip", source, dest)
|
||||
base.replaceInFile(tmp_build_dir + "/bin/ar", source, dest)
|
||||
base.replaceInFile(tmp_build_dir + "/bin/clang++", source, dest)
|
||||
base.replaceInFile(tmp_build_dir + "/bin/ranlib", source, dest)
|
||||
|
||||
build_dir_tmp = tmp_build_dir + "/tmp"
|
||||
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex", "--prefix=../build/android_" + platform])
|
||||
base.cmd("./b2", ["headers"])
|
||||
base.cmd("./b2", ["--clean"])
|
||||
|
||||
old_path = base.get_env("PATH")
|
||||
base.set_env("PATH", tmp_build_dir + "/bin:" + old_path)
|
||||
base.set_env("NDK_DIR", base.get_env("ANDROID_NDK_ROOT"))
|
||||
|
||||
base.set_env("BFA_CLANG_TRIPLE_FOR_ABI", current_platform["clang_triple"])
|
||||
base.set_env("BFA_TOOL_TRIPLE_FOR_ABI", current_platform["tool_triple"])
|
||||
base.set_env("BFA_COMPILER_FLAGS_FOR_ABI", current_platform["compiler_flags"])
|
||||
base.set_env("BFA_LINKER_FLAGS_FOR_ABI", current_platform["linker_flags"])
|
||||
|
||||
print(current_platform)
|
||||
base.cmd("./b2", ["-q", "-j4",
|
||||
"toolset=clang-" + current_platform["toolset"],
|
||||
"binary-format=elf",
|
||||
"address-model=" + current_platform["address_model"],
|
||||
"architecture=" + current_platform["arch"],
|
||||
"abi=" + current_platform["abi"],
|
||||
"link=static",
|
||||
"threading=multi",
|
||||
"target-os=android",
|
||||
"--user-config=" + tmp_build_dir + "/user-config.jam",
|
||||
"--ignore-site-config",
|
||||
"--layout=system",
|
||||
"install"], True)
|
||||
|
||||
base.set_env("PATH", old_path)
|
||||
base.delete_dir(tmp_build_dir)
|
||||
return
|
||||
50
scripts/core_common/modules/boost_qt.py
Normal file
50
scripts/core_common/modules/boost_qt.py
Normal file
@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import qmake
|
||||
|
||||
def make(src_dir, modules, build_platform="android", qmake_addon=""):
|
||||
old_cur = os.getcwd()
|
||||
old_env = dict(os.environ)
|
||||
b2_addon = ""
|
||||
|
||||
print("boost-headers...")
|
||||
|
||||
base.cmd("./bootstrap.sh", ["--with-libraries=system"])
|
||||
base.cmd("./b2", ["--prefix=./../build/" + build_platform, "headers", "install"])
|
||||
|
||||
for module in modules:
|
||||
print("boost-module: " + module + " ...")
|
||||
module_dir = src_dir + "/libs/" + module
|
||||
os.chdir(module_dir)
|
||||
pro_file_content = []
|
||||
pro_file_content.append("QT -= core gui")
|
||||
pro_file_content.append("TARGET = boost_" + module)
|
||||
pro_file_content.append("TEMPLATE = lib")
|
||||
pro_file_content.append("CONFIG += staticlib")
|
||||
if (build_platform == "android"):
|
||||
pro_file_content.append("DEFINES += \"_HAS_AUTO_PTR_ETC=0\"")
|
||||
pro_file_content.append("")
|
||||
pro_file_content.append("CORE_ROOT_DIR = $$PWD/../../../../../..")
|
||||
pro_file_content.append("PWD_ROOT_DIR = $$PWD")
|
||||
pro_file_content.append("include($$PWD/../../../../../base.pri)")
|
||||
pro_file_content.append("")
|
||||
pro_file_content.append("BOOST_SOURCES=$$PWD/../..")
|
||||
pro_file_content.append("INCLUDEPATH += $$BOOST_SOURCES")
|
||||
pro_file_content.append("INCLUDEPATH += $$PWD/include")
|
||||
pro_file_content.append("")
|
||||
pro_file_content.append("SOURCES += $$files($$PWD/src/*.cpp, true)")
|
||||
pro_file_content.append("")
|
||||
pro_file_content.append("DESTDIR = $$BOOST_SOURCES/../build/" + build_platform + "/lib/$$CORE_BUILDS_PLATFORM_PREFIX")
|
||||
base.save_as_script(module_dir + "/" + module + ".pro", pro_file_content)
|
||||
os.chdir(module_dir)
|
||||
qmake.make_all_platforms(module_dir + "/" + module + ".pro", qmake_addon)
|
||||
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
@ -5,6 +5,13 @@ sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
|
||||
def clear_module():
|
||||
for child in glob.glob("./*"):
|
||||
if base.is_dir(child):
|
||||
base.delete_dir(child)
|
||||
return
|
||||
|
||||
def make():
|
||||
print("[fetch & build]: cef")
|
||||
@ -13,55 +20,77 @@ def make():
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32", "mac_64"]
|
||||
|
||||
url = "http://d2ettrnqo7v976.cloudfront.net/cef/3770/"
|
||||
base.check_module_version("2", clear_module)
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32", "mac_64", "mac_arm64", "win_arm64", "linux_arm64"]
|
||||
|
||||
for platform in platforms:
|
||||
if not config.check_option("platform", platform):
|
||||
continue
|
||||
|
||||
url += (platform + "/cef_binary.7z")
|
||||
url = "https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/cef/"
|
||||
archive_name = "./cef_binary.7z"
|
||||
|
||||
if (-1 != platform.find("_xp")):
|
||||
url += "4280/"
|
||||
archive_name = "./cef_binary_xp.7z"
|
||||
elif (config.check_option("config", "cef_version_107")):
|
||||
url += "5304/"
|
||||
archive_name = "./cef_binary_107.7z"
|
||||
elif ("mac_64" == platform) and (config.check_option("config", "use_v8")):
|
||||
url += "5060/"
|
||||
archive_name = "./cef_binary_103.7z"
|
||||
else:
|
||||
url += "5414/"
|
||||
|
||||
url_platform = (url + platform + "/cef_binary.7z")
|
||||
archive_name_data = archive_name + ".data"
|
||||
|
||||
if not base.is_dir(platform):
|
||||
base.create_dir(platform)
|
||||
|
||||
os.chdir(platform)
|
||||
|
||||
data_url = base.get_file_last_modified_url(url_platform)
|
||||
old_data_url = base.readFile(archive_name_data)
|
||||
|
||||
data_url = base.get_file_last_modified_url(url)
|
||||
old_data_url = base.readFile("./cef_binary.7z.data")
|
||||
build_dir_name = "build"
|
||||
if (0 == platform.find("linux")) and (config.check_option("config", "cef_version_107")):
|
||||
build_dir_name = "build_107"
|
||||
if ("mac_64" == platform) and (config.check_option("config", "use_v8")):
|
||||
build_dir_name = "build_103"
|
||||
|
||||
if (data_url != old_data_url):
|
||||
if base.is_file("./cef_binary.7z"):
|
||||
base.delete_file("./cef_binary.7z")
|
||||
if base.is_dir("build"):
|
||||
base.delete_dir("build")
|
||||
if base.is_file(archive_name):
|
||||
base.delete_file(archive_name)
|
||||
if base.is_dir(build_dir_name):
|
||||
base.delete_dir(build_dir_name)
|
||||
|
||||
if base.is_dir("build"):
|
||||
if base.is_dir(build_dir_name):
|
||||
os.chdir(base_dir)
|
||||
continue
|
||||
|
||||
# download
|
||||
if not base.is_file("./cef_binary.7z"):
|
||||
base.download(url, "./cef_binary.7z")
|
||||
if not base.is_file(archive_name):
|
||||
base.download(url_platform, archive_name)
|
||||
|
||||
# extract
|
||||
base.extract("./cef_binary.7z", "./")
|
||||
base.extract(archive_name, "./")
|
||||
|
||||
base.delete_file("./cef_binary.7z.data")
|
||||
base.writeFile("./cef_binary.7z.data", data_url)
|
||||
base.delete_file(archive_name_data)
|
||||
base.writeFile(archive_name_data, data_url)
|
||||
|
||||
base.create_dir("./build")
|
||||
base.create_dir("./" + build_dir_name)
|
||||
|
||||
# deploy
|
||||
if ("mac_64" != platform):
|
||||
base.copy_files("cef_binary/Release/*", "build/")
|
||||
base.copy_files("cef_binary/Resources/*", "build/")
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.cmd("chmod", ["a+xr", "build/locales"])
|
||||
|
||||
if ("mac_64" == platform):
|
||||
base.cmd("mv", ["Chromium Embedded Framework.framework", "build/Chromium Embedded Framework.framework"])
|
||||
if (0 == platform.find("mac")):
|
||||
base.cmd("mv", ["Chromium Embedded Framework.framework", build_dir_name + "/Chromium Embedded Framework.framework"])
|
||||
base.delete_dir("./Chromium Embedded Framework.framework")
|
||||
else:
|
||||
base.copy_files("cef_binary/Release/*", build_dir_name + "/")
|
||||
base.copy_files("cef_binary/Resources/*", build_dir_name + "/")
|
||||
if (0 == platform.find("linux")):
|
||||
base.cmd("chmod", ["a+xr", build_dir_name + "/locales"])
|
||||
base.delete_dir("./cef_binary")
|
||||
|
||||
os.chdir(base_dir)
|
||||
|
||||
|
||||
25
scripts/core_common/modules/curl.py
Normal file
25
scripts/core_common/modules/curl.py
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
sys.path.append('android')
|
||||
import config
|
||||
import subprocess
|
||||
import os
|
||||
import base
|
||||
import curl_android
|
||||
|
||||
def make():
|
||||
path = base.get_script_dir() + "/../../core/Common/3dParty/curl"
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(path)
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
curl_android.make()
|
||||
elif (-1 != config.option("platform").find("ios")):
|
||||
if base.is_dir(path + "/build/ios"):
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
subprocess.call(["./build-ios-curl.sh"])
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
34
scripts/core_common/modules/glew.py
Normal file
34
scripts/core_common/modules/glew.py
Normal file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
|
||||
def clean():
|
||||
if base.is_dir("glew-2.1.0"):
|
||||
base.delete_dir("glew-2.1.0")
|
||||
return
|
||||
|
||||
def make():
|
||||
if ("windows" != base.host_platform()):
|
||||
return
|
||||
|
||||
if not config.check_option("module", "mobile"):
|
||||
return
|
||||
|
||||
print("[fetch & build]: glew")
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/glew"
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
base.common_check_version("glew", "1", clean)
|
||||
|
||||
if not base.is_dir("glew-2.1.0"):
|
||||
base.download("https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/glew/glew-2.1.0-win32.zip", "./archive.zip")
|
||||
base.extract("./archive.zip", "./")
|
||||
base.delete_file("./archive.zip")
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
19
scripts/core_common/modules/googletest.py
Normal file
19
scripts/core_common/modules/googletest.py
Normal file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
|
||||
def make():
|
||||
print("[fetch]: googletest")
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/googletest"
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
if not base.is_dir("googletest"):
|
||||
base.cmd("git", ["clone", "https://github.com/google/googletest.git", "-b", "v1.13.0"])
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
15
scripts/core_common/modules/harfbuzz.py
Executable file
15
scripts/core_common/modules/harfbuzz.py
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
|
||||
def make():
|
||||
print("[fetch & build]: harfbuzz")
|
||||
base.cmd_in_dir(base.get_script_dir() + "/../../core/Common/3dParty/harfbuzz", "./make.py")
|
||||
return
|
||||
|
||||
if __name__ == '__main__':
|
||||
# manual compile
|
||||
make()
|
||||
403
scripts/core_common/modules/heif.py
Normal file
403
scripts/core_common/modules/heif.py
Normal file
@ -0,0 +1,403 @@
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
import config
|
||||
|
||||
# NOTE:
|
||||
# - requires CMake >= 3.21, < 4.0.0
|
||||
|
||||
# libs versions
|
||||
X265_VERSION = "4.1"
|
||||
DE265_VERSION = "1.0.16"
|
||||
# 1.18.2 - the latest version of libheif supporting C++11 builds (as for now)
|
||||
HEIF_VERSION = "1.18.2"
|
||||
|
||||
# ios cmake toolchain
|
||||
IOS_CMAKE_VERSION = "4.5.0"
|
||||
IOS_CMAKE_TOOLCHAIN_FILE = base.get_script_dir() + "/../../core/Common/3dParty/heif/ios-cmake/ios.toolchain.cmake"
|
||||
|
||||
# android cmake toolchain
|
||||
ANDROID_CMAKE_TOOLCHAIN_FILE = base.get_env("ANDROID_NDK_ROOT") + "/build/cmake/android.toolchain.cmake"
|
||||
|
||||
# linux arm64 cmake toolchain
|
||||
LINUX_SYSTEM_AARCH64_TOOLCHAIN_FILE = base.get_script_dir() + "/../tools/linux/sysroot/system-aarch64.toolchain.cmake"
|
||||
LINUX_CUSTOM_SYSROOT_TOOLCHAIN_FILE = base.get_script_dir() + "/../tools/linux/sysroot/custom-sysroot.toolchain.cmake"
|
||||
|
||||
OLD_ENV = dict()
|
||||
|
||||
def get_vs_version():
|
||||
vs_version = "14 2015"
|
||||
if config.option("vs-version") == "2019":
|
||||
vs_version = "16 2019"
|
||||
return vs_version
|
||||
|
||||
def get_xcode_sdk(platform):
|
||||
xcode_sdk = "iphoneos"
|
||||
if "simulator" in platform:
|
||||
xcode_sdk = "iphonesimulator"
|
||||
return xcode_sdk
|
||||
|
||||
def fetch_repo(repo_url, branch_or_tag):
|
||||
base.cmd("git", ["clone", "--depth", "1", "--branch", branch_or_tag, repo_url])
|
||||
return
|
||||
|
||||
def get_build_dir(base_dir, repo_dir, platform, build_type):
|
||||
return os.path.join(base_dir, repo_dir, "build", platform, build_type.lower())
|
||||
|
||||
# general build function that builds for ONE platform (supposing we are located in the build directory)
|
||||
def build_with_cmake(platform, cmake_args, build_type):
|
||||
# extend cmake arguments
|
||||
cmake_args_ext = []
|
||||
# WINDOWS
|
||||
if "win" in platform:
|
||||
cmake_args_ext = [
|
||||
"-G", f"Visual Studio {get_vs_version()}"
|
||||
]
|
||||
if platform == "win_64" or platform == "win_64_xp":
|
||||
cmake_args_ext += ["-A", "x64"]
|
||||
elif platform == "win_32" or platform == "win_32_xp":
|
||||
cmake_args_ext += ["-A", "Win32"]
|
||||
elif platform == "win_arm64":
|
||||
cmake_args_ext += ["-A", "ARM64"]
|
||||
# LINUX, MAC
|
||||
elif "linux" in platform or "mac" in platform:
|
||||
cmake_args_ext = [
|
||||
"-G", "Unix Makefiles",
|
||||
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON" # on UNIX we need to compile with fPIC
|
||||
]
|
||||
if platform == "mac_64":
|
||||
cmake_args_ext += ["-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11", "-DCMAKE_OSX_ARCHITECTURES=x86_64"]
|
||||
elif platform == "mac_arm64":
|
||||
cmake_args_ext += ["-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0", "-DCMAKE_OSX_ARCHITECTURES=arm64"]
|
||||
elif config.option("sysroot") != "":
|
||||
# force use custom CXXFLAGS with Release/Debug build
|
||||
if (platform == "linux_64"):
|
||||
cmake_args += ["-DCMAKE_TOOLCHAIN_FILE=" + LINUX_CUSTOM_SYSROOT_TOOLCHAIN_FILE]
|
||||
else:
|
||||
cmake_args += ["-DCMAKE_TOOLCHAIN_FILE=" + LINUX_SYSTEM_AARCH64_TOOLCHAIN_FILE]
|
||||
elif platform == "linux_arm64" and not base.is_os_arm():
|
||||
cmake_args += ["-DCMAKE_TOOLCHAIN_FILE=" + LINUX_SYSTEM_AARCH64_TOOLCHAIN_FILE]
|
||||
# IOS
|
||||
elif "ios" in platform:
|
||||
cmake_args_ext = [
|
||||
"-G", "Xcode",
|
||||
"-DCMAKE_TOOLCHAIN_FILE=" + IOS_CMAKE_TOOLCHAIN_FILE,
|
||||
"-DDEPLOYMENT_TARGET=11.0"
|
||||
]
|
||||
if platform == "ios":
|
||||
cmake_args_ext += ["-DPLATFORM=OS64"]
|
||||
elif platform == "ios_simulator":
|
||||
cmake_args_ext += ["-DPLATFORM=SIMULATOR64COMBINED"]
|
||||
# ANDROID
|
||||
elif "android" in platform:
|
||||
cmake_args_ext = [
|
||||
"-G", "Unix Makefiles",
|
||||
"-DCMAKE_TOOLCHAIN_FILE=" + ANDROID_CMAKE_TOOLCHAIN_FILE,
|
||||
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
|
||||
]
|
||||
def get_cmake_args_android(arch, api_level):
|
||||
return [
|
||||
"-DANDROID_ABI=" + arch,
|
||||
"-DANDROID_NATIVE_API_LEVEL=" + api_level
|
||||
]
|
||||
if platform == "android_arm64_v8a":
|
||||
cmake_args_ext += get_cmake_args_android("arm64-v8a", "21")
|
||||
elif platform == "android_armv7":
|
||||
cmake_args_ext += get_cmake_args_android("armeabi-v7a", "16")
|
||||
elif platform == "android_x86":
|
||||
cmake_args_ext += get_cmake_args_android("x86", "16")
|
||||
elif platform == "android_x86_64":
|
||||
cmake_args_ext += get_cmake_args_android("x86_64", "21")
|
||||
|
||||
# env setup for custom sysroot
|
||||
if config.option("sysroot") != "":
|
||||
base.set_sysroot_env(platform)
|
||||
|
||||
# run cmake
|
||||
base.cmd("cmake", cmake_args + cmake_args_ext)
|
||||
|
||||
# build
|
||||
if "Unix Makefiles" in cmake_args_ext:
|
||||
base.cmd("make", ["-j4"])
|
||||
else:
|
||||
base.cmd("cmake", ["--build", ".", "--config", build_type])
|
||||
|
||||
if config.option("sysroot") != "":
|
||||
base.restore_sysroot_env()
|
||||
return
|
||||
|
||||
# general make function that calls `build_func` callback for configured platform(s) with specified cmake arguments
|
||||
def make_common(build_func, cmake_args):
|
||||
# WINDOWS
|
||||
if "windows" == base.host_platform():
|
||||
# win_64
|
||||
if config.check_option("platform", "win_64") or config.check_option("platform", "win_64_xp"):
|
||||
build_func("win_64", cmake_args)
|
||||
# win_32
|
||||
if config.check_option("platform", "win_32") or config.check_option("platform", "win_32_xp"):
|
||||
build_func("win_32", cmake_args)
|
||||
# win_arm64
|
||||
if config.check_option("platform", "win_arm64"):
|
||||
build_func("win_arm64", cmake_args)
|
||||
|
||||
# LINUX
|
||||
elif "linux" == base.host_platform():
|
||||
# linux_64
|
||||
if config.check_option("platform", "linux_64"):
|
||||
build_func("linux_64", cmake_args)
|
||||
# linux_arm64
|
||||
if config.check_option("platform", "linux_arm64"):
|
||||
build_func("linux_arm64", cmake_args)
|
||||
|
||||
# MAC
|
||||
elif "mac" == base.host_platform():
|
||||
# mac_64
|
||||
if config.check_option("platform", "mac_64"):
|
||||
build_func("mac_64", cmake_args)
|
||||
# mac_arm64
|
||||
if config.check_option("platform", "mac_arm64"):
|
||||
build_func("mac_arm64", cmake_args)
|
||||
|
||||
# IOS
|
||||
if -1 != config.option("platform").find("ios"):
|
||||
# ios (arm64)
|
||||
build_func("ios", cmake_args)
|
||||
# ios simulator (x86_64 and arm64 FAT lib)
|
||||
build_func("ios_simulator", cmake_args)
|
||||
|
||||
# ANDROID
|
||||
if -1 != config.option("platform").find("android"):
|
||||
# android_arm64_v8a
|
||||
if config.check_option("platform", "android_arm64_v8a"):
|
||||
build_func("android_arm64_v8a", cmake_args)
|
||||
# android_armv7
|
||||
if config.check_option("platform", "android_armv7"):
|
||||
build_func("android_armv7", cmake_args)
|
||||
# android_x86
|
||||
if config.check_option("platform", "android_x86"):
|
||||
build_func("android_x86", cmake_args)
|
||||
# android_x86_64
|
||||
if config.check_option("platform", "android_x86_64"):
|
||||
build_func("android_x86_64", cmake_args)
|
||||
|
||||
return
|
||||
|
||||
def make_x265(base_dir, build_type):
|
||||
# fetch lib repo
|
||||
if not base.is_dir("x265_git"):
|
||||
fetch_repo("https://bitbucket.org/multicoreware/x265_git.git", f"Release_{X265_VERSION}")
|
||||
# fix x265 version detection so it reads version from x265Version.txt instead of parsing it from .git
|
||||
base.replaceInFile(
|
||||
base_dir + "/x265_git/source/cmake/Version.cmake",
|
||||
"elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt)",
|
||||
"endif()\n if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt)"
|
||||
)
|
||||
|
||||
# prepare cmake args
|
||||
cmake_dir = base_dir + "/x265_git/source"
|
||||
cmake_args = [
|
||||
cmake_dir,
|
||||
"-DCMAKE_BUILD_TYPE=" + build_type,
|
||||
"-DENABLE_CLI=OFF", # do not build standalone CLI app
|
||||
"-DENABLE_SHARED=OFF", # do not build shared libs
|
||||
"-DENABLE_ASSEMBLY=OFF", # disable assembly optimizations
|
||||
"-DENABLE_LIBNUMA=OFF", # disable libnuma usage (affects Linux only)
|
||||
]
|
||||
|
||||
# lib build function
|
||||
def build_x265(platform, cmake_args):
|
||||
# check if target lib has already been built
|
||||
build_dir = get_build_dir(base_dir, "x265_git", platform, build_type)
|
||||
if platform.find("win") != -1:
|
||||
target_lib = os.path.join(build_dir, build_type, "x265-static.lib")
|
||||
else:
|
||||
target_lib = os.path.join(build_dir, "libx265.a")
|
||||
if base.is_file(target_lib):
|
||||
return
|
||||
# go to the build directory
|
||||
base.create_dir(build_dir)
|
||||
os.chdir(build_dir)
|
||||
# run build
|
||||
build_with_cmake(platform, cmake_args, build_type)
|
||||
# for iOS there is no target for building libx265.a, so we need to form it ourselves from libcommon.a and libencoder.a
|
||||
if platform.find("ios") != -1:
|
||||
xcode_sdk = get_xcode_sdk(platform)
|
||||
base.cmd("libtool", [
|
||||
"-static",
|
||||
"-o", "libx265.a",
|
||||
f"build/common.build/{build_type}-{xcode_sdk}/libcommon.a",
|
||||
f"build/encoder.build/{build_type}-{xcode_sdk}/libencoder.a"
|
||||
])
|
||||
# copy header
|
||||
base.copy_file(base_dir + "/x265_git/source/x265.h", build_dir)
|
||||
# reset directory
|
||||
os.chdir(base_dir)
|
||||
return
|
||||
|
||||
make_common(build_x265, cmake_args)
|
||||
return
|
||||
|
||||
def make_de265(base_dir, build_type):
|
||||
# fetch lib repo
|
||||
if not base.is_dir("libde265"):
|
||||
fetch_repo("https://github.com/strukturag/libde265.git", f"v{DE265_VERSION}")
|
||||
|
||||
# prepare cmake args
|
||||
cmake_dir = base_dir + "/libde265"
|
||||
cmake_args = [
|
||||
cmake_dir,
|
||||
"-DCMAKE_BUILD_TYPE=" + build_type,
|
||||
"-DBUILD_SHARED_LIBS=OFF", # do not build shared libs
|
||||
"-DENABLE_SDL=OFF", # disable SDL
|
||||
"-DENABLE_DECODER=OFF", # do not build decoder CLI executable
|
||||
"-DENABLE_ENCODER=OFF", # do not build encoder CLI executable
|
||||
]
|
||||
|
||||
# lib build function
|
||||
def build_de265(platform, cmake_args):
|
||||
# check if target lib has already been built
|
||||
build_dir = get_build_dir(base_dir, "libde265", platform, build_type)
|
||||
if platform.find("win") != -1:
|
||||
target_lib = os.path.join(build_dir, "libde265", build_type, "libde265.lib")
|
||||
else:
|
||||
target_lib = os.path.join(build_dir, "libde265/libde265.a")
|
||||
if base.is_file(target_lib):
|
||||
return
|
||||
# go to the build directory
|
||||
base.create_dir(build_dir)
|
||||
os.chdir(build_dir)
|
||||
# run build
|
||||
build_with_cmake(platform, cmake_args, build_type)
|
||||
# for ios copy target library from the default build path
|
||||
if platform.find("ios") != -1:
|
||||
xcode_sdk = get_xcode_sdk(platform)
|
||||
base.copy_file(f"libde265/{build_type}-{xcode_sdk}/libde265.a", "libde265")
|
||||
# copy header
|
||||
base.copy_file(base_dir + "/libde265/libde265/de265.h", "libde265")
|
||||
# reset directory
|
||||
os.chdir(base_dir)
|
||||
return
|
||||
|
||||
make_common(build_de265, cmake_args)
|
||||
return
|
||||
|
||||
def make_heif(base_dir, build_type):
|
||||
# fetch lib repo
|
||||
if not base.is_dir("libheif"):
|
||||
fetch_repo("https://github.com/strukturag/libheif.git", f"v{HEIF_VERSION}")
|
||||
# do not build heifio module
|
||||
base.replaceInFile(
|
||||
base_dir + "/libheif/CMakeLists.txt",
|
||||
"add_subdirectory(heifio)",
|
||||
"# add_subdirectory(heifio)"
|
||||
)
|
||||
base.replaceInFile(
|
||||
base_dir + "/libheif/CMakeLists.txt",
|
||||
"if (DOXYGEN_FOUND)",
|
||||
"if (FALSE)"
|
||||
)
|
||||
|
||||
# prepare cmake args
|
||||
cmake_dir = base_dir + "/libheif"
|
||||
cmake_args = [
|
||||
cmake_dir,
|
||||
"--preset=release-noplugins", # preset to disable plugins system
|
||||
"-DCMAKE_BUILD_TYPE=" + build_type,
|
||||
"-DBUILD_SHARED_LIBS=OFF", # do not build shared libs
|
||||
"-DWITH_LIBSHARPYUV=OFF", # do not build libsharpyuv (for RGB <--> YUV color space conversions)
|
||||
"-DWITH_AOM_DECODER=OFF", # do not build AOM V1 decoder (for AVIF image format)
|
||||
"-DWITH_AOM_ENCODER=OFF", # do not build AOM V1 encoder (for AVIF image format)
|
||||
"-DWITH_GDK_PIXBUF=OFF", # do not build gdk-pixbuf plugin (UNIX only)
|
||||
"-DWITH_GNOME=OFF", # do not build gnome plugin (Linux only)
|
||||
"-DWITH_EXAMPLES=OFF", # do not build examples
|
||||
"-DWITH_EXAMPLE_HEIF_VIEW=OFF", # do not build heif-view CLI tool
|
||||
"-DWITH_X265=ON", # enable x265 codec
|
||||
"-DWITH_LIBDE265=ON", # enable de265 codec
|
||||
"-DCMAKE_CXX_FLAGS=-DLIBDE265_STATIC_BUILD", # add macro definition to properly compile with de265 static library
|
||||
"-DCMAKE_C_FLAGS=-DLIBDE265_STATIC_BUILD", # same ^
|
||||
]
|
||||
|
||||
# lib build function
|
||||
def build_heif(platform, cmake_args):
|
||||
# check if target lib has already been built
|
||||
build_dir = get_build_dir(base_dir, "libheif", platform, build_type)
|
||||
if platform.find("win") != -1:
|
||||
target_lib = os.path.join(build_dir, "libheif", build_type, "heif.lib")
|
||||
else:
|
||||
target_lib = os.path.join(build_dir, "libheif/libheif.a")
|
||||
if base.is_file(target_lib):
|
||||
return
|
||||
# go to the build directory
|
||||
base.create_dir(build_dir)
|
||||
os.chdir(build_dir)
|
||||
# add paths to dependent libraries and includes to cmake args
|
||||
de265_build_dir = get_build_dir(base_dir, "libde265", platform, build_type)
|
||||
x265_build_dir = get_build_dir(base_dir, "x265_git", platform, build_type)
|
||||
cmake_args_ext = [
|
||||
f"-DLIBDE265_INCLUDE_DIR={de265_build_dir}",
|
||||
f"-DX265_INCLUDE_DIR={x265_build_dir}"
|
||||
]
|
||||
if platform.find("win") != -1:
|
||||
cmake_args_ext += [
|
||||
f"-DLIBDE265_LIBRARY={de265_build_dir}/libde265/{build_type}/libde265.lib",
|
||||
f"-DX265_LIBRARY={x265_build_dir}/{build_type}/x265-static.lib"
|
||||
]
|
||||
else:
|
||||
cmake_args_ext += [
|
||||
f"-DLIBDE265_LIBRARY={de265_build_dir}/libde265/libde265.a",
|
||||
f"-DX265_LIBRARY={x265_build_dir}/libx265.a"
|
||||
]
|
||||
# run build
|
||||
build_with_cmake(platform, cmake_args + cmake_args_ext, build_type)
|
||||
# for ios copy target library from the default build path
|
||||
if platform.find("ios") != -1:
|
||||
xcode_sdk = get_xcode_sdk(platform)
|
||||
base.copy_file(f"libheif/{build_type}-{xcode_sdk}/libheif.a", "libheif")
|
||||
# reset directory
|
||||
os.chdir(base_dir)
|
||||
return
|
||||
|
||||
make_common(build_heif, cmake_args)
|
||||
return
|
||||
|
||||
def clear_module():
|
||||
if base.is_dir("libde265"):
|
||||
base.delete_dir_with_access_error("libde265")
|
||||
if base.is_dir("x265_git"):
|
||||
base.delete_dir_with_access_error("x265_git")
|
||||
if base.is_dir("libheif"):
|
||||
base.delete_dir_with_access_error("libheif")
|
||||
return
|
||||
|
||||
def make():
|
||||
print("[fetch & build]: heif")
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/heif"
|
||||
old_dir = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
base.check_module_version("2", clear_module)
|
||||
|
||||
build_type = "Release"
|
||||
if (-1 != config.option("config").lower().find("debug")):
|
||||
build_type = "Debug"
|
||||
|
||||
# fetch custom cmake toolchain for ios
|
||||
if -1 != config.option("platform").find("ios"):
|
||||
if not base.is_file(IOS_CMAKE_TOOLCHAIN_FILE):
|
||||
fetch_repo("https://github.com/leetal/ios-cmake.git", IOS_CMAKE_VERSION)
|
||||
|
||||
# build encoder library
|
||||
make_x265(base_dir, build_type)
|
||||
# build decoder library
|
||||
make_de265(base_dir, build_type)
|
||||
|
||||
# build libheif
|
||||
make_heif(base_dir, build_type)
|
||||
|
||||
os.chdir(old_dir)
|
||||
return
|
||||
|
||||
if __name__ == '__main__':
|
||||
make()
|
||||
33
scripts/core_common/modules/html2.py
Normal file
33
scripts/core_common/modules/html2.py
Normal file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def clear_module():
|
||||
directories = ["gumbo-parser", "katana-parser"]
|
||||
|
||||
for dir in directories:
|
||||
if base.is_dir(dir):
|
||||
base.delete_dir_with_access_error(dir)
|
||||
|
||||
def make():
|
||||
old_cur_dir = os.getcwd()
|
||||
|
||||
print("[fetch]: html")
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/html"
|
||||
|
||||
os.chdir(base_dir)
|
||||
base.check_module_version("2", clear_module)
|
||||
os.chdir(old_cur_dir)
|
||||
|
||||
base.cmd_in_dir(base_dir, "python", ["fetch.py"])
|
||||
return
|
||||
|
||||
if __name__ == '__main__':
|
||||
# manual compile
|
||||
make()
|
||||
31
scripts/core_common/modules/hunspell.py
Normal file
31
scripts/core_common/modules/hunspell.py
Normal file
@ -0,0 +1,31 @@
|
||||
import sys
|
||||
sys.path.append('../../../scripts')
|
||||
import base
|
||||
import os
|
||||
|
||||
def clean():
|
||||
if base.is_dir("hunspell"):
|
||||
base.delete_dir_with_access_error("hunspell")
|
||||
return
|
||||
|
||||
def make(build_js = True):
|
||||
|
||||
old_cur_dir = os.getcwd()
|
||||
#fetch libhunspell
|
||||
print("[fetch & build]: hunspell")
|
||||
core_common_dir = base.get_script_dir() + "/../../core/Common"
|
||||
|
||||
os.chdir(core_common_dir + "/3dParty/hunspell")
|
||||
|
||||
base.common_check_version("hunspell", "1", clean)
|
||||
base.cmd("python", ["./before.py"])
|
||||
|
||||
if (build_js):
|
||||
os.chdir(core_common_dir + "/js")
|
||||
base.cmd("python", ["./make.py", core_common_dir + "/3dParty/hunspell/hunspell.json"])
|
||||
|
||||
os.chdir(old_cur_dir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
# manual compile
|
||||
make(True)
|
||||
21
scripts/core_common/modules/hyphen.py
Normal file
21
scripts/core_common/modules/hyphen.py
Normal file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
|
||||
def make():
|
||||
print("[fetch]: hyphen")
|
||||
new_dir = base.get_script_dir() + "/../../core/Common/3dParty/hyphen"
|
||||
old_dir = os.getcwd()
|
||||
os.chdir(new_dir)
|
||||
|
||||
if not base.is_dir("hyphen"):
|
||||
base.cmd("git", ["clone", "https://github.com/hunspell/hyphen"])
|
||||
|
||||
|
||||
os.chdir(old_dir)
|
||||
return
|
||||
|
||||
@ -2,9 +2,31 @@
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
sys.path.append('android')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
import icu_android
|
||||
|
||||
def fetch_icu(major, minor, target_dir="icu"):
|
||||
if (base.is_dir("./icu2")):
|
||||
base.delete_dir_with_access_error("icu2")
|
||||
base.cmd("git", ["clone", "--depth", "1", "--branch", "release-" + major + "-" + minor, "https://github.com/unicode-org/icu.git", "./icu2"])
|
||||
base.copy_dir("./icu2/icu4c", target_dir)
|
||||
base.delete_dir_with_access_error("icu2")
|
||||
return
|
||||
|
||||
def clear_module():
|
||||
if base.is_dir("icu"):
|
||||
base.delete_dir_with_access_error("icu")
|
||||
|
||||
# remove build
|
||||
for child in glob.glob("./*"):
|
||||
if base.is_dir(child):
|
||||
base.delete_dir(child)
|
||||
|
||||
return
|
||||
|
||||
def make():
|
||||
print("[fetch & build]: icu")
|
||||
@ -13,64 +35,164 @@ def make():
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
icu_major = "58"
|
||||
base.check_module_version("8", clear_module)
|
||||
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
icu_android.make()
|
||||
|
||||
os.chdir(base_dir)
|
||||
|
||||
icu_major = "74"
|
||||
icu_minor = "2"
|
||||
|
||||
if not base.is_dir("icu"):
|
||||
base.cmd("svn", ["export", "https://github.com/unicode-org/icu/tags/release-" + icu_major + "-" + icu_minor + "/icu4c", "./icu"])
|
||||
fetch_icu(icu_major, icu_minor)
|
||||
|
||||
# old version for win_xp
|
||||
icu_major_old = "58"
|
||||
icu_minor_old = "3"
|
||||
|
||||
if config.check_option("platform", "win_64_xp") or config.check_option("platform", "win_32_xp"):
|
||||
if not base.is_dir("icu58"):
|
||||
fetch_icu(icu_major_old, icu_minor_old, "icu58")
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
platformToolset = "v140"
|
||||
if (config.option("vs-version") == "2019"):
|
||||
platformToolset = "v142"
|
||||
need_platforms = []
|
||||
if (-1 != config.option("platform").find("win_64")):
|
||||
need_platforms.append("win_64")
|
||||
if (-1 != config.option("platform").find("win_32")):
|
||||
need_platforms.append("win_32")
|
||||
if (-1 != config.option("platform").find("win_arm64")):
|
||||
need_platforms.append("win_64") # for exe files
|
||||
need_platforms.append("win_arm64")
|
||||
|
||||
def build_icu_win(source_dir, out_dir, icu_major):
|
||||
if base.is_dir(out_dir):
|
||||
return
|
||||
|
||||
compile_bat = []
|
||||
compile_bat.append("setlocal")
|
||||
|
||||
args = {
|
||||
"win_32" : {
|
||||
"msbuild_platfrom" : "Win32",
|
||||
"vcvarsall_arch" : "x86",
|
||||
"out_bin_dir" : source_dir + "/bin/",
|
||||
"out_lib_dir" : source_dir + "/lib/"
|
||||
},
|
||||
"win_64" : {
|
||||
"msbuild_platfrom" : "X64",
|
||||
"vcvarsall_arch" : "x64",
|
||||
"out_bin_dir" : source_dir + "/bin64/",
|
||||
"out_lib_dir" : source_dir + "/lib64/"
|
||||
},
|
||||
"win_arm64" : {
|
||||
"msbuild_platfrom" : "ARM64",
|
||||
"vcvarsall_arch" : "x64_arm64",
|
||||
"out_bin_dir" : source_dir + "/binARM64/",
|
||||
"out_lib_dir" : source_dir + "/libARM64/"
|
||||
}
|
||||
}
|
||||
|
||||
platform_args = args[platform]
|
||||
|
||||
compile_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + platform_args['vcvarsall_arch'])
|
||||
compile_bat.append("call MSBuild.exe " + source_dir + "/source/allinone/allinone.sln /p:Configuration=Release /p:PlatformToolset=" + platformToolset + " /p:Platform=" + platform_args['msbuild_platfrom'])
|
||||
compile_bat.append("endlocal")
|
||||
base.run_as_bat(compile_bat)
|
||||
|
||||
base.create_dir(out_dir)
|
||||
base.copy_file(platform_args['out_bin_dir'] + "icudt" + icu_major + ".dll", out_dir)
|
||||
base.copy_file(platform_args['out_bin_dir'] + "icuuc" + icu_major + ".dll", out_dir)
|
||||
base.copy_file(platform_args['out_lib_dir'] + "icudt.lib", out_dir)
|
||||
base.copy_file(platform_args['out_lib_dir'] + "icuuc.lib", out_dir)
|
||||
|
||||
for platform in need_platforms:
|
||||
if not config.check_option("platform", platform) and not config.check_option("platform", platform + "_xp"):
|
||||
continue
|
||||
if not base.is_dir(platform + "/build"):
|
||||
base.create_dir(platform)
|
||||
base.vcvarsall_start("x64" if ("win_64" == platform) else "x86")
|
||||
base.cmd("MSBuild.exe", ["icu/source/allinone/allinone.sln", "/p:Configuration=Release", "/p:PlatformToolset=v140", "/p:Platform=" + ("X64" if ("win_64" == platform) else "Win32")])
|
||||
base.vcvarsall_end()
|
||||
bin_dir = "icu/bin64/" if ("win_64" == platform) else "icu/bin/"
|
||||
lib_dir = "icu/lib64/" if ("win_64" == platform) else "icu/lib/"
|
||||
base.create_dir(platform + "/build")
|
||||
base.copy_file(bin_dir + "icudt" + icu_major + ".dll", platform + "/build/")
|
||||
base.copy_file(bin_dir + "icuuc" + icu_major + ".dll", platform + "/build/")
|
||||
base.copy_file(lib_dir + "icudt.lib", platform + "/build/")
|
||||
base.copy_file(lib_dir + "icuuc.lib", platform + "/build/")
|
||||
|
||||
platform = ""
|
||||
if not (config.check_option("platform", "win_64_xp") or config.check_option("platform", "win_32_xp")):
|
||||
build_icu_win("icu", platform + "/build", icu_major)
|
||||
else:
|
||||
# xp
|
||||
build_icu_win("icu58", platform + "/build/xp", icu_major_old)
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
if ("linux" == base.host_platform()):
|
||||
platform = "linux_64"
|
||||
if not base.is_dir(platform + "/build"):
|
||||
base.replaceInFile("./icu/source/i18n/digitlst.cpp", "xlocale", "locale")
|
||||
if not base.is_dir(base_dir + "/linux_64"):
|
||||
base.create_dir(base_dir + "/icu/cross_build")
|
||||
os.chdir("icu/cross_build")
|
||||
command_configure = "./../source/runConfigureICU"
|
||||
command_compile_addon = "-static-libstdc++ -static-libgcc"
|
||||
if "1" == config.option("use-clang"):
|
||||
command_configure = "CXXFLAGS=-stdlib=libc++ " + command_configure
|
||||
command_compile_addon = "-stdlib=libc++"
|
||||
if "" == config.option("sysroot"):
|
||||
base.cmd(command_configure, ["Linux", "--prefix=" + base_dir + "/icu/cross_build_install"])
|
||||
base.replaceInFile("./../source/icudefs.mk.in", "LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)", "LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS) " + command_compile_addon)
|
||||
else:
|
||||
base.set_sysroot_env("linux_64")
|
||||
sysroot_path = config.option("sysroot_linux_64")
|
||||
sysroot_path_bin = config.get_custom_sysroot_bin("linux_64")
|
||||
base.cmd_exe("./../source/configure", ["--prefix=" + base_dir + "/icu/cross_build_install",
|
||||
"CC=" + sysroot_path_bin + "/gcc", "CXX=" + sysroot_path_bin + "/g++",
|
||||
"AR=" + sysroot_path_bin + "/ar", "RANLIB=" + sysroot_path_bin + "/ranlib",
|
||||
"CFLAGS=--sysroot=" + sysroot_path,
|
||||
"CXXFLAGS=--sysroot=" + sysroot_path + " " + command_compile_addon,
|
||||
"LDFLAGS=--sysroot=" + sysroot_path])
|
||||
|
||||
if "" == config.option("sysroot"):
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
else:
|
||||
base.cmd_exe("make", ["-j4"])
|
||||
base.cmd_exe("make", ["install"], True)
|
||||
base.restore_sysroot_env()
|
||||
|
||||
base.create_dir(base_dir + "/linux_64")
|
||||
base.create_dir(base_dir + "/linux_64/build")
|
||||
base.copy_file(base_dir + "/icu/cross_build_install/lib/libicudata.so." + icu_major + "." + icu_minor, base_dir + "/linux_64/build/libicudata.so." + icu_major)
|
||||
base.copy_file(base_dir + "/icu/cross_build_install/lib/libicuuc.so." + icu_major + "." + icu_minor, base_dir + "/linux_64/build/libicuuc.so." + icu_major)
|
||||
base.copy_dir(base_dir + "/icu/cross_build_install/include", base_dir + "/linux_64/build/include")
|
||||
|
||||
if config.check_option("platform", "linux_arm64") and not base.is_dir(base_dir + "/linux_arm64") and not base.is_os_arm():
|
||||
base.create_dir(base_dir + "/icu/linux_arm64")
|
||||
os.chdir(base_dir + "/icu/linux_arm64")
|
||||
compiler_gcc_prefix = base.get_compiler_gcc_prefix("linux_arm64")
|
||||
if config.option("sysroot") != "":
|
||||
base.set_sysroot_env("linux_arm64")
|
||||
base.cmd("./../source/configure", ["--host=arm-linux", "--prefix=" + base_dir + "/icu/linux_arm64_install", "--with-cross-build=" + base_dir + "/icu/cross_build",
|
||||
"CC=" + compiler_gcc_prefix + "gcc", "CXX=" + compiler_gcc_prefix + "g++", "AR=" + compiler_gcc_prefix + "ar", "RANLIB=" + compiler_gcc_prefix + "ranlib"])
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
base.create_dir(base_dir + "/linux_arm64")
|
||||
base.create_dir(base_dir + "/linux_arm64/build")
|
||||
base.copy_file(base_dir + "/icu/linux_arm64_install/lib/libicudata.so." + icu_major + "." + icu_minor, base_dir + "/linux_arm64/build/libicudata.so." + icu_major)
|
||||
base.copy_file(base_dir + "/icu/linux_arm64_install/lib/libicuuc.so." + icu_major + "." + icu_minor, base_dir + "/linux_arm64/build/libicuuc.so." + icu_major)
|
||||
base.copy_dir(base_dir + "/icu/linux_arm64_install/include", base_dir + "/linux_arm64/build/include")
|
||||
if config.option("sysroot") != "":
|
||||
base.restore_sysroot_env()
|
||||
|
||||
os.chdir("../..")
|
||||
|
||||
if ("mac" == base.host_platform()):
|
||||
platform = "mac_64"
|
||||
if not base.is_dir(platform + "/build"):
|
||||
if not base.is_file("./icu/source/tools/pkgdata/pkgdata.cpp.bak"):
|
||||
base.copy_file("./icu/source/tools/pkgdata/pkgdata.cpp", "./icu/source/tools/pkgdata/pkgdata.cpp.bak")
|
||||
base.replaceInFile("./icu/source/tools/pkgdata/pkgdata.cpp", "cmd, \"%s %s -o %s%s %s %s%s %s %s\",", "cmd, \"%s %s -o %s%s %s %s %s %s %s\",")
|
||||
|
||||
if (-1 != config.option("platform").find("ios")):
|
||||
if not base.is_dir("build"):
|
||||
base.bash("./icu_ios")
|
||||
elif ("" != platform) and not base.is_dir(platform + "/build"):
|
||||
base.create_dir(platform)
|
||||
os.chdir("icu/source")
|
||||
base.cmd("./runConfigureICU", ["Linux" if "linux" == base.host_platform() else "MacOSX"])
|
||||
old_env = os.environ.copy()
|
||||
base.set_env("DESTDIR", base_dir + "/" + platform)
|
||||
base.cmd("make", ["install"])
|
||||
os.environ = old_env.copy()
|
||||
os.chdir("../..")
|
||||
base.create_dir(platform + "/build")
|
||||
if ("linux_64" == platform):
|
||||
base.copy_file("icu/source/lib/libicudata.so." + icu_major + "." + icu_minor, platform + "/build/libicudata.so." + icu_major)
|
||||
base.copy_file("icu/source/lib/libicuuc.so." + icu_major + "." + icu_minor, platform + "/build/libicuuc.so." + icu_major)
|
||||
elif ("mac_64" == platform):
|
||||
base.copy_file("icu/source/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", platform + "/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file("icu/source/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", platform + "/build/libicuuc." + icu_major + ".dylib")
|
||||
|
||||
# mac
|
||||
if (-1 != config.option("platform").find("mac_")) and not base.is_dir("mac_64/build"):
|
||||
base.cmd_in_dir(base_dir + "/../../../../build_tools/scripts/core_common/modules", "python", ["icu_mac.py"])
|
||||
|
||||
# ios
|
||||
if (-1 != config.option("platform").find("ios")):
|
||||
if not base.is_dir("build"):
|
||||
base.bash("./icu_ios")
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
105
scripts/core_common/modules/icu_mac.py
Executable file
105
scripts/core_common/modules/icu_mac.py
Executable file
@ -0,0 +1,105 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
|
||||
def change_icu_defs(arch):
|
||||
old_env = dict(os.environ)
|
||||
|
||||
param = "-arch x86_64"
|
||||
if arch == "arm64":
|
||||
param = "-arch arm64"
|
||||
|
||||
param += " -isysroot " + base.find_mac_sdk()
|
||||
param += " -mmacosx-version-min=10.12"
|
||||
|
||||
os.environ["CFLAGS"] = param
|
||||
os.environ["CXXFLAGS"] = param + " --std=c++11"
|
||||
os.environ["LDFLAGS"] = param
|
||||
|
||||
return old_env
|
||||
|
||||
def restore_icu_defs(old_env):
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
return
|
||||
|
||||
icu_major = "74"
|
||||
icu_minor = "2"
|
||||
|
||||
current_dir_old = os.getcwd()
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu"
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
if not base.is_dir(current_dir + "/mac_cross_64"):
|
||||
base.create_dir(current_dir + "/mac_cross_64")
|
||||
os.chdir(current_dir + "/mac_cross_64")
|
||||
|
||||
old_env = change_icu_defs("x86_64")
|
||||
|
||||
base.cmd("../icu/source/runConfigureICU", ["MacOSX",
|
||||
"--prefix=" + current_dir + "/mac_64_install", "--enable-static"])
|
||||
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
|
||||
restore_icu_defs(old_env)
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
os.chdir(current_dir + "/icu/source")
|
||||
|
||||
old_env = change_icu_defs("arm64")
|
||||
|
||||
addon = []
|
||||
if not base.is_os_arm():
|
||||
addon = ["--host=aarch64-apple-darwin"]
|
||||
|
||||
base.cmd("./configure", ["--prefix=" + current_dir + "/mac_arm64_install",
|
||||
"--with-cross-build=" + current_dir + "/mac_cross_64", "--enable-static", "VERBOSE=1"] + addon)
|
||||
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"])
|
||||
|
||||
restore_icu_defs(old_env)
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
if base.is_dir(current_dir + "/mac_64"):
|
||||
base.delete_dir(current_dir + "/mac_64")
|
||||
|
||||
if base.is_dir(current_dir + "/mac_arm64"):
|
||||
base.delete_dir(current_dir + "/mac_arm64")
|
||||
|
||||
base.create_dir(current_dir + "/mac_64")
|
||||
base.create_dir(current_dir + "/mac_64/build")
|
||||
|
||||
base.create_dir(current_dir + "/mac_arm64")
|
||||
base.create_dir(current_dir + "/mac_arm64/build")
|
||||
|
||||
base.copy_dir(current_dir + "/mac_64_install/include", current_dir + "/mac_64/build/include")
|
||||
# copy shared libs
|
||||
base.copy_file(current_dir + "/mac_64_install/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file(current_dir + "/mac_64_install/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_64/build/libicuuc." + icu_major + ".dylib")
|
||||
# copy static libs
|
||||
base.copy_file(current_dir + "/mac_64_install/lib/libicudata.a", current_dir + "/mac_64/build")
|
||||
base.copy_file(current_dir + "/mac_64_install/lib/libicui18n.a", current_dir + "/mac_64/build")
|
||||
base.copy_file(current_dir + "/mac_64_install/lib/libicuuc.a", current_dir + "/mac_64/build")
|
||||
|
||||
base.copy_dir(current_dir + "/mac_arm64_install/include", current_dir + "/mac_arm64/build/include")
|
||||
# copy shared libs
|
||||
base.copy_file(current_dir + "/mac_arm64_install/lib/libicudata." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicudata." + icu_major + ".dylib")
|
||||
base.copy_file(current_dir + "/mac_arm64_install/lib/libicuuc." + icu_major + "." + icu_minor + ".dylib", current_dir + "/mac_arm64/build/libicuuc." + icu_major + ".dylib")
|
||||
# copy static libs
|
||||
base.copy_file(current_dir + "/mac_arm64_install/lib/libicudata.a", current_dir + "/mac_arm64/build")
|
||||
base.copy_file(current_dir + "/mac_arm64_install/lib/libicui18n.a", current_dir + "/mac_arm64/build")
|
||||
base.copy_file(current_dir + "/mac_arm64_install/lib/libicuuc.a", current_dir + "/mac_arm64/build")
|
||||
|
||||
base.delete_dir(current_dir + "/mac_cross_64")
|
||||
base.delete_dir(current_dir + "/mac_64_install")
|
||||
base.delete_dir(current_dir + "/mac_arm64_install")
|
||||
|
||||
os.chdir(current_dir_old)
|
||||
39
scripts/core_common/modules/iwork.py
Normal file
39
scripts/core_common/modules/iwork.py
Normal file
@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def clear_module():
|
||||
directories = ["glm", "libetonyek", "libodfgen", "librevenge", "mdds"]
|
||||
|
||||
for dir in directories:
|
||||
if base.is_dir(dir):
|
||||
base.delete_dir_with_access_error(dir)
|
||||
|
||||
def make(use_gperf = True):
|
||||
old_cur_dir = os.getcwd()
|
||||
|
||||
print("[fetch & build]: iwork")
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/apple"
|
||||
|
||||
os.chdir(base_dir)
|
||||
base.check_module_version("4", clear_module)
|
||||
os.chdir(old_cur_dir)
|
||||
|
||||
cmd_args = ["fetch.py"]
|
||||
|
||||
if use_gperf:
|
||||
cmd_args.append("--gperf")
|
||||
|
||||
base.cmd_in_dir(base_dir, "python", cmd_args)
|
||||
return
|
||||
|
||||
if __name__ == '__main__':
|
||||
# manual compile
|
||||
make(False)
|
||||
|
||||
204
scripts/core_common/modules/ixwebsocket.py
Normal file
204
scripts/core_common/modules/ixwebsocket.py
Normal file
@ -0,0 +1,204 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
import config
|
||||
from distutils.version import LooseVersion, StrictVersion
|
||||
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/ixwebsocket"
|
||||
|
||||
CMAKE = "cmake"
|
||||
|
||||
def find_last_version(arr_input, base_directory):
|
||||
arr = []
|
||||
for arr_rec in arr_input:
|
||||
if base.is_file(base_directory + "/" + arr_rec + "/bin/cmake"):
|
||||
arr.append(arr_rec)
|
||||
res = arr[0]
|
||||
for version in arr:
|
||||
if(LooseVersion(version) > LooseVersion(res)):
|
||||
res = version
|
||||
return res
|
||||
|
||||
def build_arch(platform, arch, params, is_debug=False):
|
||||
print("ixwebsocket build: " + platform + "....." + arch + " ----------------------------------------")
|
||||
|
||||
if base.is_dir(current_dir + "/IXWebSocket/build/"+ platform + "/" + arch):
|
||||
base.delete_dir(current_dir + "/IXWebSocket/build/" + platform + "/" + arch)
|
||||
base.create_dir(current_dir + "/IXWebSocket/build/" + platform + "/" + arch)
|
||||
cache_dir = current_dir + "/IXWebSocket/build/" + platform + "/cache"
|
||||
base.create_dir(cache_dir)
|
||||
os.chdir(cache_dir)
|
||||
|
||||
libext = "a"
|
||||
prefix = "/"
|
||||
zlib = "1"
|
||||
if (0 == platform.find("windows")):
|
||||
zlib = "0"
|
||||
libext = "lib"
|
||||
prefix = cache_dir + "/../" + arch
|
||||
|
||||
path = platform
|
||||
if(platform == "ios" or platform == "android"):
|
||||
path += "/"
|
||||
else:
|
||||
path = ""
|
||||
|
||||
base.cmd(CMAKE, ["../../..",
|
||||
"-DUSE_WS=0", "-DUSE_ZLIB=" + zlib, "-DUSE_TLS=1", "-DUSE_OPEN_SSL=1",
|
||||
"-DOPENSSL_ROOT_DIR=" + cache_dir + "/../../../../../openssl/build/" + path + arch,
|
||||
"-DOPENSSL_INCLUDE_DIR=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/include",
|
||||
"-DOPENSSL_CRYPTO_LIBRARY=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/lib/libcrypto." + libext,
|
||||
"-DOPENSSL_SSL_LIBRARY=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/lib/libssl." + libext,
|
||||
"-DCMAKE_INSTALL_PREFIX:PATH=" + prefix] + params)
|
||||
|
||||
if(-1 != platform.find("ios") or -1 != platform.find("mac")):
|
||||
base.cmd(CMAKE, ["--build", ".", "--config", "Release"])
|
||||
base.cmd(CMAKE, ["--install", ".", "--config", "Release", "--prefix", cache_dir + "/../" + arch])
|
||||
elif(-1 != platform.find("android") or -1 != platform.find("linux")):
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["DESTDIR=" + cache_dir + "/../" + arch, "install"])
|
||||
elif(-1 != platform.find("windows")):
|
||||
conf = "Debug" if is_debug else "Release"
|
||||
base.cmd(CMAKE, ["--build", ".", "--target", "install", "--config", conf])
|
||||
|
||||
base.delete_dir(cache_dir)
|
||||
os.chdir(current_dir)
|
||||
|
||||
return
|
||||
|
||||
def make():
|
||||
if not base.is_dir(current_dir):
|
||||
base.create_dir(current_dir)
|
||||
|
||||
print("[fetch & build]: ixwebsocket")
|
||||
|
||||
current_dir_old = os.getcwd()
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
if not base.is_dir(current_dir + "/IXWebSocket"):
|
||||
base.cmd("git", ["clone", "https://github.com/machinezone/IXWebSocket"])
|
||||
|
||||
|
||||
# build for platform
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
if base.is_dir(current_dir + "/IXWebSocket/build/android"):
|
||||
os.chdir(current_dir_old)
|
||||
return
|
||||
|
||||
os.chdir(current_dir + "/IXWebSocket")
|
||||
|
||||
global CMAKE
|
||||
|
||||
CMAKE_TOOLCHAIN_FILE = base.get_env("ANDROID_NDK_ROOT") + "/build/cmake/android.toolchain.cmake"
|
||||
CMAKE_DIR = base.get_android_sdk_home() + "/cmake/"
|
||||
CMAKE = CMAKE_DIR + find_last_version(os.listdir(CMAKE_DIR), CMAKE_DIR) + "/bin/cmake"
|
||||
|
||||
def param_android(arch, api):
|
||||
return ["-G","Unix Makefiles", "-DANDROID_NATIVE_API_LEVEL=" + api, "-DANDROID_ABI=" + arch, "-DANDROID_TOOLCHAIN=clang", "-DANDROID_NDK=" + base.get_env("ANDROID_NDK_ROOT"), "-DCMAKE_TOOLCHAIN_FILE=" + CMAKE_TOOLCHAIN_FILE, "-DCMAKE_MAKE_PROGRAM=make"]
|
||||
|
||||
build_arch("android", "arm64-v8a", param_android("arm64-v8a", "21"))
|
||||
build_arch("android", "armeabi-v7a", param_android("armeabi-v7a", "16"))
|
||||
build_arch("android", "x86_64", param_android("x86_64", "21"))
|
||||
build_arch("android", "x86", param_android("x86", "16"))
|
||||
|
||||
|
||||
elif (-1 != config.option("platform").find("ios") or -1 != config.option("platform").find("mac")):
|
||||
platform = "ios" if -1 != config.option("platform").find("ios") else "mac"
|
||||
if base.is_dir(current_dir + "/IXWebSocket/build/" + platform):
|
||||
os.chdir(current_dir_old)
|
||||
return
|
||||
|
||||
if not base.is_dir(current_dir + "/ios-cmake"):
|
||||
base.cmd("git", ["clone", "https://github.com/leetal/ios-cmake"])
|
||||
|
||||
CMAKE_TOOLCHAIN_FILE = current_dir + "/ios-cmake/ios.toolchain.cmake"
|
||||
|
||||
os_cmd = 'cmake'
|
||||
if os.system(os_cmd) != 0:
|
||||
base.cmd("brew install", ["cmake"])
|
||||
|
||||
os.chdir(current_dir + "/IXWebSocket")
|
||||
|
||||
def param_apple(platform, arch):
|
||||
return ["-G","Xcode", "-DDEPLOYMENT_TARGET=10", "-DENABLE_BITCODE=1", "-DPLATFORM=" + platform, "-DARCHS=" + arch, "-DCMAKE_TOOLCHAIN_FILE=" + CMAKE_TOOLCHAIN_FILE]
|
||||
|
||||
def param_apple_ios(platform, arch, params=[]):
|
||||
return params + ["-G","Xcode", "-DDEPLOYMENT_TARGET=11", "-DENABLE_BITCODE=1", "-DPLATFORM=" + platform, "-DARCHS=" + arch, "-DCMAKE_TOOLCHAIN_FILE=" + CMAKE_TOOLCHAIN_FILE]
|
||||
|
||||
if(platform == "ios"):
|
||||
#build_arch("ios", "armv7", param_apple("OS", "armv7"))
|
||||
build_arch("ios", "arm64", param_apple_ios("OS64", "arm64"))
|
||||
#build_arch("ios", "i386", param_apple_ios("SIMULATOR", "i386"))
|
||||
build_arch("ios", "x86_64", param_apple_ios("SIMULATOR64", "x86_64", ["-DCMAKE_CXX_FLAGS=-std=c++11"]))
|
||||
else:
|
||||
build_arch("mac", "mac_arm64", param_apple("MAC_ARM64", "arm64"))
|
||||
build_arch("mac", "mac_64", param_apple("MAC", "x86_64"))
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
if(platform == "ios"):
|
||||
base.create_dir(current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal/include")
|
||||
base.create_dir(current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal/lib")
|
||||
|
||||
#copy include
|
||||
prefix_dir = current_dir + "/IXWebSocket/build/ios/"
|
||||
postfix_dir = ""
|
||||
if base.is_dir(prefix_dir + "arm64/usr"):
|
||||
postfix_dir = "/usr"
|
||||
|
||||
if base.is_dir(prefix_dir + "armv7" + postfix_dir + "/include"):
|
||||
base.cmd("cp", [ "-r", prefix_dir + "armv7" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
elif base.is_dir(prefix_dir + "armv64" + postfix_dir + "/include"):
|
||||
base.cmd("cp", [ "-r", prefix_dir + "armv64" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
elif base.is_dir(prefix_dir + "i386" + postfix_dir + "/include"):
|
||||
base.cmd("cp", [ "-r", prefix_dir + "i386" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
elif base.is_dir(prefix_dir + "x86_64" + postfix_dir + "/include"):
|
||||
base.cmd("cp", [ "-r", prefix_dir + "x86_64" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
|
||||
|
||||
# Create fat lib
|
||||
if (True):
|
||||
base.cmd("lipo", ["IXWebSocket/build/ios/arm64" + postfix_dir + "/lib/libixwebsocket.a",
|
||||
"IXWebSocket/build/ios/x86_64" + postfix_dir + "/lib/libixwebsocket.a",
|
||||
"-create", "-output",
|
||||
"IXWebSocket/build/ios/ixwebsocket-universal/lib/libixwebsocket.a"])
|
||||
else:
|
||||
base.cmd("lipo", ["IXWebSocket/build/ios/armv7" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/arm64" + postfix_dir + "/lib/libixwebsocket.a",
|
||||
"IXWebSocket/build/ios/i386" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/x86_64" + postfix_dir + "/lib/libixwebsocket.a",
|
||||
"-create", "-output",
|
||||
"IXWebSocket/build/ios/ixwebsocket-universal/lib/libixwebsocket.a"])
|
||||
|
||||
|
||||
elif (-1 != config.option("platform").find("linux")):
|
||||
if base.is_dir(current_dir + "/IXWebSocket/build/linux"):
|
||||
os.chdir(current_dir_old)
|
||||
return
|
||||
|
||||
#will support when openssl x86 will support
|
||||
#if (-1 != config.option("platform").find("linux_32")):
|
||||
#build_arch("linux", "linux_32", ["-G","Unix Makefiles", "-DCMAKE_MAKE_PROGRAM=make", "-DCMAKE_C_FLAGS=-m32", "-DCMAKE_CXX_FLAGS=-m32"])
|
||||
if (-1 != config.option("platform").find("linux_64")):
|
||||
build_arch("linux", "linux_64", ["-G","Unix Makefiles", "-DCMAKE_MAKE_PROGRAM=make"])
|
||||
|
||||
|
||||
elif ("windows" == base.host_platform()):
|
||||
if base.is_dir(current_dir + "/IXWebSocket/build/windows"):
|
||||
os.chdir(current_dir_old)
|
||||
return
|
||||
|
||||
vsVersion = "14 2015"
|
||||
if (config.option("vs-version") == "2019"):
|
||||
vsVersion = "16 2019"
|
||||
|
||||
if (-1 != config.option("platform").find("win_32")):
|
||||
build_arch("windows", "win_32", ["-G","Visual Studio " + vsVersion, "-A", "Win32"])
|
||||
build_arch("windows_debug", "win_32", ["-G","Visual Studio" + vsVersion, "-A", "Win32"], True)
|
||||
if (-1 != config.option("platform").find("win_64")):
|
||||
build_arch("windows", "win_64", ["-G","Visual Studio " + vsVersion + " Win64"])
|
||||
build_arch("windows_debug", "win_64", ["-G","Visual Studio " + vsVersion + " Win64"], True)
|
||||
|
||||
os.chdir(current_dir_old)
|
||||
return
|
||||
124
scripts/core_common/modules/libvlc.py
Normal file
124
scripts/core_common/modules/libvlc.py
Normal file
@ -0,0 +1,124 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
|
||||
def docker_build(image_name, dockerfile_dir, base_dir):
|
||||
base.cmd("docker", ["build", "-t", image_name, dockerfile_dir])
|
||||
vlc_dir = base_dir + "/vlc"
|
||||
base.cmd("docker", ["run", "--rm", "-v", vlc_dir + ":/vlc", image_name])
|
||||
base.cmd("docker", ["image", "rm", image_name])
|
||||
return
|
||||
|
||||
def form_build_win(src_dir, dest_dir):
|
||||
if not base.is_dir(dest_dir):
|
||||
base.create_dir(dest_dir)
|
||||
# copy include dir
|
||||
base.copy_dir(src_dir + "/sdk/include", dest_dir + "/include")
|
||||
# form lib dir
|
||||
base.create_dir(dest_dir + "/lib")
|
||||
base.copy_file(src_dir + "/sdk/lib/libvlc.lib", dest_dir + "/lib/vlc.lib")
|
||||
base.copy_file(src_dir + "/sdk/lib/libvlccore.lib", dest_dir + "/lib/vlccore.lib")
|
||||
base.copy_dir(src_dir + "/plugins", dest_dir + "/lib/plugins")
|
||||
base.copy_file(src_dir + "/libvlc.dll", dest_dir + "/lib")
|
||||
base.copy_file(src_dir + "/libvlccore.dll", dest_dir + "/lib")
|
||||
base.copy_file(src_dir + "/vlc-cache-gen.exe", dest_dir + "/lib")
|
||||
# generate cache file 'plugins.dat' for plugins loading
|
||||
base.cmd_exe(dest_dir + "/lib/vlc-cache-gen", [dest_dir + "/lib/plugins"])
|
||||
return
|
||||
|
||||
def form_build_linux(src_dir, dest_dir):
|
||||
if not base.is_dir(dest_dir):
|
||||
base.create_dir(dest_dir)
|
||||
# copy include dir
|
||||
base.copy_dir(src_dir + "/include", dest_dir + "/include")
|
||||
# copy and form lib dir
|
||||
base.copy_dir(src_dir + "/lib", dest_dir + "/lib")
|
||||
base.delete_dir(dest_dir + "/lib/pkgconfig")
|
||||
base.delete_file(dest_dir + "/lib/vlc/libcompat.a")
|
||||
|
||||
def form_build_mac(src_dir, dest_dir):
|
||||
if not base.is_dir(dest_dir):
|
||||
base.create_dir(dest_dir)
|
||||
# copy include dir
|
||||
base.copy_dir(src_dir + "/include", dest_dir + "/include")
|
||||
# copy and form lib dir
|
||||
base.copy_dir(src_dir + "/lib", dest_dir + "/lib")
|
||||
base.cmd("find", [dest_dir + "/lib", "-name", "\"*.la\"", "-type", "f", "-delete"])
|
||||
base.delete_dir(dest_dir + "/lib/pkgconfig")
|
||||
base.delete_file(dest_dir + "/lib/vlc/libcompat.a")
|
||||
# generate cache file 'plugins.dat' for plugins loading
|
||||
base.run_command("DYLD_LIBRARY_PATH=" + dest_dir + "/lib " + dest_dir + "/lib/vlc/vlc-cache-gen " + dest_dir + "/lib/vlc/plugins")
|
||||
return
|
||||
|
||||
def make():
|
||||
|
||||
print("[fetch & build]: libvlc")
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/libvlc"
|
||||
vlc_dir = base_dir + "/vlc"
|
||||
vlc_version = "3.0.18"
|
||||
|
||||
tools_dir = base.get_script_dir() + "/../tools"
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
if not base.is_dir(vlc_dir):
|
||||
# temporary disable auto CRLF for Windows
|
||||
if "windows" == base.host_platform():
|
||||
autocrlf_old = base.run_command("git config --global core.autocrlf")['stdout']
|
||||
base.cmd("git", ["config", "--global", "core.autocrlf", "false"])
|
||||
base.cmd("git", ["clone", "https://code.videolan.org/videolan/vlc.git", "--branch", vlc_version])
|
||||
if "windows" == base.host_platform():
|
||||
base.cmd("git", ["config", "--global", "core.autocrlf", autocrlf_old])
|
||||
|
||||
base.create_dir("build")
|
||||
base.copy_file("tools/ignore-cache-time.patch", "vlc")
|
||||
|
||||
# windows
|
||||
if "windows" == base.host_platform():
|
||||
if config.check_option("platform", "win_64"):
|
||||
base.copy_file("tools/win_64/build.patch", "vlc")
|
||||
docker_build("libvlc-win64", base_dir + "/tools/win_64", base_dir)
|
||||
form_build_win(vlc_dir + "/build/win64/vlc-" + vlc_version, base_dir + "/build/win_64")
|
||||
|
||||
if config.check_option("platform", "win_32"):
|
||||
base.copy_file("tools/win_32/build.patch", "vlc")
|
||||
docker_build("libvlc-win32", base_dir + "/tools/win_32", base_dir)
|
||||
form_build_win(vlc_dir + "/build/win32/vlc-" + vlc_version, base_dir + "/build/win_32")
|
||||
|
||||
# linux
|
||||
if config.check_option("platform", "linux_64"):
|
||||
base.copy_file(tools_dir + "/linux/elf/patchelf", "vlc")
|
||||
base.copy_file("tools/linux_64/change-rpaths.sh", "vlc")
|
||||
docker_build("libvlc-linux64", base_dir + "/tools/linux_64", base_dir)
|
||||
form_build_linux(vlc_dir + "/build/linux_64", base_dir + "/build/linux_64")
|
||||
|
||||
# mac
|
||||
if "mac" == base.host_platform():
|
||||
os.chdir(vlc_dir)
|
||||
|
||||
base.cmd("git", ["restore", "src/modules/bank.c"])
|
||||
base.cmd("patch", ["-p1", "src/modules/bank.c", "../tools/ignore-cache-time.patch"])
|
||||
|
||||
if config.check_option("platform", "mac_64"):
|
||||
base.cmd("git", ["restore", "extras/package/macosx/build.sh"])
|
||||
base.cmd("patch", ["-p1", "extras/package/macosx/build.sh", "../tools/mac_64/build.patch"])
|
||||
base.create_dir("build/mac_64")
|
||||
os.chdir("build/mac_64")
|
||||
base.cmd("../../extras/package/macosx/build.sh", ["-c"])
|
||||
form_build_mac(vlc_dir + "/build/mac_64/vlc_install_dir", base_dir + "/build/mac_64")
|
||||
|
||||
if config.check_option("platform", "mac_arm64"):
|
||||
base.cmd("git", ["restore", "extras/package/macosx/build.sh"])
|
||||
base.cmd("patch", ["-p1", "extras/package/macosx/build.sh", "../tools/mac_arm64/build.patch"])
|
||||
base.create_dir("build/mac_arm64")
|
||||
os.chdir("build/mac_arm64")
|
||||
base.cmd("../../extras/package/macosx/build.sh", ["-c"])
|
||||
form_build_mac(vlc_dir + "/build/mac_arm64/vlc_install_dir", base_dir + "/build/mac_arm64")
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
20
scripts/core_common/modules/md.py
Normal file
20
scripts/core_common/modules/md.py
Normal file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def make():
|
||||
print("[fetch]: md")
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/md"
|
||||
|
||||
base.cmd_in_dir(base_dir, "python", ["fetch.py"])
|
||||
return
|
||||
|
||||
if __name__ == '__main__':
|
||||
# manual compile
|
||||
make()
|
||||
15
scripts/core_common/modules/oo_brotli.py
Normal file
15
scripts/core_common/modules/oo_brotli.py
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
|
||||
def make():
|
||||
print("[fetch & build]: brotli")
|
||||
base.cmd_in_dir(base.get_script_dir() + "/../../core/Common/3dParty/brotli", "./make.py")
|
||||
return
|
||||
|
||||
if __name__ == '__main__':
|
||||
# manual compile
|
||||
make()
|
||||
@ -5,15 +5,17 @@ sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import platform
|
||||
import openssl_mobile
|
||||
|
||||
def clean():
|
||||
if base.is_dir("openssl"):
|
||||
base.delete_dir("openssl")
|
||||
base.delete_dir_with_access_error("openssl")
|
||||
if base.is_dir("build"):
|
||||
base.delete_dir("build")
|
||||
return
|
||||
|
||||
def make():
|
||||
if ("windows" == base.host_platform() or "ios" == config.option("platform")):
|
||||
return
|
||||
|
||||
print("[fetch & build]: openssl")
|
||||
|
||||
@ -21,24 +23,133 @@ def make():
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
base.common_check_version("openssl", "1", clean)
|
||||
base.common_check_version("openssl", "4", clean)
|
||||
|
||||
if (-1 != config.option("platform").find("android") or -1 != config.option("platform").find("ios")):
|
||||
os.chdir(old_cur)
|
||||
openssl_mobile.make()
|
||||
return
|
||||
|
||||
if not base.is_dir("openssl"):
|
||||
base.cmd("git", ["clone", "--depth=1", "--branch", "OpenSSL_1_1_1f", "https://github.com/openssl/openssl.git"])
|
||||
|
||||
os.chdir(base_dir + "/openssl")
|
||||
if not base.is_file("Makefile"):
|
||||
base.cmd("./config", ["no-shared", "no-asm"])
|
||||
|
||||
if base.is_file("./libssl.a") and base.is_file("./libcrypto.a"):
|
||||
old_cur_dir = base_dir.replace(" ", "\\ ")
|
||||
if ("windows" == base.host_platform()):
|
||||
old_cur_dir = base_dir.replace(" ", "\\ ")
|
||||
if (-1 != config.option("platform").find("win_64")) and not base.is_dir("../build/win_64"):
|
||||
base.create_dir("./../build/win_64")
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x64")
|
||||
qmake_bat.append("perl Configure VC-WIN64A --prefix=" + old_cur_dir + "\\build\\win_64 --openssldir=" + old_cur_dir + "\\build\\win_64 no-shared no-asm enable-md2")
|
||||
qmake_bat.append("call nmake clean")
|
||||
qmake_bat.append("call nmake build_libs install")
|
||||
base.run_as_bat(qmake_bat, True)
|
||||
if (-1 != config.option("platform").find("win_32")) and not base.is_dir("../build/win_32"):
|
||||
base.create_dir("./../build/win_32")
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x86")
|
||||
qmake_bat.append("perl Configure VC-WIN32 --prefix=" + old_cur_dir + "\\build\\win_32 --openssldir=" + old_cur_dir + "\\build\\win_32 no-shared no-asm enable-md2")
|
||||
qmake_bat.append("call nmake clean")
|
||||
qmake_bat.append("call nmake build_libs install")
|
||||
base.run_as_bat(qmake_bat, True)
|
||||
if (-1 != config.option("platform").find("win_arm64")) and not base.is_dir("../build/win_arm64"):
|
||||
base.create_dir("./../build/win_arm64")
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x64_arm64")
|
||||
qmake_bat.append("perl Configure VC-WIN64-ARM --prefix=" + old_cur_dir + "\\build\\win_arm64 --openssldir=" + old_cur_dir + "\\build\\win_arm64 no-shared no-asm enable-md2")
|
||||
qmake_bat.append("call nmake clean")
|
||||
qmake_bat.append("call nmake build_libs install")
|
||||
base.run_as_bat(qmake_bat, True)
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
# xp ----------------------------------------------------------------------------------------------------
|
||||
os.chdir(base_dir + "/openssl")
|
||||
base.replaceInFile(base_dir + "/openssl/crypto/rand/rand_win.c", "define USE_BCRYPTGENRANDOM", "define USE_BCRYPTGENRANDOM_FIX")
|
||||
old_cur_dir = base_dir.replace(" ", "\\ ")
|
||||
if (-1 != config.option("platform").find("win_64_xp")) and not base.is_dir("../build/win_64_xp"):
|
||||
base.create_dir("./../build/win_64_xp")
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x64")
|
||||
qmake_bat.append("perl Configure VC-WIN64A --prefix=" + old_cur_dir + "\\build\\win_64_xp --openssldir=" + old_cur_dir + "\\build\\win_64_xp no-shared no-asm no-async enable-md2")
|
||||
qmake_bat.append("call nmake clean")
|
||||
qmake_bat.append("call nmake build_libs install")
|
||||
base.run_as_bat(qmake_bat, True)
|
||||
if (-1 != config.option("platform").find("win_32_xp")) and not base.is_dir("../build/win_32_xp"):
|
||||
base.create_dir("./../build/win_32_xp")
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" x86")
|
||||
qmake_bat.append("perl Configure VC-WIN32 --prefix=" + old_cur_dir + "\\build\\win_32_xp --openssldir=" + old_cur_dir + "\\build\\win_32_xp no-shared no-asm no-async enable-md2")
|
||||
qmake_bat.append("call nmake clean")
|
||||
qmake_bat.append("call nmake build_libs install")
|
||||
base.run_as_bat(qmake_bat, True)
|
||||
os.chdir(old_cur)
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
return
|
||||
|
||||
if ("linux" == base.host_platform()):
|
||||
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
if (-1 != config.option("platform").find("linux")) and not base.is_dir("../build/linux_64"):
|
||||
base.cmd("./config", ["enable-md2", "no-shared", "no-asm", "--prefix=" + old_cur_dir + "/build/linux_64", "--openssldir=" + old_cur_dir + "/build/linux_64"])
|
||||
if "1" == config.option("use-clang"):
|
||||
base.replaceInFile("./Makefile", "CC=$(CROSS_COMPILE)gcc", "CC=$(CROSS_COMPILE)clang")
|
||||
base.replaceInFile("./Makefile", "CXX=$(CROSS_COMPILE)g++", "CXX=$(CROSS_COMPILE)clang++")
|
||||
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden -stdlib=libc++")
|
||||
base.replaceInFile("./Makefile", "LDFLAGS=", "LDFLAGS=-stdlib=libc++")
|
||||
elif config.option("sysroot") == "":
|
||||
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
else:
|
||||
base.replaceInFile("./Makefile", "CROSS_COMPILE=", "CROSS_COMPILE=" + config.get_custom_sysroot_bin("linux_64") + "/")
|
||||
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden --sysroot=" + config.option("sysroot_linux_64"))
|
||||
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden --sysroot=" + config.option("sysroot_linux_64"))
|
||||
|
||||
base.cmd("make", ["build_libs"])
|
||||
if config.option("sysroot") == "":
|
||||
base.cmd("make", [])
|
||||
base.cmd("make", ["install"])
|
||||
base.cmd("make", ["clean"], True)
|
||||
else:
|
||||
base.set_sysroot_env("linux_64")
|
||||
base.cmd_exe("make", [])
|
||||
base.cmd_exe("make", ["install"])
|
||||
base.cmd_exe("make", ["clean"], True)
|
||||
base.restore_sysroot_env()
|
||||
|
||||
if (-1 != config.option("platform").find("linux_arm64")) and not base.is_dir("../build/linux_arm64"):
|
||||
if (base.is_os_arm()):
|
||||
base.copy_dir("../build/linux_64", "../build/linux_arm64")
|
||||
else:
|
||||
if config.option("sysroot") != "":
|
||||
base.set_sysroot_env("linux_arm64")
|
||||
base.cmd("/usr/bin/perl", ["./Configure", "linux-aarch64", "enable-md2", "no-shared", "no-asm", "no-tests", "--prefix=" + old_cur_dir + "/build/linux_arm64", "--openssldir=" + old_cur_dir + "/build/linux_arm64"])
|
||||
#base.cmd("./Configure", ["linux-aarch64", "enable-md2", "no-shared", "no-asm", "no-tests", "--prefix=" + old_cur_dir + "/build/linux_arm64", "--openssldir=" + old_cur_dir + "/build/linux_arm64"])
|
||||
base.replaceInFile("./Makefile", "CFLAGS=-Wall -O3", "CFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
base.replaceInFile("./Makefile", "CXXFLAGS=-Wall -O3", "CXXFLAGS=-Wall -O3 -fvisibility=hidden")
|
||||
base.cmd("make", [], True)
|
||||
base.cmd("make", ["install"], True)
|
||||
if config.option("sysroot") != "":
|
||||
base.restore_sysroot_env()
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
|
||||
base.cmd("./Configure", ["enable-md2", "no-shared", "no-asm", "darwin64-x86_64-cc", "--prefix=" + old_cur_dir + "/build/mac_64", "--openssldir=" + old_cur_dir + "/build/mac_64", "-mmacosx-version-min=10.11"])
|
||||
base.cmd("make", ["build_libs", "install"])
|
||||
|
||||
if (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_arm64"):
|
||||
os.chdir(base_dir)
|
||||
base.cmd("git", ["clone", "--depth=1", "--branch", "OpenSSL_1_1_1f", "https://github.com/openssl/openssl.git", "openssl2"])
|
||||
os.chdir(base_dir + "/openssl2")
|
||||
replace1 = "\"darwin64-x86_64-cc\" => {"
|
||||
replace2 = "\"darwin64-arm64-cc\" => {\n\
|
||||
inherit_from => [ \"darwin-common\", asm(\"aarch64_asm\") ],\n\
|
||||
CFLAGS => add(\"-Wall\"),\n\
|
||||
cflags => add(\"-arch arm64 -isysroot " + base.find_mac_sdk() + "\"),\n\
|
||||
lib_cppflags => add(\"-DL_ENDIAN\"),\n\
|
||||
bn_ops => \"SIXTY_FOUR_BIT_LONG\",\n\
|
||||
perlasm_scheme => \"macosx\",\n\
|
||||
},\n\
|
||||
\"darwin64-x86_64-cc\" => {"
|
||||
base.replaceInFile(base_dir + "/openssl2/Configurations/10-main.conf", replace1, replace2)
|
||||
base.cmd("./Configure", ["enable-md2", "no-shared", "no-asm", "darwin64-arm64-cc", "--prefix=" + old_cur_dir + "/build/mac_arm64", "--openssldir=" + old_cur_dir + "/build/mac_arm64"])
|
||||
base.cmd("make", ["build_libs", "install"])
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
22
scripts/core_common/modules/openssl_mobile.py
Executable file
22
scripts/core_common/modules/openssl_mobile.py
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
sys.path.append('android')
|
||||
import base
|
||||
import config
|
||||
import os
|
||||
import subprocess
|
||||
import openssl_android
|
||||
|
||||
def make():
|
||||
path = base.get_script_dir() + "/../../core/Common/3dParty/openssl"
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(path)
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
openssl_android.make()
|
||||
|
||||
if (-1 != config.option("platform").find("ios") and not base.is_dir("./build/ios")):
|
||||
subprocess.call(["./build-ios-openssl.sh"])
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
74
scripts/core_common/modules/socket_io.py
Normal file
74
scripts/core_common/modules/socket_io.py
Normal file
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
import glob
|
||||
|
||||
def clean():
|
||||
if base.is_dir("socket.io-client-cpp"):
|
||||
base.delete_dir_with_access_error("socket.io-client-cpp")
|
||||
return
|
||||
|
||||
def correct_namespace(dir):
|
||||
folder = dir
|
||||
if ("/" != folder[-1:]):
|
||||
folder += "/"
|
||||
folder += "*"
|
||||
for file in glob.glob(folder):
|
||||
if base.is_file(file):
|
||||
base.replaceInFile(file, "namespace sio", "namespace sio_no_tls")
|
||||
base.replaceInFile(file, "asio::", "asio_no_tls::")
|
||||
base.replaceInFile(file, "sio::", "sio_no_tls::")
|
||||
base.replaceInFile(file, "asio_no_tls::", "asio::")
|
||||
elif base.is_dir(file):
|
||||
correct_namespace(file)
|
||||
return
|
||||
|
||||
def make():
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/socketio"
|
||||
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
base.common_check_version("socketio", "2", clean)
|
||||
os.chdir(old_cur)
|
||||
|
||||
if not base.is_dir(base_dir + "/socket.io-client-cpp"):
|
||||
base.cmd_in_dir(base_dir, "git", ["clone", "https://github.com/socketio/socket.io-client-cpp.git"])
|
||||
base.cmd_in_dir(base_dir + "/socket.io-client-cpp", "git", ["checkout", "da779141a7379cc30c870d48295033bc16a23c66"])
|
||||
base.cmd_in_dir(base_dir + "/socket.io-client-cpp", "git", ["submodule", "init"])
|
||||
base.cmd_in_dir(base_dir + "/socket.io-client-cpp", "git", ["submodule", "update"])
|
||||
base.cmd_in_dir(base_dir + "/socket.io-client-cpp/lib/asio", "git", ["checkout", "230c0d2ae035c5ce1292233fcab03cea0d341264"])
|
||||
base.cmd_in_dir(base_dir + "/socket.io-client-cpp/lib/websocketpp", "git", ["checkout", "56123c87598f8b1dd471be83ca841ceae07f95ba"])
|
||||
# patches
|
||||
base.apply_patch(base_dir + "/socket.io-client-cpp/lib/websocketpp/websocketpp/impl/connection_impl.hpp", base_dir + "/patches/websocketpp.patch")
|
||||
base.apply_patch(base_dir + "/socket.io-client-cpp/src/internal/sio_client_impl.cpp", base_dir + "/patches/sio_client_impl_fail.patch")
|
||||
base.apply_patch(base_dir + "/socket.io-client-cpp/src/internal/sio_client_impl.cpp", base_dir + "/patches/sio_client_impl_open.patch")
|
||||
base.apply_patch(base_dir + "/socket.io-client-cpp/src/internal/sio_client_impl.cpp", base_dir + "/patches/sio_client_impl_close_timeout.patch")
|
||||
base.apply_patch(base_dir + "/socket.io-client-cpp/src/internal/sio_client_impl.cpp", base_dir + "/patches/sio_client_impl_encode.patch")
|
||||
|
||||
# no tls realization (remove if socket.io fix this)
|
||||
dst_dir = base_dir + "/socket.io-client-cpp/src_no_tls"
|
||||
base.copy_dir(base_dir + "/socket.io-client-cpp/src", dst_dir)
|
||||
correct_namespace(dst_dir)
|
||||
base.replaceInFile(dst_dir + "/internal/sio_client_impl.h", "SIO_TLS", "SIO_TLS_NO")
|
||||
base.replaceInFile(dst_dir + "/internal/sio_client_impl.cpp", "SIO_TLS", "SIO_TLS_NO")
|
||||
|
||||
base.replaceInFile(dst_dir + "/sio_socket.h", "SIO_SOCKET_H", "SIO_SOCKET_NO_TLS_H")
|
||||
base.replaceInFile(dst_dir + "/sio_client.h", "SIO_CLIENT_H", "SIO_CLIENT_NO_TLS_H")
|
||||
base.replaceInFile(dst_dir + "/sio_message.h", "__SIO_MESSAGE_H__", "__SIO_MESSAGE_NO_TLS_H__")
|
||||
base.replaceInFile(dst_dir + "/internal/sio_packet.h", "SIO_PACKET_H", "SIO_PACKET_NO_TLS_H")
|
||||
|
||||
old_ping = " m_ping_timeout_timer->expires_from_now(milliseconds(m_ping_interval + m_ping_timeout), ec);"
|
||||
new_ping = "#if defined(PING_TIMEOUT_INTERVAL)\n"
|
||||
new_ping += " m_ping_timeout_timer->expires_from_now(milliseconds(PING_TIMEOUT_INTERVAL), ec);\n"
|
||||
new_ping += "#else\n"
|
||||
new_ping += old_ping
|
||||
new_ping += "\n#endif"
|
||||
|
||||
base.replaceInFile(base_dir + "/socket.io-client-cpp/src/internal/sio_client_impl.cpp", old_ping, new_ping)
|
||||
base.replaceInFile(base_dir + "/socket.io-client-cpp/src_no_tls/internal/sio_client_impl.cpp", old_ping, new_ping)
|
||||
return
|
||||
66
scripts/core_common/modules/socketrocket.py
Normal file
66
scripts/core_common/modules/socketrocket.py
Normal file
@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import config
|
||||
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/socketrocket"
|
||||
|
||||
def buildIOS():
|
||||
# Build for iphone
|
||||
base.cmd("xcodebuild", ["archive", "-project", current_dir + "/SocketRocket.xcodeproj", "-scheme", "SocketRocket", "-archivePath", current_dir + "/build/SocketRocket-devices.xcarchive", "-sdk", "iphoneos", "ENABLE_BITCODE=NO", "BUILD_LIBRARY_FOR_DISTRIBUTION=YES", "SKIP_INSTALL=NO"])
|
||||
base.cmd("xcodebuild", ["-sdk", "iphoneos", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release"])
|
||||
|
||||
# Build for simulator
|
||||
base.cmd("xcodebuild", ["archive", "-project", current_dir + "/SocketRocket.xcodeproj", "-scheme", "SocketRocket", "-archivePath", current_dir + "/build/SocketRocket-simulators.xcarchive", "-sdk", "iphonesimulator", "ENABLE_BITCODE=NO", "BUILD_LIBRARY_FOR_DISTRIBUTION=YES", "SKIP_INSTALL=NO"])
|
||||
base.cmd("xcodebuild", ["-sdk", "iphonesimulator", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release"])
|
||||
|
||||
# Package xcframework
|
||||
base.cmd("xcodebuild", ["-create-xcframework", "-library", current_dir + "/build/SocketRocket-devices.xcarchive/Products/usr/local/lib/libSocketRocket.a", "-library", current_dir + "/build/SocketRocket-simulators.xcarchive/Products/usr/local/lib/libSocketRocket.a", "-output", current_dir + "/build/SocketRocket.xcframework"])
|
||||
|
||||
# Remove arm64 for simulator for SDK 14
|
||||
base.cmd("lipo", ["-remove", "arm64", "-output", "build/Release-iphonesimulator/libSocketRocket.a", "build/Release-iphonesimulator/libSocketRocket.a"])
|
||||
|
||||
base.create_dir(current_dir + "/build/ios/lib")
|
||||
|
||||
# Create fat lib
|
||||
base.cmd("lipo", ["./build/Release-iphonesimulator/libSocketRocket.a", "./build/Release-iphoneos/libSocketRocket.a", "-create", "-output",
|
||||
"./build/ios/lib/libSoсketRocket.a"])
|
||||
|
||||
return
|
||||
|
||||
def buildMacOS():
|
||||
|
||||
# Build for iphone
|
||||
base.cmd("xcodebuild", ["-sdk", "macosx", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release"])
|
||||
|
||||
base.create_dir(current_dir + "/build/mac_64/lib")
|
||||
base.create_dir(current_dir + "/build/mac_arm64/lib")
|
||||
|
||||
base.cmd("lipo", ["build/Release/libSocketRocket.a", "-thin", "x86_64", "-output", "build/mac_64/lib/libSoсketRocket.a"])
|
||||
base.cmd("lipo", ["build/Release/libSocketRocket.a", "-thin", "arm64", "-output", "build/mac_arm64/lib/libSoсketRocket.a"])
|
||||
|
||||
base.delete_file("build/Release/libSocketRocket.a")
|
||||
|
||||
return
|
||||
|
||||
def make():
|
||||
if (-1 == config.option("platform").find("mac") and -1 == config.option("platform").find("ios")):
|
||||
return
|
||||
|
||||
current_dir_old = os.getcwd()
|
||||
|
||||
print("[build]: socketrocket")
|
||||
os.chdir(current_dir)
|
||||
|
||||
if (-1 != config.option("platform").find("mac")):
|
||||
if not base.is_dir(current_dir + "/build/mac_64") or not base.is_dir(current_dir + "/build/mac_arm_64"):
|
||||
buildMacOS()
|
||||
elif (-1 != config.option("platform").find("ios")):
|
||||
if not base.is_dir(current_dir + "/build/ios"):
|
||||
buildIOS()
|
||||
os.chdir(current_dir_old)
|
||||
return
|
||||
@ -5,13 +5,15 @@ sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
import v8_89
|
||||
|
||||
def clean():
|
||||
if base.is_dir("depot_tools"):
|
||||
base.delete_dir_with_access_error("depot_tools");
|
||||
base.delete_dir_with_access_error("depot_tools")
|
||||
base.delete_dir("depot_tools")
|
||||
if base.is_dir("v8"):
|
||||
base.delete_dir_with_access_error("v8");
|
||||
base.delete_dir_with_access_error("v8")
|
||||
base.delete_dir("v8")
|
||||
if base.is_exist("./.gclient"):
|
||||
base.delete_file("./.gclient")
|
||||
@ -24,10 +26,16 @@ def clean():
|
||||
def is_main_platform():
|
||||
if (config.check_option("platform", "win_64") or config.check_option("platform", "win_32")):
|
||||
return True
|
||||
if (config.check_option("platform", "linux_64") or config.check_option("platform", "linux_32")):
|
||||
if (config.check_option("platform", "win_arm64")):
|
||||
return True
|
||||
if (config.check_option("platform", "linux_64") or config.check_option("platform", "linux_32") or config.check_option("platform", "linux_arm64")):
|
||||
return True
|
||||
if config.check_option("platform", "mac_64"):
|
||||
return True
|
||||
if config.check_option("platform", "ios"):
|
||||
return True
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
return True
|
||||
return False
|
||||
|
||||
def is_xp_platform():
|
||||
@ -35,17 +43,39 @@ def is_xp_platform():
|
||||
return True
|
||||
return False
|
||||
|
||||
def is_use_clang():
|
||||
if config.option("sysroot") == "" and "1" == config.option("use-clang"):
|
||||
return "true"
|
||||
return "false"
|
||||
|
||||
def make():
|
||||
if not is_main_platform():
|
||||
make_xp()
|
||||
return
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8"
|
||||
if ("ios" == config.option("platform")):
|
||||
return
|
||||
|
||||
print("[fetch & build]: v8")
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
base.cmd_in_dir(base_dir + "/android", "python", ["./make.py"])
|
||||
if (-1 == config.option("platform").find("linux")) and (-1 == config.option("platform").find("mac")) and (-1 == config.option("platform").find("win")):
|
||||
return
|
||||
|
||||
if ("mac" == base.host_platform()) and (-1 == config.option("config").find("use_v8")):
|
||||
return
|
||||
|
||||
use_v8_89 = True
|
||||
if config.check_option("config", "v8_version_60"):
|
||||
use_v8_89 = False
|
||||
|
||||
if (use_v8_89):
|
||||
v8_89.make()
|
||||
return
|
||||
|
||||
print("[fetch & build]: v8")
|
||||
old_env = dict(os.environ)
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8"
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
@ -60,6 +90,7 @@ def make():
|
||||
|
||||
if not base.is_dir("depot_tools"):
|
||||
base.cmd("git", ["clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"])
|
||||
v8_89.change_bootstrap()
|
||||
if ("windows" == base.host_platform()):
|
||||
# hack for 32 bit system!!!
|
||||
if base.is_file("depot_tools/cipd.ps1"):
|
||||
@ -81,7 +112,18 @@ def make():
|
||||
# --------------------------------------------------------------------------
|
||||
# correct
|
||||
if not base.is_dir("v8/out.gn"):
|
||||
base.cmd("gclient", ["sync"], True)
|
||||
|
||||
# windows hack (delete later) ----------------------
|
||||
if ("windows" == base.host_platform()):
|
||||
base.delete_dir_with_access_error("v8/buildtools/win")
|
||||
base.cmd("git", ["config", "--system", "core.longpaths", "true"], True)
|
||||
base.cmd("gclient", ["sync", "--force"], True)
|
||||
else:
|
||||
base.cmd("gclient", ["sync"], True)
|
||||
|
||||
# normal version !!!
|
||||
#base.cmd("gclient", ["sync"], True)
|
||||
# --------------------------------------------------
|
||||
|
||||
if ("linux" == base.host_platform()):
|
||||
if base.is_dir("v8/third_party/binutils/Linux_x64/Release"):
|
||||
@ -108,7 +150,13 @@ def make():
|
||||
if ("windows" == base.host_platform()):
|
||||
base.replaceInFile("v8/build/config/win/BUILD.gn", ":static_crt", ":dynamic_crt")
|
||||
if ("mac" == base.host_platform()):
|
||||
base.replaceInFile("v8/build/config/mac/mac_sdk.gni", "if (mac_sdk_version != mac_sdk_min_build_override", "if (false && mac_sdk_version != mac_sdk_min_build_override")
|
||||
base.replaceInFile("v8/build/config/mac/mac_sdk.gni", "if (mac_sdk_version != mac_sdk_min_build_override", "if (false && mac_sdk_version != mac_sdk_min_build_override")
|
||||
base.replaceInFile("v8/build/mac/find_sdk.py", "^MacOSX(10\\.\\d+)\\.sdk$", "^MacOSX(1\\d\\.\\d+)\\.sdk$")
|
||||
|
||||
if (11003 <= base.get_mac_sdk_version_number()):
|
||||
base.copy_dir("v8/third_party/llvm-build/Release+Asserts/include", "v8/third_party/llvm-build/Release+Asserts/__include")
|
||||
base.delete_dir("v8/third_party/llvm-build/Release+Asserts/include")
|
||||
base.replaceInFile("v8/build/config/mac/BUILD.gn", "\"-mmacosx-version-min=$mac_deployment_target\",", "\"-mmacosx-version-min=$mac_deployment_target\",\n \"-Wno-deprecated-declarations\",")
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# build
|
||||
@ -118,17 +166,18 @@ def make():
|
||||
base_args32 = "target_cpu=\\\"x86\\\" v8_target_cpu=\\\"x86\\\" v8_static_library=true is_component_build=false v8_use_snapshot=false"
|
||||
|
||||
if config.check_option("platform", "linux_64"):
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_64", "--args=\"is_debug=false " + base_args64 + " is_clang=false use_sysroot=false\""])
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_64", "--args=\"is_debug=false " + base_args64 + " is_clang=" + is_use_clang() + " use_sysroot=false treat_warnings_as_errors=false\""])
|
||||
base.cmd("ninja", ["-C", "out.gn/linux_64"])
|
||||
|
||||
if config.check_option("platform", "linux_32"):
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_32", "--args=\"is_debug=false " + base_args32 + " is_clang=false use_sysroot=false\""])
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_32", "--args=\"is_debug=false " + base_args32 + " is_clang=" + is_use_clang() + " use_sysroot=false treat_warnings_as_errors=false\""])
|
||||
base.cmd("ninja", ["-C", "out.gn/linux_32"])
|
||||
|
||||
if config.check_option("platform", "mac_64"):
|
||||
base.cmd2("gn", ["gen", "out.gn/mac_64", "--args=\"is_debug=false " + base_args64 + "\""])
|
||||
base.cmd("ninja", ["-C", "out.gn/mac_64"])
|
||||
|
||||
# add enable_iterator_debugging=false for disable _ITERATOR_DEBUG_LEVEL
|
||||
if config.check_option("platform", "win_64"):
|
||||
if (-1 != config.option("config").lower().find("debug")):
|
||||
base.cmd2("gn", ["gen", "out.gn/win_64/debug", "--args=\"is_debug=true " + base_args64 + " is_clang=false\""])
|
||||
@ -146,9 +195,10 @@ def make():
|
||||
base.cmd("ninja", ["-C", "out.gn/win_32/release"])
|
||||
|
||||
os.chdir(old_cur)
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
|
||||
make_xp()
|
||||
|
||||
return
|
||||
|
||||
def make_xp():
|
||||
@ -156,6 +206,7 @@ def make_xp():
|
||||
return
|
||||
|
||||
print("[fetch & build]: v8_xp")
|
||||
old_env = dict(os.environ)
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8/v8_xp"
|
||||
old_cur = os.getcwd()
|
||||
@ -172,13 +223,16 @@ def make_xp():
|
||||
|
||||
if not base.is_dir("depot_tools"):
|
||||
base.cmd("git", ["clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"])
|
||||
v8_89.change_bootstrap()
|
||||
if ("windows" == base.host_platform()):
|
||||
# hack for 32 bit system!!!
|
||||
base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64")
|
||||
if base.is_file("depot_tools/cipd.ps1"):
|
||||
base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64")
|
||||
|
||||
old_path = os.environ["PATH"]
|
||||
# old variant
|
||||
path_to_python2 = "/depot_tools/bootstrap-2@3_11_8_chromium_35_bin/python/bin"
|
||||
os.environ["PATH"] = os.pathsep.join([base_dir + "/depot_tools",
|
||||
base_dir + "/depot_tools/win_tools-2_7_13_chromium7_bin/python/bin",
|
||||
base_dir + path_to_python2,
|
||||
config.option("vs-path") + "/../Common7/IDE",
|
||||
os.environ["PATH"]])
|
||||
|
||||
@ -187,6 +241,9 @@ def make_xp():
|
||||
if not base.is_dir("v8"):
|
||||
base.cmd("./depot_tools/fetch", ["v8"], True)
|
||||
base.cmd("./depot_tools/gclient", ["sync", "-r", "4.10.253"], True)
|
||||
base.delete_dir_with_access_error("v8/buildtools/win")
|
||||
base.cmd("git", ["config", "--system", "core.longpaths", "true"], True)
|
||||
base.cmd("gclient", ["sync", "--force"], True)
|
||||
|
||||
# save common py script
|
||||
base.save_as_script("v8/build/common_xp.py", [
|
||||
@ -208,8 +265,16 @@ def make_xp():
|
||||
"for file in projects:",
|
||||
" replaceInFile(file, '<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>', '<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>')",
|
||||
" replaceInFile(file, '<RuntimeLibrary>MultiThreaded</RuntimeLibrary>', '<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>')",
|
||||
]);
|
||||
])
|
||||
|
||||
programFilesDir = base.get_env("ProgramFiles")
|
||||
if ("" != base.get_env("ProgramFiles(x86)")):
|
||||
programFilesDir = base.get_env("ProgramFiles(x86)")
|
||||
dev_path = programFilesDir + "\\Microsoft Visual Studio 14.0\\Common7\\IDE"
|
||||
if (base.is_dir(dev_path)):
|
||||
os.environ["PATH"] = dev_path + os.pathsep + os.environ["PATH"]
|
||||
|
||||
# add "SET CL=\"/D_ITERATOR_DEBUG_LEVEL=0\"" before devenv for disable _ITERATOR_DEBUG_LEVEL in debug
|
||||
if config.check_option("platform", "win_64_xp"):
|
||||
if not base.is_dir("win_64/release"):
|
||||
base.run_as_bat(["call python v8/build/gyp_v8 -Dtarget_arch=x64", "call python v8/build/common_xp.py", "call devenv v8/tools/gyp/v8.sln /Rebuild Release"])
|
||||
@ -236,6 +301,7 @@ def make_xp():
|
||||
base.copy_files("v8/build/Debug/lib/*", "win_32/debug/")
|
||||
base.copy_file("v8/build/Debug/icudt.dll", "win_32/debug/icudt.dll")
|
||||
|
||||
os.environ["PATH"] = old_path
|
||||
os.chdir(old_cur)
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
return
|
||||
|
||||
37
scripts/core_common/modules/v8_89.patch
Normal file
37
scripts/core_common/modules/v8_89.patch
Normal file
@ -0,0 +1,37 @@
|
||||
class StrongRootBlockAllocator {
|
||||
public:
|
||||
using pointer = Address*;
|
||||
using const_pointer = const Address*;
|
||||
using reference = Address&;
|
||||
using const_reference = const Address&;
|
||||
using value_type = Address;
|
||||
using size_type = size_t;
|
||||
using difference_type = ptrdiff_t;
|
||||
template <class U>
|
||||
struct rebind;
|
||||
|
||||
explicit StrongRootBlockAllocator(Heap* heap) : heap_(heap) {}
|
||||
|
||||
Address* allocate(size_t n);
|
||||
void deallocate(Address* p, size_t n) noexcept;
|
||||
|
||||
private:
|
||||
Heap* heap_;
|
||||
};
|
||||
|
||||
// Rebinding to Address gives another StrongRootBlockAllocator.
|
||||
template <>
|
||||
struct StrongRootBlockAllocator::rebind<Address> {
|
||||
using other = StrongRootBlockAllocator;
|
||||
};
|
||||
|
||||
// Rebinding to something other than Address gives a std::allocator that
|
||||
// is copy-constructable from StrongRootBlockAllocator.
|
||||
template <class U>
|
||||
struct StrongRootBlockAllocator::rebind {
|
||||
class other : public std::allocator<U> {
|
||||
public:
|
||||
// NOLINTNEXTLINE
|
||||
other(const StrongRootBlockAllocator&) {}
|
||||
};
|
||||
};
|
||||
348
scripts/core_common/modules/v8_89.py
Normal file
348
scripts/core_common/modules/v8_89.py
Normal file
@ -0,0 +1,348 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def clean():
|
||||
if base.is_dir("depot_tools"):
|
||||
base.delete_dir_with_access_error("depot_tools")
|
||||
base.delete_dir("depot_tools")
|
||||
if base.is_dir("v8"):
|
||||
base.delete_dir_with_access_error("v8")
|
||||
base.delete_dir("v8")
|
||||
if base.is_exist("./.gclient"):
|
||||
base.delete_file("./.gclient")
|
||||
if base.is_exist("./.gclient_entries"):
|
||||
base.delete_file("./.gclient_entries")
|
||||
if base.is_exist("./.gclient_previous_sync_commits"):
|
||||
base.delete_file("./.gclient_previous_sync_commits")
|
||||
if base.is_exist("./.gcs_entries"):
|
||||
base.delete_file("./.gcs_entries")
|
||||
if base.is_exist("./.cipd"):
|
||||
base.delete_dir("./.cipd")
|
||||
return
|
||||
|
||||
def change_bootstrap():
|
||||
base.move_file("./depot_tools/bootstrap/manifest.txt", "./depot_tools/bootstrap/manifest.txt.bak")
|
||||
content = "# changed by build_tools\n\n"
|
||||
content += "$VerifiedPlatform windows-amd64 windows-arm64 linux-amd64 mac-amd64 mac-arm64\n\n"
|
||||
|
||||
content += "@Subdir python\n"
|
||||
content += "infra/3pp/tools/cpython/${platform} version:2@2.7.18.chromium.39\n\n"
|
||||
|
||||
content += "@Subdir python3\n"
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
content += "infra/3pp/tools/cpython3/${platform} version:2@3.11.8.chromium.35\n\n"
|
||||
else:
|
||||
content += "infra/3pp/tools/cpython3/${platform} version:2@3.8.10.chromium.23\n\n"
|
||||
|
||||
content += "@Subdir git\n"
|
||||
content += "infra/3pp/tools/git/${platform} version:2@2.41.0.chromium.11\n"
|
||||
|
||||
base.replaceInFile("./depot_tools/bootstrap/bootstrap.py",
|
||||
"raise subprocess.CalledProcessError(proc.returncode, argv, None)", "return")
|
||||
|
||||
base.replaceInFile("./depot_tools/bootstrap/bootstrap.py",
|
||||
" _win_git_bootstrap_config()", " #_win_git_bootstrap_config()")
|
||||
|
||||
base.writeFile("./depot_tools/bootstrap/manifest.txt", content)
|
||||
return
|
||||
|
||||
def is_ubuntu_24_or_higher():
|
||||
try:
|
||||
with open('/etc/os-release') as f:
|
||||
for line in f:
|
||||
if line.startswith('VERSION_ID='):
|
||||
version = line.split('=')[1].strip().strip('"')
|
||||
return float(version) >= 24
|
||||
except:
|
||||
pass
|
||||
return False
|
||||
|
||||
def fix_ubuntu24():
|
||||
#if not is_ubuntu_24_or_higher():
|
||||
# return
|
||||
|
||||
if "" == config.option("sysroot"):
|
||||
return
|
||||
|
||||
old_cur = os.getcwd()
|
||||
os.chdir("third_party/llvm-build/Release+Asserts/lib")
|
||||
base.cmd("mv", ["libstdc++.so.6", "libstdc++.so.6.old"])
|
||||
base.cmd("ln", ["-s", "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", "libstdc++.so.6"])
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
def make_args(args, platform, is_64=True, is_debug=False):
|
||||
args_copy = args[:]
|
||||
if is_64:
|
||||
args_copy.append("target_cpu=\\\"x64\\\"")
|
||||
args_copy.append("v8_target_cpu=\\\"x64\\\"")
|
||||
else:
|
||||
args_copy.append("target_cpu=\\\"x86\\\"")
|
||||
args_copy.append("v8_target_cpu=\\\"x86\\\"")
|
||||
|
||||
if (platform == "linux_arm64"):
|
||||
args_copy = args[:]
|
||||
args_copy.append("target_cpu=\\\"arm64\\\"")
|
||||
args_copy.append("v8_target_cpu=\\\"arm64\\\"")
|
||||
|
||||
if (platform == "win_arm64"):
|
||||
args_copy = args[:]
|
||||
args_copy.append("target_cpu=\\\"arm64\\\"")
|
||||
args_copy.append("v8_target_cpu=\\\"arm64\\\"")
|
||||
args_copy.append("is_clang=false")
|
||||
|
||||
if is_debug:
|
||||
args_copy.append("is_debug=true")
|
||||
if (platform == "windows"):
|
||||
args_copy.append("enable_iterator_debugging=true")
|
||||
else:
|
||||
args_copy.append("is_debug=false")
|
||||
|
||||
linux_clang = False
|
||||
if platform == "linux":
|
||||
if "" != config.option("sysroot"):
|
||||
args_copy.append("use_sysroot=true")
|
||||
args_copy.append("is_clang=false")
|
||||
if is_ubuntu_24_or_higher():
|
||||
args_copy.append("use_gold=false")
|
||||
args_copy.append("sysroot=\\\"" + config.option("sysroot_linux_64") + "\\\"")
|
||||
args_copy.append("target_sysroot=\\\"" + config.option("sysroot_linux_64") + "\\\"")
|
||||
else:
|
||||
args_copy.append("is_clang=true")
|
||||
if "1" == config.option("use-clang"):
|
||||
linux_clang = True
|
||||
else:
|
||||
args_copy.append("use_sysroot=false")
|
||||
|
||||
if platform == "linux_arm64":
|
||||
if "" != config.option("sysroot"):
|
||||
args_copy.append("use_sysroot=true")
|
||||
if is_ubuntu_24_or_higher():
|
||||
args_copy.append("use_gold=false")
|
||||
#args_copy.append("sysroot=\\\"" + config.option("sysroot_linux_64") + "\\\"")
|
||||
args_copy.append("target_sysroot=\\\"" + config.option("sysroot_linux_arm64") + "\\\"")
|
||||
else:
|
||||
args_copy.append("is_clang=true")
|
||||
if "1" == config.option("use-clang"):
|
||||
linux_clang = True
|
||||
else:
|
||||
args_copy.append("use_sysroot=false")
|
||||
|
||||
|
||||
if (platform == "windows"):
|
||||
args_copy.append("is_clang=false")
|
||||
|
||||
if (platform == "mac") and base.is_os_arm():
|
||||
args_copy.append("host_cpu=\\\"x64\\\"")
|
||||
|
||||
if linux_clang != True:
|
||||
args_copy.append("use_custom_libcxx=false")
|
||||
|
||||
return "--args=\"" + " ".join(args_copy) + "\""
|
||||
|
||||
def ninja_windows_make(args, is_64=True, is_debug=False, is_arm=False):
|
||||
directory_out = "out.gn/"
|
||||
|
||||
if is_arm:
|
||||
directory_out += "win_arm64/"
|
||||
else:
|
||||
directory_out += ("win_64/" if is_64 else "win_32/")
|
||||
|
||||
directory_out += ("debug" if is_debug else "release")
|
||||
|
||||
if is_arm:
|
||||
base.cmd2("gn", ["gen", directory_out, make_args(args, "win_arm64", is_64, is_debug)])
|
||||
else:
|
||||
base.cmd2("gn", ["gen", directory_out, make_args(args, "windows", is_64, is_debug)])
|
||||
|
||||
base.copy_file("./" + directory_out + "/obj/v8_wrappers.ninja", "./" + directory_out + "/obj/v8_wrappers.ninja.bak")
|
||||
base.replaceInFile("./" + directory_out + "/obj/v8_wrappers.ninja", "target_output_name = v8_wrappers", "target_output_name = v8_wrappers\nbuild obj/v8_wrappers.obj: cxx ../../../src/base/platform/wrappers.cc")
|
||||
base.replaceInFile("./" + directory_out + "/obj/v8_wrappers.ninja", "build obj/v8_wrappers.lib: alink", "build obj/v8_wrappers.lib: alink obj/v8_wrappers.obj")
|
||||
|
||||
win_toolset_wrapper_file = "build/toolchain/win/tool_wrapper.py"
|
||||
win_toolset_wrapper_file_content = base.readFile("build/toolchain/win/tool_wrapper.py")
|
||||
if (-1 == win_toolset_wrapper_file_content.find("line = line.decode('utf8')")):
|
||||
base.replaceInFile(win_toolset_wrapper_file, "for line in link.stdout:\n", "for line in link.stdout:\n line = line.decode('utf8')\n")
|
||||
|
||||
|
||||
base.cmd("ninja", ["-C", directory_out, "v8_wrappers"])
|
||||
if is_arm:
|
||||
base.copy_file('./' + directory_out + '/obj/v8_wrappers.lib', './' + directory_out + '/x64/obj/v8_wrappers.lib')
|
||||
base.cmd("ninja", ["-C", directory_out])
|
||||
base.delete_file("./" + directory_out + "/obj/v8_wrappers.ninja")
|
||||
base.move_file("./" + directory_out + "/obj/v8_wrappers.ninja.bak", "./" + directory_out + "/obj/v8_wrappers.ninja")
|
||||
return
|
||||
|
||||
# patch v8 for build ---------------------------------------------------
|
||||
def patch_windows_debug():
|
||||
# v8 8.9 version does not built with enable_iterator_debugging flag
|
||||
# patch heap.h file:
|
||||
file_patch = "./src/heap/heap.h"
|
||||
base.copy_file(file_patch, file_patch + ".bak")
|
||||
content_old = base.readFile(file_patch)
|
||||
posStart = content_old.find("class StrongRootBlockAllocator {")
|
||||
posEnd = content_old.find("};", posStart + 1)
|
||||
posEnd = content_old.find("};", posEnd + 1)
|
||||
content = content_old[0:posStart]
|
||||
content += base.readFile("./../../../../../build_tools/scripts/core_common/modules/v8_89.patch")
|
||||
content += content_old[posEnd + 2:]
|
||||
base.writeFile(file_patch, content)
|
||||
return
|
||||
|
||||
def unpatch_windows_debug():
|
||||
file_patch = "./src/heap/heap.h"
|
||||
base.move_file(file_patch + ".bak", file_patch)
|
||||
return
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
def make():
|
||||
old_env = dict(os.environ)
|
||||
old_cur = os.getcwd()
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/v8_89"
|
||||
if not base.is_dir(base_dir):
|
||||
base.create_dir(base_dir)
|
||||
|
||||
if ("mac" == base.host_platform()):
|
||||
base.cmd("git", ["config", "--global", "http.postBuffer", "157286400"], True)
|
||||
|
||||
os.chdir(base_dir)
|
||||
base.common_check_version("v8", "1", clean)
|
||||
|
||||
if not base.is_dir("depot_tools"):
|
||||
base.cmd("git", ["clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"])
|
||||
change_bootstrap()
|
||||
|
||||
os.environ["PATH"] = base_dir + "/depot_tools" + os.pathsep + os.environ["PATH"]
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
base.set_env("DEPOT_TOOLS_WIN_TOOLCHAIN", "0")
|
||||
base.set_env("GYP_MSVS_VERSION", config.option("vs-version"))
|
||||
|
||||
if not base.is_dir("v8"):
|
||||
base.cmd("./depot_tools/fetch", ["v8"], True)
|
||||
base.copy_dir("./v8/third_party", "./v8/third_party_new")
|
||||
if ("windows" == base.host_platform()):
|
||||
os.chdir("v8")
|
||||
base.cmd("git", ["config", "--system", "core.longpaths", "true"], True)
|
||||
os.chdir("../")
|
||||
v8_branch_version = "remotes/branch-heads/8.9"
|
||||
if ("mac" == base.host_platform()):
|
||||
v8_branch_version = "remotes/branch-heads/9.9"
|
||||
base.cmd("./depot_tools/gclient", ["sync", "-r", v8_branch_version], True)
|
||||
base.cmd("gclient", ["sync", "--force"], True)
|
||||
base.copy_dir("./v8/third_party_new/ninja", "./v8/third_party/ninja")
|
||||
if ("linux" == base.host_platform()):
|
||||
if not base.is_file("./depot_tools/python3_bin_reldir.txt"):
|
||||
base.cmd_in_dir("./depot_tools", "./ensure_bootstrap", [], True)
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
base.replaceInFile("v8/build/config/win/BUILD.gn", ":static_crt", ":dynamic_crt")
|
||||
|
||||
# fix for new depot_tools and vs2019, as VC folder contains a folder with a symbol in the name
|
||||
# sorting is done by increasing version, so 0 is a dummy value
|
||||
replace_src = " def to_int_if_int(x):\n try:\n return int(x)\n except ValueError:\n return x"
|
||||
replace_dst = " def to_int_if_int(x):\n try:\n return int(x)\n except ValueError:\n return 0"
|
||||
base.replaceInFile("v8/build/vs_toolchain.py", replace_src, replace_dst)
|
||||
|
||||
|
||||
if not base.is_file("v8/src/base/platform/wrappers.cc"):
|
||||
base.writeFile("v8/src/base/platform/wrappers.cc", "#include \"src/base/platform/wrappers.h\"\n")
|
||||
|
||||
if config.check_option("platform", "win_arm64"):
|
||||
base.replaceInFile("v8/build/toolchain/win/setup_toolchain.py", "SDK_VERSION = \'10.0.26100.0\'", "SDK_VERSION = \'10.0.22621.0\'")
|
||||
else:
|
||||
base.replaceInFile("depot_tools/gclient_paths.py", "@functools.lru_cache", "")
|
||||
|
||||
if ("mac" == base.host_platform()):
|
||||
if not base.is_file("v8/build/config/compiler/BUILD.gn.bak"):
|
||||
base.copy_file("v8/build/config/compiler/BUILD.gn", "v8/build/config/compiler/BUILD.gn.bak")
|
||||
base.replaceInFile("v8/build/config/compiler/BUILD.gn", "\"-Wloop-analysis\",", "\"-Wloop-analysis\", \"-D_Float16=short\",")
|
||||
|
||||
if not base.is_file("v8/third_party/jinja2/tests.py.bak"):
|
||||
base.copy_file("v8/third_party/jinja2/tests.py", "v8/third_party/jinja2/tests.py.bak")
|
||||
base.replaceInFile("v8/third_party/jinja2/tests.py", "from collections import Mapping", "try:\n from collections.abc import Mapping\nexcept ImportError:\n from collections import Mapping")
|
||||
|
||||
os.chdir("v8")
|
||||
|
||||
is_ubuntu24 = is_ubuntu_24_or_higher()
|
||||
fix_ubuntu24()
|
||||
|
||||
gn_args = ["v8_static_library=true",
|
||||
"is_component_build=false",
|
||||
"v8_monolithic=true",
|
||||
"v8_use_external_startup_data=false",
|
||||
"treat_warnings_as_errors=false"]
|
||||
|
||||
if config.check_option("platform", "linux_64"):
|
||||
if config.option("sysroot") != "":
|
||||
sysroot_path = config.option("sysroot_linux_64")
|
||||
sysroot_path_bin = config.get_custom_sysroot_bin("linux_64")
|
||||
|
||||
old_env = dict(os.environ)
|
||||
base.set_sysroot_env("linux_64")
|
||||
|
||||
pkg_old = os.environ.get("PKG_CONFIG_PATH", "")
|
||||
os.environ["PKG_CONFIG_PATH"] = sysroot_path + "/usr/lib/x86_64-linux-gnu/pkgconfig:" + sysroot_path + "/usr/lib/pkgconfig:" + sysroot_path + "/usr/share/pkgconfig"
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_64", make_args(gn_args, "linux")], False)
|
||||
os.environ["PKG_CONFIG_PATH"] = pkg_old
|
||||
|
||||
base.cmd2("ninja", ["-C", "out.gn/linux_64"], False)
|
||||
base.restore_sysroot_env()
|
||||
else:
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_64", make_args(gn_args, "linux")], False)
|
||||
base.cmd2("ninja", ["-C", "out.gn/linux_64"], False)
|
||||
|
||||
|
||||
if config.check_option("platform", "linux_32"):
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_32", make_args(gn_args, "linux", False)])
|
||||
base.cmd("ninja", ["-C", "out.gn/linux_32"])
|
||||
|
||||
if config.check_option("platform", "linux_arm64"):
|
||||
base.cmd("build/linux/sysroot_scripts/install-sysroot.py", ["--arch=arm64"], False)
|
||||
|
||||
sysroot_path = config.option("sysroot_linux_64")
|
||||
pkg_old = os.environ.get("PKG_CONFIG_PATH", "")
|
||||
os.environ["PKG_CONFIG_PATH"] = sysroot_path + "/usr/lib/x86_64-linux-gnu/pkgconfig:" + sysroot_path + "/usr/lib/pkgconfig:" + sysroot_path + "/usr/share/pkgconfig"
|
||||
base.cmd2("gn", ["gen", "out.gn/linux_arm64", make_args(gn_args, "linux_arm64", False)])
|
||||
os.environ["PKG_CONFIG_PATH"] = pkg_old
|
||||
|
||||
base.cmd("ninja", ["-C", "out.gn/linux_arm64"])
|
||||
|
||||
if config.check_option("platform", "mac_64"):
|
||||
base.cmd2("gn", ["gen", "out.gn/mac_64", make_args(gn_args, "mac")])
|
||||
base.cmd("ninja", ["-C", "out.gn/mac_64"])
|
||||
|
||||
if config.check_option("platform", "win_arm64") and not base.is_file("out.gn/win_arm64/release/obj/v8_monolith.lib"):
|
||||
ninja_windows_make(gn_args, True, False, True)
|
||||
|
||||
if config.check_option("platform", "win_64"):
|
||||
if (-1 != config.option("config").lower().find("debug")):
|
||||
if not base.is_file("out.gn/win_64/debug/obj/v8_monolith.lib"):
|
||||
patch_windows_debug()
|
||||
ninja_windows_make(gn_args, True, True)
|
||||
unpatch_windows_debug()
|
||||
|
||||
if not base.is_file("out.gn/win_64/release/obj/v8_monolith.lib"):
|
||||
ninja_windows_make(gn_args)
|
||||
|
||||
if config.check_option("platform", "win_32"):
|
||||
if (-1 != config.option("config").lower().find("debug")):
|
||||
if not base.is_file("out.gn/win_32/debug/obj/v8_monolith.lib"):
|
||||
patch_windows_debug()
|
||||
ninja_windows_make(gn_args, False, True)
|
||||
unpatch_windows_debug()
|
||||
|
||||
if not base.is_file("out.gn/win_32/release/obj/v8_monolith.lib"):
|
||||
ninja_windows_make(gn_args, False)
|
||||
|
||||
os.chdir(old_cur)
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
16
scripts/core_common/modules/websocket_all.py
Normal file
16
scripts/core_common/modules/websocket_all.py
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
#import ixwebsocket
|
||||
#import socketrocket
|
||||
import socket_io
|
||||
|
||||
def make():
|
||||
#ixwebsocket.make()
|
||||
#socketrocket.make()
|
||||
socket_io.make()
|
||||
|
||||
return
|
||||
@ -5,8 +5,9 @@ import base
|
||||
import deploy_desktop
|
||||
import deploy_builder
|
||||
import deploy_server
|
||||
import deploy_develop
|
||||
import deploy_core
|
||||
import deploy_mobile
|
||||
import deploy_osign
|
||||
|
||||
def make():
|
||||
if config.check_option("module", "desktop"):
|
||||
@ -15,8 +16,12 @@ def make():
|
||||
deploy_builder.make()
|
||||
if config.check_option("module", "server"):
|
||||
deploy_server.make()
|
||||
if config.check_option("module", "develop"):
|
||||
deploy_develop.make()
|
||||
if config.check_option("module", "core"):
|
||||
deploy_core.make()
|
||||
if config.check_option("module", "mobile"):
|
||||
deploy_mobile.make()
|
||||
if config.check_option("module", "osign"):
|
||||
deploy_osign.make()
|
||||
if base.is_use_create_artifacts_qemu_any_platform():
|
||||
base.create_artifacts_qemu_any_platform()
|
||||
return
|
||||
|
||||
@ -15,6 +15,7 @@ def make():
|
||||
continue
|
||||
|
||||
root_dir = base_dir + ("/" + native_platform + "/" + branding + ("/DocumentBuilder" if base.is_windows() else "/documentbuilder"))
|
||||
root_dir_win64 = base_dir + "/win_64/" + branding + "/DocumentBuilder"
|
||||
if (base.is_dir(root_dir)):
|
||||
base.delete_dir(root_dir)
|
||||
base.create_dir(root_dir)
|
||||
@ -34,59 +35,56 @@ def make():
|
||||
# x2t
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "UnicodeConverter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel_network")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "graphics")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfWriter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfReader")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DjVuFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "XpsFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlRenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "OFDFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlFile2")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "Fb2File")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "EpubFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "IWorkFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HWPFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DocxRenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "StarMathConverter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "ooxmlsignature", "xp" if isWindowsXP else "")
|
||||
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", root_dir + "/cmap.bin")
|
||||
|
||||
if ("ios" == platform):
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "x2t")
|
||||
else:
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "x2t")
|
||||
|
||||
#if (native_platform == "linux_64"):
|
||||
# base.generate_check_linux_system(git_dir + "/build_tools", root_dir)
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/icudt58.dll")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icuuc58.dll", root_dir + "/icuuc58.dll")
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", root_dir + "/libicudata.so.58")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.so.58", root_dir + "/libicuuc.so.58")
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.58.dylib", root_dir + "/libicudata.58.dylib")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.58.dylib", root_dir + "/libicuuc.58.dylib")
|
||||
base.deploy_icu(core_dir, root_dir, native_platform)
|
||||
|
||||
# doctrenderer
|
||||
if isWindowsXP:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir, "doctrenderer")
|
||||
base.copy_file(core_build_dir + "/lib/" + platform_postfix + "/xp/doctrenderer.lib", root_dir + "/doctrenderer.lib")
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8_xp/" + platform + "/release/icudt*.dll", root_dir + "/")
|
||||
else:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "doctrenderer")
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_build_dir + "/lib/" + platform_postfix + "/doctrenderer.lib", root_dir + "/doctrenderer.lib")
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/")
|
||||
else:
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/icudtl.dat")
|
||||
base.copy_v8_files(core_dir, root_dir, platform, isWindowsXP)
|
||||
# python wrapper
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "docbuilder.c")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.python/src/docbuilder.py", root_dir + "/docbuilder.py")
|
||||
# java wrapper
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "docbuilder.jni")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.java/build/libs/docbuilder.jar", root_dir + "/docbuilder.jar")
|
||||
|
||||
# app
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "docbuilder")
|
||||
base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder")
|
||||
base.copy_dir(git_dir + "/DocumentBuilder/empty", root_dir + "/empty")
|
||||
base.copy_dir(git_dir + "/DocumentBuilder/samples", root_dir + "/samples")
|
||||
base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder", "", "./dictionaries")
|
||||
base.copy_dir(git_dir + "/document-templates/new/en-US", root_dir + "/empty")
|
||||
|
||||
# html
|
||||
base.create_dir(root_dir + "/HtmlFileInternal")
|
||||
if (False == isWindowsXP) and (0 != platform.find("mac")) and (0 != platform.find("ios")):
|
||||
base.copy_exe(core_build_dir + "/lib/" + platform_postfix, root_dir + "/HtmlFileInternal", "HtmlFileInternal")
|
||||
base.copy_files(core_dir + "/Common/3dParty/cef/" + platform + "/build/*", root_dir + "/HtmlFileInternal")
|
||||
if (0 == platform.find("win")):
|
||||
base.delete_file(root_dir + "/HtmlFileInternal/cef_sandbox.lib")
|
||||
base.delete_file(root_dir + "/HtmlFileInternal/libcef.lib")
|
||||
# dictionaries
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", root_dir + "/dictionaries", True, False)
|
||||
|
||||
# js
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", root_dir + "/sdkjs")
|
||||
@ -98,19 +96,54 @@ def make():
|
||||
base.create_dir(root_dir + "/include")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/common_deploy.h", root_dir + "/include/common.h")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.h", root_dir + "/include/docbuilder.h")
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/src/docbuilder_midl.h", root_dir + "/include/docbuilder_midl.h")
|
||||
base.replaceInFile(root_dir + "/include/docbuilder.h", "Q_DECL_EXPORT", "BUILDING_DOCBUILDER")
|
||||
|
||||
|
||||
if ("win_64" == platform):
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/x64/Release/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/deploy/win_64/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.net/deploy/win_64/docbuilder.net.dll", root_dir + "/docbuilder.net.dll")
|
||||
|
||||
elif ("win_32" == platform):
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/Win32/Release/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/deploy/win_32/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.net/deploy/win_32/docbuilder.net.dll", root_dir + "/docbuilder.net.dll")
|
||||
|
||||
# correct ios frameworks
|
||||
if ("ios" == platform):
|
||||
base.generate_plist(root_dir)
|
||||
base.for_each_framework(root_dir, "ios", callbacks=[base.generate_plist, base.generate_xcprivacy])
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.linux_correct_rpath_docbuilder(root_dir)
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.for_each_framework(root_dir, "mac", callbacks=[base.generate_plist], max_depth=1)
|
||||
base.mac_correct_rpath_x2t(root_dir)
|
||||
base.mac_correct_rpath_docbuilder(root_dir)
|
||||
|
||||
base.create_x2t_js_cache(root_dir, "builder", platform)
|
||||
|
||||
base.create_dir(root_dir + "/fonts")
|
||||
base.copy_dir(git_dir + "/core-fonts/asana", root_dir + "/fonts/asana")
|
||||
base.copy_dir(git_dir + "/core-fonts/caladea", root_dir + "/fonts/caladea")
|
||||
base.copy_dir(git_dir + "/core-fonts/crosextra", root_dir + "/fonts/crosextra")
|
||||
base.copy_dir(git_dir + "/core-fonts/openoffice", root_dir + "/fonts/openoffice")
|
||||
base.copy_file(git_dir + "/core-fonts/ASC.ttf", root_dir + "/fonts/ASC.ttf")
|
||||
|
||||
# delete unnecessary builder files
|
||||
def delete_files(files):
|
||||
for file in files:
|
||||
base.delete_file(file)
|
||||
|
||||
delete_files(base.find_files(root_dir, "*.wasm"))
|
||||
delete_files(base.find_files(root_dir, "*_ie.js"))
|
||||
base.delete_file(root_dir + "/sdkjs/pdf/src/engine/cmap.bin")
|
||||
if 0 != platform.find("mac"):
|
||||
delete_files(base.find_files(root_dir, "sdk-all.js"))
|
||||
delete_files(base.find_files(root_dir, "sdk-all-min.js"))
|
||||
base.delete_dir(root_dir + "/sdkjs/slide/themes")
|
||||
base.delete_dir(root_dir + "/sdkjs/cell/css")
|
||||
base.delete_file(root_dir + "/sdkjs/pdf/src/engine/viewer.js")
|
||||
base.delete_file(root_dir + "/sdkjs/common/spell/spell/spell.js.mem")
|
||||
base.delete_dir(root_dir + "/sdkjs/common/Images")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@ -24,41 +24,62 @@ def make():
|
||||
base.create_dir(archive_dir)
|
||||
|
||||
platform = native_platform
|
||||
platform_postfix = platform + base.qt_dst_postfix()
|
||||
isWindowsXP = False if (-1 == native_platform.find("_xp")) else True
|
||||
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "kernel")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "graphics")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "doctrenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "HtmlRenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "DjVuFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "XpsFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "PdfReader")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "PdfWriter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "HtmlFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "UnicodeConverter")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "x2t")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "kernel")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "kernel_network")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "graphics")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "doctrenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "DjVuFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "XpsFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "OFDFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "PdfFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "HtmlFile2")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "UnicodeConverter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "Fb2File")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "EpubFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "IWorkFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "HWPFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "DocxRenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "hunspell")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "StarMathConverter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "ooxmlsignature", "xp" if isWindowsXP else "")
|
||||
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", archive_dir + "/cmap.bin")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "x2t")
|
||||
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", archive_dir + "/sdkjs")
|
||||
base.create_dir(archive_dir + "/sdkjs/vendor")
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/web-apps/vendor/jquery", archive_dir + "/sdkjs/vendor/jquery")
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/web-apps/vendor/xregexp", archive_dir + "/sdkjs/vendor/xregexp")
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*.dll", archive_dir + "/")
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", archive_dir + "/")
|
||||
else:
|
||||
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*", archive_dir + "/")
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", archive_dir + "/")
|
||||
if not (0 == platform.find("mac") and config.check_option("config", "bundle_dylibs")):
|
||||
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*", archive_dir + "/")
|
||||
base.copy_v8_files(core_dir, archive_dir, platform)
|
||||
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allfontsgen")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allthemesgen")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "standardtester")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "allfontsgen")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "allthemesgen")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "pluginsmanager")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "standardtester")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "x2ttester")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "ooxml_crypt")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "vboxtester")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "metafiletester")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "dictionariestester")
|
||||
|
||||
base.create_dir(archive_dir + "/HtmlFileInternal")
|
||||
# correct mac frameworks
|
||||
if (0 == platform.find("mac")):
|
||||
base.for_each_framework(archive_dir, "mac", callbacks=[base.generate_plist], max_depth=1)
|
||||
base.mac_correct_rpath_x2t(archive_dir)
|
||||
|
||||
base.copy_exe(core_build_dir + "/lib/" + platform, archive_dir + "/HtmlFileInternal", "HtmlFileInternal")
|
||||
base.copy_files(core_dir + "/Common/3dParty/cef/" + platform + "/build/*", archive_dir + "/HtmlFileInternal")
|
||||
if (0 == platform.find("win")):
|
||||
base.delete_file(archive_dir + "/HtmlFileInternal/cef_sandbox.lib")
|
||||
base.delete_file(archive_dir + "/HtmlFileInternal/libcef.lib")
|
||||
|
||||
if base.is_file(archive_dir + "/core.7z"):
|
||||
base.delete_file(archive_dir + "/core.7z")
|
||||
base.archive_folder(archive_dir, archive_dir + "/core.7z")
|
||||
# js cache
|
||||
base.generate_doctrenderer_config(archive_dir + "/DoctRenderer.config", "./", "builder", "", "./dictionaries")
|
||||
base.create_x2t_js_cache(archive_dir, "core", platform)
|
||||
base.delete_file(archive_dir + "/DoctRenderer.config")
|
||||
|
||||
# dictionaries
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", archive_dir + "/dictionaries", True, False)
|
||||
return
|
||||
|
||||
|
||||
@ -2,6 +2,21 @@
|
||||
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import platform
|
||||
import glob
|
||||
|
||||
def copy_lib_with_links(src_dir, dst_dir, lib, version):
|
||||
lib_full_name = lib + "." + version
|
||||
major_version = version[:version.find(".")]
|
||||
lib_major_name = lib + "." + major_version
|
||||
|
||||
base.copy_file(src_dir + "/" + lib_full_name, dst_dir + "/" + lib_full_name)
|
||||
|
||||
base.cmd_in_dir(dst_dir, "ln", ["-s", "./" + lib_full_name, "./" + lib_major_name])
|
||||
base.cmd_in_dir(dst_dir, "ln", ["-s", "./" + lib_major_name, "./" + lib])
|
||||
|
||||
return
|
||||
|
||||
def make():
|
||||
base_dir = base.get_script_dir() + "/../out"
|
||||
@ -25,7 +40,7 @@ def make():
|
||||
isWindowsXP = False if (-1 == native_platform.find("_xp")) else True
|
||||
platform = native_platform[0:-3] if isWindowsXP else native_platform
|
||||
|
||||
apps_postfix = "build" + base.qt_dst_postfix();
|
||||
apps_postfix = "build" + base.qt_dst_postfix()
|
||||
if ("" != config.option("branding")):
|
||||
apps_postfix += ("/" + config.option("branding"))
|
||||
apps_postfix += "/"
|
||||
@ -39,90 +54,106 @@ def make():
|
||||
|
||||
platform_postfix = platform + base.qt_dst_postfix()
|
||||
|
||||
build_libraries_path = core_build_dir + "/lib/" + platform_postfix
|
||||
|
||||
# x2t
|
||||
base.create_dir(root_dir + "/converter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "kernel")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "UnicodeConverter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "graphics")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfWriter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfReader")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "DjVuFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "XpsFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlRenderer")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "kernel")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "kernel_network")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "UnicodeConverter")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "graphics")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "PdfFile")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "DjVuFile")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "XpsFile")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "OFDFile")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "HtmlFile2")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "Fb2File")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "EpubFile")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "IWorkFile")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "HWPFile")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "DocxRenderer")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "StarMathConverter")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "ooxmlsignature", "xp" if isWindowsXP else "")
|
||||
|
||||
if ("ios" == platform):
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "x2t")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "x2t")
|
||||
else:
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "x2t")
|
||||
|
||||
#if (native_platform == "linux_64"):
|
||||
# base.generate_check_linux_system(git_dir + "/build_tools", root_dir + "/converter")
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/converter/icudt58.dll")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icuuc58.dll", root_dir + "/converter/icuuc58.dll")
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", root_dir + "/converter/libicudata.so.58")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.so.58", root_dir + "/converter/libicuuc.so.58")
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.58.dylib", root_dir + "/converter/libicudata.58.dylib")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.58.dylib", root_dir + "/converter/libicuuc.58.dylib")
|
||||
base.deploy_icu(core_dir, root_dir + "/converter", native_platform)
|
||||
|
||||
# doctrenderer
|
||||
if isWindowsXP:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir + "/converter", "doctrenderer")
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8_xp/" + platform + "/release/icudt*.dll", root_dir + "/converter/")
|
||||
base.copy_lib(build_libraries_path + "/xp", root_dir + "/converter", "doctrenderer")
|
||||
else:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "doctrenderer")
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/converter/")
|
||||
else:
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/converter/icudtl.dat")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "doctrenderer")
|
||||
base.copy_v8_files(core_dir, root_dir + "/converter", platform, isWindowsXP)
|
||||
|
||||
base.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop")
|
||||
base.copy_dir(git_dir + "/desktop-apps/common/converter/empty", root_dir + "/converter/empty")
|
||||
|
||||
if (False == isWindowsXP) and (0 != platform.find("mac")) and (0 != platform.find("ios")):
|
||||
base.copy_exe(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlFileInternal")
|
||||
base.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop", "", "../dictionaries")
|
||||
base.copy_dir(git_dir + "/document-templates/new", root_dir + "/converter/empty")
|
||||
base.copy_dir(git_dir + "/desktop-apps/common/templates", root_dir + "/converter/templates")
|
||||
|
||||
# dictionaries
|
||||
base.create_dir(root_dir + "/dictionaries")
|
||||
base.copy_dir_content(git_dir + "/dictionaries", root_dir + "/dictionaries", "", ".git")
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", root_dir + "/dictionaries")
|
||||
|
||||
base.copy_dir(git_dir + "/core-fonts/opensans", root_dir + "/fonts")
|
||||
base.copy_dir(git_dir + "/core-fonts/asana", root_dir + "/fonts/asana")
|
||||
base.copy_dir(git_dir + "/core-fonts/caladea", root_dir + "/fonts/caladea")
|
||||
base.copy_dir(git_dir + "/core-fonts/crosextra", root_dir + "/fonts/crosextra")
|
||||
base.copy_dir(git_dir + "/core-fonts/openoffice", root_dir + "/fonts/openoffice")
|
||||
base.copy_file(git_dir + "/core-fonts/ASC.ttf", root_dir + "/fonts/ASC.ttf")
|
||||
|
||||
base.copy_dir(git_dir + "/desktop-apps/common/package/fonts", root_dir + "/fonts")
|
||||
base.copy_file(git_dir + "/desktop-apps/common/package/license/3dparty/3DPARTYLICENSE", root_dir + "/3DPARTYLICENSE")
|
||||
|
||||
# cef
|
||||
build_dir_name = "build"
|
||||
if (0 == platform.find("linux")) and (config.check_option("config", "cef_version_107")):
|
||||
build_dir_name = "build_107"
|
||||
elif (0 == platform.find("mac")) and (config.check_option("config", "use_v8")):
|
||||
build_dir_name = "build_103"
|
||||
|
||||
if not isWindowsXP:
|
||||
base.copy_files(core_dir + "/Common/3dParty/cef/" + platform + "/build/*", root_dir)
|
||||
base.copy_files(core_dir + "/Common/3dParty/cef/" + platform + "/" + build_dir_name + "/*", root_dir)
|
||||
else:
|
||||
base.copy_files(core_dir + "/Common/3dParty/cef/" + native_platform + "/build/*", root_dir)
|
||||
base.copy_files(core_dir + "/Common/3dParty/cef/" + native_platform + "/" + build_dir_name + "/*", root_dir)
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
dir_base_old = os.getcwd()
|
||||
os.chdir(root_dir + "/Chromium Embedded Framework.framework")
|
||||
base.create_dir("Versions")
|
||||
base.create_dir("Versions/A")
|
||||
base.move_file("Chromium Embedded Framework", "Versions/A/Chromium Embedded Framework")
|
||||
base.move_dir("Resources", "Versions/A/Resources")
|
||||
base.move_dir("Libraries", "Versions/A/Libraries")
|
||||
base.cmd("ln", ["-s", "Versions/A/Chromium Embedded Framework", "Chromium Embedded Framework"])
|
||||
base.cmd("ln", ["-s", "Versions/A/Resources", "Resources"])
|
||||
base.cmd("ln", ["-s", "Versions/A/Libraries", "Libraries"])
|
||||
base.cmd("ln", ["-s", "A", "Versions/Current"])
|
||||
os.chdir(dir_base_old);
|
||||
|
||||
isUseQt = True
|
||||
if (0 == platform.find("mac")) or (0 == platform.find("ios")):
|
||||
isUseQt = False
|
||||
|
||||
# libraries
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "hunspell")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "ooxmlsignature")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "ascdocumentscore")
|
||||
base.copy_lib(build_libraries_path, root_dir, "hunspell")
|
||||
base.copy_lib(build_libraries_path + ("/xp" if isWindowsXP else ""), root_dir, "ascdocumentscore")
|
||||
if (0 != platform.find("mac")):
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "qtascdocumentscore")
|
||||
|
||||
base.copy_lib(build_libraries_path + ("/xp" if isWindowsXP else ""), root_dir, "qtascdocumentscore")
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.copy_dir(core_build_dir + "/bin/" + platform_postfix + "/editors_helper.app", root_dir + "/editors_helper.app")
|
||||
else:
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "editors_helper")
|
||||
|
||||
|
||||
if isUseQt:
|
||||
base.qt_copy_lib("Qt5Core", root_dir)
|
||||
base.qt_copy_lib("Qt5Gui", root_dir)
|
||||
base.qt_copy_lib("Qt5PrintSupport", root_dir)
|
||||
base.qt_copy_lib("Qt5Svg", root_dir)
|
||||
base.qt_copy_lib("Qt5Widgets", root_dir)
|
||||
base.qt_copy_lib("Qt5Multimedia", root_dir)
|
||||
base.qt_copy_lib("Qt5MultimediaWidgets", root_dir)
|
||||
base.qt_copy_lib("Qt5Network", root_dir)
|
||||
base.qt_copy_lib("Qt5OpenGL", root_dir)
|
||||
|
||||
@ -132,37 +163,70 @@ def make():
|
||||
base.qt_copy_plugin("platforms", root_dir)
|
||||
base.qt_copy_plugin("platforminputcontexts", root_dir)
|
||||
base.qt_copy_plugin("printsupport", root_dir)
|
||||
base.qt_copy_plugin("mediaservice", root_dir)
|
||||
base.qt_copy_plugin("playlistformats", root_dir)
|
||||
|
||||
base.qt_copy_plugin("platformthemes", root_dir)
|
||||
base.qt_copy_plugin("xcbglintegrations", root_dir)
|
||||
|
||||
if not base.check_congig_option_with_platfom(platform, "libvlc"):
|
||||
base.qt_copy_lib("Qt5Multimedia", root_dir)
|
||||
base.qt_copy_lib("Qt5MultimediaWidgets", root_dir)
|
||||
base.qt_copy_plugin("mediaservice", root_dir)
|
||||
base.qt_copy_plugin("playlistformats", root_dir)
|
||||
|
||||
base.qt_copy_plugin("styles", root_dir)
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.qt_copy_lib("Qt5DBus", root_dir)
|
||||
base.qt_copy_lib("Qt5X11Extras", root_dir)
|
||||
base.qt_copy_lib("Qt5XcbQpa", root_dir)
|
||||
base.qt_copy_icu(root_dir)
|
||||
base.copy_files(base.get_env("QT_DEPLOY") + "/../lib/libqgsttools_p.so*", root_dir)
|
||||
base.qt_copy_icu(root_dir, platform)
|
||||
if not base.check_congig_option_with_platfom(platform, "libvlc"):
|
||||
base.copy_files(base.get_env("QT_DEPLOY") + "/../lib/libqgsttools_p.so*", root_dir)
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/extras/projicons/" + apps_postfix + "/projicons.exe", root_dir + "/DesktopEditors.exe")
|
||||
if not isWindowsXP:
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/extras/update-daemon/" + apps_postfix + "/updatesvc.exe", root_dir + "/updatesvc.exe")
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors.exe", root_dir + "/editors.exe")
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/res/icons/desktopeditors.ico", root_dir + "/app.ico")
|
||||
elif (0 == platform.find("linux")):
|
||||
base.copy_file(git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors", root_dir + "/DesktopEditors")
|
||||
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "videoplayer")
|
||||
if base.check_congig_option_with_platfom(platform, "libvlc"):
|
||||
vlc_dir = git_dir + "/core/Common/3dParty/libvlc/build/" + platform + "/lib"
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_dir(vlc_dir + "/plugins", root_dir + "/plugins")
|
||||
base.copy_files(vlc_dir + "/*.dll", root_dir)
|
||||
base.copy_file(vlc_dir + "/vlc-cache-gen.exe", root_dir + "/vlc-cache-gen.exe")
|
||||
elif (0 == platform.find("linux")):
|
||||
base.copy_dir(vlc_dir + "/vlc/plugins", root_dir + "/plugins")
|
||||
base.copy_file(vlc_dir + "/vlc/libcompat.a", root_dir + "/libcompat.a")
|
||||
copy_lib_with_links(vlc_dir + "/vlc", root_dir, "libvlc_pulse.so", "0.0.0")
|
||||
copy_lib_with_links(vlc_dir + "/vlc", root_dir, "libvlc_vdpau.so", "0.0.0")
|
||||
copy_lib_with_links(vlc_dir + "/vlc", root_dir, "libvlc_xcb_events.so", "0.0.0")
|
||||
copy_lib_with_links(vlc_dir, root_dir, "libvlc.so", "5.6.1")
|
||||
copy_lib_with_links(vlc_dir, root_dir, "libvlccore.so", "9.0.1")
|
||||
base.copy_file(vlc_dir + "/vlc/vlc-cache-gen", root_dir + "/vlc-cache-gen")
|
||||
|
||||
if isWindowsXP:
|
||||
base.copy_lib(build_libraries_path + "/mediaplayer/xp", root_dir, "videoplayer")
|
||||
else:
|
||||
base.copy_lib(build_libraries_path + "/mediaplayer", root_dir, "videoplayer")
|
||||
else:
|
||||
base.copy_lib(build_libraries_path + ("/xp" if isWindowsXP else ""), root_dir, "videoplayer")
|
||||
|
||||
base.create_dir(root_dir + "/editors")
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/desktop/sdkjs", root_dir + "/editors/sdkjs")
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/desktop/web-apps", root_dir + "/editors/web-apps")
|
||||
for file in glob.glob(root_dir + "/editors/web-apps/apps/*/*/*.js.map"):
|
||||
base.delete_file(file)
|
||||
base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/resources/local", root_dir + "/editors/sdkjs/common/Images/local")
|
||||
|
||||
base.create_dir(root_dir + "/editors/sdkjs-plugins")
|
||||
base.copy_sdkjs_plugins(root_dir + "/editors/sdkjs-plugins", True)
|
||||
if not isWindowsXP:
|
||||
base.copy_marketplace_plugin(root_dir + "/editors/sdkjs-plugins", True, True, True)
|
||||
base.copy_sdkjs_plugins(root_dir + "/editors/sdkjs-plugins", True, True, isWindowsXP)
|
||||
# remove some default plugins
|
||||
if base.is_dir(root_dir + "/editors/sdkjs-plugins/speech"):
|
||||
base.delete_dir(root_dir + "/editors/sdkjs-plugins/speech")
|
||||
@ -172,42 +236,113 @@ def make():
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js", root_dir + "/editors/sdkjs-plugins/v1/plugins.js")
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", root_dir + "/editors/sdkjs-plugins/v1/plugins-ui.js")
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", root_dir + "/editors/sdkjs-plugins/v1/plugins.css")
|
||||
base.support_old_versions_plugins(root_dir + "/editors/sdkjs-plugins")
|
||||
|
||||
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "manager", True)
|
||||
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt", root_dir + "/editors/sdkjs-plugins", "advanced2", True)
|
||||
#base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt/ui/common/{14A8FC87-8E26-4216-B34E-F27F053B2EC4}", root_dir + "/editors/sdkjs-plugins/{14A8FC87-8E26-4216-B34E-F27F053B2EC4}")
|
||||
#base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt/ui/engine/database/{9AB4BBA8-A7E5-48D5-B683-ECE76A020BB1}", root_dir + "/editors/sdkjs-plugins/{9AB4BBA8-A7E5-48D5-B683-ECE76A020BB1}")
|
||||
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "sendto", True)
|
||||
|
||||
if (0 != platform.find("mac")):
|
||||
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "audio", True)
|
||||
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "video", True)
|
||||
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "sendto", True)
|
||||
isUseAgent = True
|
||||
if isWindowsXP:
|
||||
isUseAgent = False
|
||||
if (0 == platform.find("mac")) and (config.check_option("config", "use_v8")):
|
||||
isUseAgent = False
|
||||
|
||||
if (isUseAgent):
|
||||
agent_plugin_dir = git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/ai-agent"
|
||||
if (False):
|
||||
base.cmd_in_dir(agent_plugin_dir, "npm", ["install"], True)
|
||||
base.cmd_in_dir(agent_plugin_dir, "npm", ["run", "build"], True)
|
||||
base.copy_dir(agent_plugin_dir + "/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}", root_dir + "/editors/sdkjs-plugins/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}")
|
||||
else:
|
||||
base.copy_dir(agent_plugin_dir + "/deploy/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}", root_dir + "/editors/sdkjs-plugins/{9DC93CDB-B576-4F0C-B55E-FCC9C48DD777}")
|
||||
|
||||
base.copy_file(base_dir + "/js/" + branding + "/desktop/index.html", root_dir + "/index.html")
|
||||
base.copy_file(git_dir + "/desktop-apps/common/loginpage/addon/externalcloud.json", root_dir + "/editors/externalcloud.json")
|
||||
base.create_dir(root_dir + "/editors/webext")
|
||||
base.copy_file(base_dir + "/js/" + branding + "/desktop/noconnect.html", root_dir + "/editors/webext/noconnect.html")
|
||||
|
||||
if isWindowsXP:
|
||||
base.create_dir(root_dir + "/providers")
|
||||
base.copy_dir(git_dir + "/desktop-apps/common/loginpage/providers/onlyoffice", root_dir + "/providers/onlyoffice")
|
||||
else:
|
||||
base.copy_dir(git_dir + "/desktop-apps/common/loginpage/providers", root_dir + "/providers")
|
||||
|
||||
isUseJSC = False
|
||||
if (0 == platform.find("mac")):
|
||||
doctrenderer_lib = "libdoctrenderer.dylib"
|
||||
if config.check_option("config", "bundle_dylibs"):
|
||||
doctrenderer_lib = "doctrenderer.framework/doctrenderer"
|
||||
file_size_doctrenderer = os.path.getsize(root_dir + "/converter/" + doctrenderer_lib)
|
||||
print("file_size_doctrenderer: " + str(file_size_doctrenderer))
|
||||
if (file_size_doctrenderer < 5*1024*1024):
|
||||
isUseJSC = True
|
||||
|
||||
if isUseJSC:
|
||||
base.delete_file(root_dir + "/converter/icudtl.dat")
|
||||
|
||||
base.create_x2t_js_cache(root_dir + "/converter", "desktop", platform)
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_lib(git_dir + "/desktop-apps/win-linux/3dparty/WinSparkle/" + platform, root_dir, "WinSparkle")
|
||||
base.delete_file(root_dir + "/cef_sandbox.lib")
|
||||
base.delete_file(root_dir + "/libcef.lib")
|
||||
|
||||
is_host_not_arm = False
|
||||
host_platform = ""
|
||||
|
||||
# TODO: fix this on mac_arm64 (qemu)
|
||||
# on windows we are using qemu
|
||||
if (platform == "mac_arm64") and not base.is_os_arm():
|
||||
is_host_not_arm = True
|
||||
host_platform = "mac_64"
|
||||
|
||||
# all themes generate ----
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "allfontsgen")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "allthemesgen")
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
# gen plists with max_depth 2 because frameworks are only located in root_dir and converter subdirectory
|
||||
base.for_each_framework(root_dir, "mac", callbacks=[base.generate_plist], max_depth=2)
|
||||
base.mac_correct_rpath_desktop(root_dir)
|
||||
|
||||
themes_params = []
|
||||
if ("" != config.option("themesparams")):
|
||||
themes_params = ["--params=\"" + config.option("themesparams") + "\""]
|
||||
base.cmd_exe(root_dir + "/converter/allfontsgen", ["--use-system=\"1\"", "--input=\"" + root_dir + "/fonts\"", "--input=\"" + git_dir + "/core-fonts\"", "--allfonts=\"" + root_dir + "/converter/AllFonts.js\"", "--selection=\"" + root_dir + "/converter/font_selection.bin\""])
|
||||
base.cmd_exe(root_dir + "/converter/allthemesgen", ["--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\""] + themes_params)
|
||||
if is_host_not_arm:
|
||||
sdkjs_dir = root_dir + "/editors/sdkjs"
|
||||
str1 = "/" + platform + "/"
|
||||
str2 = "/" + host_platform + "/"
|
||||
sdkjs_dir_host = sdkjs_dir.replace(str1, str2)
|
||||
base.delete_dir(sdkjs_dir)
|
||||
base.copy_dir(sdkjs_dir_host, sdkjs_dir)
|
||||
else:
|
||||
themes_params = []
|
||||
if ("" != config.option("themesparams")):
|
||||
themes_params = ["--params=\"" + config.option("themesparams") + "\""]
|
||||
|
||||
base.delete_exe(root_dir + "/converter/allfontsgen")
|
||||
base.delete_exe(root_dir + "/converter/allthemesgen")
|
||||
base.delete_file(root_dir + "/converter/AllFonts.js")
|
||||
base.delete_file(root_dir + "/converter/font_selection.bin")
|
||||
base.delete_file(root_dir + "/editors/sdkjs/slide/sdk-all.cache")
|
||||
params_allfontsgen = ["--use-system=\"1\"", "--input=\"" + root_dir + "/fonts\"", "--input=\"" + git_dir + "/core-fonts\"", "--allfonts=\"" + root_dir + "/converter/AllFonts.js\"", "--selection=\"" + root_dir + "/converter/font_selection.bin\""]
|
||||
params_allthemesgen = ["--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\""] + themes_params
|
||||
if (0 == platform.find("linux_arm") and not base.is_os_arm()):
|
||||
x2t_origin = ""
|
||||
if (config.option("sysroot") != ""):
|
||||
x2t_origin = base.create_qemu_wrapper(root_dir + "/converter/x2t", platform)
|
||||
|
||||
base.cmd_in_dir_qemu(platform, root_dir + "/converter", "./allfontsgen", params_allfontsgen, True)
|
||||
base.cmd_in_dir_qemu(platform, root_dir + "/converter", "./allthemesgen", params_allthemesgen, True)
|
||||
|
||||
if "" != x2t_origin:
|
||||
base.delete_file(root_dir + "/converter/x2t")
|
||||
base.move_file(x2t_origin, root_dir + "/converter/x2t")
|
||||
else:
|
||||
base.cmd_exe(root_dir + "/converter/allfontsgen", params_allfontsgen, True)
|
||||
base.cmd_exe(root_dir + "/converter/allthemesgen", params_allthemesgen, True)
|
||||
|
||||
base.delete_file(root_dir + "/converter/AllFonts.js")
|
||||
base.delete_file(root_dir + "/converter/font_selection.bin")
|
||||
base.delete_file(root_dir + "/converter/fonts.log")
|
||||
|
||||
if not base.is_use_create_artifacts_qemu(platform):
|
||||
base.delete_exe(root_dir + "/converter/allfontsgen")
|
||||
base.delete_exe(root_dir + "/converter/allthemesgen")
|
||||
|
||||
if not isUseJSC:
|
||||
base.delete_file(root_dir + "/editors/sdkjs/slide/sdk-all.cache")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@ -1,99 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
|
||||
def make():
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
old_cur = os.getcwd()
|
||||
|
||||
work_dir = git_dir + "/server/FileConverter/bin"
|
||||
if not base.is_dir(work_dir):
|
||||
base.create_dir(work_dir)
|
||||
|
||||
os.chdir(work_dir)
|
||||
|
||||
arch = "x64"
|
||||
arch2 = "_64"
|
||||
if ("windows" == base.host_platform()) and not base.host_platform_is64():
|
||||
arch = "x86"
|
||||
arch2 = "_32"
|
||||
|
||||
url = "http://repo-doc-onlyoffice-com.s3.amazonaws.com/" + base.host_platform() + "/core/" + config.option("branch") + "/latest/" + arch + "/core.7z"
|
||||
data_url = base.get_file_last_modified_url(url)
|
||||
old_data_url = base.readFile("./core.7z.data")
|
||||
|
||||
if (old_data_url != data_url):
|
||||
print("-----------------------------------------------------------")
|
||||
print("Downloading core last version... --------------------------")
|
||||
print("-----------------------------------------------------------")
|
||||
if (base.is_file("./core.7z")):
|
||||
base.delete_file("./core.7z")
|
||||
if (base.is_dir("./core")):
|
||||
base.delete_dir("./core")
|
||||
if (base.is_dir("./HtmlFileInternal")):
|
||||
base.delete_dir("./HtmlFileInternal")
|
||||
base.download(url, "./core.7z")
|
||||
|
||||
print("-----------------------------------------------------------")
|
||||
print("Extracting core last version... ---------------------------")
|
||||
print("-----------------------------------------------------------")
|
||||
|
||||
base.extract("./core.7z", "./")
|
||||
base.writeFile("./core.7z.data", data_url)
|
||||
|
||||
platform = ""
|
||||
if ("windows" == base.host_platform()):
|
||||
platform = "win" + arch2
|
||||
else:
|
||||
platform = base.host_platform() + arch2
|
||||
|
||||
base.copy_files("./core/*", "./")
|
||||
|
||||
base.generate_doctrenderer_config("./DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/")
|
||||
|
||||
if base.is_dir(git_dir + "/fonts"):
|
||||
base.delete_dir(git_dir + "/fonts")
|
||||
base.create_dir(git_dir + "/fonts")
|
||||
|
||||
if ("mac" == base.host_platform()):
|
||||
base.mac_correct_rpath_x2t("./")
|
||||
|
||||
print("-----------------------------------------------------------")
|
||||
print("All fonts generation... -----------------------------------")
|
||||
print("-----------------------------------------------------------")
|
||||
base.cmd_exe("./allfontsgen", ["--input=../../../core-fonts", "--allfonts-web=../../../sdkjs/common/AllFonts.js", "--allfonts=./AllFonts.js",
|
||||
"--images=../../../sdkjs/common/Images", "--selection=./font_selection.bin",
|
||||
"--use-system=true", "--output-web=../../../fonts"])
|
||||
|
||||
print("All presentation themes generation... ---------------------")
|
||||
print("-----------------------------------------------------------")
|
||||
base.cmd_exe("./allthemesgen", ["--converter-dir=\"" + git_dir + "/server/FileConverter/bin\"", "--src=\"" + git_dir + "/sdkjs/slide/themes\"", "--output=\"" + git_dir + "/sdkjs/common/Images\""])
|
||||
|
||||
# add directories to open directories
|
||||
data_local_devel = "{\n"
|
||||
data_local_devel += "\"services\": {\n"
|
||||
data_local_devel += "\"CoAuthoring\": {\n"
|
||||
data_local_devel += "\"server\": {\n"
|
||||
data_local_devel += "\"static_content\": {\n"
|
||||
is_exist_addons = False
|
||||
for addon in config.sdkjs_addons:
|
||||
data_local_devel += ("\"/" + config.sdkjs_addons[addon] + "\" : { \"path\": \"../../../" + config.sdkjs_addons[addon] + "\" },\n")
|
||||
is_exist_addons = True
|
||||
for addon in config.web_apps_addons:
|
||||
data_local_devel += ("\"/" + config.web_apps_addons[addon] + "\" : { \"path\": \"../../../" + config.web_apps_addons[addon] + "\" },\n")
|
||||
is_exist_addons = True
|
||||
if is_exist_addons:
|
||||
data_local_devel = data_local_devel[:-2]
|
||||
data_local_devel += "\n"
|
||||
data_local_devel += "}\n"
|
||||
data_local_devel += "}\n"
|
||||
data_local_devel += "}\n"
|
||||
data_local_devel += "}\n"
|
||||
data_local_devel += "}\n"
|
||||
base.writeFile(git_dir + "/server/Common/config/local-development-" + base.host_platform() + ".json", data_local_devel)
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
125
scripts/deploy_mobile.py
Normal file
125
scripts/deploy_mobile.py
Normal file
@ -0,0 +1,125 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import config
|
||||
import base
|
||||
|
||||
def exclude_arch(directory, frameworks):
|
||||
for lib in frameworks:
|
||||
base.cmd("lipo", ["-remove", "arm64", directory + "/" + lib + ".framework/" + lib, "-o", directory + "/" + lib + ".framework/" + lib])
|
||||
return
|
||||
|
||||
def deploy_fonts(git_dir, root_dir, platform=""):
|
||||
base.create_dir(root_dir + "/fonts")
|
||||
base.copy_file(git_dir + "/core-fonts/ASC.ttf", root_dir + "/fonts/ASC.ttf")
|
||||
base.copy_dir(git_dir + "/core-fonts/asana", root_dir + "/fonts/asana")
|
||||
base.copy_dir(git_dir + "/core-fonts/caladea", root_dir + "/fonts/caladea")
|
||||
base.copy_dir(git_dir + "/core-fonts/crosextra", root_dir + "/fonts/crosextra")
|
||||
base.copy_dir(git_dir + "/core-fonts/openoffice", root_dir + "/fonts/openoffice")
|
||||
if (platform == "android"):
|
||||
base.copy_dir(git_dir + "/core-fonts/dejavu", root_dir + "/fonts/dejavu")
|
||||
base.copy_dir(git_dir + "/core-fonts/liberation", root_dir + "/fonts/liberation")
|
||||
return
|
||||
|
||||
def make():
|
||||
base_dir = base.get_script_dir() + "/../out"
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
core_dir = git_dir + "/core"
|
||||
branding = config.branding()
|
||||
|
||||
platforms = config.option("platform").split()
|
||||
for native_platform in platforms:
|
||||
if not native_platform in config.platforms:
|
||||
continue
|
||||
|
||||
root_dir = base_dir + "/" + native_platform + "/" + branding + "/mobile"
|
||||
|
||||
if base.get_env("DESTDIR_BUILD_OVERRIDE") != "":
|
||||
return
|
||||
|
||||
if (base.is_dir(root_dir)):
|
||||
base.delete_dir(root_dir)
|
||||
base.create_dir(root_dir)
|
||||
|
||||
qt_dir = base.qt_setup(native_platform)
|
||||
platform = native_platform
|
||||
|
||||
core_build_dir = core_dir + "/build"
|
||||
if ("" != config.option("branding")):
|
||||
core_build_dir += ("/" + config.option("branding"))
|
||||
|
||||
platform_postfix = platform + base.qt_dst_postfix()
|
||||
|
||||
# x2t
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel_network")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "UnicodeConverter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "graphics")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DjVuFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "XpsFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "OFDFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlFile2")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "doctrenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "Fb2File")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "EpubFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "IWorkFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HWPFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DocxRenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "StarMathConverter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "ooxmlsignature")
|
||||
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", root_dir + "/cmap.bin")
|
||||
|
||||
if (0 == platform.find("win") or 0 == platform.find("linux") or 0 == platform.find("mac")):
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "x2t")
|
||||
else:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "x2t")
|
||||
|
||||
# icu
|
||||
base.deploy_icu(core_dir, root_dir, platform)
|
||||
|
||||
# js
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/mobile/sdkjs", root_dir + "/sdkjs")
|
||||
|
||||
# correct ios frameworks
|
||||
if ("ios" == platform):
|
||||
base.for_each_framework(root_dir, "ios", callbacks=[base.generate_plist, base.generate_xcprivacy])
|
||||
deploy_fonts(git_dir, root_dir)
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", root_dir + "/dictionaries", True, False)
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.mac_correct_rpath_x2t(root_dir)
|
||||
|
||||
for native_platform in platforms:
|
||||
if native_platform == "android":
|
||||
# make full version
|
||||
root_dir = base_dir + "/android/" + branding + "/mobile"
|
||||
if (base.is_dir(root_dir)):
|
||||
base.delete_dir(root_dir)
|
||||
base.create_dir(root_dir)
|
||||
# js
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/mobile/sdkjs", root_dir + "/sdkjs")
|
||||
# fonts
|
||||
deploy_fonts(git_dir, root_dir, "android")
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", root_dir + "/dictionaries", True, False)
|
||||
# app
|
||||
base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder", "", "./dictionaries")
|
||||
libs_dir = root_dir + "/lib"
|
||||
base.create_dir(libs_dir + "/arm64-v8a")
|
||||
base.copy_files(base_dir + "/android_arm64_v8a/" + branding + "/mobile/*.so", libs_dir + "/arm64-v8a")
|
||||
base.copy_files(base_dir + "/android_arm64_v8a/" + branding + "/mobile/*.so.*", libs_dir + "/arm64-v8a")
|
||||
base.copy_files(base_dir + "/android_arm64_v8a/" + branding + "/mobile/*.dat", libs_dir + "/arm64-v8a")
|
||||
base.create_dir(libs_dir + "/armeabi-v7a")
|
||||
base.copy_files(base_dir + "/android_armv7/" + branding + "/mobile/*.so", libs_dir + "/armeabi-v7a")
|
||||
base.copy_files(base_dir + "/android_armv7/" + branding + "/mobile/*.so.*", libs_dir + "/armeabi-v7a")
|
||||
base.copy_files(base_dir + "/android_armv7/" + branding + "/mobile/*.dat", libs_dir + "/armeabi-v7a")
|
||||
base.create_dir(libs_dir + "/x86")
|
||||
base.copy_files(base_dir + "/android_x86/" + branding + "/mobile/*.so", libs_dir + "/x86")
|
||||
base.copy_files(base_dir + "/android_x86/" + branding + "/mobile/*.so.*", libs_dir + "/x86")
|
||||
base.copy_files(base_dir + "/android_x86/" + branding + "/mobile/*.dat", libs_dir + "/x86")
|
||||
base.create_dir(libs_dir + "/x86_64")
|
||||
base.copy_files(base_dir + "/android_x86_64/" + branding + "/mobile/*.so", libs_dir + "/x86_64")
|
||||
base.copy_files(base_dir + "/android_x86_64/" + branding + "/mobile/*.so.*", libs_dir + "/x86_64")
|
||||
base.copy_files(base_dir + "/android_x86_64/" + branding + "/mobile/*.dat", libs_dir + "/x86_64")
|
||||
break
|
||||
|
||||
return
|
||||
60
scripts/deploy_osign.py
Normal file
60
scripts/deploy_osign.py
Normal file
@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import config
|
||||
import base
|
||||
|
||||
def make():
|
||||
base_dir = base.get_script_dir() + "/../out"
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
core_dir = git_dir + "/core"
|
||||
branding = config.branding()
|
||||
|
||||
platforms = config.option("platform").split()
|
||||
for native_platform in platforms:
|
||||
if not native_platform in config.platforms:
|
||||
continue
|
||||
|
||||
root_dir = base_dir + "/" + native_platform + "/" + branding + "/osign"
|
||||
|
||||
if base.get_env("DESTDIR_BUILD_OVERRIDE") != "":
|
||||
return
|
||||
|
||||
if (base.is_dir(root_dir)):
|
||||
base.delete_dir(root_dir)
|
||||
base.create_dir(root_dir)
|
||||
|
||||
qt_dir = base.qt_setup(native_platform)
|
||||
platform = native_platform
|
||||
|
||||
core_build_dir = core_dir + "/build"
|
||||
if ("" != config.option("branding")):
|
||||
core_build_dir += ("/" + config.option("branding"))
|
||||
|
||||
platform_postfix = platform + base.qt_dst_postfix()
|
||||
|
||||
# x2t
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "osign")
|
||||
|
||||
# correct ios frameworks
|
||||
if ("ios" == platform):
|
||||
base.for_each_framework(root_dir, "ios", callbacks=[base.generate_plist, base.generate_xcprivacy])
|
||||
|
||||
for native_platform in platforms:
|
||||
if native_platform == "android":
|
||||
# make full version
|
||||
root_dir = base_dir + "/android/" + branding + "/osign"
|
||||
if (base.is_dir(root_dir)):
|
||||
base.delete_dir(root_dir)
|
||||
base.create_dir(root_dir)
|
||||
libs_dir = root_dir + "/lib"
|
||||
base.create_dir(libs_dir + "/arm64-v8a")
|
||||
base.copy_files(base_dir + "/android_arm64_v8a/" + branding + "/osign/*.so", libs_dir + "/arm64-v8a")
|
||||
base.create_dir(libs_dir + "/armeabi-v7a")
|
||||
base.copy_files(base_dir + "/android_armv7/" + branding + "/osign/*.so", libs_dir + "/armeabi-v7a")
|
||||
base.create_dir(libs_dir + "/x86")
|
||||
base.copy_files(base_dir + "/android_x86/" + branding + "/osign/*.so", libs_dir + "/x86")
|
||||
base.create_dir(libs_dir + "/x86_64")
|
||||
base.copy_files(base_dir + "/android_x86_64/" + branding + "/osign/*.so", libs_dir + "/x86_64")
|
||||
break
|
||||
|
||||
return
|
||||
@ -5,6 +5,7 @@ import base
|
||||
|
||||
import re
|
||||
import shutil
|
||||
import glob
|
||||
from tempfile import mkstemp
|
||||
|
||||
def make():
|
||||
@ -32,35 +33,40 @@ def make():
|
||||
continue
|
||||
|
||||
root_dir = base_dir + ("/" + native_platform + "/" + branding + "/documentserver")
|
||||
root_dir_snap = root_dir + '-snap/var/www/onlyoffice/documentserver'
|
||||
root_dir_snap_example = root_dir_snap + '-example'
|
||||
if (base.is_dir(root_dir)):
|
||||
base.delete_dir(root_dir)
|
||||
base.create_dir(root_dir)
|
||||
|
||||
build_server_dir = root_dir + '/server'
|
||||
server_dir = base.get_script_dir() + "/../../server"
|
||||
bin_server_dir = server_dir + "/build/server"
|
||||
server_admin_panel_dir = base.get_script_dir() + "/../../server-admin-panel"
|
||||
|
||||
base.create_dir(build_server_dir + '/DocService')
|
||||
|
||||
base.copy_dir(bin_server_dir + '/Common/config', build_server_dir + '/Common/config')
|
||||
base.copy_dir(server_dir + '/Common/config', build_server_dir + '/Common/config')
|
||||
|
||||
base.create_dir(build_server_dir + '/DocService')
|
||||
base.copy_exe(bin_server_dir + "/DocService", build_server_dir + '/DocService', "docservice")
|
||||
base.copy_exe(server_dir + "/DocService", build_server_dir + '/DocService', "docservice")
|
||||
|
||||
base.create_dir(build_server_dir + '/FileConverter')
|
||||
base.copy_exe(bin_server_dir + "/FileConverter", build_server_dir + '/FileConverter', "converter")
|
||||
base.copy_exe(server_dir + "/FileConverter", build_server_dir + '/FileConverter', "converter")
|
||||
|
||||
base.create_dir(build_server_dir + '/Metrics')
|
||||
base.copy_exe(bin_server_dir + "/Metrics", build_server_dir + '/Metrics', "metrics")
|
||||
base.copy_dir(bin_server_dir + '/Metrics/config', build_server_dir + '/Metrics/config')
|
||||
base.copy_exe(server_dir + "/Metrics", build_server_dir + '/Metrics', "metrics")
|
||||
base.copy_dir(server_dir + '/Metrics/config', build_server_dir + '/Metrics/config')
|
||||
base.create_dir(build_server_dir + '/Metrics/node_modules/modern-syslog/build/Release')
|
||||
base.copy_file(bin_server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node", build_server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node")
|
||||
base.copy_file(server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node", build_server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node")
|
||||
|
||||
base.create_dir(build_server_dir + '/SpellChecker')
|
||||
base.copy_exe(bin_server_dir + "/SpellChecker", build_server_dir + '/SpellChecker', "spellchecker")
|
||||
base.create_dir(build_server_dir + '/SpellChecker/node_modules/nodehun/build/Release')
|
||||
base.copy_file(bin_server_dir + "/SpellChecker/node_modules/nodehun/build/Release/nodehun.node", build_server_dir + '/SpellChecker/node_modules/nodehun/build/Release/nodehun.node')
|
||||
|
||||
if "server-admin-panel" in base.get_server_addons() and base.is_exist(server_admin_panel_dir):
|
||||
# AdminPanel server part
|
||||
base.create_dir(build_server_dir + '/AdminPanel/server')
|
||||
base.copy_exe(server_admin_panel_dir + "/server", build_server_dir + '/AdminPanel/server', "adminpanel")
|
||||
|
||||
# AdminPanel client part
|
||||
base.create_dir(build_server_dir + '/AdminPanel/client/build')
|
||||
base.copy_dir(server_admin_panel_dir + '/client/build', build_server_dir + '/AdminPanel/client/build')
|
||||
|
||||
qt_dir = base.qt_setup(native_platform)
|
||||
platform = native_platform
|
||||
@ -75,73 +81,84 @@ def make():
|
||||
base.create_dir(converter_dir)
|
||||
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "kernel")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "kernel_network")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "UnicodeConverter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "graphics")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "PdfWriter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "PdfReader")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "PdfFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "DjVuFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "XpsFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "HtmlFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "HtmlRenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "OFDFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "HtmlFile2")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "doctrenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "Fb2File")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "EpubFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "IWorkFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "HWPFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "DocxRenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "StarMathConverter")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "ooxmlsignature")
|
||||
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", converter_dir + "/cmap.bin")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, converter_dir, "x2t")
|
||||
|
||||
base.generate_doctrenderer_config(converter_dir + "/DoctRenderer.config", "../../../", "server")
|
||||
#if (native_platform == "linux_64"):
|
||||
# base.generate_check_linux_system(git_dir + "/build_tools", converter_dir)
|
||||
|
||||
base.generate_doctrenderer_config(converter_dir + "/DoctRenderer.config", "../../../", "server", "", "../../../dictionaries")
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", converter_dir + "/icudt58.dll")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icuuc58.dll", converter_dir + "/icuuc58.dll")
|
||||
base.deploy_icu(core_dir, converter_dir, platform)
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", converter_dir + "/libicudata.so.58")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.so.58", converter_dir + "/libicuuc.so.58")
|
||||
|
||||
if (0 == platform.find("mac")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.58.dylib", converter_dir + "/libicudata.58.dylib")
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.58.dylib", converter_dir + "/libicuuc.58.dylib")
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", converter_dir + "/")
|
||||
else:
|
||||
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", converter_dir + "/icudtl.dat")
|
||||
base.copy_v8_files(core_dir, converter_dir, platform)
|
||||
|
||||
# builder
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, converter_dir, "docbuilder")
|
||||
base.copy_dir(git_dir + "/DocumentBuilder/empty", converter_dir + "/empty")
|
||||
base.copy_dir(git_dir + "/document-templates/new/en-US", converter_dir + "/empty")
|
||||
|
||||
# html
|
||||
base.create_dir(converter_dir + "/HtmlFileInternal")
|
||||
base.copy_exe(core_build_dir + "/lib/" + platform_postfix, converter_dir + "/HtmlFileInternal", "HtmlFileInternal")
|
||||
base.copy_files(core_dir + "/Common/3dParty/cef/" + platform + "/build/*", converter_dir + "/HtmlFileInternal")
|
||||
if (0 == platform.find("win")):
|
||||
base.delete_file(root_dir + "/HtmlFileInternal/cef_sandbox.lib")
|
||||
base.delete_file(root_dir + "/HtmlFileInternal/libcef.lib")
|
||||
# correct mac frameworks
|
||||
if (0 == platform.find("mac")):
|
||||
base.for_each_framework(converter_dir, "mac", callbacks=[base.generate_plist], max_depth=1)
|
||||
|
||||
# js
|
||||
js_dir = root_dir
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", js_dir + "/sdkjs")
|
||||
base.copy_dir(base_dir + "/js/" + branding + "/builder/web-apps", js_dir + "/web-apps")
|
||||
|
||||
for file in glob.glob(js_dir + "/web-apps/apps/*/*/*.js.map") \
|
||||
+ glob.glob(js_dir + "/web-apps/apps/*/mobile/dist/js/*.js.map"):
|
||||
base.delete_file(file)
|
||||
|
||||
base.create_x2t_js_cache(converter_dir, "server", platform)
|
||||
|
||||
# add embed worker code
|
||||
base.cmd_in_dir(git_dir + "/sdkjs/common/embed", "python", ["make.py", js_dir + "/web-apps/apps/api/documents/api.js"])
|
||||
|
||||
# plugins
|
||||
base.create_dir(js_dir + "/sdkjs-plugins")
|
||||
base.copy_sdkjs_plugins(js_dir + "/sdkjs-plugins")
|
||||
|
||||
base.copy_marketplace_plugin(js_dir + "/sdkjs-plugins", False, True)
|
||||
if ("1" == config.option("preinstalled-plugins")):
|
||||
base.copy_sdkjs_plugins(js_dir + "/sdkjs-plugins", False, True)
|
||||
base.copy_sdkjs_plugins_server(js_dir + "/sdkjs-plugins", False, True)
|
||||
else:
|
||||
base.generate_sdkjs_plugin_list(js_dir + "/sdkjs-plugins/plugin-list-default.json")
|
||||
base.create_dir(js_dir + "/sdkjs-plugins/v1")
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js", js_dir + "/sdkjs-plugins/v1/plugins.js")
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", js_dir + "/sdkjs-plugins/v1/plugins-ui.js")
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", js_dir + "/sdkjs-plugins/v1/plugins.css")
|
||||
base.support_old_versions_plugins(js_dir + "/sdkjs-plugins")
|
||||
|
||||
# tools
|
||||
tools_dir = root_dir + "/server/tools"
|
||||
base.create_dir(tools_dir)
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, tools_dir, "allfontsgen")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, tools_dir, "allthemesgen")
|
||||
if ("1" != config.option("preinstalled-plugins")):
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, tools_dir, "pluginsmanager")
|
||||
|
||||
branding_dir = server_dir + "/branding"
|
||||
if("" != config.option("branding")):
|
||||
if("" != config.option("branding") and "onlyoffice" != config.option("branding")):
|
||||
branding_dir = git_dir + '/' + config.option("branding") + '/server'
|
||||
|
||||
#dictionaries
|
||||
spellchecker_dictionaries = build_server_dir + '/SpellChecker/dictionaries'
|
||||
spellchecker_dictionaries_files = server_dir + '/../dictionaries/*_*'
|
||||
base.create_dir(spellchecker_dictionaries)
|
||||
base.copy_files(spellchecker_dictionaries_files, spellchecker_dictionaries)
|
||||
base.copy_dictionaries(server_dir + "/../dictionaries", root_dir + "/dictionaries")
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
exec_ext = '.exe'
|
||||
@ -160,6 +177,18 @@ def make():
|
||||
base.create_dir(core_fonts)
|
||||
base.copy_dir_content(core_fonts_files, core_fonts, "", ".git")
|
||||
|
||||
#document-templates
|
||||
document_templates_files = server_dir + '/../document-templates'
|
||||
document_templates = build_server_dir + '/../document-templates'
|
||||
base.copy_dir(document_templates_files + '/new', document_templates + '/new')
|
||||
base.copy_dir(document_templates_files + '/sample', document_templates + '/sample')
|
||||
|
||||
#document-formats
|
||||
document_formats_files = server_dir + '/../document-formats'
|
||||
document_formats = build_server_dir + '/../document-formats'
|
||||
base.create_dir(document_formats)
|
||||
base.copy_file(document_formats_files + '/onlyoffice-docs-formats.json', document_formats + '/onlyoffice-docs-formats.json')
|
||||
|
||||
#license
|
||||
license_file1 = server_dir + '/LICENSE.txt'
|
||||
license_file2 = server_dir + '/3rd-Party.txt'
|
||||
@ -168,6 +197,7 @@ def make():
|
||||
base.copy_file(license_file1, build_server_dir)
|
||||
base.copy_file(license_file2, build_server_dir)
|
||||
base.copy_dir(license_dir, license)
|
||||
base.copy_dir(server_dir + '/dictionaries', build_server_dir + '/dictionaries')
|
||||
|
||||
#branding
|
||||
welcome_files = branding_dir + '/welcome'
|
||||
@ -188,5 +218,25 @@ def make():
|
||||
base.copy_exe(bin_example_dir, build_example_dir, "example")
|
||||
base.copy_dir(bin_example_dir + "/config", build_example_dir + "/config")
|
||||
|
||||
return
|
||||
# snap
|
||||
if (0 == platform.find("linux")):
|
||||
if (base.is_dir(root_dir_snap)):
|
||||
base.delete_dir(root_dir_snap)
|
||||
base.create_dir(root_dir_snap)
|
||||
base.copy_dir(root_dir, root_dir_snap)
|
||||
base.copy_dir(server_dir + '/DocService/node_modules', root_dir_snap + '/server/DocService/node_modules')
|
||||
base.copy_dir(server_dir + '/DocService/sources', root_dir_snap + '/server/DocService/sources')
|
||||
base.copy_dir(server_dir + '/DocService/public', root_dir_snap + '/server/DocService/public')
|
||||
base.delete_file(root_dir_snap + '/server/DocService/docservice')
|
||||
base.copy_dir(server_dir + '/FileConverter/node_modules', root_dir_snap + '/server/FileConverter/node_modules')
|
||||
base.copy_dir(server_dir + '/FileConverter/sources', root_dir_snap + '/server/FileConverter/sources')
|
||||
base.delete_file(root_dir_snap + '/server/FileConverter/converter')
|
||||
base.copy_dir(server_dir + '/Common/node_modules', root_dir_snap + '/server/Common/node_modules')
|
||||
base.copy_dir(server_dir + '/Common/sources', root_dir_snap + '/server/Common/sources')
|
||||
if (base.is_dir(root_dir_snap_example)):
|
||||
base.delete_dir(root_dir_snap_example)
|
||||
base.create_dir(root_dir_snap_example)
|
||||
base.copy_dir(bin_example_dir + '/..', root_dir_snap_example)
|
||||
base.delete_file(root_dir_snap + '/example/nodejs/example')
|
||||
|
||||
return
|
||||
|
||||
104
scripts/develop/build_lo_linux.py
Normal file
104
scripts/develop/build_lo_linux.py
Normal file
@ -0,0 +1,104 @@
|
||||
# This script was successfully executed on Ubuntu 22.04.5 LTS
|
||||
|
||||
# Before starting, make sure that:
|
||||
# 1. Python >= 3.9
|
||||
# 2. The current working folder with the script and its path do not contain spaces and use Latin characters.
|
||||
# 3. Antivirus is turned off
|
||||
# 4. There is enough free space on the disk (50GB Libre Office and during the unpacking of packages, it's recommended that you allocate at least 80 gigabytes of free space)
|
||||
# 5. The current working folder with the script and its path do not contain spaces and use Latin characters.
|
||||
|
||||
# If the error "You must put some 'source' URIs in your sources.list" occurs, you need to run the command:
|
||||
# software-properties-gtk
|
||||
# in the terminal, and then under the "Ubuntu Software" tab, click "Source code" if it's not turned on and submit
|
||||
|
||||
# after completion, the file will appear:
|
||||
# current_folder_with_script/libreoffice_build/instdir/soffice
|
||||
# debugging can be done via MVS 2022
|
||||
# https://wiki.documentfoundation.org/Development/IDE#Microsoft_Visual_Studio
|
||||
# or via VS Code with c/c++ tools
|
||||
# https://wiki.documentfoundation.org/Development/IDE#Visual_Studio_Code_(VSCode)
|
||||
# or via Qt Creator
|
||||
# https://wiki.documentfoundation.org/Development/IDE#Qt_Creator
|
||||
# or via attatch to the soffice.bin process
|
||||
# https://wiki.documentfoundation.org/Development/How_to_debug#Debugging_with_gdb
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
|
||||
CONFIGURE_PARAMS = [
|
||||
"--enable-dbgutil",
|
||||
"--without-doxygen",
|
||||
"--enable-pch",
|
||||
"--disable-ccache",
|
||||
# "--with-visual-studio=2022",
|
||||
'--enable-symbols="all"'
|
||||
]
|
||||
|
||||
SUDO_DEPENDENCIES = [
|
||||
"git", "build-essential", "zip", "ccache", "junit4", "libkrb5-dev", "nasm", "graphviz", "python3",
|
||||
"python3-dev", "python3-setuptools", "qtbase5-dev", "libkf5coreaddons-dev", "libkf5i18n-dev",
|
||||
"libkf5config-dev", "libkf5windowsystem-dev", "libkf5kio-dev", "libqt5x11extras5-dev", "autoconf",
|
||||
"libcups2-dev", "libfontconfig1-dev", "gperf", "openjdk-17-jdk", "doxygen", "libxslt1-dev",
|
||||
"xsltproc", "libxml2-utils", "libxrandr-dev", "libx11-dev", "bison", "flex", "libgtk-3-dev",
|
||||
"libgstreamer-plugins-base1.0-dev", "libgstreamer1.0-dev", "ant", "ant-optional", "libnss3-dev",
|
||||
"libavahi-client-dev", "libxt-dev"
|
||||
]
|
||||
|
||||
DIR_NAME = "libreoffice"
|
||||
OFFICE_PATH = "instdir/program/soffice"
|
||||
|
||||
class bcolors:
|
||||
OKBLUE = '\033[94m'
|
||||
OKCYAN = '\033[96m'
|
||||
OKGREEN = '\033[92m'
|
||||
FAIL = '\033[91m'
|
||||
RESET = '\033[0m'
|
||||
|
||||
def run_command(command, exit_on_error=True):
|
||||
try:
|
||||
subprocess.run(command, shell=True, check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"{bcolors.FAIL}Error executing command: {command}{bcolors.RESET}")
|
||||
if exit_on_error:
|
||||
sys.exit(1)
|
||||
|
||||
def install_dependencies():
|
||||
print("Updating package list...")
|
||||
run_command("sudo apt update")
|
||||
|
||||
print("Adding PPA for GCC/G++ update...")
|
||||
run_command("sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test")
|
||||
run_command("sudo apt update")
|
||||
|
||||
print("Installing dependencies for LibreOffice...")
|
||||
run_command("sudo apt-get build-dep -y libreoffice")
|
||||
run_command(f"sudo apt-get install {' '.join(map(str, SUDO_DEPENDENCIES))}")
|
||||
|
||||
print("Updating GCC/G++ to v12...")
|
||||
run_command("sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 60 --slave /usr/bin/g++ g++ /usr/bin/g++-12", exit_on_error=False)
|
||||
|
||||
print(bcolors.OKGREEN + "All dependencies successfully installed!" + bcolors.RESET)
|
||||
|
||||
def build_libreoffice():
|
||||
print("Cloning LibreOffice repository...")
|
||||
run_command(f"git clone https://git.libreoffice.org/core {DIR_NAME}", exit_on_error=False)
|
||||
|
||||
print("Changing to build directory...")
|
||||
os.chdir(f"./{DIR_NAME}")
|
||||
|
||||
print("Start configurator autogen.sh...")
|
||||
run_command(f"./autogen.sh {' '.join(map(str, CONFIGURE_PARAMS))}")
|
||||
|
||||
print(bcolors.OKCYAN + "Starting libreoffice build, this may take up to 24 hours and takes up about 20 GB of drive space. You will also most likely need at least 8 GBs of RAM, otherwise the machine might fall into swap and appear to freeze up..." + bcolors.RESET)
|
||||
run_command("make")
|
||||
|
||||
print(bcolors.OKGREEN + "LibreOffice build completed!" + bcolors.RESET)
|
||||
|
||||
# print(bcolors.OKCYAN + "Running LibreOffice..." + bcolors.RESET)
|
||||
# run_command(OFFICE_PATH, exit_on_error=False)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
install_dependencies()
|
||||
build_libreoffice()
|
||||
202
scripts/develop/build_lo_windows.py
Normal file
202
scripts/develop/build_lo_windows.py
Normal file
@ -0,0 +1,202 @@
|
||||
# Before starting, make sure that:
|
||||
# 1. MVS 2022 is installed and the necessary individual components are in its installer
|
||||
# <20> Windows Universal C Runtime
|
||||
# <20> .NET Framework 4.x SDK (.NET Framework 5.x SDK and later are currently not supported. These don't register their information to registry, don't have csc.exe and they use dotnet command with csc.dll instead for compiling.)
|
||||
# <20> C++ 20xx Redistributable MSMs (only required to build MSI installer)
|
||||
# <20> C++ Clang Compiler for Windows (x.x.x)
|
||||
# 2. Java JDK >= 17
|
||||
# 3. Antivirus is turned off
|
||||
# 4. There is enough free space on the disk (50GB Libre Office, 50Gb cygwin64)
|
||||
|
||||
# after completion, the files will appear:
|
||||
# {LO_BUILD_PATH}/sources/libo-core/instdir/program/soffice.exe
|
||||
# {LO_BUILD_PATH}/sources/libo-core/LibreOffice.sln
|
||||
# debugging can be done via MVS 2022
|
||||
# https://wiki.documentfoundation.org/Development/IDE#Microsoft_Visual_Studio
|
||||
# or via attatch to the soffice.bin process
|
||||
# https://wiki.documentfoundation.org/Development/How_to_debug#Debugging_with_gdb
|
||||
|
||||
import sys
|
||||
|
||||
sys.path.append('../../scripts')
|
||||
import threading
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import shutil
|
||||
import argparse
|
||||
import base
|
||||
|
||||
CYGWIN_DOWNLOAD_URL = 'https://cygwin.com/setup-x86_64.exe'
|
||||
CYGWIN_TEMP_PATH = './tmp'
|
||||
CYGWIN_SETUP_FILENAME = 'setup-x86_64.exe'
|
||||
CYGWIN_SETUP_PARAMS = [
|
||||
"-P", "autoconf",
|
||||
"-P", "automake",
|
||||
"-P", "bison",
|
||||
"-P", "cabextract",
|
||||
"-P", "doxygen",
|
||||
"-P", "flex",
|
||||
"-P", "gawk=5.2.2-1",
|
||||
"-P", "gcc-g++",
|
||||
"-P", "gettext-devel",
|
||||
"-P", "git",
|
||||
"-P", "gnupg",
|
||||
"-P", "gperf",
|
||||
"-P", "make",
|
||||
"-P", "mintty",
|
||||
"-P", "nasm",
|
||||
"-P", "openssh",
|
||||
"-P", "openssl",
|
||||
"-P", "patch",
|
||||
"-P", "perl",
|
||||
"-P", "python",
|
||||
"-P", "python3",
|
||||
"-P", "pkg-config",
|
||||
"-P", "rsync",
|
||||
"-P", "unzip",
|
||||
"-P", "vim",
|
||||
"-P", "wget",
|
||||
"-P", "zip",
|
||||
"-P", "perl-Archive-Zip",
|
||||
"-P", "perl-Font-TTF",
|
||||
"-P", "perl-IO-String",
|
||||
"--no-admin",
|
||||
"--quiet-mode"
|
||||
]
|
||||
CYGWIN_BAT_PATH = 'C:/cygwin64/Cygwin.bat'
|
||||
LO_BUILD_PATH = os.path.normpath(os.path.join(os.getcwd(), '../../../LO'))
|
||||
|
||||
CONFIGURE_PARAMS = [f'--with-external-tar="{LO_BUILD_PATH}/sources/lo-externalsrc"',
|
||||
f'--with-junit="{LO_BUILD_PATH}/sources/junit-4.10.jar"',
|
||||
f'--with-ant-home="{LO_BUILD_PATH}/sources/apache-ant-1.9.5"',
|
||||
"--enable-pch",
|
||||
"--disable-ccache",
|
||||
"--with-visual-studio=2022",
|
||||
"--enable-dbgutil",
|
||||
'--enable-symbols="all"']
|
||||
|
||||
|
||||
def create_folder_safe(folder_path):
|
||||
if not os.path.exists(folder_path):
|
||||
try:
|
||||
os.mkdir(folder_path)
|
||||
print(f"Folder '{folder_path}' created successfully.")
|
||||
except Exception as e:
|
||||
print(f"Error creating folder: {e}")
|
||||
else:
|
||||
print(f"Folder '{folder_path}' already exists.")
|
||||
|
||||
|
||||
class CygwinRunner:
|
||||
@staticmethod
|
||||
def process_commands(commands: list[str]):
|
||||
proc = subprocess.Popen(
|
||||
[CYGWIN_BAT_PATH], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True,
|
||||
shell=True, creationflags=subprocess.CREATE_NEW_CONSOLE
|
||||
)
|
||||
|
||||
def read_stdout():
|
||||
for line in iter(proc.stdout.readline, ''):
|
||||
sys.stdout.write(line)
|
||||
proc.stdout.close()
|
||||
|
||||
def read_stderr():
|
||||
for line in iter(proc.stderr.readline, ''):
|
||||
sys.stderr.write(line)
|
||||
proc.stderr.close()
|
||||
|
||||
stdout_thread = threading.Thread(target=read_stdout)
|
||||
stderr_thread = threading.Thread(target=read_stderr)
|
||||
|
||||
stdout_thread.start()
|
||||
stderr_thread.start()
|
||||
|
||||
for command in commands:
|
||||
proc.stdin.write(command + '\n')
|
||||
proc.stdin.flush()
|
||||
|
||||
stdout_thread.join()
|
||||
stderr_thread.join()
|
||||
|
||||
proc.stdin.close()
|
||||
|
||||
proc.wait()
|
||||
|
||||
@staticmethod
|
||||
def install_gnu_make():
|
||||
base.print_info("install_gnu_make")
|
||||
commands = ['mkdir -p /opt/lo/bin',
|
||||
'cd /opt/lo/bin',
|
||||
'wget https://dev-www.libreoffice.org/bin/cygwin/make-4.2.1-msvc.exe',
|
||||
'cp make-4.2.1-msvc.exe make',
|
||||
'chmod +x make',
|
||||
'exit']
|
||||
CygwinRunner.process_commands(commands)
|
||||
|
||||
@staticmethod
|
||||
def install_ant_and_junit():
|
||||
base.print_info("install_ant_and_junit")
|
||||
commands = [f'mkdir -p {LO_BUILD_PATH}/sources',
|
||||
f'cd {LO_BUILD_PATH}/sources',
|
||||
'wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.5-bin.tar.bz2',
|
||||
'tar -xjvf apache-ant-1.9.5-bin.tar.bz2',
|
||||
'wget http://downloads.sourceforge.net/project/junit/junit/4.10/junit-4.10.jar',
|
||||
'exit']
|
||||
CygwinRunner.process_commands(commands)
|
||||
|
||||
@staticmethod
|
||||
def clone_lo():
|
||||
base.print_info("clone_lo")
|
||||
commands = [f'cd {LO_BUILD_PATH}/sources',
|
||||
'git clone https://gerrit.libreoffice.org/core libo-core',
|
||||
'exit']
|
||||
CygwinRunner.process_commands(commands)
|
||||
|
||||
@staticmethod
|
||||
def build_autogen():
|
||||
base.print_info("build_autogen")
|
||||
commands = [f'cd {LO_BUILD_PATH}/sources/libo-core',
|
||||
f"./autogen.sh {' '.join(map(str, CONFIGURE_PARAMS))}",
|
||||
'exit']
|
||||
CygwinRunner.process_commands(commands)
|
||||
|
||||
@staticmethod
|
||||
def run_make_build():
|
||||
base.print_info("run_make")
|
||||
commands = [f'cd {LO_BUILD_PATH}/sources/libo-core',
|
||||
f'/opt/lo/bin/make gb_COLOR=1',
|
||||
"exit"]
|
||||
CygwinRunner.process_commands(commands)
|
||||
|
||||
@staticmethod
|
||||
def build_vs_integration():
|
||||
base.print_info("run_make")
|
||||
commands = [f'cd {LO_BUILD_PATH}/sources/libo-core',
|
||||
f'/opt/lo/bin/make gb_COLOR=1 vs-ide-integration',
|
||||
"exit"]
|
||||
CygwinRunner.process_commands(commands)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description="options")
|
||||
parser.add_argument("--lo_build_path", dest="build_path", default=f'../../../LO')
|
||||
parser.add_argument("--disable_sln", dest="disable_sln", action=argparse.BooleanOptionalAction)
|
||||
args = parser.parse_args()
|
||||
|
||||
LO_BUILD_PATH = args.build_path
|
||||
DISABLE_SLN = args.disable_sln
|
||||
create_folder_safe(f'{LO_BUILD_PATH}/sources/lo-externalsrc')
|
||||
create_folder_safe(CYGWIN_TEMP_PATH)
|
||||
os.chdir(CYGWIN_TEMP_PATH)
|
||||
base.download(CYGWIN_DOWNLOAD_URL, CYGWIN_SETUP_FILENAME)
|
||||
subprocess.run([CYGWIN_SETUP_FILENAME] + CYGWIN_SETUP_PARAMS)
|
||||
os.chdir('..')
|
||||
shutil.rmtree(CYGWIN_TEMP_PATH)
|
||||
CygwinRunner.install_gnu_make()
|
||||
CygwinRunner.install_ant_and_junit()
|
||||
CygwinRunner.clone_lo()
|
||||
CygwinRunner.build_autogen()
|
||||
CygwinRunner.run_make_build()
|
||||
if not DISABLE_SLN:
|
||||
CygwinRunner.build_vs_integration()
|
||||
148
scripts/develop/config_server.py
Normal file
148
scripts/develop/config_server.py
Normal file
@ -0,0 +1,148 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import json
|
||||
|
||||
def make():
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
old_cur = os.getcwd()
|
||||
|
||||
work_dir = git_dir + "/server/FileConverter/bin"
|
||||
if not base.is_dir(work_dir):
|
||||
base.create_dir(work_dir)
|
||||
|
||||
os.chdir(work_dir)
|
||||
|
||||
url = base.get_autobuild_version("core", "", config.option("branch"))
|
||||
data_url = base.get_file_last_modified_url(url)
|
||||
if (data_url == "" and config.option("branch") != "develop"):
|
||||
url = base.get_autobuild_version("core", "", "develop")
|
||||
data_url = base.get_file_last_modified_url(url)
|
||||
|
||||
old_data_url = base.readFile("./core.7z.data")
|
||||
|
||||
if (data_url != "" and old_data_url != data_url):
|
||||
print("-----------------------------------------------------------")
|
||||
print("Downloading core last version... --------------------------")
|
||||
print("-----------------------------------------------------------")
|
||||
if (base.is_file("./core.7z")):
|
||||
base.delete_file("./core.7z")
|
||||
if (base.is_dir("./core")):
|
||||
base.delete_dir("./core")
|
||||
base.download(url, "./core.7z")
|
||||
|
||||
print("-----------------------------------------------------------")
|
||||
print("Extracting core last version... ---------------------------")
|
||||
print("-----------------------------------------------------------")
|
||||
|
||||
base.extract("./core.7z", "./")
|
||||
base.writeFile("./core.7z.data", data_url)
|
||||
|
||||
base.copy_files("./core/*", "./")
|
||||
else:
|
||||
print("-----------------------------------------------------------")
|
||||
print("Core is up to date. ---------------------------------------")
|
||||
print("-----------------------------------------------------------")
|
||||
|
||||
base.generate_doctrenderer_config("./DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/", "../../../dictionaries")
|
||||
|
||||
if not base.is_dir(git_dir + "/sdkjs-plugins"):
|
||||
base.create_dir(git_dir + "/sdkjs-plugins")
|
||||
|
||||
if not base.is_dir(git_dir + "/sdkjs-plugins/v1"):
|
||||
base.create_dir(git_dir + "/sdkjs-plugins/v1")
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js", git_dir + "/sdkjs-plugins/v1/plugins.js")
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", git_dir + "/sdkjs-plugins/v1/plugins-ui.js")
|
||||
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", git_dir + "/sdkjs-plugins/v1/plugins.css")
|
||||
|
||||
base.support_old_versions_plugins(git_dir + "/sdkjs-plugins")
|
||||
base.copy_marketplace_plugin(git_dir + "/sdkjs-plugins", False, False)
|
||||
|
||||
if not base.is_dir(git_dir + "/fonts"):
|
||||
base.create_dir(git_dir + "/fonts")
|
||||
|
||||
if ("mac" == base.host_platform()):
|
||||
base.mac_correct_rpath_x2t("./")
|
||||
|
||||
print("-----------------------------------------------------------")
|
||||
print("All fonts generation... -----------------------------------")
|
||||
print("-----------------------------------------------------------")
|
||||
base.cmd_exe("./allfontsgen", ["--input=../../../core-fonts", "--allfonts-web=../../../sdkjs/common/AllFonts.js", "--allfonts=./AllFonts.js",
|
||||
"--images=../../../sdkjs/common/Images", "--selection=./font_selection.bin",
|
||||
"--use-system=true", "--output-web=../../../fonts"])
|
||||
|
||||
print("All presentation themes generation... ---------------------")
|
||||
print("-----------------------------------------------------------")
|
||||
base.cmd_exe("./allthemesgen", ["--converter-dir=\"" + git_dir + "/server/FileConverter/bin\"", "--src=\"" + git_dir + "/sdkjs/slide/themes\"", "--output=\"" + git_dir + "/sdkjs/common/Images\""])
|
||||
|
||||
#print("- allthemesgen (ios) --------------------------------------")
|
||||
#base.cmd_exe("./allthemesgen", ["--converter-dir=\"" + git_dir + "/server/FileConverter/bin\"", "--src=\"" + git_dir + "/sdkjs/slide/themes\"", "--output=\"" + git_dir + "/sdkjs/common/Images\"", "--postfix=ios", "--params=280,224"])
|
||||
# android
|
||||
#print("- allthemesgen (android) ----------------------------------")
|
||||
#base.cmd_exe("./allthemesgen", ["--converter-dir=\"" + git_dir + "/server/FileConverter/bin\"", "--src=\"" + git_dir + "/sdkjs/slide/themes\"", "--output=\"" + git_dir + "/sdkjs/common/Images\"", "--postfix=android", "--params=280,224"])
|
||||
|
||||
# add directories to open directories
|
||||
addon_base_path = "../../"
|
||||
server_config = {}
|
||||
static_content = {}
|
||||
sql = {}
|
||||
|
||||
server_addons = []
|
||||
if (config.option("server-addons") != ""):
|
||||
server_addons = config.option("server-addons").rsplit(", ")
|
||||
#server-lockstorage is private
|
||||
if ("server-lockstorage" in server_addons and base.is_dir(git_dir + "/server-lockstorage")):
|
||||
server_config["editorDataStorage"] = "editorDataRedis"
|
||||
|
||||
sdkjs_addons = []
|
||||
if (config.option("sdkjs-addons") != ""):
|
||||
sdkjs_addons = config.option("sdkjs-addons").rsplit(", ")
|
||||
for addon in sdkjs_addons:
|
||||
static_content["/" + addon] = {"path": addon_base_path + addon}
|
||||
|
||||
web_apps_addons = []
|
||||
if (config.option("web-apps-addons") != ""):
|
||||
web_apps_addons = config.option("web-apps-addons").rsplit(", ")
|
||||
for addon in web_apps_addons:
|
||||
static_content["/" + addon] = {"path": addon_base_path + addon}
|
||||
|
||||
if (config.option("external-folder") != ""):
|
||||
external_folder = config.option("external-folder")
|
||||
static_content["/sdkjs"] = {"path": addon_base_path + external_folder + "/sdkjs"}
|
||||
static_content["/web-apps"] = {"path": addon_base_path + external_folder + "/web-apps"}
|
||||
|
||||
if (config.option("sql-type") != ""):
|
||||
sql["type"] = config.option("sql-type")
|
||||
if (config.option("db-port") != ""):
|
||||
sql["dbPort"] = config.option("db-port")
|
||||
if (config.option("db-name") != ""):
|
||||
sql["dbName"] = config.option("db-name")
|
||||
if (config.option("db-user") != ""):
|
||||
sql["dbUser"] = config.option("db-user")
|
||||
if (config.option("db-pass") != ""):
|
||||
sql["dbPass"] = config.option("db-pass")
|
||||
|
||||
server_config["static_content"] = static_content
|
||||
|
||||
json_file = git_dir + "/server/Common/config/local-development-" + base.host_platform() + ".json"
|
||||
base.writeFile(json_file, json.dumps({"services": {"CoAuthoring": {"server": server_config, "sql": sql}}}, indent=2))
|
||||
|
||||
#site url
|
||||
example_config = {}
|
||||
if (base.host_platform() == "linux"):
|
||||
example_config["port"] = 3000
|
||||
else:
|
||||
example_config["port"] = 80
|
||||
example_config["siteUrl"] = "http://" + config.option("siteUrl") + ":8000/"
|
||||
example_config["apiUrl"] = "web-apps/apps/api/documents/api.js"
|
||||
example_config["preloaderUrl"] = "web-apps/apps/api/documents/cache-scripts.html"
|
||||
json_dir = git_dir + "/document-server-integration/web/documentserver-example/nodejs/config/"
|
||||
json_file = json_dir + "/local-development-" + base.host_platform() + ".json"
|
||||
if base.is_exist(json_dir):
|
||||
base.writeFile(json_file, json.dumps({"server": example_config}, indent=2))
|
||||
|
||||
os.chdir(old_cur)
|
||||
return
|
||||
|
||||
1065
scripts/develop/dependence.py
Normal file
1065
scripts/develop/dependence.py
Normal file
File diff suppressed because it is too large
Load Diff
37
scripts/develop/develop.py
Normal file
37
scripts/develop/develop.py
Normal file
@ -0,0 +1,37 @@
|
||||
import sys
|
||||
sys.path.append('scripts')
|
||||
sys.path.append('scripts/develop')
|
||||
import base
|
||||
import build_js
|
||||
import build_server
|
||||
import config
|
||||
import dependence
|
||||
import config_server as develop_config_server
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
def build_docker_server():
|
||||
dependence.check__docker_dependencies()
|
||||
build_develop_server()
|
||||
|
||||
def build_docker_sdk_web_apps(dir):
|
||||
dependence.check__docker_dependencies()
|
||||
build_js.build_js_develop(dir)
|
||||
|
||||
def build_develop_server():
|
||||
build_server.build_server_develop()
|
||||
build_js.build_js_develop(base_dir + "/../../..")
|
||||
develop_config_server.make()
|
||||
if ("" != config.option("branding")):
|
||||
branding_develop_script_dir = base_dir + "/../../../" + config.option("branding") + "/build_tools/scripts"
|
||||
if base.is_file(branding_develop_script_dir + "/develop.py"):
|
||||
base.cmd_in_dir(branding_develop_script_dir, "python", ["develop.py"], True)
|
||||
|
||||
def make():
|
||||
if ("1" != config.option("develop")):
|
||||
return
|
||||
if not dependence.check_dependencies():
|
||||
exit(1)
|
||||
build_develop_server()
|
||||
exit(0)
|
||||
|
||||
342
scripts/develop/git_operations.py
Normal file
342
scripts/develop/git_operations.py
Normal file
@ -0,0 +1,342 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Git Operations Script
|
||||
Provides functionality to clone repositories and create branches.
|
||||
Uses existing methods from base module and integrates with release.py patterns.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
import logging
|
||||
from typing import Dict
|
||||
|
||||
# Add parent directory to path to import modules
|
||||
sys.path.append('../')
|
||||
import base
|
||||
import config
|
||||
import dependence
|
||||
|
||||
# Setup logging
|
||||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GitOperations:
|
||||
"""Class to handle git clone and branch creation using existing base module methods."""
|
||||
|
||||
def __init__(self, branding: str = "onlyoffice", base_branch: str = "develop",
|
||||
branding_url: str = "ONLYOFFICE/onlyoffice.git", branch_name: str = None,
|
||||
modules: str = "core desktop builder server mobile"):
|
||||
"""
|
||||
Initialize GitOperations with branding configuration and configure repositories.
|
||||
|
||||
Args:
|
||||
branding: Branding name (default: onlyoffice)
|
||||
base_branch: Base branch to work from (default: develop)
|
||||
branding_url: Relative path from git host base (default: ONLYOFFICE/onlyoffice.git)
|
||||
branch_name: Name of the branch to create (required for branch operations)
|
||||
modules: Modules to include (default: core desktop builder server mobile)
|
||||
"""
|
||||
self.branding = branding
|
||||
self.base_branch = base_branch
|
||||
self.branding_url = branding_url
|
||||
self.branch_name = branch_name
|
||||
self.modules = modules
|
||||
self.work_dir = None
|
||||
|
||||
# Configure repositories immediately
|
||||
self._configure()
|
||||
|
||||
# Update repositories after configuration
|
||||
repositories = self.get_configured_repositories()
|
||||
#base.update_repositories(repositories)
|
||||
|
||||
def create_branch(self, branch_name: str, repo_dir: str = None) -> bool:
|
||||
"""
|
||||
Create a new branch using base.cmd_in_dir.
|
||||
|
||||
Args:
|
||||
branch_name: Name of the new branch
|
||||
repo_dir: Repository directory (optional, uses current if not specified)
|
||||
from_branch: Branch to create from (optional, uses current if not specified)
|
||||
|
||||
Returns:
|
||||
bool: True if successful, False otherwise
|
||||
"""
|
||||
work_dir = repo_dir or self.work_dir
|
||||
logger.info(f"Creating branch '{branch_name}' in {work_dir}")
|
||||
|
||||
try:
|
||||
# Create and checkout new branch
|
||||
base.cmd_in_dir(work_dir, "git", ["checkout", "-b", branch_name], True)
|
||||
logger.info(f"Successfully created branch: {branch_name}")
|
||||
return True
|
||||
except SystemExit:
|
||||
logger.error(f"Failed to create branch: {branch_name}")
|
||||
return False
|
||||
|
||||
def push_branch(self, branch_name: str, repo_dir: str = None, set_upstream: bool = True) -> bool:
|
||||
"""
|
||||
Push a branch to remote repository using base.cmd_in_dir.
|
||||
|
||||
Args:
|
||||
branch_name: Name of the branch to push
|
||||
repo_dir: Repository directory (optional, uses current if not specified)
|
||||
set_upstream: Whether to set upstream tracking (default: True)
|
||||
|
||||
Returns:
|
||||
bool: True if successful, False otherwise
|
||||
"""
|
||||
work_dir = repo_dir or self.work_dir
|
||||
logger.info(f"Pushing branch '{branch_name}' in {work_dir}")
|
||||
|
||||
try:
|
||||
if set_upstream:
|
||||
# Push branch and set upstream tracking
|
||||
base.cmd_in_dir(work_dir, "git", ["push", "-u", "origin", branch_name], True)
|
||||
else:
|
||||
# Just push the branch
|
||||
base.cmd_in_dir(work_dir, "git", ["push", "origin", branch_name], True)
|
||||
|
||||
logger.info(f"Successfully pushed branch: {branch_name}")
|
||||
return True
|
||||
except SystemExit:
|
||||
logger.error(f"Failed to push branch: {branch_name}")
|
||||
return False
|
||||
|
||||
def _configure(self) -> bool:
|
||||
"""
|
||||
Configure repositories using existing configure.py pattern from release.py.
|
||||
|
||||
Returns:
|
||||
bool: True if successful, False otherwise
|
||||
"""
|
||||
logger.info(f"Configuring and cloning repositories for branch: {self.base_branch}")
|
||||
|
||||
try:
|
||||
# Get build_tools origin and construct branding URL from git host base
|
||||
build_tools_origin = base.git_get_origin()
|
||||
# Extract git host base (everything up to the host)
|
||||
# For https://github.com/ORG/build_tools.git -> https://github.com/
|
||||
# For git@github.com:ORG/build_tools.git -> git@github.com:
|
||||
if '://' in build_tools_origin: # HTTPS
|
||||
host_base = build_tools_origin.split('/', 3)[0] + '//' + build_tools_origin.split('/', 3)[2] + '/'
|
||||
else: # SSH
|
||||
host_base = build_tools_origin.split(':', 1)[0] + ':'
|
||||
|
||||
branding_url = host_base + self.branding_url
|
||||
|
||||
logger.info(f"Build tools origin: {build_tools_origin}")
|
||||
logger.info(f"Git host base: {host_base}")
|
||||
logger.info(f"Using branding URL: {branding_url}")
|
||||
|
||||
# Check platform and dependencies like in release.py
|
||||
platform = base.host_platform()
|
||||
if platform == "windows":
|
||||
dependence.check_pythonPath()
|
||||
dependence.check_gitPath()
|
||||
|
||||
# Run configure.py like in release.py
|
||||
configure_args = [
|
||||
'configure.py',
|
||||
'--branding', self.branding,
|
||||
'--branding-url', branding_url,
|
||||
'--branch', self.base_branch,
|
||||
'--module', self.modules,
|
||||
'--update', '1',
|
||||
'--clean', '0'
|
||||
]
|
||||
|
||||
base.cmd_in_dir('../../', 'python', configure_args)
|
||||
|
||||
# Parse configuration like in release.py
|
||||
config.parse()
|
||||
|
||||
# Update build_tools repository
|
||||
base.git_update('build_tools')
|
||||
|
||||
# Update branding repository
|
||||
base.git_update(self.branding)
|
||||
|
||||
# Correct defaults (the branding repo is already updated)
|
||||
config.parse_defaults()
|
||||
|
||||
logger.info("Successfully configured")
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to configure and clone: {e}")
|
||||
return False
|
||||
|
||||
def get_configured_repositories(self) -> Dict:
|
||||
"""Get repositories using existing base.get_repositories() pattern from release.py."""
|
||||
repositories = base.get_repositories()
|
||||
repositories['core-ext'] = [True, False]
|
||||
repositories['build_tools'] = [True, False]
|
||||
repositories[self.branding] = [True, False]
|
||||
return repositories
|
||||
|
||||
def _iterate_repositories(self, operation_func, operation_name: str) -> bool:
|
||||
"""
|
||||
Iterate over all repositories and apply the given operation function.
|
||||
|
||||
Args:
|
||||
operation_func: Function to apply to each repository (takes repo_name and repo_path)
|
||||
operation_name: Name of the operation for logging
|
||||
|
||||
Returns:
|
||||
bool: True if at least one operation succeeded, False otherwise
|
||||
"""
|
||||
repositories = self.get_configured_repositories()
|
||||
success_count = 0
|
||||
total_count = len(repositories)
|
||||
|
||||
for repo_name in repositories:
|
||||
current_dir = repositories[repo_name][1]
|
||||
repo_path = f"../../../{repo_name}" if current_dir == False else current_dir
|
||||
|
||||
if base.is_dir(repo_path):
|
||||
if operation_func(repo_name, repo_path):
|
||||
success_count += 1
|
||||
else:
|
||||
logger.warning(f"✗ Failed to {operation_name} in {repo_name}")
|
||||
else:
|
||||
logger.warning(f"Repository {repo_name} not found at {repo_path}")
|
||||
|
||||
logger.info(f"{operation_name.capitalize()} completed in {success_count}/{total_count} repositories")
|
||||
return success_count > 0
|
||||
|
||||
def delete_branch(self, branch_name: str, repo_dir: str = None, force: bool = False) -> bool:
|
||||
"""
|
||||
Delete a branch using base.cmd_in_dir.
|
||||
|
||||
Args:
|
||||
branch_name: Name of the branch to delete
|
||||
repo_dir: Repository directory (optional, uses current if not specified)
|
||||
force: Whether to force delete the branch (default: False)
|
||||
|
||||
Returns:
|
||||
bool: True if successful, False otherwise
|
||||
"""
|
||||
work_dir = repo_dir or self.work_dir
|
||||
logger.info(f"Deleting branch '{branch_name}' in {work_dir}")
|
||||
|
||||
try:
|
||||
# Switch to base branch first to avoid deleting current branch
|
||||
base.cmd_in_dir(work_dir, "git", ["checkout", self.base_branch], True)
|
||||
|
||||
# Delete local branch
|
||||
delete_flag = "-D" if force else "-d"
|
||||
base.cmd_in_dir(work_dir, "git", ["branch", delete_flag, branch_name], True)
|
||||
logger.info(f"Successfully deleted local branch: {branch_name}")
|
||||
|
||||
# Delete remote branch
|
||||
try:
|
||||
base.cmd_in_dir(work_dir, "git", ["push", "origin", "--delete", branch_name], True)
|
||||
logger.info(f"Successfully deleted remote branch: {branch_name}")
|
||||
except SystemExit:
|
||||
logger.warning(f"Failed to delete remote branch: {branch_name} (may not exist)")
|
||||
|
||||
return True
|
||||
except SystemExit:
|
||||
logger.error(f"Failed to delete branch: {branch_name}")
|
||||
return False
|
||||
|
||||
def create_branches(self) -> bool:
|
||||
"""
|
||||
Create a branch with the given name in all repositories.
|
||||
|
||||
Returns:
|
||||
bool: True if successful, False otherwise
|
||||
"""
|
||||
logger.info(f"Creating branch '{self.branch_name}' in all repositories")
|
||||
|
||||
def create_and_push_branch(repo_name: str, repo_path: str) -> bool:
|
||||
"""Create and push branch for a single repository."""
|
||||
if self.create_branch(self.branch_name, repo_path):
|
||||
logger.info(f"✓ Created branch '{self.branch_name}' in {repo_name}")
|
||||
# Push the created branch
|
||||
if self.push_branch(self.branch_name, repo_path):
|
||||
logger.info(f"✓ Pushed branch '{self.branch_name}' in {repo_name}")
|
||||
return True
|
||||
else:
|
||||
logger.warning(f"✗ Failed to push branch '{self.branch_name}' in {repo_name}")
|
||||
return False
|
||||
else:
|
||||
logger.warning(f"✗ Failed to create branch '{self.branch_name}' in {repo_name}")
|
||||
return False
|
||||
|
||||
try:
|
||||
return self._iterate_repositories(create_and_push_branch, f"create and push branch '{self.branch_name}'")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to create branch in all repositories: {e}")
|
||||
return False
|
||||
|
||||
def remove_branches(self, force: bool = False) -> bool:
|
||||
"""
|
||||
Remove a branch with the given name from all repositories.
|
||||
|
||||
Args:
|
||||
force: Whether to force delete the branch (default: False)
|
||||
|
||||
Returns:
|
||||
bool: True if successful, False otherwise
|
||||
"""
|
||||
logger.info(f"Removing branch '{self.branch_name}' from all repositories")
|
||||
|
||||
def delete_branch_operation(repo_name: str, repo_path: str) -> bool:
|
||||
"""Delete branch for a single repository."""
|
||||
if self.delete_branch(self.branch_name, repo_path, force):
|
||||
logger.info(f"✓ Removed branch '{self.branch_name}' from {repo_name}")
|
||||
return True
|
||||
else:
|
||||
logger.warning(f"✗ Failed to remove branch '{self.branch_name}' from {repo_name}")
|
||||
return False
|
||||
|
||||
try:
|
||||
return self._iterate_repositories(delete_branch_operation, f"remove branch '{self.branch_name}'")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to remove branch from all repositories: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def main():
|
||||
"""Main function to handle command line arguments."""
|
||||
parser = argparse.ArgumentParser(description='Git Operations Tool - Create and Remove Branches')
|
||||
subparsers = parser.add_subparsers(dest='command', help='Available commands')
|
||||
|
||||
# Create branch command (configure, clone and create branch in all repositories)
|
||||
branch_parser = subparsers.add_parser('create', help='Configure, clone and create branch in all repositories')
|
||||
branch_parser.add_argument('branch_name', help='Name of the branch to create')
|
||||
branch_parser.add_argument('--base-branch', default='develop', help='Base branch to work from (default: develop)')
|
||||
branch_parser.add_argument('--branding', default='onlyoffice', help='Branding name')
|
||||
branch_parser.add_argument('--branding-url', default='ONLYOFFICE/onlyoffice.git', help='Relative path from git host base (default: ONLYOFFICE/onlyoffice.git)')
|
||||
branch_parser.add_argument('--modules', default='core desktop builder server mobile', help='Modules to include')
|
||||
|
||||
# Remove branch command (configure, clone and remove branch from all repositories)
|
||||
remove_parser = subparsers.add_parser('remove', help='Configure, clone and remove branch from all repositories')
|
||||
remove_parser.add_argument('branch_name', help='Name of the branch to remove')
|
||||
remove_parser.add_argument('--base-branch', default='develop', help='Base branch to work from (default: develop)')
|
||||
remove_parser.add_argument('--branding', default='onlyoffice', help='Branding name')
|
||||
remove_parser.add_argument('--branding-url', default='ONLYOFFICE/onlyoffice.git', help='Relative path from git host base (default: ONLYOFFICE/onlyoffice.git)')
|
||||
remove_parser.add_argument('--modules', default='core desktop builder server mobile', help='Modules to include')
|
||||
remove_parser.add_argument('--force', action='store_true', help='Force delete the branch (equivalent to git branch -D)')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.command:
|
||||
parser.print_help()
|
||||
return
|
||||
|
||||
git_ops = GitOperations(args.branding, args.base_branch, args.branding_url, args.branch_name, args.modules)
|
||||
|
||||
if args.command == 'create':
|
||||
success = git_ops.create_branches()
|
||||
sys.exit(0 if success else 1)
|
||||
elif args.command == 'remove':
|
||||
success = git_ops.remove_branches(args.force)
|
||||
sys.exit(0 if success else 1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
31
scripts/develop/install.py
Normal file
31
scripts/develop/install.py
Normal file
@ -0,0 +1,31 @@
|
||||
import sys
|
||||
sys.path.append('scripts')
|
||||
sys.path.append('scripts/develop')
|
||||
sys.path.append('scripts/develop/vendor')
|
||||
import base
|
||||
import shutil
|
||||
import optparse
|
||||
import dependence
|
||||
import config
|
||||
|
||||
arguments = sys.argv[1:]
|
||||
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option("--install", action="append", type="string", dest="install", default=[], help="provides install dependencies")
|
||||
parser.add_option("--uninstall", action="append", type="string", dest="uninstall", default=[], help="provides uninstall dependencies")
|
||||
parser.add_option("--remove-path", action="append", type="string", dest="remove-path", default=[], help="provides path dependencies to remove")
|
||||
|
||||
(options, args) = parser.parse_args(arguments)
|
||||
configOptions = vars(options)
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
config.parse_defaults()
|
||||
|
||||
for item in configOptions["uninstall"]:
|
||||
dependence.uninstallProgram(item)
|
||||
for item in configOptions["remove-path"]:
|
||||
if (base.is_dir(item) == True):
|
||||
shutil.rmtree(item)
|
||||
for item in configOptions["install"]:
|
||||
dependence.installProgram(item)
|
||||
53
scripts/develop/print_repositories.py
Executable file
53
scripts/develop/print_repositories.py
Executable file
@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../')
|
||||
|
||||
import argparse
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
|
||||
parser = argparse.ArgumentParser(description="Print repositories list.")
|
||||
parser.add_argument('-P', '--platform', type=str, dest='platform',
|
||||
action='store', default="native", help="Defines platform")
|
||||
parser.add_argument('-M', '--module', type=str, dest='module',
|
||||
action='store', default="core desktop builder server",
|
||||
help="Defines modules")
|
||||
parser.add_argument('-B', '--branding', type=str, dest='branding',
|
||||
action='store', help="Defines branding path")
|
||||
args = parser.parse_args()
|
||||
|
||||
config_args = [
|
||||
'configure.py',
|
||||
'--platform', args.platform,
|
||||
'--module', args.module
|
||||
]
|
||||
if args.branding != None:
|
||||
config_args += ['--branding', args.branding]
|
||||
|
||||
base.cmd_in_dir('../../', 'python', config_args)
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
config.parse_defaults()
|
||||
|
||||
repositories = base.get_repositories()
|
||||
|
||||
# Add other repositories
|
||||
if config.check_option("module", "builder"):
|
||||
repositories['document-builder-package'] = [False, False]
|
||||
|
||||
if (config.check_option("module", "server")):
|
||||
repositories['document-server-package'] = [False, False]
|
||||
repositories['Docker-DocumentServer'] = [False, False]
|
||||
|
||||
for repo in repositories:
|
||||
line = repo
|
||||
repo_dir = repositories[repo][1]
|
||||
if repo_dir != False:
|
||||
repo_dir = os.path.relpath(repo_dir, base.get_script_dir() + "../../..")
|
||||
line += " " + repo_dir
|
||||
print(line)
|
||||
|
||||
sys.exit(0)
|
||||
60
scripts/develop/release.py
Normal file
60
scripts/develop/release.py
Normal file
@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../')
|
||||
|
||||
import base
|
||||
import dependence
|
||||
import config
|
||||
|
||||
def protect_brunch(branch, repo, strict = False):
|
||||
team = '' if strict else 'dep-application-development-leads'
|
||||
command = 'echo {"required_status_checks": null,"enforce_admins":true,"required_pull_request_reviews": null,"restrictions": {"users":[],"teams":["'
|
||||
command += team + '"]}} | gh api -X PUT repos/ONLYOFFICE/' + repo + '/branches/' + branch + '/protection --input -'
|
||||
result = base.run_command(command)
|
||||
if ('' != result['stderr']):
|
||||
print(result['stderr'])
|
||||
return
|
||||
|
||||
branch_from = 'release/v6.2.0'
|
||||
branches_to = ['develop']
|
||||
|
||||
platform = base.host_platform()
|
||||
if ("windows" == platform):
|
||||
dependence.check_pythonPath()
|
||||
dependence.check_gitPath()
|
||||
|
||||
if (dependence.check_gh() != True or dependence.check_gh_auth() != True):
|
||||
sys.exit(0)
|
||||
|
||||
base.cmd_in_dir('../../', 'python', ['configure.py', '--branding', 'onlyoffice', '--branding-url', 'https://github.com/ONLYOFFICE/onlyoffice.git', '--branch', branch_from, '--module', 'core desktop builder server mobile', '--update', '1', '--update-light', '1', '--clean', '0'])
|
||||
|
||||
# parse configuration
|
||||
config.parse()
|
||||
|
||||
base.git_update('onlyoffice')
|
||||
|
||||
# correct defaults (the branding repo is already updated)
|
||||
config.parse_defaults()
|
||||
|
||||
repositories = base.get_repositories()
|
||||
|
||||
# Add other repositories
|
||||
repositories['core-ext'] = [True, False]
|
||||
|
||||
base.update_repositories(repositories)
|
||||
|
||||
repositories['onlyoffice'] = [True, False]
|
||||
|
||||
for repo in repositories:
|
||||
current_dir = repositories[repo][1]
|
||||
if current_dir != False:
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(current_dir)
|
||||
|
||||
base.create_pull_request(branches_to, repo, True, current_dir)
|
||||
|
||||
if current_dir != False:
|
||||
os.chdir(cur_dir)
|
||||
|
||||
sys.exit(0)
|
||||
163
scripts/develop/run_server.py
Normal file
163
scripts/develop/run_server.py
Normal file
@ -0,0 +1,163 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../')
|
||||
import os
|
||||
import base
|
||||
import dependence
|
||||
import traceback
|
||||
import develop
|
||||
|
||||
# if (sys.version_info[0] >= 3):
|
||||
# unicode = str
|
||||
|
||||
# host_platform = base.host_platform()
|
||||
# if (host_platform == 'windows'):
|
||||
# import libwindows
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
def install_module(path):
|
||||
base.print_info('Install: ' + path)
|
||||
base.cmd_in_dir(path, 'npm', ['ci'])
|
||||
|
||||
def run_module(directory, args=[]):
|
||||
base.run_nodejs_in_dir(directory, args)
|
||||
|
||||
def find_rabbitmqctl(base_path):
|
||||
return base.find_file(os.path.join(base_path, 'RabbitMQ Server'), 'rabbitmqctl.bat')
|
||||
|
||||
def restart_win_rabbit():
|
||||
# todo maybe restarting is not relevant after many years and versions?
|
||||
base.print_info('restart RabbitMQ node to prevent "Erl.exe high CPU usage every Monday morning on Windows" https://groups.google.com/forum/#!topic/rabbitmq-users/myl74gsYyYg')
|
||||
rabbitmqctl = find_rabbitmqctl(os.environ['PROGRAMW6432']) or find_rabbitmqctl(os.environ['ProgramFiles(x86)'])
|
||||
if rabbitmqctl is not None:
|
||||
try:
|
||||
# code = libwindows.sudo(unicode(sys.executable), ['net', 'stop', 'rabbitmq'])
|
||||
# code = libwindows.sudo(unicode(sys.executable), ['net', 'start', 'rabbitmq'])
|
||||
base.cmd_in_dir(base.get_script_dir(rabbitmqctl), 'rabbitmqctl.bat', ['stop_app'])
|
||||
base.cmd_in_dir(base.get_script_dir(rabbitmqctl), 'rabbitmqctl.bat', ['start_app'])
|
||||
except SystemExit:
|
||||
base.print_error('Perhaps Erlang cookies are different: Replace %userprofile%/.erlang.cookie with %WINDIR%/System32/config/systemprofile/.erlang.cookie')
|
||||
raise
|
||||
else:
|
||||
base.print_info('Missing rabbitmqctl.bat')
|
||||
|
||||
def start_mac_services():
|
||||
base.print_info('Restart MySQL Server')
|
||||
base.run_process(['mysql.server', 'restart'])
|
||||
base.print_info('Start RabbitMQ Server')
|
||||
base.run_process(['rabbitmq-server'])
|
||||
# base.print_info('Start Redis')
|
||||
# base.run_process(['redis-server'])
|
||||
|
||||
def start_linux_services():
|
||||
base.print_info('Restart MySQL Server')
|
||||
os.system('sudo service mysql restart')
|
||||
base.print_info('Restart RabbitMQ Server')
|
||||
os.system('sudo service rabbitmq-server restart')
|
||||
|
||||
def run_integration_example():
|
||||
if base.is_exist(base_dir + '/../../../document-server-integration/web/documentserver-example/nodejs'):
|
||||
base.cmd_in_dir(base_dir + '/../../../document-server-integration/web/documentserver-example/nodejs', 'python', ['run-develop.py'])
|
||||
|
||||
def start_linux_services():
|
||||
base.print_info('Restart MySQL Server')
|
||||
|
||||
|
||||
def update_config(args):
|
||||
platform = base.host_platform()
|
||||
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']
|
||||
|
||||
if ("linux" == platform):
|
||||
base.cmd_in_dir(base_dir + '/../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0'] + args)
|
||||
else:
|
||||
base.cmd_in_dir(base_dir + '/../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0', '--sql-type', 'mysql', '--db-port', '3306', '--db-name', 'onlyoffice', '--db-user', 'root', '--db-pass', 'onlyoffice'] + args)
|
||||
|
||||
|
||||
def make_start():
|
||||
base.configure_common_apps()
|
||||
|
||||
platform = base.host_platform()
|
||||
if ("windows" == platform):
|
||||
dependence.check_pythonPath()
|
||||
dependence.check_gitPath()
|
||||
restart_win_rabbit()
|
||||
elif ("mac" == platform):
|
||||
start_mac_services()
|
||||
elif ("linux" == platform):
|
||||
start_linux_services()
|
||||
|
||||
def make_configure(args):
|
||||
base.print_info('Build modules')
|
||||
update_config(args)
|
||||
base.cmd_in_dir(base_dir + '/../../', 'python', ['make.py'])
|
||||
def make_install():
|
||||
platform = base.host_platform()
|
||||
run_integration_example()
|
||||
|
||||
base.create_dir(base_dir + '/../../../server/App_Data')
|
||||
|
||||
install_module(base_dir + '/../../../server/DocService')
|
||||
install_module(base_dir + '/../../../server/Common')
|
||||
install_module(base_dir + '/../../../server/FileConverter')
|
||||
|
||||
def make_run():
|
||||
platform = base.host_platform()
|
||||
base.set_env('NODE_ENV', 'development-' + platform)
|
||||
base.set_env('NODE_CONFIG_DIR', '../Common/config')
|
||||
|
||||
if ("mac" == platform):
|
||||
base.set_env('DYLD_LIBRARY_PATH', '../FileConverter/bin/')
|
||||
elif ("linux" == platform):
|
||||
base.set_env('LD_LIBRARY_PATH', '../FileConverter/bin/')
|
||||
|
||||
run_module(base_dir + '/../../../server/DocService', ['sources/server.js'])
|
||||
#run_module(base_dir + '/../../../server/DocService', ['sources/gc.js'])
|
||||
run_module(base_dir + '/../../../server/FileConverter', ['sources/convertermaster.js'])
|
||||
#run_module(base_dir + '/../../../server/SpellChecker', ['sources/server.js'])
|
||||
|
||||
def run_docker_server(args = []):
|
||||
try:
|
||||
make_start()
|
||||
develop.build_docker_server()
|
||||
make_install()
|
||||
|
||||
except SystemExit:
|
||||
input("Ignoring SystemExit. Press Enter to continue...")
|
||||
exit(0)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
except:
|
||||
input("Unexpected error. " + traceback.format_exc() + "Press Enter to continue...")
|
||||
|
||||
def run_docker_sdk_web_apps(dir):
|
||||
try:
|
||||
develop.build_docker_sdk_web_apps(dir)
|
||||
|
||||
except SystemExit:
|
||||
input("Ignoring SystemExit. Press Enter to continue...")
|
||||
exit(0)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
except:
|
||||
input("Unexpected error. " + traceback.format_exc() + "Press Enter to continue...")
|
||||
|
||||
def make(args = []):
|
||||
try:
|
||||
make_start()
|
||||
make_configure(args)
|
||||
make_install()
|
||||
make_run()
|
||||
|
||||
except SystemExit:
|
||||
input("Ignoring SystemExit. Press Enter to continue...")
|
||||
exit(0)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
except:
|
||||
input("Unexpected error. " + traceback.format_exc() + "Press Enter to continue...")
|
||||
|
||||
if __name__ == "__main__":
|
||||
make(sys.argv[1:])
|
||||
|
||||
114
scripts/develop/vendor/libwindows.py
vendored
Normal file
114
scripts/develop/vendor/libwindows.py
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
'''
|
||||
This file is based on the code from https://github.com/JustAMan/pyWinClobber/blob/master/win32elevate.py
|
||||
|
||||
Copyright (c) 2013 by JustAMan at GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
'''
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
import ctypes
|
||||
from ctypes.wintypes import HANDLE, BOOL, DWORD, HWND, HINSTANCE, HKEY
|
||||
from ctypes import c_ulong, c_char_p, c_int, c_void_p
|
||||
PHANDLE = ctypes.POINTER(HANDLE)
|
||||
PDWORD = ctypes.POINTER(DWORD)
|
||||
|
||||
CloseHandle = ctypes.windll.kernel32.CloseHandle
|
||||
CloseHandle.argtypes = (HANDLE, )
|
||||
CloseHandle.restype = BOOL
|
||||
|
||||
TOKEN_READ = 0x20008
|
||||
|
||||
class ShellExecuteInfo(ctypes.Structure):
|
||||
_fields_ = [('cbSize', DWORD),
|
||||
('fMask', c_ulong),
|
||||
('hwnd', HWND),
|
||||
('lpVerb', c_char_p),
|
||||
('lpFile', c_char_p),
|
||||
('lpParameters', c_char_p),
|
||||
('lpDirectory', c_char_p),
|
||||
('nShow', c_int),
|
||||
('hInstApp', HINSTANCE),
|
||||
('lpIDList', c_void_p),
|
||||
('lpClass', c_char_p),
|
||||
('hKeyClass', HKEY),
|
||||
('dwHotKey', DWORD),
|
||||
('hIcon', HANDLE),
|
||||
('hProcess', HANDLE)]
|
||||
def __init__(self, **kw):
|
||||
ctypes.Structure.__init__(self)
|
||||
self.cbSize = ctypes.sizeof(self)
|
||||
for field_name, field_value in kw.items():
|
||||
setattr(self, field_name, field_value)
|
||||
|
||||
PShellExecuteInfo = ctypes.POINTER(ShellExecuteInfo)
|
||||
|
||||
ShellExecuteEx = ctypes.windll.Shell32.ShellExecuteExA
|
||||
ShellExecuteEx.argtypes = (PShellExecuteInfo, )
|
||||
ShellExecuteEx.restype = BOOL
|
||||
|
||||
WaitForSingleObject = ctypes.windll.kernel32.WaitForSingleObject
|
||||
WaitForSingleObject.argtypes = (HANDLE, DWORD)
|
||||
WaitForSingleObject.restype = DWORD
|
||||
|
||||
# SW_HIDE = 0
|
||||
SW_SHOW = 5
|
||||
SEE_MASK_NOCLOSEPROCESS = 0x00000040
|
||||
SEE_MASK_NO_CONSOLE = 0x00008000
|
||||
INFINITE = -1
|
||||
|
||||
ELEVATE_MARKER = 'win32elevate_marker_parameter'
|
||||
|
||||
|
||||
def wait_and_close_handle(process_handle):
|
||||
'''
|
||||
Waits till spawned process finishes and closes the handle for it
|
||||
'''
|
||||
WaitForSingleObject(process_handle, INFINITE)
|
||||
CloseHandle(process_handle)
|
||||
|
||||
def sudo(executable, params=None):
|
||||
'''
|
||||
This will re-run current Python script requesting to elevate administrative rights.
|
||||
'''
|
||||
if not params:
|
||||
params = []
|
||||
|
||||
execute_info = ShellExecuteInfo(
|
||||
fMask=SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE,
|
||||
hwnd=None,
|
||||
lpVerb=b'runas',
|
||||
lpFile=executable.encode('utf-8'),
|
||||
lpParameters=subprocess.list2cmdline(params).encode('utf-8'),
|
||||
lpDirectory=None,
|
||||
nShow=SW_SHOW
|
||||
)
|
||||
|
||||
if not all(stream.isatty() for stream in (sys.stdin, sys.stdout, sys.stderr)):
|
||||
# TODO: Some streams were redirected, we need to manually work them
|
||||
raise NotImplementedError("Redirection is not supported")
|
||||
|
||||
if not ShellExecuteEx(ctypes.byref(execute_info)):
|
||||
raise ctypes.WinError()
|
||||
|
||||
wait_and_close_handle(execute_info.hProcess)
|
||||
|
||||
|
||||
__all__ = ('sudo')
|
||||
162
scripts/license_checker/Readme.md
Normal file
162
scripts/license_checker/Readme.md
Normal file
@ -0,0 +1,162 @@
|
||||
# license_checker
|
||||
|
||||
## Overview
|
||||
|
||||
**license_checker** allow you to automatically check
|
||||
licenses inside specified code files.
|
||||
|
||||
## How to use
|
||||
|
||||
### Running
|
||||
|
||||
**Note**: Pyhton 3.9 and above required
|
||||
(otherwise `TypeError: 'type' object is not subscriptable`)
|
||||
|
||||
* Linux
|
||||
|
||||
```bash
|
||||
python3 license_checker.py
|
||||
```
|
||||
|
||||
* Windows
|
||||
|
||||
```bash
|
||||
python license_checker.py
|
||||
```
|
||||
|
||||
## How to configure
|
||||
|
||||
The checker settings are specified in the `config.json`.
|
||||
The path to the license template is indicated there.
|
||||
|
||||
### How to specify a license template
|
||||
|
||||
The license template is a plain text
|
||||
file where the license text is indicated
|
||||
as you would like to see the license at
|
||||
the beginning of the file.
|
||||
|
||||
### How to configure `config.json`
|
||||
|
||||
#### Сonfig parameters
|
||||
|
||||
* `basePath` specifies which folder the
|
||||
paths will be relative to.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"basePath": "../../../"
|
||||
```
|
||||
|
||||
* `reportFolder` specifies in which folder to
|
||||
save text files with reports.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"reportFolder": "build_tools/scripts/license_checker/reports"
|
||||
```
|
||||
|
||||
* `printChecking` specifies whether to output
|
||||
information about which file is
|
||||
being checked to the console.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"printChecking": false
|
||||
```
|
||||
|
||||
* `printReports` specifies whether to output
|
||||
reports to the console.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"printReports": false
|
||||
```
|
||||
|
||||
* `fix` specifies which categories of reports
|
||||
should be repaired automatically.
|
||||
Possible array values:
|
||||
`"OUTDATED"`,
|
||||
`"NO_LICENSE"`,
|
||||
`"INVALID_LICENSE"`,
|
||||
`"LEN_MISMATCH"`.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"fix": ["OUTDATED", "NO_LICENSE"],
|
||||
```
|
||||
|
||||
Automatically repair files where the license is outdated or not found.
|
||||
|
||||
* `configs` license check and repair configurations.
|
||||
|
||||
* `dir` folder to check.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"dir": "sdkjs"
|
||||
```
|
||||
|
||||
* `fileExtensions` file extensions to check.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"fileExtensions": [".js"]
|
||||
```
|
||||
|
||||
* `licensePath` specifies the path to the license template.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"licensePath": "header.license"
|
||||
```
|
||||
|
||||
* `ignoreListDir` folder paths to ignore.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"ignoreListDir": [
|
||||
"sdkjs/deploy",
|
||||
"sdkjs/develop",
|
||||
"sdkjs/configs",
|
||||
"sdkjs/common/AllFonts.js",
|
||||
"sdkjs/slide/themes/themes.js"
|
||||
]
|
||||
```
|
||||
|
||||
* `ignoreListDirName` folder names to ignore.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor"
|
||||
]
|
||||
```
|
||||
|
||||
* `ignoreListFile` file paths to ignore.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"ignoreListFile": [
|
||||
"sdkjs/develop/awesomeFileToIgnore.js",
|
||||
]
|
||||
```
|
||||
|
||||
* `allowListFile` file paths to allow. It is needed if you ignore the directory, but there is a file in it that needs to be checked.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"ignoreListDir": [
|
||||
"sdkjs/develop"
|
||||
],
|
||||
"allowListFile": [
|
||||
"sdkjs/develop/awesomeFileToAllow.js",
|
||||
]
|
||||
```
|
||||
|
||||
Any number of configurations can be
|
||||
specified, they can overlap
|
||||
if we need to check
|
||||
files in the same folder in different ways.
|
||||
|
||||
208
scripts/license_checker/config.json
Normal file
208
scripts/license_checker/config.json
Normal file
@ -0,0 +1,208 @@
|
||||
{
|
||||
"basePath": "../../../",
|
||||
"reportFolder": "build_tools/scripts/license_checker/reports",
|
||||
"printChecking": false,
|
||||
"printReports": false,
|
||||
"fix": ["OUTDATED"],
|
||||
"configs": [
|
||||
{
|
||||
"dir": "core",
|
||||
"fileExtensions": [".h", ".c", ".hpp", ".cpp", ".hxx", ".cxx", ".cs", ".js", ".m", ".mm", ".license"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDir": [
|
||||
"core/build",
|
||||
"core/Common/cfcpp/test",
|
||||
"core/Common/js",
|
||||
"core/DesktopEditor/agg-2.4",
|
||||
"core/DesktopEditor/cximage",
|
||||
"core/DesktopEditor/freetype_names/freetype-2.5.3",
|
||||
"core/DesktopEditor/freetype-2.5.2",
|
||||
"core/DesktopEditor/freetype-2.10.4",
|
||||
"core/DesktopEditor/raster/JBig2",
|
||||
"core/DesktopEditor/raster/Jp2",
|
||||
"core/DesktopEditor/xml/libxml2",
|
||||
"core/DesktopEditor/xmlsec",
|
||||
"core/DjVuFile/libdjvu",
|
||||
"core/DjVuFile/wasm",
|
||||
"core/EpubFile",
|
||||
"core/OOXML/PPTXFormat/Limit/pri",
|
||||
"core/Fb2File",
|
||||
"core/HtmlFile2",
|
||||
"core/Apple",
|
||||
"core/HwpFile",
|
||||
"core/OdfFile/Common/utf8cpp",
|
||||
"core/OfficeUtils/js/emsdk",
|
||||
"core/OfficeUtils/src/zlib-1.2.11",
|
||||
"core/PdfFile/lib",
|
||||
"core/UnicodeConverter/icubuilds-mac",
|
||||
"core/UnicodeConverter/icubuilds-win32"
|
||||
],
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor",
|
||||
"3dParty"
|
||||
],
|
||||
"ignoreListFile": [
|
||||
"core/Test/CoAuthoring/settings.js",
|
||||
"core/OdfFile/Projects/Linux/precompiled.h",
|
||||
"core/MsBinaryFile/Projects/XlsFormatLib/Linux/precompiled.h"
|
||||
],
|
||||
"allowListFile": [
|
||||
"core/DesktopEditor/freetype_names/FontMaps/FontMaps.cpp",
|
||||
"core/Common/3dParty/openssl/test/main.cpp ",
|
||||
"core/Common/3dParty/openssl/common/common_openssl.h",
|
||||
"core/Common/3dParty/openssl/common/common_openssl.cpp"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "core-ext",
|
||||
"fileExtensions": [".h", ".c", ".hpp", ".cpp", ".hxx", ".cxx", ".m", ".mm"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDir": [
|
||||
"core-ext/AutoTester",
|
||||
"core-ext/cell_android",
|
||||
"core-ext/cell_android",
|
||||
"core-ext/desktop-sdk-private",
|
||||
"core-ext/docbuilder",
|
||||
"core-ext/Registration",
|
||||
"core-ext/slide_android",
|
||||
"core-ext/test",
|
||||
"core-ext/word_android",
|
||||
"core-ext/word_ios"
|
||||
],
|
||||
"ignoreListFile": [
|
||||
"core-ext/native_base/json.hpp",
|
||||
"core-ext/native_base/android_base/libeditors/src/main/cpp/workaround/swab/swab.h"
|
||||
]
|
||||
|
||||
},
|
||||
{
|
||||
"dir": "sdkjs",
|
||||
"fileExtensions": [".js"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDir": [
|
||||
"sdkjs/deploy",
|
||||
"sdkjs/develop",
|
||||
"sdkjs/configs"
|
||||
],
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor"
|
||||
],
|
||||
"ignoreListFile": [
|
||||
"sdkjs/common/externs/jquery-3.2.js",
|
||||
"sdkjs/common/externs/socket.io.js",
|
||||
"sdkjs/common/Native/jquery_native.js",
|
||||
"sdkjs/common/AllFonts.js",
|
||||
"sdkjs/slide/themes/themes.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "sdkjs-forms",
|
||||
"fileExtensions": [".js"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "sdkjs-ooxml",
|
||||
"fileExtensions": [".js"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "web-apps",
|
||||
"fileExtensions": [".js"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor",
|
||||
"search"
|
||||
],
|
||||
"ignoreListDir": [
|
||||
"web-apps/apps/common/mobile",
|
||||
"web-apps/apps/common/main/lib/mods",
|
||||
"web-apps/apps/documenteditor/mobile",
|
||||
"web-apps/apps/spreadsheeteditor/mobile",
|
||||
"web-apps/apps/presentationeditor/mobile",
|
||||
"web-apps/build/plugins/grunt-inline"
|
||||
],
|
||||
"ignoreListFile": [
|
||||
"web-apps/apps/api/documents/api.js",
|
||||
"web-apps/apps/common/main/lib/core/application.js",
|
||||
"web-apps/apps/common/main/lib/core/keymaster.js",
|
||||
"web-apps/apps/presentationeditor/embed/resources/less/watch.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "web-apps-mobile",
|
||||
"fileExtensions": [".js"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "server",
|
||||
"fileExtensions": [".js"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDir": [
|
||||
"server/FileConverter/bin"
|
||||
],
|
||||
"ignoreListDirName": [
|
||||
"node_modules"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "server-lockstorage",
|
||||
"fileExtensions": [".js"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDirName": [
|
||||
"node_modules"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "server-license",
|
||||
"fileExtensions": [".js"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDirName": [
|
||||
"node_modules"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "server-license-key",
|
||||
"fileExtensions": [".js"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDirName": [
|
||||
"node_modules"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "editors-ios",
|
||||
"fileExtensions": [".h", ".c", ".hpp", ".cpp", ".hxx", ".cxx", ".m", ".mm"],
|
||||
"licensePath": "header.license",
|
||||
"ignoreListDirName": [
|
||||
"vendor",
|
||||
"Vendor",
|
||||
"3dParty"
|
||||
],
|
||||
"allowListFile": [
|
||||
"editors-ios/Vendor/ThreadSafeMutable/ThreadSafeMutableArray.h",
|
||||
"editors-ios/Vendor/ThreadSafeMutable/ThreadSafeMutableArray.m",
|
||||
"editors-ios/Vendor/ThreadSafeMutable/ThreadSafeMutableDictionary.h",
|
||||
"editors-ios/Vendor/ThreadSafeMutable/ThreadSafeMutableDictionary.m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "editors-webview-ios",
|
||||
"fileExtensions": [".swift", ".xcconfig"],
|
||||
"licensePath": "header.license",
|
||||
}
|
||||
]
|
||||
}
|
||||
31
scripts/license_checker/header.license
Normal file
31
scripts/license_checker/header.license
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2025
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
339
scripts/license_checker/license_checker.py
Normal file
339
scripts/license_checker/license_checker.py
Normal file
@ -0,0 +1,339 @@
|
||||
import os
|
||||
import re
|
||||
import enum
|
||||
import json
|
||||
import codecs
|
||||
|
||||
CONFIG_PATH = 'config.json'
|
||||
|
||||
class ErrorType(enum.Enum):
|
||||
INVALID_LICENSE = 1
|
||||
NO_LICENSE = 2
|
||||
OUTDATED = 3
|
||||
LEN_MISMATCH = 4
|
||||
|
||||
FIX_TYPES = {
|
||||
'OUTDATED': ErrorType.OUTDATED,
|
||||
'NO_LICENSE': ErrorType.NO_LICENSE,
|
||||
'INVALID_LICENSE': ErrorType.INVALID_LICENSE,
|
||||
'LEN_MISMATCH': ErrorType.LEN_MISMATCH
|
||||
}
|
||||
|
||||
class Config(object):
|
||||
"""
|
||||
License checker configuration.
|
||||
Attributes:
|
||||
dir: Directory to check.
|
||||
fileExtensions: file extensions to check.
|
||||
ignoreListDir: Ignored folder paths.
|
||||
ignoreListDirName: Ignored folder names.
|
||||
ignoreListFile: Ignored file paths.
|
||||
allowListFile: allow file paths.
|
||||
"""
|
||||
def __init__(self,
|
||||
dir: str,
|
||||
fileExtensions: list[str],
|
||||
licensePath: str = 'header.license',
|
||||
allowListFile: list[str] = [],
|
||||
ignoreListDir: list[str] = [],
|
||||
ignoreListDirName: list[str] = [],
|
||||
ignoreListFile: list[str] = []) -> None:
|
||||
|
||||
self._dir = dir
|
||||
self._fileExtensions = fileExtensions
|
||||
self._allowListFile = allowListFile
|
||||
self._ignoreListDir = ignoreListDir
|
||||
self._ignoreListDirName = ignoreListDirName
|
||||
self._ignoreListFile = ignoreListFile
|
||||
"""Read license template."""
|
||||
with open(licensePath, 'r', encoding="utf8") as file:
|
||||
lines = file.readlines()
|
||||
if not lines:
|
||||
raise Exception(f'Error getting license template. Cannot read {licensePath} file. Is not it empty?')
|
||||
non_empty_lines = [s for s in lines if not s.isspace()]
|
||||
self._startMultiComm = non_empty_lines[0]
|
||||
self._endMultiComm = non_empty_lines[-1]
|
||||
self._license_lines = lines
|
||||
|
||||
def getDir(self) -> str:
|
||||
return self._dir
|
||||
def getFileExtensions(self) -> list[str]:
|
||||
return self._fileExtensions
|
||||
def getStartMultiComm(self) -> str:
|
||||
return self._startMultiComm
|
||||
def getEndMultiComm(self) -> str:
|
||||
return self._endMultiComm
|
||||
def getLicense(self) -> list[str]:
|
||||
return self._license_lines
|
||||
def getAllowListFile(self) -> list[str]:
|
||||
return self._allowListFile
|
||||
def getIgnoreListDir(self) -> list[str]:
|
||||
return self._ignoreListDir
|
||||
def getIgnoreListDirName(self) -> list[str]:
|
||||
return self._ignoreListDirName
|
||||
def getIgnoreListFile(self) -> list[str]:
|
||||
return self._ignoreListFile
|
||||
|
||||
with open(CONFIG_PATH, 'r') as j:
|
||||
_json: dict = json.load(j)
|
||||
BASE_PATH: str = _json.get('basePath') or '../../../'
|
||||
REPORT_FOLDER: str = _json.get('reportFolder') or 'build_tools/scripts/license_checker/reports'
|
||||
if (_json.get('fix')):
|
||||
try:
|
||||
FIX: list[ErrorType] = list(map(lambda x: FIX_TYPES[x], _json.get('fix')))
|
||||
except KeyError:
|
||||
raise Exception(f'KeyError. "fix" cannot process value. It must be an array of strings. Check {CONFIG_PATH}. Possible array values: "OUTDATED", "NO_LICENSE", "INVALID_LICENSE", "LEN_MISMATCH"')
|
||||
else:
|
||||
FIX = False
|
||||
PRINT_CHECKING: bool = _json.get('printChecking')
|
||||
PRINT_REPORTS: bool = _json.get('printReports')
|
||||
CONFIGS: list[Config] = []
|
||||
for i in _json.get('configs'):
|
||||
CONFIGS.append(Config(**i))
|
||||
|
||||
os.chdir(BASE_PATH)
|
||||
|
||||
class Error(object):
|
||||
def __init__(self, errorType: ErrorType) -> None:
|
||||
self._errorType = errorType
|
||||
self._errorMessages = {
|
||||
ErrorType.INVALID_LICENSE: 'Detected license is invalid',
|
||||
ErrorType.NO_LICENSE: 'The license was not found',
|
||||
ErrorType.OUTDATED: 'Detected license is outdated',
|
||||
ErrorType.LEN_MISMATCH: 'Detected license length does not match pattern'
|
||||
}
|
||||
def getErrorType(self) -> ErrorType:
|
||||
return self._errorType
|
||||
def getErrorMessage(self) -> str:
|
||||
return self._errorMessages.get(self._errorType)
|
||||
|
||||
class Report(object):
|
||||
def __init__(self, pathToFile: str, error: Error, message:str = '') -> None:
|
||||
self._pathToFile = pathToFile
|
||||
self._error = error
|
||||
self._message = message
|
||||
def getPathToFile(self) -> str:
|
||||
return self._pathToFile
|
||||
def getError(self) -> Error:
|
||||
return self._error
|
||||
def getMessage(self) -> str:
|
||||
return self._message
|
||||
def report(self) -> str:
|
||||
return f'{self.getPathToFile()}: {self.getError().getErrorMessage()}. {self.getMessage()}.'
|
||||
|
||||
class Checker(object):
|
||||
def __init__(self, config: Config) -> None:
|
||||
self._config = config
|
||||
self._reports: list[Report] = []
|
||||
def getReports(self):
|
||||
return self._reports
|
||||
def _checkLine(self, line: str, prefix: str) -> bool:
|
||||
"""Checks if a line has a prefix."""
|
||||
"""Trim to catch invalid license without leading spaces"""
|
||||
prefix = prefix.lstrip()
|
||||
if (re.search(re.escape(prefix), line)):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
def findLicense(self, lines: list[str]) -> list[str]:
|
||||
"""Looks for consecutive comments in a list of strings."""
|
||||
result = []
|
||||
isStarted = False
|
||||
for line in lines:
|
||||
if line == '\n': continue
|
||||
if (self._checkLine(line=line, prefix=self._config.getStartMultiComm())):
|
||||
result.append(line)
|
||||
isStarted = True
|
||||
elif(self._checkLine(line=line, prefix=self._config.getEndMultiComm())):
|
||||
result.append(line)
|
||||
break
|
||||
elif (isStarted):
|
||||
result.append(line)
|
||||
else:
|
||||
break
|
||||
return result
|
||||
def _checkLicense(self, test: list[str], pathToFile: str) -> Report:
|
||||
license = self._config.getLicense()
|
||||
if len(license) != len(test):
|
||||
return Report(pathToFile=pathToFile,
|
||||
error=Error(errorType=ErrorType.LEN_MISMATCH),
|
||||
message=f'Found {len(test)} lines, expected {len(license)}')
|
||||
invalidLinesCount = 0
|
||||
lastWrongLine = 0
|
||||
for i in range(len(license)):
|
||||
if (license[i] != test[i]):
|
||||
invalidLinesCount += 1
|
||||
lastWrongLine = i
|
||||
if (invalidLinesCount == 1):
|
||||
r = r'\d\d\d\d'
|
||||
testDate = re.findall(r, test[lastWrongLine])
|
||||
licenseDate = re.findall(r, license[lastWrongLine])
|
||||
|
||||
if not (testDate and licenseDate):
|
||||
return Report(pathToFile=pathToFile,
|
||||
error=Error(errorType=ErrorType.INVALID_LICENSE),
|
||||
message=f'Something wrong...')
|
||||
|
||||
testLastYear = int(testDate[-1])
|
||||
licenseLastYear = int(licenseDate[-1])
|
||||
if (testLastYear < licenseLastYear):
|
||||
return Report(pathToFile=pathToFile,
|
||||
error=Error(errorType=ErrorType.OUTDATED),
|
||||
message=f'Found date {testLastYear}, expected {licenseLastYear}')
|
||||
else:
|
||||
return Report(pathToFile=pathToFile,
|
||||
error=Error(errorType=ErrorType.INVALID_LICENSE),
|
||||
message=f"Found something similar to the date: {testLastYear}, but it's not correct. Expected: {licenseLastYear}")
|
||||
elif (invalidLinesCount > 0):
|
||||
return Report(pathToFile=pathToFile,
|
||||
error=Error(errorType=ErrorType.INVALID_LICENSE),
|
||||
message=f'Found {invalidLinesCount} wrong lines out of {len(license)}')
|
||||
def checkFile(self, pathToFile: str) -> None:
|
||||
"""Checks a file for a valid license."""
|
||||
with open(pathToFile, 'r', encoding="utf-8-sig") as file:
|
||||
test = self.findLicense(lines=file.readlines())
|
||||
if test:
|
||||
result = self._checkLicense(test=test, pathToFile=pathToFile)
|
||||
if result:
|
||||
self._reports.append(result)
|
||||
else:
|
||||
self._reports.append(Report(pathToFile=pathToFile, error=Error(errorType=ErrorType.NO_LICENSE)))
|
||||
return
|
||||
|
||||
class Walker(object):
|
||||
def __init__(self, config: Config) -> None:
|
||||
self._config = config
|
||||
self._checker = Checker(config=self._config)
|
||||
def getChecker(self):
|
||||
return self._checker
|
||||
def getConfig(self):
|
||||
return self._config
|
||||
def _getFiles(self) -> list[str]:
|
||||
result = []
|
||||
for address, dirs, files in os.walk(self._config.getDir()):
|
||||
for i in files:
|
||||
if (os.path.join(address, i) in list(map(lambda x: os.path.normpath(x), self._config.getAllowListFile()))):
|
||||
filename, file_extension = os.path.splitext(i)
|
||||
if file_extension in self._config.getFileExtensions():
|
||||
result.append(os.path.join(address, i))
|
||||
else:
|
||||
for i in self._config.getIgnoreListDirName():
|
||||
if(re.search(re.escape(i), address)):
|
||||
break
|
||||
else:
|
||||
for i in self._config.getIgnoreListDir():
|
||||
if(re.search(re.escape(os.path.normpath(i)), address)):
|
||||
break
|
||||
else:
|
||||
for i in files:
|
||||
if not (os.path.join(address, i) in list(map(lambda x: os.path.normpath(x), self._config.getIgnoreListFile()))):
|
||||
filename, file_extension = os.path.splitext(i)
|
||||
if file_extension in self._config.getFileExtensions():
|
||||
result.append(os.path.join(address, i))
|
||||
return result
|
||||
def checkFiles(self) -> list[Report]:
|
||||
files = self._getFiles()
|
||||
for file in files:
|
||||
if (PRINT_CHECKING):
|
||||
print(f'Checking {file}...')
|
||||
# self._checker.checkFile(file)
|
||||
try:
|
||||
self._checker.checkFile(file)
|
||||
except Exception as e:
|
||||
print(file)
|
||||
print(e)
|
||||
return self._checker.getReports()
|
||||
|
||||
class Fixer(object):
|
||||
def __init__(self, walker: Walker) -> int:
|
||||
self._walker = walker
|
||||
self._checker = self._walker.getChecker()
|
||||
self._config = self._walker.getConfig()
|
||||
def fix(self):
|
||||
count = 0
|
||||
for report in self._checker.getReports():
|
||||
if ((not FIX and report.getError().getErrorType() == ErrorType.NO_LICENSE) or (report.getError().getErrorType() == ErrorType.NO_LICENSE and report.getError().getErrorType() in FIX)):
|
||||
self._addLicense(report.getPathToFile())
|
||||
count += 1
|
||||
elif ((not FIX and report.getError().getErrorType() != ErrorType.NO_LICENSE) or (report.getError().getErrorType() != ErrorType.NO_LICENSE and report.getError().getErrorType() in FIX)):
|
||||
self._fixLicense(report.getPathToFile())
|
||||
count += 1
|
||||
return count
|
||||
def _addLicense(self, pathToFile: str):
|
||||
buffer = []
|
||||
with open(pathToFile, 'r', encoding="utf8") as file:
|
||||
buffer = file.readlines()
|
||||
with open(pathToFile, 'w', encoding="utf8") as file:
|
||||
license = self._config.getLicense()
|
||||
file.writelines(license)
|
||||
file.write('\n')
|
||||
file.writelines(buffer)
|
||||
return
|
||||
def _fixLicense(self, pathToFile: str):
|
||||
buffer = []
|
||||
writeEncoding = "utf8"
|
||||
with open(pathToFile, 'r', encoding="utf8") as file:
|
||||
buffer = file.readlines()
|
||||
if buffer and buffer[0].startswith(codecs.decode(codecs.BOM_UTF8)):
|
||||
writeEncoding = "utf-8-sig"
|
||||
oldLicense = self._checker.findLicense(buffer)
|
||||
for i in oldLicense:
|
||||
buffer.remove(i)
|
||||
with open(pathToFile, 'w', encoding=writeEncoding) as file:
|
||||
license = self._config.getLicense()
|
||||
file.writelines(license)
|
||||
file.writelines(buffer)
|
||||
return
|
||||
|
||||
|
||||
walkers: list[Walker] = []
|
||||
reports: list[Report] = []
|
||||
|
||||
def fix(walkers):
|
||||
count = 0
|
||||
if FIX:
|
||||
print(f'Fixing selected files...')
|
||||
else:
|
||||
print(f'Fixing all {len(reports)} files...')
|
||||
for walker in walkers:
|
||||
fixer = Fixer(walker=walker)
|
||||
count += fixer.fix()
|
||||
print(f'Fixed {count} files.')
|
||||
|
||||
def writeReports(reports: list[Report]) -> None:
|
||||
files: dict[str, list[Report]] = dict()
|
||||
for i in ErrorType:
|
||||
files[i.name] = []
|
||||
for i in reports:
|
||||
files[i.getError().getErrorType().name].append(i)
|
||||
for i in ErrorType:
|
||||
with open(f'{REPORT_FOLDER}/{i.name}.txt', 'w', encoding="utf8") as f:
|
||||
f.writelines(map(lambda x: "".join([x.report(), '\n']), files.get(i.name)))
|
||||
|
||||
for config in CONFIGS:
|
||||
walkers.append(Walker(config=config))
|
||||
|
||||
print('Checking files...')
|
||||
|
||||
for walker in walkers:
|
||||
reports = reports + walker.checkFiles()
|
||||
|
||||
if reports:
|
||||
if not os.path.exists(REPORT_FOLDER):
|
||||
os.mkdir(REPORT_FOLDER)
|
||||
if PRINT_REPORTS:
|
||||
print('\n'.join(map(lambda report: report.report(), reports)))
|
||||
print(f'{len(reports)} invalid licenses were found.')
|
||||
print(f'Saving reports in {REPORT_FOLDER}')
|
||||
writeReports(reports=reports)
|
||||
if FIX:
|
||||
fix(walkers=walkers)
|
||||
# else:
|
||||
# choice = str(input(f'Fix it automatically? [Y/N] ')).lower()
|
||||
# if choice == 'y':
|
||||
# fix(walkers=walkers)
|
||||
else:
|
||||
print('All licenses are ok.')
|
||||
|
||||
# os.system('pause')
|
||||
|
||||
32
scripts/min.py
Normal file
32
scripts/min.py
Normal file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../build_tools/scripts')
|
||||
import base
|
||||
import os
|
||||
|
||||
args = sys.argv[1:]
|
||||
|
||||
if (1 > len(args)):
|
||||
print("Please use min.py PATH_TO_SCRIPT.js")
|
||||
exit(0)
|
||||
|
||||
script_path = args[0]
|
||||
script_path = os.path.abspath(script_path)
|
||||
script_dir = os.path.dirname(script_path)
|
||||
|
||||
script_name = os.path.splitext(os.path.basename(script_path))[0]
|
||||
script_path_min = os.path.join(script_dir, script_name + ".min.js")
|
||||
|
||||
#compilation_level = "WHITESPACE_ONLY"
|
||||
compilation_level = "SIMPLE_OPTIMIZATIONS"
|
||||
base.cmd("java", ["-jar", "../../sdkjs/build/node_modules/google-closure-compiler-java/compiler.jar",
|
||||
"--compilation_level", compilation_level,
|
||||
"--js_output_file", script_path_min,
|
||||
"--js", script_path])
|
||||
|
||||
dev_content = base.readFile(script_path)
|
||||
license = dev_content[0:dev_content.find("*/")+2]
|
||||
min_content = base.readFile(script_path_min)
|
||||
base.delete_file(script_path_min)
|
||||
base.writeFile(script_path_min, license + "\n\n" + min_content)
|
||||
71
scripts/package_branding.py
Normal file
71
scripts/package_branding.py
Normal file
@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import package_utils as utils
|
||||
|
||||
onlyoffice = True
|
||||
company_name = "ONLYOFFICE"
|
||||
company_name_l = company_name.lower()
|
||||
publisher_name = "Ascensio System SIA"
|
||||
cert_name = "Ascensio System SIA"
|
||||
|
||||
s3_bucket = "repo-doc-onlyoffice-com"
|
||||
s3_region = "eu-west-1"
|
||||
s3_base_url = "https://s3.eu-west-1.amazonaws.com/repo-doc-onlyoffice-com"
|
||||
|
||||
if utils.is_windows():
|
||||
desktop_product_name = "Desktop Editors"
|
||||
desktop_product_name_s = desktop_product_name.replace(" ","")
|
||||
desktop_package_name = company_name + "-" + desktop_product_name_s
|
||||
desktop_changes_dir = "desktop-apps/win-linux/package/windows/update/changes"
|
||||
|
||||
if utils.is_macos():
|
||||
desktop_package_name = "ONLYOFFICE"
|
||||
desktop_build_dir = "desktop-apps/macos"
|
||||
desktop_branding_dir = "desktop-apps/macos"
|
||||
desktop_updates_dir = "build/update"
|
||||
desktop_changes_dir = "ONLYOFFICE/update/updates/ONLYOFFICE/changes"
|
||||
sparkle_base_url = "https://download.onlyoffice.com/install/desktop/editors/mac"
|
||||
|
||||
builder_product_name = "Document Builder"
|
||||
|
||||
if utils.is_linux():
|
||||
desktop_make_targets = [
|
||||
{
|
||||
"make": "tar",
|
||||
"src": "tar/*.tar*",
|
||||
"dst": "desktop/linux/generic/"
|
||||
},
|
||||
{
|
||||
"make": "deb",
|
||||
"src": "deb/*.deb",
|
||||
"dst": "desktop/linux/debian/"
|
||||
},
|
||||
{
|
||||
"make": "rpm",
|
||||
"src": "rpm/build/RPMS/*/*.rpm",
|
||||
"dst": "desktop/linux/rhel/"
|
||||
},
|
||||
{
|
||||
"make": "rpm-suse",
|
||||
"src": "rpm-suse/build/RPMS/*/*.rpm",
|
||||
"dst": "desktop/linux/suse/"
|
||||
}
|
||||
]
|
||||
server_make_targets = [
|
||||
{
|
||||
"make": "deb",
|
||||
"src": "deb/*.deb",
|
||||
"dst": "server/linux/debian/"
|
||||
},
|
||||
{
|
||||
"make": "rpm",
|
||||
"src": "rpm/builddir/RPMS/*/*.rpm",
|
||||
"dst": "server/linux/rhel/"
|
||||
},
|
||||
{
|
||||
"make": "tar",
|
||||
"src": "*.tar*",
|
||||
"dst": "server/linux/snap/"
|
||||
}
|
||||
]
|
||||
235
scripts/package_builder.py
Normal file
235
scripts/package_builder.py
Normal file
@ -0,0 +1,235 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import package_utils as utils
|
||||
import package_common as common
|
||||
import package_branding as branding
|
||||
|
||||
def make():
|
||||
utils.log_h1("BUILDER")
|
||||
if not (utils.is_windows() or utils.is_macos() or utils.is_linux()):
|
||||
utils.log("Unsupported host OS")
|
||||
return
|
||||
if common.deploy:
|
||||
make_archive()
|
||||
if utils.is_windows():
|
||||
make_windows()
|
||||
elif utils.is_macos():
|
||||
make_macos_linux()
|
||||
elif utils.is_linux():
|
||||
make_macos_linux()
|
||||
return
|
||||
|
||||
def s3_upload(files, dst):
|
||||
if not files: return False
|
||||
ret = True
|
||||
for f in files:
|
||||
key = dst + utils.get_basename(f) if dst.endswith("/") else dst
|
||||
upload = utils.s3_upload(f, "s3://" + branding.s3_bucket + "/" + key)
|
||||
if upload:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
ret &= upload
|
||||
return ret
|
||||
|
||||
def make_archive():
|
||||
utils.set_cwd(utils.get_path(
|
||||
"build_tools/out/" + common.prefix + "/" + branding.company_name.lower()))
|
||||
|
||||
utils.log_h2("builder archive build")
|
||||
utils.delete_file("builder.7z")
|
||||
args = ["7z", "a", "-y", "builder.7z", "./documentbuilder/*"]
|
||||
if utils.is_windows():
|
||||
ret = utils.cmd(*args, verbose=True)
|
||||
else:
|
||||
ret = utils.sh(" ".join(args), verbose=True)
|
||||
utils.set_summary("builder archive build", ret)
|
||||
|
||||
utils.log_h2("builder archive deploy")
|
||||
dest = "builder-" + common.prefix.replace("_","-") + ".7z"
|
||||
dest_latest = "archive/%s/latest/%s" % (common.branch, dest)
|
||||
dest_version = "archive/%s/%s/%s" % (common.branch, common.build, dest)
|
||||
ret = utils.s3_upload(
|
||||
"builder.7z", "s3://" + branding.s3_bucket + "/" + dest_version)
|
||||
utils.set_summary("builder archive deploy", ret)
|
||||
if ret:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_version)
|
||||
utils.s3_copy(
|
||||
"s3://" + branding.s3_bucket + "/" + dest_version,
|
||||
"s3://" + branding.s3_bucket + "/" + dest_latest)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_latest)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
def make_windows():
|
||||
global package_version, arch
|
||||
utils.set_cwd("document-builder-package")
|
||||
|
||||
package_version = common.version + "." + common.build
|
||||
arch = {
|
||||
"windows_x64": "x64",
|
||||
"windows_x86": "x86"
|
||||
}[common.platform]
|
||||
|
||||
if common.clean:
|
||||
utils.log_h2("builder clean")
|
||||
utils.delete_dir("build")
|
||||
utils.delete_dir("zip")
|
||||
|
||||
if make_prepare():
|
||||
make_zip()
|
||||
make_wheel()
|
||||
else:
|
||||
utils.set_summary("builder zip build", False)
|
||||
utils.set_summary("builder python wheel build", False)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
def make_prepare():
|
||||
args = [
|
||||
"-Version", package_version,
|
||||
"-Arch", arch
|
||||
]
|
||||
if common.sign:
|
||||
args += ["-Sign"]
|
||||
|
||||
utils.log_h2("builder prepare")
|
||||
ret = utils.ps1("make.ps1", args, verbose=True)
|
||||
utils.set_summary("builder prepare", ret)
|
||||
return ret
|
||||
|
||||
def make_zip():
|
||||
args = [
|
||||
"-Version", package_version,
|
||||
"-Arch", arch
|
||||
]
|
||||
# if common.sign:
|
||||
# args += ["-Sign"]
|
||||
|
||||
utils.log_h2("builder zip build")
|
||||
ret = utils.ps1("make_zip.ps1", args, verbose=True)
|
||||
utils.set_summary("builder zip build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("builder zip deploy")
|
||||
ret = s3_upload(utils.glob_path("zip/*.zip"), "builder/win/generic/")
|
||||
utils.set_summary("builder zip deploy", ret)
|
||||
return
|
||||
|
||||
def make_macos_linux():
|
||||
utils.set_cwd("document-builder-package")
|
||||
|
||||
make_tar()
|
||||
make_wheel()
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
def make_tar():
|
||||
utils.log_h2("builder tar build")
|
||||
make_args = ["tar"]
|
||||
if common.platform == "darwin_arm64":
|
||||
make_args += ["-e", "UNAME_M=arm64"]
|
||||
if common.platform == "darwin_x86_64":
|
||||
make_args += ["-e", "UNAME_M=x86_64"]
|
||||
if common.platform == "linux_aarch64":
|
||||
make_args += ["-e", "UNAME_M=aarch64"]
|
||||
if not branding.onlyoffice:
|
||||
make_args += ["-e", "BRANDING_DIR=../" + common.branding + "/document-builder-package"]
|
||||
ret = utils.sh("make clean && make " + " ".join(make_args), verbose=True)
|
||||
utils.set_summary("builder tar build", ret)
|
||||
|
||||
if common.deploy:
|
||||
utils.log_h2("builder tar deploy")
|
||||
if utils.is_macos():
|
||||
s3_dest = "builder/mac/generic/"
|
||||
elif utils.is_linux():
|
||||
s3_dest = "builder/linux/generic/"
|
||||
ret = s3_upload(utils.glob_path("tar/*.tar.xz"), s3_dest)
|
||||
utils.set_summary("builder tar deploy", ret)
|
||||
return
|
||||
|
||||
def make_wheel():
|
||||
platform_tags = {
|
||||
"windows_x64": "win_amd64",
|
||||
"windows_x86": "win32",
|
||||
"darwin_arm64": "macosx_11_0_arm64",
|
||||
"darwin_x86_64": "macosx_10_9_x86_64",
|
||||
"linux_x86_64": "manylinux_2_23_x86_64",
|
||||
"linux_aarch64": "manylinux_2_23_aarch64"
|
||||
}
|
||||
|
||||
if not common.platform in platform_tags: return
|
||||
|
||||
utils.log_h2("builder python wheel build")
|
||||
|
||||
builder_dir = "build"
|
||||
if utils.is_linux():
|
||||
builder_dir = "build/opt/onlyoffice/documentbuilder"
|
||||
|
||||
utils.delete_dir("python")
|
||||
utils.copy_dir("../onlyoffice/build_tools/packaging/docbuilder/resources", "python")
|
||||
utils.copy_dir(builder_dir, "python/docbuilder/lib", True, True)
|
||||
|
||||
desktop_dir = "../desktop-apps/macos/build/ONLYOFFICE.app/Contents/Resources/converter"
|
||||
if utils.is_macos() and "desktop" in common.targets and utils.is_exist(desktop_dir):
|
||||
for f in utils.glob_path(desktop_dir + "/*.dylib") + [desktop_dir + "/x2t"]:
|
||||
utils.copy_file(f, builder_dir + "/" + utils.get_basename(f))
|
||||
|
||||
old_cwd = utils.get_cwd()
|
||||
utils.set_cwd("python/docbuilder")
|
||||
|
||||
if not utils.is_file("docbuilder.py"):
|
||||
utils.copy_file("lib/docbuilder.py", "docbuilder.py")
|
||||
# fix docbuilder.py
|
||||
content = ""
|
||||
with open("docbuilder.py", "r") as file:
|
||||
content = file.read()
|
||||
old_line = "builder_path = os.path.dirname(os.path.realpath(__file__))"
|
||||
new_line = "builder_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), \"lib\")"
|
||||
content = content.replace(old_line, new_line)
|
||||
with open("docbuilder.py", "w") as file:
|
||||
file.write(content)
|
||||
|
||||
# remove unnecessary files
|
||||
utils.set_cwd("lib")
|
||||
utils.delete_dir("include")
|
||||
utils.delete_file("build.date")
|
||||
utils.delete_file("docbuilder.jar")
|
||||
utils.delete_file("docbuilder.py")
|
||||
if utils.is_windows():
|
||||
utils.delete_file("doctrenderer.lib")
|
||||
utils.delete_file("docbuilder.com.dll")
|
||||
utils.delete_file("docbuilder.net.dll")
|
||||
utils.delete_file("docbuilder.jni.dll")
|
||||
elif utils.is_macos():
|
||||
if (utils.is_file("libdocbuilder.jni.dylib")):
|
||||
utils.delete_file("libdocbuilder.jni.dylib")
|
||||
if (utils.is_dir("docbuilder.jni.framework")):
|
||||
utils.delete_file("docbuilder.jni.framework")
|
||||
utils.remove_all_symlinks(".")
|
||||
elif utils.is_linux():
|
||||
utils.delete_file("libdocbuilder.jni.so")
|
||||
|
||||
utils.set_env("DOCBUILDER_VERSION", common.version + "." + common.build)
|
||||
platform = "linux_64"
|
||||
utils.set_cwd("../..")
|
||||
plat_name = platform_tags[common.platform]
|
||||
ret = utils.sh("python setup.py bdist_wheel --plat-name " + plat_name + " --python-tag py2.py3", verbose=True)
|
||||
utils.set_summary("builder python wheel build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("builder python wheel deploy")
|
||||
if utils.is_windows():
|
||||
s3_dest = "builder/win/python/"
|
||||
elif utils.is_macos():
|
||||
s3_dest = "builder/mac/python/"
|
||||
elif utils.is_linux():
|
||||
s3_dest = "builder/linux/python/"
|
||||
ret = s3_upload(utils.glob_path("dist/*.whl"), s3_dest)
|
||||
utils.set_summary("builder python wheel deploy", ret)
|
||||
|
||||
utils.set_cwd(old_cwd)
|
||||
|
||||
return
|
||||
17
scripts/package_common.py
Normal file
17
scripts/package_common.py
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
platformPrefixes = {
|
||||
"windows_x64": "win_64",
|
||||
"windows_x86": "win_32",
|
||||
"windows_arm64": "win_arm64",
|
||||
"windows_x64_xp": "win_64_xp",
|
||||
"windows_x86_xp": "win_32_xp",
|
||||
"darwin_arm64": "mac_arm64",
|
||||
"darwin_x86_64": "mac_64",
|
||||
"darwin_x86_64_v8": "mac_64",
|
||||
"linux_x86_64": "linux_64",
|
||||
"linux_aarch64": "linux_arm64",
|
||||
}
|
||||
|
||||
out_dir = "build_tools/out"
|
||||
tsa_server = "http://timestamp.digicert.com"
|
||||
93
scripts/package_core.py
Normal file
93
scripts/package_core.py
Normal file
@ -0,0 +1,93 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import package_utils as utils
|
||||
import package_common as common
|
||||
import package_branding as branding
|
||||
|
||||
def make():
|
||||
utils.log_h1("CORE")
|
||||
if not (utils.is_windows() or utils.is_macos() or utils.is_linux()):
|
||||
utils.log("Unsupported host OS")
|
||||
return
|
||||
if common.deploy:
|
||||
make_archive()
|
||||
return
|
||||
|
||||
def make_archive():
|
||||
utils.set_cwd(utils.get_path(
|
||||
"build_tools/out/" + common.prefix + "/" + branding.company_name.lower()))
|
||||
|
||||
utils.log_h2("core archive build")
|
||||
utils.delete_file("core.7z")
|
||||
args = ["7z", "a", "-y", "core.7z", "./core/*"]
|
||||
if utils.is_windows():
|
||||
ret = utils.cmd(*args, verbose=True)
|
||||
else:
|
||||
ret = utils.sh(" ".join(args), verbose=True)
|
||||
utils.set_summary("core archive build", ret)
|
||||
|
||||
utils.log_h2("core archive deploy")
|
||||
dest = "core-" + common.prefix.replace("_","-") + ".7z"
|
||||
dest_latest = "archive/%s/latest/%s" % (common.branch, dest)
|
||||
dest_version = "archive/%s/%s/%s" % (common.branch, common.build, dest)
|
||||
ret = utils.s3_upload(
|
||||
"core.7z", "s3://" + branding.s3_bucket + "/" + dest_version)
|
||||
utils.set_summary("core archive deploy", ret)
|
||||
if ret:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_version)
|
||||
utils.s3_copy(
|
||||
"s3://" + branding.s3_bucket + "/" + dest_version,
|
||||
"s3://" + branding.s3_bucket + "/" + dest_latest)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_latest)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
def deploy_closuremaps_sdkjs(license):
|
||||
if not common.deploy: return
|
||||
utils.log_h1("SDKJS CLOSURE MAPS")
|
||||
|
||||
maps = utils.glob_path("sdkjs/build/maps/*.js.map")
|
||||
if maps:
|
||||
for m in maps: utils.log("- " + m)
|
||||
else:
|
||||
utils.log_err("files do not exist")
|
||||
utils.set_summary("sdkjs closure maps %s deploy" % license, False)
|
||||
return
|
||||
|
||||
utils.log_h2("sdkjs closure maps %s deploy" % license)
|
||||
ret = True
|
||||
for f in maps:
|
||||
base = utils.get_basename(f)
|
||||
key = "closure-maps/sdkjs/%s/%s/%s/%s" % (license, common.version, common.build, base)
|
||||
upload = utils.s3_upload(f, "s3://" + branding.s3_bucket + "/" + key)
|
||||
ret &= upload
|
||||
if upload:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
utils.set_summary("sdkjs closure maps %s deploy" % license, ret)
|
||||
return
|
||||
|
||||
def deploy_closuremaps_webapps(license):
|
||||
if not common.deploy: return
|
||||
utils.log_h1("WEB-APPS CLOSURE MAPS")
|
||||
|
||||
maps = utils.glob_path("web-apps/deploy/web-apps/apps/*/*/*.js.map") \
|
||||
+ utils.glob_path("web-apps/deploy/web-apps/apps/*/mobile/dist/js/*.js.map")
|
||||
if maps:
|
||||
for m in maps: utils.log("- " + m)
|
||||
else:
|
||||
utils.log_err("files do not exist")
|
||||
utils.set_summary("web-apps closure maps %s deploy" % license, False)
|
||||
return
|
||||
|
||||
utils.log_h2("web-apps closure maps %s deploy" % license)
|
||||
ret = True
|
||||
for f in maps:
|
||||
base = utils.get_relpath(f, "web-apps/deploy/web-apps/apps").replace("/", "_")
|
||||
key = "closure-maps/web-apps/%s/%s/%s/%s" % (license, common.version, common.build, base)
|
||||
upload = utils.s3_upload(f, "s3://" + branding.s3_bucket + "/" + key)
|
||||
ret &= upload
|
||||
if upload:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
utils.set_summary("web-apps closure maps %s deploy" % license, ret)
|
||||
return
|
||||
344
scripts/package_desktop.py
Normal file
344
scripts/package_desktop.py
Normal file
@ -0,0 +1,344 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import re
|
||||
import package_utils as utils
|
||||
import package_common as common
|
||||
import package_branding as branding
|
||||
|
||||
def make():
|
||||
utils.log_h1("DESKTOP")
|
||||
if utils.is_windows():
|
||||
make_windows()
|
||||
elif utils.is_macos():
|
||||
make_macos()
|
||||
elif utils.is_linux():
|
||||
make_linux()
|
||||
else:
|
||||
utils.log("Unsupported host OS")
|
||||
return
|
||||
|
||||
def s3_upload(files, dst):
|
||||
if not files: return False
|
||||
ret = True
|
||||
for f in files:
|
||||
key = dst + utils.get_basename(f) if dst.endswith("/") else dst
|
||||
upload = utils.s3_upload(f, "s3://" + branding.s3_bucket + "/" + key)
|
||||
if upload:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
ret &= upload
|
||||
return ret
|
||||
|
||||
#
|
||||
# Windows
|
||||
#
|
||||
|
||||
def make_windows():
|
||||
global package_name, package_version, arch, xp
|
||||
utils.set_cwd("desktop-apps\\package")
|
||||
|
||||
package_name = branding.desktop_package_name
|
||||
package_version = common.version + "." + common.build
|
||||
arch = {
|
||||
"windows_x64": "x64",
|
||||
"windows_x64_xp": "x64",
|
||||
"windows_x86": "x86",
|
||||
"windows_x86_xp": "x86",
|
||||
"windows_arm64": "arm64"
|
||||
}[common.platform]
|
||||
xp = common.platform.endswith("_xp")
|
||||
|
||||
if common.clean:
|
||||
utils.log_h2("desktop clean")
|
||||
utils.delete_dir("build")
|
||||
utils.delete_files("inno\\package.config")
|
||||
utils.delete_files("inno\\*.exe")
|
||||
utils.delete_dir("advinst\\DesktopEditors-cache")
|
||||
utils.delete_files("advinst\\package.config")
|
||||
utils.delete_files("advinst\\*.msi")
|
||||
utils.delete_files("advinst\\*.aic")
|
||||
utils.delete_dir("zip")
|
||||
|
||||
if not xp:
|
||||
make_prepare()
|
||||
make_zip()
|
||||
if branding.onlyoffice:
|
||||
make_inno()
|
||||
make_inno("standalone")
|
||||
make_advinst()
|
||||
|
||||
make_prepare("commercial")
|
||||
make_zip("commercial")
|
||||
make_inno("commercial")
|
||||
make_advinst("commercial")
|
||||
else:
|
||||
make_prepare("xp")
|
||||
make_zip("xp")
|
||||
make_inno("xp")
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
def make_prepare(edition = "opensource"):
|
||||
args = [
|
||||
"-Version", package_version,
|
||||
"-Arch", arch,
|
||||
"-Target", edition,
|
||||
"-CompanyName", branding.company_name
|
||||
]
|
||||
if common.sign:
|
||||
args += ["-Sign"]
|
||||
|
||||
utils.log_h2("desktop prepare " + edition)
|
||||
ret = utils.ps1("make.ps1", args, verbose=True)
|
||||
utils.set_summary("desktop prepare " + edition, ret)
|
||||
return
|
||||
|
||||
def make_zip(edition = "opensource"):
|
||||
if edition == "commercial": zip_file = "%s-Enterprise-%s-%s.zip"
|
||||
elif edition == "xp": zip_file = "%s-XP-%s-%s.zip"
|
||||
else: zip_file = "%s-%s-%s.zip"
|
||||
zip_file = "zip\\" + zip_file % (package_name, package_version, arch)
|
||||
args = [
|
||||
"-Version", package_version,
|
||||
"-Arch", arch,
|
||||
"-Target", edition,
|
||||
"-CompanyName", branding.company_name
|
||||
]
|
||||
# if common.sign:
|
||||
# args += ["-Sign"]
|
||||
|
||||
utils.log_h2("desktop zip " + edition + " build")
|
||||
ret = utils.ps1("make_zip.ps1", args, verbose=True)
|
||||
utils.set_summary("desktop zip " + edition + " build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("desktop zip " + edition + " deploy")
|
||||
ret = s3_upload([zip_file], "desktop/win/generic/")
|
||||
utils.set_summary("desktop zip " + edition + " deploy", ret)
|
||||
return
|
||||
|
||||
def make_inno(edition = "opensource"):
|
||||
if edition == "commercial": inno_file = "%s-Enterprise-%s-%s.exe"
|
||||
elif edition == "standalone": inno_file = "%s-Standalone-%s-%s.exe"
|
||||
elif edition == "update": inno_file = "%s-Update-%s-%s.exe"
|
||||
elif edition == "xp": inno_file = "%s-XP-%s-%s.exe"
|
||||
else: inno_file = "%s-%s-%s.exe"
|
||||
inno_file = "inno\\" + inno_file % (package_name, package_version, arch)
|
||||
args = [
|
||||
"-Version", package_version,
|
||||
"-Arch", arch,
|
||||
"-Target", edition
|
||||
]
|
||||
if common.sign:
|
||||
args += ["-Sign"]
|
||||
|
||||
if xp:
|
||||
args += ["-TimestampServer", "http://timestamp.comodoca.com/authenticode"]
|
||||
|
||||
utils.log_h2("desktop inno " + edition + " build")
|
||||
ret = utils.ps1("make_inno.ps1", args, verbose=True)
|
||||
utils.set_summary("desktop inno " + edition + " build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("desktop inno " + edition + " deploy")
|
||||
ret = s3_upload([inno_file], "desktop/win/inno/")
|
||||
utils.set_summary("desktop inno " + edition + " deploy", ret)
|
||||
return
|
||||
|
||||
def make_advinst(edition = "opensource"):
|
||||
if edition == "commercial": advinst_file = "%s-Enterprise-%s-%s.msi"
|
||||
else: advinst_file = "%s-%s-%s.msi"
|
||||
advinst_file = "advinst\\" + advinst_file % (package_name, package_version, arch)
|
||||
args = [
|
||||
"-Version", package_version,
|
||||
"-Arch", arch,
|
||||
"-Target", edition
|
||||
]
|
||||
if common.sign:
|
||||
args += ["-Sign"]
|
||||
|
||||
utils.log_h2("desktop advinst " + edition + " build")
|
||||
ret = utils.ps1("make_advinst.ps1", args, verbose=True)
|
||||
utils.set_summary("desktop advinst " + edition + " build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("desktop advinst " + edition + " deploy")
|
||||
ret = s3_upload([advinst_file], "desktop/win/advinst/")
|
||||
utils.set_summary("desktop advinst " + edition + " deploy", ret)
|
||||
return
|
||||
|
||||
#
|
||||
# macOS
|
||||
#
|
||||
|
||||
def make_macos():
|
||||
global package_name, build_dir, branding_dir, updates_dir, changes_dir, \
|
||||
suffix, lane, scheme, source_dir, released_updates_dir
|
||||
package_name = branding.desktop_package_name
|
||||
build_dir = branding.desktop_build_dir
|
||||
branding_dir = branding.desktop_branding_dir
|
||||
updates_dir = branding.desktop_updates_dir
|
||||
changes_dir = branding.desktop_changes_dir
|
||||
suffix = {
|
||||
"darwin_x86_64": "x86_64",
|
||||
"darwin_x86_64_v8": "v8",
|
||||
"darwin_arm64": "arm"
|
||||
}[common.platform]
|
||||
lane = "release_" + suffix
|
||||
scheme = package_name + "-" + suffix
|
||||
sparkle_updates = False
|
||||
|
||||
utils.set_cwd(branding_dir)
|
||||
|
||||
if common.clean:
|
||||
utils.log_h2("clean")
|
||||
utils.delete_dir(utils.get_env("HOME") + "/Library/Developer/Xcode/Archives")
|
||||
utils.delete_dir(utils.get_env("HOME") + "/Library/Caches/Sparkle_generate_appcast")
|
||||
|
||||
utils.log_h2("build")
|
||||
source_dir = "%s/build_tools/out/%s/%s" \
|
||||
% (common.workspace_dir, common.prefix, branding.company_name)
|
||||
if branding.onlyoffice:
|
||||
for path in utils.glob_path(source_dir \
|
||||
+ "/desktopeditors/editors/web-apps/apps/*/main/resources/help"):
|
||||
utils.delete_dir(path)
|
||||
|
||||
if utils.get_env("ARCHIVES_DIR"):
|
||||
sparkle_updates = True
|
||||
released_updates_dir = "%s/%s/_updates" % (utils.get_env("ARCHIVES_DIR"), scheme)
|
||||
plistbuddy = "/usr/libexec/PlistBuddy"
|
||||
plist_path = "%s/%s/ONLYOFFICE/Resources/%s-%s/Info.plist" \
|
||||
% (common.workspace_dir, branding_dir, package_name, suffix)
|
||||
|
||||
appcast = utils.sh_output('%s -c "Print :SUFeedURL" %s' \
|
||||
% (plistbuddy, plist_path), verbose=True).rstrip()
|
||||
appcast = released_updates_dir + "/" + appcast[appcast.rfind("/")+1:]
|
||||
|
||||
release_version_string = utils.sh_output(
|
||||
'xmllint --xpath "/rss/channel/item[1]/*[name()=\'sparkle:shortVersionString\']/text()" ' + appcast,
|
||||
verbose=True).rstrip()
|
||||
release_version = utils.sh_output(
|
||||
'xmllint --xpath "/rss/channel/item[1]/*[name()=\'sparkle:version\']/text()" ' + appcast,
|
||||
verbose=True).rstrip()
|
||||
bundle_version = str(int(release_version) + 1)
|
||||
help_url = "https://download.onlyoffice.com/install/desktop/editors/help/v" + common.version + "/apps"
|
||||
|
||||
utils.sh('%s -c "Set :CFBundleShortVersionString %s" %s' \
|
||||
% (plistbuddy, common.version, plist_path), verbose=True)
|
||||
utils.sh('%s -c "Set :CFBundleVersion %s" %s' \
|
||||
% (plistbuddy, bundle_version, plist_path), verbose=True)
|
||||
utils.sh('%s -c "Set :ASCBundleBuildNumber %s" %s' \
|
||||
% (plistbuddy, common.build, plist_path), verbose=True)
|
||||
utils.sh('%s -c "Add :ASCWebappsHelpUrl string %s" %s' \
|
||||
% (plistbuddy, help_url, plist_path), verbose=True)
|
||||
|
||||
utils.log("RELEASE=" + release_version_string + "(" + release_version + ")" \
|
||||
+ "\nCURRENT=" + common.version + "(" + bundle_version + ")")
|
||||
|
||||
dmg = make_dmg()
|
||||
if dmg and sparkle_updates:
|
||||
make_sparkle_updates()
|
||||
if common.platform != "darwin_x86_64_v8":
|
||||
make_dmg("commercial")
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
def make_dmg(target = "opensource"):
|
||||
utils.log_h2("desktop dmg " + target + " build")
|
||||
utils.log_h3("build/" + package_name + ".app")
|
||||
args = ["bundler", "exec", "fastlane", lane, "skip_git_bump:true"]
|
||||
if target == "commercial":
|
||||
args += ["edition:Enterprise"]
|
||||
dmg = utils.sh(" ".join(args), verbose=True)
|
||||
utils.set_summary("desktop dmg " + target + " build", dmg)
|
||||
|
||||
if common.deploy and dmg:
|
||||
utils.log_h2("desktop dmg " + target + " deploy")
|
||||
ret = s3_upload(
|
||||
utils.glob_path("build/*.dmg"),
|
||||
"desktop/mac/%s/%s/%s/" % (suffix, common.version, common.build))
|
||||
utils.set_summary("desktop dmg deploy", ret)
|
||||
|
||||
if common.deploy and dmg and target != "commercial":
|
||||
utils.log_h2("desktop zip " + target + " deploy")
|
||||
ret = s3_upload(
|
||||
["build/%s-%s.zip" % (scheme, common.version)],
|
||||
"desktop/mac/%s/%s/%s/" % (suffix, common.version, common.build))
|
||||
utils.set_summary("desktop zip " + target + " deploy", ret)
|
||||
return dmg
|
||||
|
||||
def make_sparkle_updates():
|
||||
utils.log_h2("desktop sparkle files build")
|
||||
|
||||
zip_filename = scheme + '-' + common.version
|
||||
macos_zip = "build/" + zip_filename + ".zip"
|
||||
utils.create_dir(updates_dir)
|
||||
utils.copy_file(macos_zip, updates_dir)
|
||||
utils.sh(
|
||||
"ls -1t " + released_updates_dir + "/*.zip" \
|
||||
+ " | head -n 3" \
|
||||
+ " | while read f; do cp -fv \"$f\" " + updates_dir + "/; done",
|
||||
verbose=True)
|
||||
|
||||
for ext in [".html", ".ru.html"]:
|
||||
changes_src = changes_dir + "/" + common.version + "/changes" + ext
|
||||
changes_dst = updates_dir + "/" + zip_filename + ext
|
||||
if not utils.copy_file(changes_src, changes_dst):
|
||||
utils.write_file(changes_dst, "<!DOCTYPE html>placeholder")
|
||||
|
||||
sparkle_base_url = "%s/%s/updates/" % (branding.sparkle_base_url, suffix)
|
||||
ret = utils.sh(
|
||||
common.workspace_dir \
|
||||
+ "/desktop-apps/macos/Vendor/Sparkle/bin/generate_appcast " \
|
||||
+ updates_dir \
|
||||
+ " --download-url-prefix " + sparkle_base_url \
|
||||
+ " --release-notes-url-prefix " + sparkle_base_url,
|
||||
verbose=True
|
||||
)
|
||||
utils.set_summary("desktop sparkle files build", ret)
|
||||
|
||||
if common.deploy:
|
||||
utils.log_h2("desktop sparkle files deploy")
|
||||
ret = s3_upload(
|
||||
utils.glob_path("build/update/*.delta") \
|
||||
+ utils.glob_path("build/update/*.xml") \
|
||||
+ utils.glob_path("build/update/*.html"),
|
||||
"desktop/mac/%s/%s/%s/" % (suffix, common.version, common.build))
|
||||
utils.set_summary("desktop sparkle files deploy", ret)
|
||||
return
|
||||
|
||||
#
|
||||
# Linux
|
||||
#
|
||||
|
||||
def make_linux():
|
||||
utils.set_cwd("desktop-apps/package")
|
||||
|
||||
for edition in ["opensource", "commercial"]:
|
||||
utils.log_h2("desktop " + edition + " build")
|
||||
make_args = [t["make"] for t in branding.desktop_make_targets]
|
||||
if edition == "commercial":
|
||||
make_args += ["-e", "PACKAGE_EDITION=commercial"]
|
||||
if common.platform == "linux_aarch64":
|
||||
make_args += ["-e", "UNAME_M=aarch64"]
|
||||
if not branding.onlyoffice:
|
||||
make_args += ["-e", "BRANDING_DIR=../../" + common.branding + "/desktop-apps/package"]
|
||||
ret = utils.sh("make clean && make " + " ".join(make_args), verbose=True)
|
||||
utils.set_summary("desktop " + edition + " build", ret)
|
||||
|
||||
if common.deploy:
|
||||
for t in branding.desktop_make_targets:
|
||||
utils.log_h2("desktop " + edition + " " + t["make"] + " deploy")
|
||||
uploads = []
|
||||
for f in utils.glob_path(t["src"]):
|
||||
if "help" in f and not \
|
||||
("x86_64" in common.platform and edition == "opensource"): continue
|
||||
uploads.append(f)
|
||||
ret = s3_upload(uploads, t["dst"])
|
||||
utils.set_summary("desktop " + edition + " " + t["make"] + " deploy", ret)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
38
scripts/package_mobile.py
Normal file
38
scripts/package_mobile.py
Normal file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import package_utils as utils
|
||||
import package_common as common
|
||||
import package_branding as branding
|
||||
|
||||
def make():
|
||||
utils.log_h1("MOBILE")
|
||||
if not utils.is_linux():
|
||||
utils.log("Unsupported host OS")
|
||||
return
|
||||
make_mobile()
|
||||
return
|
||||
|
||||
def make_mobile():
|
||||
utils.set_cwd("build_tools/out")
|
||||
|
||||
zip_file = "build-" + common.version + "-" + common.build + ".zip"
|
||||
|
||||
if common.clean:
|
||||
utils.log_h2("mobile clean")
|
||||
utils.sh("rm -rfv *.zip", verbose=True)
|
||||
|
||||
utils.log_h2("mobile build")
|
||||
ret = utils.sh("zip -r " + zip_file + " ./android ./ios", verbose=True)
|
||||
utils.set_summary("mobile build", ret)
|
||||
|
||||
if common.deploy:
|
||||
if ret:
|
||||
utils.log_h2("mobile deploy")
|
||||
key = "mobile/android/" + zip_file
|
||||
ret = utils.s3_upload(zip_file, "s3://" + branding.s3_bucket + "/" + key)
|
||||
if ret:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
utils.set_summary("mobile deploy", ret)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
82
scripts/package_server.py
Normal file
82
scripts/package_server.py
Normal file
@ -0,0 +1,82 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import package_utils as utils
|
||||
import package_common as common
|
||||
import package_branding as branding
|
||||
|
||||
def make(edition):
|
||||
utils.log_h1("SERVER (" + edition.upper() + ")")
|
||||
if utils.is_windows():
|
||||
make_windows(edition)
|
||||
elif utils.is_linux():
|
||||
make_linux(edition)
|
||||
else:
|
||||
utils.log("Unsupported host OS")
|
||||
return
|
||||
|
||||
def s3_upload(files, dst):
|
||||
if not files: return False
|
||||
ret = True
|
||||
for f in files:
|
||||
key = dst + utils.get_basename(f) if dst.endswith("/") else dst
|
||||
upload = utils.s3_upload(f, "s3://" + branding.s3_bucket + "/" + key)
|
||||
if upload:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
ret &= upload
|
||||
return ret
|
||||
|
||||
def make_windows(edition):
|
||||
if edition == "enterprise":
|
||||
product_name = "DocumentServer-EE"
|
||||
elif edition == "developer":
|
||||
product_name = "DocumentServer-DE"
|
||||
else:
|
||||
product_name = "DocumentServer"
|
||||
utils.set_cwd("document-server-package")
|
||||
|
||||
utils.log_h2("server " + edition + " build")
|
||||
ret = utils.cmd("make", "clean", verbose=True)
|
||||
if edition == "prerequisites":
|
||||
make_args = ["exe-pr"]
|
||||
else:
|
||||
make_args = ["exe", "-e", "PRODUCT_NAME=" + product_name]
|
||||
if not branding.onlyoffice:
|
||||
make_args += ["-e", "BRANDING_DIR=../" + common.branding + "/document-server-package"]
|
||||
ret &= utils.cmd("make", *make_args, verbose=True)
|
||||
utils.set_summary("server " + edition + " build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("server " + edition + " inno deploy")
|
||||
ret = s3_upload(utils.glob_path("exe/*.exe"), "server/win/inno/")
|
||||
utils.set_summary("server " + edition + " inno deploy", ret)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
def make_linux(edition):
|
||||
if edition == "enterprise":
|
||||
product_name = "documentserver-ee"
|
||||
elif edition == "developer":
|
||||
product_name = "documentserver-de"
|
||||
else:
|
||||
product_name = "documentserver"
|
||||
utils.set_cwd("document-server-package")
|
||||
|
||||
utils.log_h2("server " + edition + " build")
|
||||
make_args = [t["make"] for t in branding.server_make_targets]
|
||||
make_args += ["-e", "PRODUCT_NAME=" + product_name]
|
||||
if common.platform == "linux_aarch64":
|
||||
make_args += ["-e", "UNAME_M=aarch64"]
|
||||
if not branding.onlyoffice:
|
||||
make_args += ["-e", "BRANDING_DIR=../" + common.branding + "/document-server-package"]
|
||||
ret = utils.sh("make clean && make " + " ".join(make_args), verbose=True)
|
||||
utils.set_summary("server " + edition + " build", ret)
|
||||
|
||||
if common.deploy:
|
||||
for t in branding.server_make_targets:
|
||||
utils.log_h2("server " + edition + " " + t["make"] + " deploy")
|
||||
ret = s3_upload(utils.glob_path(t["src"]), t["dst"])
|
||||
utils.set_summary("server " + edition + " " + t["make"] + " deploy", ret)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
409
scripts/package_utils.py
Normal file
409
scripts/package_utils.py
Normal file
@ -0,0 +1,409 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import codecs
|
||||
import glob
|
||||
import hashlib
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import package_common as common
|
||||
|
||||
def host_platform():
|
||||
return platform.system().lower()
|
||||
|
||||
def is_windows():
|
||||
return host_platform() == "windows"
|
||||
|
||||
def is_macos():
|
||||
return host_platform() == "darwin"
|
||||
|
||||
def is_linux():
|
||||
return host_platform() == "linux"
|
||||
|
||||
def log(string, end='\n'):
|
||||
sys.stdout.write(string + end)
|
||||
sys.stdout.flush()
|
||||
return
|
||||
|
||||
def log_h1(string):
|
||||
line = "#" * (len(string) + 8)
|
||||
log("\n" + line + "\n### " + string + " ###\n" + line + "\n")
|
||||
return
|
||||
|
||||
def log_h2(string):
|
||||
log("\n### " + string + "\n")
|
||||
return
|
||||
|
||||
def log_h3(string):
|
||||
log("# " + string)
|
||||
return
|
||||
|
||||
def log_err(string):
|
||||
log("!!! " + string)
|
||||
return
|
||||
|
||||
def get_timestamp():
|
||||
return "%.f" % time.time()
|
||||
|
||||
def get_env(key, default=None):
|
||||
return os.getenv(key, default)
|
||||
|
||||
def set_env(key, value):
|
||||
os.environ[key] = value
|
||||
return
|
||||
|
||||
def get_cwd():
|
||||
return os.getcwd()
|
||||
|
||||
def set_cwd(path, verbose=True):
|
||||
if verbose:
|
||||
log("- change working dir:")
|
||||
log(" path: " + path)
|
||||
os.chdir(path)
|
||||
return
|
||||
|
||||
def get_path(path):
|
||||
if is_windows():
|
||||
return path.replace("/", "\\")
|
||||
return path
|
||||
|
||||
def get_relpath(path, rel_path):
|
||||
return os.path.relpath(get_path(path), get_path(rel_path))
|
||||
|
||||
def get_abspath(path):
|
||||
return os.path.abspath(get_path(path))
|
||||
|
||||
def get_basename(path):
|
||||
return os.path.basename(path)
|
||||
|
||||
def get_dirname(path):
|
||||
return os.path.dirname(path)
|
||||
|
||||
def get_file_size(path):
|
||||
return os.path.getsize(path)
|
||||
|
||||
def get_script_dir(path):
|
||||
return get_dirname(os.path.realpath(path))
|
||||
|
||||
def is_file(path):
|
||||
return os.path.isfile(path)
|
||||
|
||||
def is_dir(path):
|
||||
return os.path.isdir(path)
|
||||
|
||||
def is_exist(path):
|
||||
if os.path.exists(path):
|
||||
return True
|
||||
return False
|
||||
|
||||
def glob_path(path):
|
||||
return glob.glob(path)
|
||||
|
||||
def glob_file(path):
|
||||
if glob.glob(path) and is_file(glob.glob(path)[0]):
|
||||
return glob.glob(path)[0]
|
||||
return
|
||||
|
||||
def get_hash_sha256(path):
|
||||
if os.path.exists(path):
|
||||
h = hashlib.sha256()
|
||||
h.update(open(path, "rb").read())
|
||||
return h.hexdigest()
|
||||
return
|
||||
|
||||
def get_hash_sha1(path):
|
||||
if os.path.exists(path):
|
||||
h = hashlib.sha1()
|
||||
h.update(open(path, "rb").read())
|
||||
return h.hexdigest()
|
||||
return
|
||||
|
||||
def get_hash_md5(path):
|
||||
if os.path.exists(path):
|
||||
h = hashlib.md5()
|
||||
h.update(open(path, "rb").read())
|
||||
return h.hexdigest()
|
||||
return
|
||||
|
||||
def create_dir(path, verbose=True):
|
||||
if verbose:
|
||||
log("- create_dir:")
|
||||
log(" path: " + path)
|
||||
if not is_exist(path):
|
||||
os.makedirs(path)
|
||||
else:
|
||||
log_err("dir exist")
|
||||
return
|
||||
|
||||
def write_file(path, data, encoding='utf-8', verbose=True):
|
||||
if is_file(path):
|
||||
delete_file(path)
|
||||
if verbose:
|
||||
log("- write_file:")
|
||||
log(" path: " + path)
|
||||
log(" encoding: " + encoding)
|
||||
log(" data: |\n" + data)
|
||||
with codecs.open(path, 'w', encoding) as file:
|
||||
file.write(data)
|
||||
return
|
||||
|
||||
def replace_in_file(path, pattern, text_replace, encoding='utf-8', verbose=True):
|
||||
if verbose:
|
||||
log("- replace_in_file:")
|
||||
log(" path: " + path)
|
||||
log(" pattern: " + pattern)
|
||||
log(" replace: " + text_replace)
|
||||
log(" encoding: " + encoding)
|
||||
file_data = ""
|
||||
with codecs.open(get_path(path), "r", encoding) as file:
|
||||
file_data = file.read()
|
||||
file_data = re.sub(pattern, text_replace, file_data)
|
||||
delete_file(path)
|
||||
with codecs.open(get_path(path), "w", encoding) as file:
|
||||
file.write(file_data)
|
||||
return
|
||||
|
||||
def copy_file(src, dst, verbose=True):
|
||||
if verbose:
|
||||
log("- copy_file:")
|
||||
log(" src: " + src)
|
||||
log(" dst: " + dst)
|
||||
if is_file(dst):
|
||||
delete_file(dst, False)
|
||||
if not is_file(src):
|
||||
log_err("file not exist: " + src)
|
||||
return
|
||||
return shutil.copy2(get_path(src), get_path(dst))
|
||||
|
||||
def copy_files(src, dst, override=True, verbose=True):
|
||||
if verbose:
|
||||
log("- copy_files:")
|
||||
log(" src: " + src)
|
||||
log(" dst: " + dst)
|
||||
log(" override: " + str(override))
|
||||
for file in glob.glob(src):
|
||||
file_name = os.path.basename(file)
|
||||
if is_file(file):
|
||||
if override and is_file(dst + "/" + file_name):
|
||||
delete_file(dst + "/" + file_name)
|
||||
if not is_file(dst + "/" + file_name):
|
||||
if verbose:
|
||||
log(file + " : " + get_path(dst))
|
||||
shutil.copy2(file, get_path(dst))
|
||||
elif is_dir(file):
|
||||
if not is_dir(dst + "/" + file_name):
|
||||
create_dir(dst + "/" + file_name)
|
||||
copy_files(file + "/*", dst + "/" + file_name, override)
|
||||
return
|
||||
|
||||
def copy_dir(src, dst, verbose=True, symlinks=False):
|
||||
if verbose:
|
||||
log("- copy_dir:")
|
||||
log(" src: " + src)
|
||||
log(" dst: " + dst)
|
||||
shutil.copytree(src, dst, symlinks=symlinks)
|
||||
return
|
||||
|
||||
def copy_dir_content(src, dst, filter_include = "", filter_exclude = "", verbose=True):
|
||||
if verbose:
|
||||
log("- copy_dir_content:")
|
||||
log(" src: " + src)
|
||||
log(" dst: " + dst)
|
||||
log(" include: " + filter_include)
|
||||
log(" exclude: " + filter_exclude)
|
||||
for item in os.listdir(src):
|
||||
s = os.path.join(src, item)
|
||||
d = os.path.join(dst, item)
|
||||
if ("" != filter_include) and (-1 == item.find(filter_include)):
|
||||
continue
|
||||
if ("" != filter_exclude) and (-1 != item.find(filter_exclude)):
|
||||
continue
|
||||
if os.path.isdir(s):
|
||||
shutil.copytree(s, d)
|
||||
else:
|
||||
shutil.copy2(s, d)
|
||||
log(item)
|
||||
return
|
||||
|
||||
def delete_file(path, verbose=True):
|
||||
if verbose:
|
||||
log("- delete_file:")
|
||||
log(" path: " + path)
|
||||
if not is_file(path):
|
||||
log_err("file not exist")
|
||||
return
|
||||
return os.remove(path)
|
||||
|
||||
def delete_dir(path, verbose=True):
|
||||
if verbose:
|
||||
log("- delete_dir:")
|
||||
log(" path: " + path)
|
||||
if not is_dir(path):
|
||||
log_err("dir not exist")
|
||||
return
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
return
|
||||
|
||||
def delete_files(src, verbose=True):
|
||||
if verbose:
|
||||
log("- delete_files:")
|
||||
log(" pattern: " + src)
|
||||
for path in glob.glob(src):
|
||||
if verbose:
|
||||
log(path)
|
||||
if is_file(path):
|
||||
os.remove(path)
|
||||
elif is_dir(path):
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
return
|
||||
|
||||
def remove_all_symlinks(dir):
|
||||
for root, dirs, files in os.walk(dir, topdown=True, followlinks=False):
|
||||
for name in files:
|
||||
path = os.path.join(root, name)
|
||||
if os.path.islink(path):
|
||||
os.unlink(path)
|
||||
|
||||
for name in list(dirs):
|
||||
path = os.path.join(root, name)
|
||||
if os.path.islink(path):
|
||||
os.unlink(path)
|
||||
dirs.remove(name)
|
||||
return
|
||||
|
||||
def set_summary(target, status):
|
||||
common.summary.append({target: status})
|
||||
return
|
||||
|
||||
def cmd(*args, **kwargs):
|
||||
if kwargs.get("verbose"):
|
||||
log("- cmd:")
|
||||
log(" command: " + " ".join(args))
|
||||
if kwargs.get("chdir"):
|
||||
log(" chdir: " + kwargs["chdir"])
|
||||
if kwargs.get("creates"):
|
||||
log(" creates: " + kwargs["creates"])
|
||||
if kwargs.get("creates") and is_exist(kwargs["creates"]):
|
||||
log_err("creates exist")
|
||||
return False
|
||||
if kwargs.get("chdir") and is_dir(kwargs["chdir"]):
|
||||
oldcwd = get_cwd()
|
||||
set_cwd(kwargs["chdir"], verbose=False)
|
||||
ret = subprocess.call(
|
||||
[i for i in args], stderr=subprocess.STDOUT, shell=True
|
||||
) == 0
|
||||
if kwargs.get("chdir") and oldcwd:
|
||||
set_cwd(oldcwd, verbose=False)
|
||||
return ret
|
||||
|
||||
def cmd_output(*args, **kwargs):
|
||||
if kwargs.get("verbose"):
|
||||
log("- cmd_output:")
|
||||
log(" command: " + " ".join(args))
|
||||
return subprocess.check_output(
|
||||
[i for i in args], stderr=subprocess.STDOUT, shell=True
|
||||
).decode("utf-8")
|
||||
|
||||
def powershell(*args, **kwargs):
|
||||
if kwargs.get("verbose"):
|
||||
log("- powershell:")
|
||||
log(" command: " + " ".join(args))
|
||||
if kwargs.get("chdir"):
|
||||
log(" chdir: " + kwargs["chdir"])
|
||||
if kwargs.get("creates"):
|
||||
log(" creates: " + kwargs["creates"])
|
||||
if kwargs.get("creates") and is_exist(kwargs["creates"]):
|
||||
return False
|
||||
args = ["powershell", "-Command"] + [i for i in args]
|
||||
ret = subprocess.call(
|
||||
args, stderr=subprocess.STDOUT, shell=True
|
||||
) == 0
|
||||
return ret
|
||||
|
||||
def ps1(file, args=[], **kwargs):
|
||||
if kwargs.get("verbose"):
|
||||
log("- ps1: " + file + " " + " ".join(args))
|
||||
if kwargs.get("creates") and is_exist(kwargs["creates"]):
|
||||
return True
|
||||
ret = subprocess.call(
|
||||
["powershell", "-ExecutionPolicy", "ByPass", "-File", file] + args,
|
||||
stderr=subprocess.STDOUT, shell=True
|
||||
) == 0
|
||||
return ret
|
||||
|
||||
def sh(command, **kwargs):
|
||||
if kwargs.get("verbose"):
|
||||
log("- sh:")
|
||||
log(" command: " + command)
|
||||
if kwargs.get("chdir"):
|
||||
log(" chdir: " + kwargs["chdir"])
|
||||
if kwargs.get("creates"):
|
||||
log(" creates: " + kwargs["creates"])
|
||||
if kwargs.get("creates") and is_exist(kwargs["creates"]):
|
||||
log_err("creates exist")
|
||||
return False
|
||||
if kwargs.get("chdir") and is_dir(kwargs["chdir"]):
|
||||
oldcwd = get_cwd()
|
||||
set_cwd(kwargs["chdir"], verbose=False)
|
||||
ret = subprocess.call(
|
||||
command, stderr=subprocess.STDOUT, shell=True
|
||||
) == 0
|
||||
if kwargs.get("chdir") and oldcwd:
|
||||
set_cwd(oldcwd, verbose=False)
|
||||
return ret
|
||||
|
||||
def sh_output(command, **kwargs):
|
||||
if kwargs.get("verbose"):
|
||||
log("- sh_output:")
|
||||
log(" command: " + command)
|
||||
if kwargs.get("chdir"):
|
||||
log(" chdir: " + kwargs["chdir"])
|
||||
if kwargs.get("chdir") and is_dir(kwargs["chdir"]):
|
||||
oldcwd = get_cwd()
|
||||
set_cwd(kwargs["chdir"], verbose=False)
|
||||
ret = subprocess.check_output(
|
||||
command, stderr=subprocess.STDOUT, shell=True
|
||||
).decode("utf-8")
|
||||
log(ret)
|
||||
if kwargs.get("chdir") and oldcwd:
|
||||
set_cwd(oldcwd, verbose=False)
|
||||
return ret
|
||||
|
||||
def s3_upload(src, dst, **kwargs):
|
||||
if not is_file(src):
|
||||
log_err("file not exist: " + src)
|
||||
return False
|
||||
metadata = "sha256=" + get_hash_sha256(src) \
|
||||
+ ",sha1=" + get_hash_sha1(src) \
|
||||
+ ",md5=" + get_hash_md5(src)
|
||||
args = ["aws"]
|
||||
if kwargs.get("endpoint_url"):
|
||||
args += ["--endpoint-url", kwargs["endpoint_url"]]
|
||||
args += ["s3", "cp", "--no-progress"]
|
||||
if kwargs.get("acl"):
|
||||
args += ["--acl", kwargs["acl"]]
|
||||
args += ["--metadata", metadata, src, dst]
|
||||
if is_windows():
|
||||
ret = cmd(*args, verbose=True)
|
||||
else:
|
||||
ret = sh(" ".join(args), verbose=True)
|
||||
return ret
|
||||
|
||||
def s3_copy(src, dst, **kwargs):
|
||||
args = ["aws"]
|
||||
if kwargs.get("endpoint_url"):
|
||||
args += ["--endpoint-url", kwargs["endpoint_url"]]
|
||||
args += ["s3", "cp", "--no-progress"]
|
||||
if kwargs.get("acl"):
|
||||
args += ["--acl", kwargs["acl"]]
|
||||
args += [src, dst]
|
||||
if is_windows():
|
||||
ret = cmd(*args, verbose=True)
|
||||
else:
|
||||
ret = sh(" ".join(args), verbose=True)
|
||||
return ret
|
||||
190
scripts/qmake.py
Normal file
190
scripts/qmake.py
Normal file
@ -0,0 +1,190 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
__dir__name__ = os.path.dirname(__file__)
|
||||
sys.path.append(__dir__name__ + '/core_common/modules/android')
|
||||
|
||||
import base
|
||||
import config
|
||||
import android_ndk
|
||||
import multiprocessing
|
||||
|
||||
def get_make_file_suffix(platform):
|
||||
suffix = platform
|
||||
if config.check_option("config", "debug"):
|
||||
suffix += "_debug_"
|
||||
suffix += config.option("branding")
|
||||
return suffix
|
||||
|
||||
def get_j_num():
|
||||
if ("0" != config.option("multiprocess")):
|
||||
return ["-j" + str(multiprocessing.cpu_count())]
|
||||
return []
|
||||
|
||||
def check_support_platform(platform):
|
||||
qt_dir = base.qt_setup(platform)
|
||||
if not base.is_file(qt_dir + "/bin/qmake") and not base.is_file(qt_dir + "/bin/qmake.exe") and not base.is_file(qt_dir + "/bin/qmake.bat"):
|
||||
return False
|
||||
return True
|
||||
|
||||
def make(platform, project, qmake_config_addon="", is_no_errors=False):
|
||||
# check platform
|
||||
if not check_support_platform(platform):
|
||||
print("THIS PLATFORM IS NOT SUPPORTED")
|
||||
return
|
||||
|
||||
old_env = dict(os.environ)
|
||||
|
||||
# qt
|
||||
qt_dir = base.qt_setup(platform)
|
||||
base.set_env("OS_DEPLOY", platform)
|
||||
|
||||
# pro & makefile
|
||||
file_pro = os.path.abspath(project)
|
||||
|
||||
pro_dir = os.path.dirname(file_pro)
|
||||
if (pro_dir.endswith("/.")):
|
||||
pro_dir = pro_dir[:-2]
|
||||
if (pro_dir.endswith("/")):
|
||||
pro_dir = pro_dir[:-1]
|
||||
|
||||
makefile_name = "Makefile." + get_make_file_suffix(platform)
|
||||
makefile = pro_dir + "/" + makefile_name
|
||||
stash_file = pro_dir + "/.qmake.stash"
|
||||
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(pro_dir)
|
||||
|
||||
if (base.is_file(stash_file)):
|
||||
base.delete_file(stash_file)
|
||||
if (base.is_file(makefile)):
|
||||
base.delete_file(makefile)
|
||||
|
||||
base.set_env("DEST_MAKEFILE_NAME", "./" + makefile_name)
|
||||
|
||||
# setup android env
|
||||
if (-1 != platform.find("android")):
|
||||
base.set_env("ANDROID_NDK_HOST", android_ndk.host["arch"])
|
||||
base.set_env("ANDROID_NDK_PLATFORM", "android-" + android_ndk.get_sdk_api())
|
||||
base.set_env("PATH", qt_dir + "/bin:" + android_ndk.toolchain_dir() + "/bin:" + base.get_env("PATH"))
|
||||
|
||||
# setup ios env
|
||||
if (-1 != platform.find("ios")):
|
||||
base.hack_xcode_ios()
|
||||
sdk_name = "iphoneos"
|
||||
if qmake_config_addon.find("ios_simulator") != -1:
|
||||
sdk_name = "iphonesimulator"
|
||||
base.set_env("SDK_PATH", base.find_ios_sdk(sdk_name))
|
||||
base.set_env("XCODE_TOOLCHAIN_PATH", base.find_xcode_toolchain(sdk_name))
|
||||
|
||||
if base.is_file(makefile):
|
||||
base.delete_file(makefile)
|
||||
|
||||
config_param = base.qt_config(platform)
|
||||
if ("" != qmake_config_addon):
|
||||
config_param += (" " + qmake_config_addon)
|
||||
|
||||
# qmake ADDON
|
||||
qmake_addon = []
|
||||
if ("" != config.option("qmake_addon")):
|
||||
qmake_addon = config.option("qmake_addon").split()
|
||||
|
||||
clean_params = ["clean", "-f", makefile]
|
||||
distclean_params = ["distclean", "-f", makefile]
|
||||
build_params = ["-nocache", file_pro] + base.qt_config_as_param(config_param) + qmake_addon
|
||||
|
||||
qmake_app = qt_dir + "/bin/qmake"
|
||||
|
||||
# non windows platform
|
||||
if not base.is_windows():
|
||||
if base.is_file(qt_dir + "/onlyoffice_qt.conf"):
|
||||
build_params.append("-qtconf")
|
||||
build_params.append(qt_dir + "/onlyoffice_qt.conf")
|
||||
if "1" == config.option("use-clang"):
|
||||
build_params.append("-spec")
|
||||
build_params.append("linux-clang-libc++")
|
||||
|
||||
if "" != config.option("sysroot"):
|
||||
sysroot_path = config.option("sysroot_" + platform)
|
||||
os.environ['QMAKE_CUSTOM_SYSROOT'] = sysroot_path
|
||||
os.environ['QMAKE_CUSTOM_SYSROOT_BIN'] = config.get_custom_sysroot_bin(platform)
|
||||
os.environ['PKG_CONFIG_PATH'] = config.get_custom_sysroot_lib(platform, True) + "/pkgconfig"
|
||||
os.environ['PKG_CONFIG_SYSROOT_DIR'] = sysroot_path
|
||||
|
||||
base.cmd_exe(qmake_app, build_params)
|
||||
|
||||
if "" != config.option("sysroot"):
|
||||
base.set_sysroot_env(platform)
|
||||
|
||||
base.correct_makefile_after_qmake(platform, makefile)
|
||||
if ("1" == config.option("clean")):
|
||||
base.cmd_and_return_cwd("make", clean_params, True)
|
||||
base.cmd_and_return_cwd("make", distclean_params, True)
|
||||
|
||||
if "" != config.option("sysroot"):
|
||||
base.restore_sysroot_env()
|
||||
base.cmd(qmake_app, build_params)
|
||||
if "" != config.option("sysroot"):
|
||||
base.set_sysroot_env(platform)
|
||||
|
||||
base.correct_makefile_after_qmake(platform, makefile)
|
||||
base.cmd_and_return_cwd("make", ["-f", makefile] + get_j_num(), is_no_errors)
|
||||
|
||||
if "" != config.option("sysroot"):
|
||||
base.restore_sysroot_env()
|
||||
else:
|
||||
config_params_array = base.qt_config_as_param(config_param)
|
||||
config_params_string = ""
|
||||
for item in config_params_array:
|
||||
config_params_string += (" \"" + item + "\"")
|
||||
qmake_addon_string = " ".join(qmake_addon)
|
||||
if ("" != qmake_addon_string):
|
||||
qmake_addon_string = " " + qmake_addon_string
|
||||
|
||||
vcvarsall_arch = "x64"
|
||||
if base.platform_is_32(platform):
|
||||
vcvarsall_arch = "x86"
|
||||
if (platform == "win_arm64"):
|
||||
vcvarsall_arch = "x64_arm64"
|
||||
|
||||
qmake_env_addon = base.get_env("QT_QMAKE_ADDON")
|
||||
if (qmake_env_addon != ""):
|
||||
qmake_env_addon += " "
|
||||
|
||||
qmake_bat = []
|
||||
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + vcvarsall_arch)
|
||||
qmake_addon_string = ""
|
||||
if ("" != config.option("qmake_addon")):
|
||||
qmake_addon_string = " " + (" ").join(["\"" + addon + "\"" for addon in qmake_addon])
|
||||
qmake_bat.append("call \"" + qmake_app + "\" -nocache " + qmake_env_addon + file_pro + config_params_string + qmake_addon_string)
|
||||
if ("1" == config.option("clean")):
|
||||
qmake_bat.append("call nmake " + " ".join(clean_params))
|
||||
qmake_bat.append("call nmake " + " ".join(distclean_params))
|
||||
qmake_bat.append("call \"" + qmake_app + "\" -nocache " + file_pro + config_params_string + qmake_addon_string)
|
||||
if ("0" != config.option("multiprocess")):
|
||||
qmake_bat.append("set CL=/MP")
|
||||
qmake_bat.append("call nmake -f " + makefile)
|
||||
base.run_as_bat(qmake_bat, is_no_errors)
|
||||
|
||||
if (base.is_file(stash_file)):
|
||||
base.delete_file(stash_file)
|
||||
|
||||
os.chdir(old_cur)
|
||||
|
||||
os.environ.clear()
|
||||
os.environ.update(old_env)
|
||||
return
|
||||
|
||||
def make_all_platforms(project, qmake_config_addon=""):
|
||||
platforms = config.option("platform").split()
|
||||
for platform in platforms:
|
||||
if not platform in config.platforms:
|
||||
continue
|
||||
|
||||
print("------------------------------------------")
|
||||
print("BUILD_PLATFORM: " + platform)
|
||||
print("------------------------------------------")
|
||||
make(platform, project, qmake_config_addon)
|
||||
return
|
||||
231
scripts/sdkjs_common/generate_builder_intarface.py
Normal file
231
scripts/sdkjs_common/generate_builder_intarface.py
Normal file
@ -0,0 +1,231 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import shutil
|
||||
import re
|
||||
import argparse
|
||||
|
||||
def readFile(path):
|
||||
with open(path, "r", errors='replace') as file:
|
||||
filedata = file.read()
|
||||
return filedata
|
||||
|
||||
def writeFile(path, content):
|
||||
if (os.path.isfile(path)):
|
||||
os.remove(path)
|
||||
|
||||
with open(path, "w", encoding='utf-8') as file:
|
||||
file.write(content)
|
||||
return
|
||||
|
||||
class EditorApi(object):
|
||||
def __init__(self):
|
||||
self.records = []
|
||||
self.init = False
|
||||
self.folder = "word"
|
||||
self.type = "CDE"
|
||||
self.numfile = 0
|
||||
self.files = []
|
||||
return
|
||||
|
||||
def initFiles(self, type, files):
|
||||
self.folder = type
|
||||
if "word" == self.folder:
|
||||
self.type = "CDE"
|
||||
elif "slide" == self.folder:
|
||||
self.type = "CPE"
|
||||
else:
|
||||
self.type = "CSE"
|
||||
self.files = files
|
||||
return
|
||||
|
||||
def getReturnValue(self, description):
|
||||
paramStart = description.find("@returns {")
|
||||
if -1 == paramStart:
|
||||
return "{}"
|
||||
paramEnd = description.find("}", paramStart)
|
||||
retParam = description[paramStart + 10:paramEnd]
|
||||
isArray = False
|
||||
if -1 != retParam.find("[]"):
|
||||
isArray = True
|
||||
retParam = retParam.replace("[]", "")
|
||||
retType = retParam.replace("|", " ").replace(".", " ").split(" ")[0]
|
||||
retTypeLower = retType.lower()
|
||||
retValue = ""
|
||||
if -1 != retType.find("\""):
|
||||
retValue = "\"\""
|
||||
elif "boolean" == retTypeLower or "bool" == retTypeLower:
|
||||
retValue = "true"
|
||||
elif "string" == retTypeLower:
|
||||
retValue = "\"\""
|
||||
elif "number" == retTypeLower:
|
||||
retValue = "0"
|
||||
elif "undefined" == retTypeLower:
|
||||
retValue = "undefined"
|
||||
elif "null" == retTypeLower:
|
||||
retValue = "null"
|
||||
elif "array" == retTypeLower:
|
||||
retValue = "[]"
|
||||
elif "base64img" == retTypeLower:
|
||||
retValue = "base64img"
|
||||
elif "error" == retTypeLower:
|
||||
retValue = "undefined"
|
||||
else:
|
||||
retValue = "new " + retType + "()"
|
||||
if isArray:
|
||||
retValue = "[" + retValue + "]"
|
||||
return "{ return " + retValue + "; }"
|
||||
|
||||
def check_record(self, recordData):
|
||||
rec = recordData
|
||||
rec = rec.replace("\t", "")
|
||||
rec = rec.replace('\n ', '\n')
|
||||
indexEndDecoration = rec.find("*/")
|
||||
|
||||
indexOfStartPropName = rec.find('Object.defineProperty(')
|
||||
if indexOfStartPropName != -1:
|
||||
propName = re.search(r'"([^\"]*)"', rec[indexOfStartPropName:])[0]
|
||||
else:
|
||||
propName = None
|
||||
|
||||
decoration = "/**" + rec[0:indexEndDecoration + 2]
|
||||
decoration = decoration.replace("Api\n", "ApiInterface\n")
|
||||
decoration = decoration.replace("Api ", "ApiInterface ")
|
||||
decoration = decoration.replace("{Api}", "{ApiInterface}")
|
||||
decoration = decoration.replace("@return ", "@returns ")
|
||||
decoration = decoration.replace("@returns {?", "@returns {")
|
||||
decoration = decoration.replace("?}", "}")
|
||||
if -1 != decoration.find("@name ApiInterface"):
|
||||
self.append_record(decoration, "var ApiInterface = function() {};\nvar Api = new ApiInterface();\n", True)
|
||||
return
|
||||
code = rec[indexEndDecoration + 2:]
|
||||
code = code.replace("=\n", "= ").strip("\t\n\r ")
|
||||
lines = code.split("\n")
|
||||
codeCorrect = ""
|
||||
sMethodName = re.search(r'.prototype.(.*)=', code)
|
||||
|
||||
is_found_function = False
|
||||
addon_for_func = "{}"
|
||||
if -1 != decoration.find("@return"):
|
||||
addon_for_func = "{ return null; }"
|
||||
|
||||
for line in lines:
|
||||
line = line.strip("\t\n\r ")
|
||||
line = line.replace("{", "")
|
||||
line = line.replace("}", "")
|
||||
lineWithoutSpaces = line.replace(" ", "")
|
||||
if not is_found_function and 0 == line.find("function "):
|
||||
if -1 == decoration.find("@constructor"):
|
||||
return
|
||||
codeCorrect += (line + addon_for_func + "\n")
|
||||
is_found_function = True
|
||||
if not is_found_function and -1 != line.find(".prototype."):
|
||||
codeCorrect += (line + self.getReturnValue(decoration) + ";\n")
|
||||
is_found_function = True
|
||||
if -1 != lineWithoutSpaces.find(".prototype="):
|
||||
codeCorrect += (line + "\n")
|
||||
if -1 != line.find(".prototype.constructor"):
|
||||
codeCorrect += (line + "\n")
|
||||
codeCorrect = codeCorrect.replace("Api.prototype", "ApiInterface.prototype")
|
||||
self.append_record(decoration, codeCorrect)
|
||||
className = codeCorrect[0:codeCorrect.find('.')]
|
||||
|
||||
# если свойство определено сразу под методом (без декорации)
|
||||
if propName is not None and sMethodName is not None:
|
||||
prop_define = f'{className}.prototype.{propName[1:-1]} = {className}.prototype.{sMethodName.group(1)}();\n'
|
||||
self.append_record(decoration, prop_define)
|
||||
#иначе
|
||||
elif propName is not None:
|
||||
className = re.search(r'.defineProperty\((.*).prototype', code).group(1).strip()
|
||||
returnValue = 'undefined' if decoration.find('@return') == -1 else self.getReturnValue(decoration)
|
||||
if (returnValue != 'undefined'):
|
||||
returnValue = re.search(r'{ return (.*); }', returnValue).group(1).strip()
|
||||
prop_define = f'{className}.prototype.{propName[1:-1]} = {returnValue};\n'
|
||||
self.append_record(decoration, prop_define)
|
||||
return
|
||||
|
||||
def append_record(self, decoration, code, init=False):
|
||||
if init:
|
||||
if not self.init:
|
||||
self.init = True
|
||||
self.records.append(decoration + "\n" + code + "\n\n")
|
||||
return
|
||||
# check on private
|
||||
if -1 != code.find(".prototype.private_"):
|
||||
return
|
||||
# add records only for current editor
|
||||
index_type_editors = decoration.find("@typeofeditors")
|
||||
if -1 != index_type_editors:
|
||||
index_type_editors_end = decoration.find("]", index_type_editors)
|
||||
if -1 != index_type_editors_end:
|
||||
editors_support = decoration[index_type_editors:index_type_editors_end]
|
||||
if -1 == editors_support.find(self.type):
|
||||
return
|
||||
|
||||
decoration = "\n".join(
|
||||
line for line in decoration.splitlines()
|
||||
if "@typeofeditors" not in line and "@see" not in line
|
||||
)
|
||||
|
||||
# optimizations for first file
|
||||
if 0 == self.numfile:
|
||||
self.records.append(decoration + "\n" + code + "\n")
|
||||
return
|
||||
# check override js classes
|
||||
if 0 == code.find("function "):
|
||||
index_end_name = code.find("(")
|
||||
function_name = code[9:index_end_name].strip(" ")
|
||||
for rec in range(len(self.records)):
|
||||
if -1 != self.records[rec].find("function " + function_name + "("):
|
||||
self.records[rec] = ""
|
||||
elif -1 != self.records[rec].find("function " + function_name + " ("):
|
||||
self.records[rec] = ""
|
||||
elif -1 != self.records[rec].find("\n" + function_name + ".prototype."):
|
||||
self.records[rec] = ""
|
||||
|
||||
self.records.append(decoration + "\n" + code + "\n")
|
||||
return
|
||||
|
||||
def generate(self):
|
||||
for file in self.files:
|
||||
file_content = readFile(f'{sdkjs_dir}/{file}')
|
||||
arrRecords = file_content.split("/**")
|
||||
arrRecords = arrRecords[1:-1]
|
||||
for record in arrRecords:
|
||||
self.check_record(record)
|
||||
self.numfile += 1
|
||||
correctContent = ''.join(self.records)
|
||||
correctContent += "\n"
|
||||
os.mkdir(args.destination + self.folder)
|
||||
writeFile(args.destination + self.folder + "/api.js", correctContent)
|
||||
return
|
||||
|
||||
def convert_to_interface(arrFiles, sEditorType):
|
||||
editor = EditorApi()
|
||||
editor.initFiles(sEditorType, arrFiles)
|
||||
editor.generate()
|
||||
return
|
||||
|
||||
sdkjs_dir = "../../../sdkjs"
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Generate documentation")
|
||||
parser.add_argument(
|
||||
"destination",
|
||||
type=str,
|
||||
help="Destination directory for the generated documentation",
|
||||
nargs='?', # Indicates the argument is optional
|
||||
default="../../../web-apps/vendor/monaco/libs/" # Default value
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
old_cur = os.getcwd()
|
||||
|
||||
if True == os.path.isdir(args.destination):
|
||||
shutil.rmtree(args.destination, ignore_errors=True)
|
||||
os.mkdir(args.destination)
|
||||
convert_to_interface(["word/apiBuilder.js", "../sdkjs-forms/apiBuilder.js"], "word")
|
||||
convert_to_interface(["word/apiBuilder.js", "slide/apiBuilder.js"], "slide")
|
||||
convert_to_interface(["word/apiBuilder.js", "slide/apiBuilder.js", "cell/apiBuilder.js"], "cell")
|
||||
os.chdir(old_cur)
|
||||
|
||||
|
||||
138
scripts/sdkjs_common/jsdoc/README.md
Normal file
138
scripts/sdkjs_common/jsdoc/README.md
Normal file
@ -0,0 +1,138 @@
|
||||
# Documentation Generation Guide
|
||||
|
||||
This guide explains how to generate documentation for Onlyoffice Builder
|
||||
and Plugins (Methods/Events) API using the following Python scripts:
|
||||
|
||||
- `office-api/generate_docs_json.py`
|
||||
- `office-api/generate_docs_md.py`
|
||||
- `plugins/generate_docs_methods_json.py`
|
||||
- `plugins/generate_docs_methods_md.py`
|
||||
- `plugins/generate_docs_events_json.py`
|
||||
- `plugins/generate_docs_events_md.py`
|
||||
|
||||
## Requirements
|
||||
|
||||
```bash
|
||||
Node.js v20 and above
|
||||
Python v3.12 and above
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
git clone https://github.com/ONLYOFFICE/build_tools.git
|
||||
cd build_tools/scripts/sdkjs_common/jsdoc
|
||||
npm install
|
||||
```
|
||||
|
||||
## Scripts Overview
|
||||
|
||||
### `office-api/generate_docs_json.py`
|
||||
|
||||
This script generates JSON documentation based on the `apiBuilder.js` files.
|
||||
|
||||
- **Usage**:
|
||||
|
||||
```bash
|
||||
python generate_docs_json.py output_path
|
||||
```
|
||||
|
||||
- **Parameters**:
|
||||
- `output_path` (optional): The directory where the JSON documentation
|
||||
will be saved. If not specified, the default path is
|
||||
`../../../../office-js-api-declarations/office-js-api`.
|
||||
|
||||
### `office-api/generate_docs_md.py`
|
||||
|
||||
This script generates Markdown documentation from the `apiBuilder.js` files.
|
||||
|
||||
- **Usage**:
|
||||
|
||||
```bash
|
||||
python generate_docs_md.py output_path
|
||||
```
|
||||
|
||||
- **Parameters**:
|
||||
- `output_path` (optional): The directory where the Markdown documentation
|
||||
will be saved. If not specified, the default path is
|
||||
`../../../../office-js-api/`.
|
||||
|
||||
### `plugins/generate_docs_methods_json.py`
|
||||
|
||||
This script generates JSON documentation based on the `api_plugins.js` files.
|
||||
|
||||
- **Usage**:
|
||||
|
||||
```bash
|
||||
python generate_docs_methods_json.py output_path
|
||||
```
|
||||
|
||||
- **Parameters**:
|
||||
- `output_path` (optional): The directory where the JSON documentation
|
||||
will be saved. If not specified, the default path is
|
||||
`../../../../office-js-api-declarations/office-js-api-plugins`.
|
||||
|
||||
### `plugins/generate_docs_events_json.py`
|
||||
|
||||
This script generates JSON documentation based on the `plugin-events.js` files.
|
||||
|
||||
- **Usage**:
|
||||
|
||||
```bash
|
||||
python generate_docs_events_json.py output_path
|
||||
```
|
||||
|
||||
- **Parameters**:
|
||||
- `output_path` (optional): The directory where the JSON documentation
|
||||
will be saved. If not specified, the default path is
|
||||
`../../../../office-js-api-declarations/office-js-api-plugins`.
|
||||
|
||||
### `plugins/generate_docs_methods_md.py`
|
||||
|
||||
This script generates Markdown documentation from the `api_plugins.js` files.
|
||||
|
||||
- **Usage**:
|
||||
|
||||
```bash
|
||||
python generate_docs_methods_md.py output_path
|
||||
```
|
||||
|
||||
- **Parameters**:
|
||||
- `output_path` (optional): The directory where the Markdown documentation
|
||||
will be saved. If not specified, the default path is
|
||||
`../../../../office-js-api/`.
|
||||
|
||||
### `plugins/generate_docs_events_md.py`
|
||||
|
||||
This script generates Markdown documentation from the `plugin-events.js` files.
|
||||
|
||||
- **Usage**:
|
||||
|
||||
```bash
|
||||
python generate_docs_events_md.py output_path
|
||||
```
|
||||
|
||||
- **Parameters**:
|
||||
- `output_path` (optional): The directory where the Markdown documentation
|
||||
will be saved. If not specified, the default path is
|
||||
`../../../../office-js-api/`.
|
||||
|
||||
## Example
|
||||
|
||||
To generate JSON documentation with the default output path:
|
||||
|
||||
```bash
|
||||
python generate_docs_json.py /path/to/save/json
|
||||
```
|
||||
|
||||
To generate Markdown documentation and specify a custom output path:
|
||||
|
||||
```bash
|
||||
python generate_docs_md.py /path/to/save/markdown
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Make sure to have all necessary permissions to run these scripts and write
|
||||
to the specified directories.
|
||||
- The output directories will be created if they do not exist.
|
||||
39
scripts/sdkjs_common/jsdoc/get_latest_branch.py
Normal file
39
scripts/sdkjs_common/jsdoc/get_latest_branch.py
Normal file
@ -0,0 +1,39 @@
|
||||
import subprocess
|
||||
|
||||
def fetch_branches():
|
||||
#Fetch all branches without tags from the remote.
|
||||
subprocess.run(['git', 'fetch', '--no-tags', 'origin', '+refs/heads/*:refs/remotes/origin/*'], check=True)
|
||||
|
||||
def get_branches():
|
||||
#Get list of branches in the repository."""
|
||||
result = subprocess.run(['git', 'branch', '-r'], capture_output=True, text=True)
|
||||
return [line.strip() for line in result.stdout.splitlines()]
|
||||
|
||||
def parse_version(version_str):
|
||||
#Parse version string and return a tuple of integers (major, minor, patch).
|
||||
try:
|
||||
return tuple(map(int, version_str.lstrip('v').split('.')))
|
||||
except ValueError:
|
||||
return (0, 0, 0) # Default for non-parsable versions
|
||||
|
||||
def get_max_version_branch(branches):
|
||||
#Find the branch with the highest version.
|
||||
max_branch = None
|
||||
max_version = (0, 0, 0)
|
||||
|
||||
for branch in branches:
|
||||
parts = branch.split('/')
|
||||
if len(parts) >= 2 and (parts[1] == 'hotfix' or parts[1] == 'release'):
|
||||
version = parse_version(parts[2])
|
||||
if version > max_version:
|
||||
max_version = version
|
||||
max_branch = parts
|
||||
|
||||
return max_branch
|
||||
|
||||
if __name__ == "__main__":
|
||||
fetch_branches() # Fetch branches without tags
|
||||
branches = get_branches()
|
||||
max_version_branch = get_max_version_branch(branches)
|
||||
if max_version_branch:
|
||||
print('/'.join(max_version_branch[1:])) # Print only the branch name without origin
|
||||
16
scripts/sdkjs_common/jsdoc/office-api/config/cell.json
Normal file
16
scripts/sdkjs_common/jsdoc/office-api/config/cell.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"source": {
|
||||
"include": ["../../../../../sdkjs/word/apiBuilder.js", "../../../../../sdkjs/slide/apiBuilder.js", "../../../../../sdkjs/cell/apiBuilder.js"]
|
||||
},
|
||||
"plugins": ["./correct_doclets.js"],
|
||||
"opts": {
|
||||
"destination": "./out",
|
||||
"recurse": true,
|
||||
"encoding": "utf8"
|
||||
},
|
||||
"templates": {
|
||||
"json": {
|
||||
"pretty": true
|
||||
}
|
||||
}
|
||||
}
|
||||
231
scripts/sdkjs_common/jsdoc/office-api/config/correct_doclets.js
Normal file
231
scripts/sdkjs_common/jsdoc/office-api/config/correct_doclets.js
Normal file
@ -0,0 +1,231 @@
|
||||
exports.handlers = {
|
||||
processingComplete: function(e) {
|
||||
// array for filtered doclets
|
||||
let filteredDoclets = [];
|
||||
|
||||
const cleanName = name => name ? name.replace('<anonymous>~', '').replaceAll('"', '') : name;
|
||||
|
||||
const classesDocletsMap = {}; // doclets for classes write at the end
|
||||
let passedClasses = []; // passed classes for current editor
|
||||
|
||||
// Remove dublicates doclets
|
||||
const latestDoclets = {};
|
||||
e.doclets.forEach(doclet => {
|
||||
const isMethod = doclet.kind === 'function' || doclet.kind === 'method';
|
||||
const hasTypeofEditorsTag = isMethod && doclet.tags && doclet.tags.some(tag => tag.title === 'typeofeditors' && tag.value.includes(process.env.EDITOR));
|
||||
|
||||
const shouldAddMethod =
|
||||
doclet.kind !== 'member' &&
|
||||
(!doclet.longname || doclet.longname.search('private') === -1) &&
|
||||
doclet.scope !== 'inner' && hasTypeofEditorsTag;
|
||||
|
||||
if (shouldAddMethod || doclet.kind == 'typedef' || doclet.kind == 'class') {
|
||||
latestDoclets[doclet.longname] = doclet;
|
||||
}
|
||||
});
|
||||
e.doclets.splice(0, e.doclets.length, ...Object.values(latestDoclets));
|
||||
|
||||
// check available classess for current editor
|
||||
for (let i = 0; i < e.doclets.length; i++) {
|
||||
const doclet = e.doclets[i];
|
||||
const isMethod = doclet.kind === 'function' || doclet.kind === 'method';
|
||||
const hasTypeofEditorsTag = isMethod && doclet.tags && doclet.tags.some(tag => tag.title === 'typeofeditors' && tag.value.includes(process.env.EDITOR));
|
||||
|
||||
const shouldAdd =
|
||||
doclet.kind !== 'member' &&
|
||||
(!doclet.longname || doclet.longname.search('private') === -1) &&
|
||||
doclet.scope !== 'inner' &&
|
||||
(!isMethod || hasTypeofEditorsTag);
|
||||
|
||||
if (shouldAdd) {
|
||||
if (doclet.memberof && false == passedClasses.includes(cleanName(doclet.memberof))) {
|
||||
passedClasses.push(cleanName(doclet.memberof));
|
||||
}
|
||||
}
|
||||
else if (doclet.kind == 'class') {
|
||||
classesDocletsMap[cleanName(doclet.name)] = doclet;
|
||||
}
|
||||
}
|
||||
|
||||
// remove unavailave classes in current editor
|
||||
passedClasses = passedClasses.filter(className => {
|
||||
const doclet = classesDocletsMap[className];
|
||||
if (!doclet) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const hasTypeofEditorsTag = !!(doclet.tags && doclet.tags.some(tag => tag.title === 'typeofeditors'));
|
||||
|
||||
// class is passes if there is no editor tag or the current editor is among the tags
|
||||
const isPassed = false == hasTypeofEditorsTag || doclet.tags.some(tag => tag.title === 'typeofeditors' && tag.value && tag.value.includes(process.env.EDITOR));
|
||||
return isPassed;
|
||||
});
|
||||
|
||||
for (let i = 0; i < e.doclets.length; i++) {
|
||||
const doclet = e.doclets[i];
|
||||
const isMethod = doclet.kind === 'function' || doclet.kind === 'method';
|
||||
const hasTypeofEditorsTag = isMethod && doclet.tags && doclet.tags.some(tag => tag.title === 'typeofeditors' && tag.value.includes(process.env.EDITOR));
|
||||
|
||||
let shouldAddMethod =
|
||||
doclet.kind !== 'member' &&
|
||||
(!doclet.longname || doclet.longname.search('private') === -1) &&
|
||||
doclet.scope !== 'inner' && hasTypeofEditorsTag;
|
||||
|
||||
// class names may be the same between editors, we check against the inheritance tree
|
||||
if (doclet.inherits) {
|
||||
const parentClass = doclet.inherits.split('#')[0];
|
||||
const curClass = cleanName(doclet.memberof);
|
||||
|
||||
if (!classesDocletsMap[curClass].augments || !classesDocletsMap[curClass].augments.includes(parentClass)) {
|
||||
shouldAddMethod = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldAddMethod) {
|
||||
// if the class is not in our map, then we deleted it ourselves -> not available in the editor
|
||||
if (false == passedClasses.includes(cleanName(doclet.memberof))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// We leave only the necessary fields
|
||||
doclet.memberof = cleanName(doclet.memberof);
|
||||
doclet.longname = cleanName(doclet.longname);
|
||||
doclet.name = cleanName(doclet.name);
|
||||
|
||||
// skip inherited methods if ovveriden in child class
|
||||
if (doclet.inherited && filteredDoclets.find((addedDoclet) => addedDoclet['name'] == doclet['name'] && addedDoclet['memberof'] == doclet['memberof'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const filteredDoclet = {
|
||||
comment: doclet.comment,
|
||||
description: doclet.description,
|
||||
memberof: cleanName(doclet.memberof),
|
||||
|
||||
params: doclet.params ? doclet.params.map(param => ({
|
||||
type: param.type ? {
|
||||
names: param.type.names,
|
||||
parsedType: param.type.parsedType
|
||||
} : param.type,
|
||||
|
||||
name: param.name,
|
||||
description: param.description,
|
||||
optional: param.optional,
|
||||
defaultvalue: param.defaultvalue
|
||||
})) : doclet.params,
|
||||
|
||||
returns: doclet.returns ? doclet.returns.map(returnObj => ({
|
||||
type: {
|
||||
names: returnObj.type.names,
|
||||
parsedType: returnObj.type.parsedType
|
||||
}
|
||||
})) : doclet.returns,
|
||||
|
||||
name: doclet.name,
|
||||
longname: cleanName(doclet.longname),
|
||||
kind: doclet.kind,
|
||||
scope: doclet.scope,
|
||||
|
||||
type: doclet.type ? {
|
||||
names: doclet.type.names,
|
||||
parsedType: doclet.type.parsedType
|
||||
} : doclet.type,
|
||||
|
||||
properties: doclet.properties ? doclet.properties.map(property => ({
|
||||
type: property.type ? {
|
||||
names: property.type.names,
|
||||
parsedType: property.type.parsedType
|
||||
} : property.type,
|
||||
|
||||
name: property.name,
|
||||
description: property.description,
|
||||
optional: property.optional,
|
||||
defaultvalue: property.defaultvalue
|
||||
})) : doclet.properties,
|
||||
|
||||
meta: doclet.meta ? {
|
||||
lineno: doclet.meta.lineno,
|
||||
columnno: doclet.meta.columnno
|
||||
} : doclet.meta,
|
||||
|
||||
see: doclet.see
|
||||
};
|
||||
|
||||
// Add the filtered doclet to the array
|
||||
filteredDoclets.push(filteredDoclet);
|
||||
}
|
||||
else if (doclet.kind == 'class') {
|
||||
// if the class is not in our map, then we deleted it ourselves -> not available in the editor
|
||||
if (false == passedClasses.includes(cleanName(doclet.name))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const filteredDoclet = {
|
||||
comment: doclet.comment,
|
||||
description: doclet.description,
|
||||
name: cleanName(doclet.name),
|
||||
longname: cleanName(doclet.longname),
|
||||
kind: doclet.kind,
|
||||
scope: "global",
|
||||
augments: doclet.augments || undefined,
|
||||
meta: doclet.meta ? {
|
||||
lineno: doclet.meta.lineno,
|
||||
columnno: doclet.meta.columnno
|
||||
} : doclet.meta,
|
||||
properties: doclet.properties ? doclet.properties.map(property => ({
|
||||
type: property.type ? {
|
||||
names: property.type.names,
|
||||
parsedType: property.type.parsedType
|
||||
} : property.type,
|
||||
|
||||
name: property.name,
|
||||
description: property.description,
|
||||
optional: property.optional,
|
||||
defaultvalue: property.defaultvalue
|
||||
})) : doclet.properties,
|
||||
see: doclet.see || undefined
|
||||
};
|
||||
|
||||
filteredDoclets.push(filteredDoclet);
|
||||
}
|
||||
else if (doclet.kind == 'typedef') {
|
||||
const filteredDoclet = {
|
||||
comment: doclet.comment,
|
||||
description: doclet.description,
|
||||
name: cleanName(doclet.name),
|
||||
longname: cleanName(doclet.longname),
|
||||
kind: doclet.kind,
|
||||
scope: "global",
|
||||
|
||||
meta: doclet.meta ? {
|
||||
lineno: doclet.meta.lineno,
|
||||
columnno: doclet.meta.columnno
|
||||
} : doclet.meta,
|
||||
|
||||
properties: doclet.properties ? doclet.properties.map(property => ({
|
||||
type: property.type ? {
|
||||
names: property.type.names,
|
||||
parsedType: property.type.parsedType
|
||||
} : property.type,
|
||||
|
||||
name: property.name,
|
||||
description: property.description,
|
||||
optional: property.optional,
|
||||
defaultvalue: property.defaultvalue
|
||||
})) : doclet.properties,
|
||||
|
||||
see: doclet.see,
|
||||
type: doclet.type ? {
|
||||
names: doclet.type.names,
|
||||
parsedType: doclet.type.parsedType
|
||||
} : doclet.type
|
||||
};
|
||||
|
||||
filteredDoclets.push(filteredDoclet);
|
||||
}
|
||||
}
|
||||
|
||||
// Replace doclets with a filtered array
|
||||
e.doclets.splice(0, e.doclets.length, ...filteredDoclets);
|
||||
}
|
||||
};
|
||||
16
scripts/sdkjs_common/jsdoc/office-api/config/forms.json
Normal file
16
scripts/sdkjs_common/jsdoc/office-api/config/forms.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"source": {
|
||||
"include": ["../../../../../sdkjs/word/apiBuilder.js", "../../../../../sdkjs-forms/apiBuilder.js"]
|
||||
},
|
||||
"plugins": ["./correct_doclets.js"],
|
||||
"opts": {
|
||||
"destination": "./out",
|
||||
"recurse": true,
|
||||
"encoding": "utf8"
|
||||
},
|
||||
"templates": {
|
||||
"json": {
|
||||
"pretty": true
|
||||
}
|
||||
}
|
||||
}
|
||||
16
scripts/sdkjs_common/jsdoc/office-api/config/pdf.json
Normal file
16
scripts/sdkjs_common/jsdoc/office-api/config/pdf.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"source": {
|
||||
"include": ["../../../../../sdkjs/word/apiBuilder.js", "../../../../../sdkjs/pdf/apiBuilder.js"]
|
||||
},
|
||||
"plugins": ["./correct_doclets.js"],
|
||||
"opts": {
|
||||
"destination": "./out",
|
||||
"recurse": true,
|
||||
"encoding": "utf8"
|
||||
},
|
||||
"templates": {
|
||||
"json": {
|
||||
"pretty": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user