mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
Compare commits
416 Commits
feature/do
...
v8.0.1.40
| Author | SHA1 | Date | |
|---|---|---|---|
| d8c2505fb8 | |||
| 02426e413f | |||
| bd05971ebb | |||
| 4e12692325 | |||
| f7ea69acc9 | |||
| 3640cea64d | |||
| f801e77208 | |||
| 2a8c5ea9eb | |||
| 181a42e344 | |||
| a0511ca3ac | |||
| 0b48f3a67f | |||
| 15727e83cc | |||
| 7d06432a76 | |||
| 761c47e26d | |||
| edc6a38dfb | |||
| 2b79e127c4 | |||
| 449875d5b8 | |||
| 0a613734f7 | |||
| ff2aa0434a | |||
| 2fa22ca2b3 | |||
| 25473c1b5c | |||
| 7c087e20b7 | |||
| 7250b59f19 | |||
| e54e7ad6ec | |||
| 4a2fd9fb72 | |||
| afd5f2b3be | |||
| 3e9b233ecb | |||
| 1f6a3010b5 | |||
| b74c359523 | |||
| 6d7e67820a | |||
| 265cac6474 | |||
| 96ff18b45c | |||
| 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 | |||
| f7bbe2d9f7 | |||
| 92760b2835 | |||
| 379718dbf9 | |||
| 787d690c41 | |||
| 32f124517a | |||
| f501a6ebac | |||
| 2f632a0f8d | |||
| 306703e677 | |||
| 256edf489c | |||
| 655837f8cd | |||
| ef43e6a9a4 | |||
| 8fa222a9b9 | |||
| 0e90989998 | |||
| dd9a8b9df5 | |||
| d758cd1e7d | |||
| ad83a772a1 | |||
| 1ad42f671a | |||
| b3ab757416 | |||
| 65571cfa06 | |||
| 4fd5d6a814 | |||
| c68c365261 | |||
| d2d7dc0717 | |||
| e50a0e84f2 |
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -3,7 +3,7 @@ name: Bug Report
|
||||
about: Report an issue with build_tools you've discovered.
|
||||
---
|
||||
|
||||
**Describe your problem**:
|
||||
# Describe your problem:
|
||||
|
||||
*Be clear in your description of the problem.
|
||||
Open an issue with a descriptive title and a summary in complete sentences.*
|
||||
|
||||
11
.github/workflows/check.yml
vendored
11
.github/workflows/check.yml
vendored
@ -3,9 +3,12 @@ name: Markdown check
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- '*.md'
|
||||
- 'develop/*.md'
|
||||
- 'scripts/**.md'
|
||||
|
||||
jobs:
|
||||
markdownlint:
|
||||
@ -14,5 +17,9 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v9
|
||||
with:
|
||||
globs: '*.md,develop/*.md'
|
||||
separator: ','
|
||||
command: config
|
||||
globs: |
|
||||
.markdownlint.jsonc
|
||||
*.md
|
||||
develop/*.md
|
||||
scripts/**.md
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@ -7,3 +7,8 @@ config
|
||||
*.*~
|
||||
**~
|
||||
*.DS_Store
|
||||
scripts/license_checker/reports
|
||||
tests/puppeteer/node_modules
|
||||
tests/puppeteer/work_directory
|
||||
tests/puppeteer/package.json
|
||||
tests/puppeteer/package-lock.json
|
||||
|
||||
5
.markdownlint.jsonc
Normal file
5
.markdownlint.jsonc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"line-length": {
|
||||
"code_block_line_length": 300
|
||||
}
|
||||
}
|
||||
192
build.pro
192
build.pro
@ -8,120 +8,142 @@ include($$PWD/common.pri)
|
||||
|
||||
CONFIG += ordered
|
||||
|
||||
core:CONFIG += core_libraries
|
||||
builder:CONFIG += core_libraries
|
||||
desktop:CONFIG += core_libraries
|
||||
server:CONFIG += core_libraries
|
||||
mobile:CONFIG += core_libraries
|
||||
|
||||
!core_libraries:CONFIG += no_x2t
|
||||
!core_libraries:CONFIG += no_use_common_binary
|
||||
!core_libraries:CONFIG += no_tests
|
||||
|
||||
core_windows {
|
||||
desktop:CONFIG += core_and_multimedia
|
||||
desktop:CONFIG += core_and_multimedia
|
||||
}
|
||||
core_linux {
|
||||
desktop:CONFIG += core_and_multimedia
|
||||
desktop:CONFIG += core_and_multimedia
|
||||
}
|
||||
core_mac {
|
||||
CONFIG += no_desktop_apps
|
||||
CONFIG += no_desktop_apps
|
||||
}
|
||||
core_ios {
|
||||
CONFIG += no_use_common_binary
|
||||
CONFIG += no_desktop_apps
|
||||
CONFIG += no_tests
|
||||
CONFIG += no_use_common_binary
|
||||
CONFIG += no_desktop_apps
|
||||
CONFIG += no_tests
|
||||
}
|
||||
core_android {
|
||||
CONFIG += no_use_common_binary
|
||||
CONFIG += no_desktop_apps
|
||||
CONFIG += no_tests
|
||||
CONFIG += no_use_common_binary
|
||||
CONFIG += no_desktop_apps
|
||||
CONFIG += no_tests
|
||||
}
|
||||
|
||||
addSubProject(cryptopp, $$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/cryptopp.pro)
|
||||
addSubProject(unicodeconverter, $$CORE_ROOT_DIR/UnicodeConverter/UnicodeConverter.pro,\
|
||||
cryptopp)
|
||||
addSubProject(kernel, $$CORE_ROOT_DIR/Common/kernel.pro,\
|
||||
unicodeconverter)
|
||||
addSubProject(network, $$CORE_ROOT_DIR/Common/Network/network.pro,\
|
||||
kernel unicodeconverter)
|
||||
addSubProject(graphics, $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/graphics.pro,\
|
||||
kernel unicodeconverter)
|
||||
addSubProject(pdffile, $$CORE_ROOT_DIR/PdfFile/PdfFile.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(djvufile, $$CORE_ROOT_DIR/DjVuFile/DjVuFile.pro,\
|
||||
kernel unicodeconverter graphics pdffile)
|
||||
addSubProject(xpsfile, $$CORE_ROOT_DIR/XpsFile/XpsFile.pro,\
|
||||
kernel unicodeconverter graphics pdffile)
|
||||
addSubProject(htmlrenderer, $$CORE_ROOT_DIR/HtmlRenderer/htmlrenderer.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(docxrenderer, $$CORE_ROOT_DIR/DocxRenderer/DocxRenderer.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(htmlfile2, $$CORE_ROOT_DIR/HtmlFile2/HtmlFile2.pro,\
|
||||
kernel unicodeconverter graphics network)
|
||||
addSubProject(doctrenderer, $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/doctrenderer.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(fb2file, $$CORE_ROOT_DIR/Fb2File/Fb2File.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(epubfile, $$CORE_ROOT_DIR/EpubFile/CEpubFile.pro,\
|
||||
kernel unicodeconverter graphics htmlfile2)
|
||||
core_libraries {
|
||||
addSubProject(cryptopp, $$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/cryptopp.pro)
|
||||
addSubProject(cfcpp, $$CORE_ROOT_DIR/Common/cfcpp/cfcpp.pro)
|
||||
addSubProject(unicodeconverter, $$CORE_ROOT_DIR/UnicodeConverter/UnicodeConverter.pro,\
|
||||
cryptopp)
|
||||
addSubProject(kernel, $$CORE_ROOT_DIR/Common/kernel.pro,\
|
||||
unicodeconverter)
|
||||
addSubProject(network, $$CORE_ROOT_DIR/Common/Network/network.pro,\
|
||||
kernel unicodeconverter)
|
||||
addSubProject(graphics, $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/graphics.pro,\
|
||||
kernel unicodeconverter)
|
||||
addSubProject(pdffile, $$CORE_ROOT_DIR/PdfFile/PdfFile.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(djvufile, $$CORE_ROOT_DIR/DjVuFile/DjVuFile.pro,\
|
||||
kernel unicodeconverter graphics pdffile)
|
||||
addSubProject(xpsfile, $$CORE_ROOT_DIR/XpsFile/XpsFile.pro,\
|
||||
kernel unicodeconverter graphics pdffile)
|
||||
addSubProject(htmlrenderer, $$CORE_ROOT_DIR/HtmlRenderer/htmlrenderer.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(docxrenderer, $$CORE_ROOT_DIR/DocxRenderer/DocxRenderer.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(htmlfile2, $$CORE_ROOT_DIR/HtmlFile2/HtmlFile2.pro,\
|
||||
kernel unicodeconverter graphics network)
|
||||
addSubProject(doctrenderer, $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/doctrenderer.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(fb2file, $$CORE_ROOT_DIR/Fb2File/Fb2File.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(epubfile, $$CORE_ROOT_DIR/EpubFile/CEpubFile.pro,\
|
||||
kernel unicodeconverter graphics htmlfile2)
|
||||
}
|
||||
!no_x2t {
|
||||
addSubProject(docxformat, $$CORE_ROOT_DIR/OOXML/Projects/Linux/DocxFormatLib/DocxFormatLib.pro)
|
||||
addSubProject(pptxformat, $$CORE_ROOT_DIR/OOXML/Projects/Linux/PPTXFormatLib/PPTXFormatLib.pro)
|
||||
addSubProject(xlsbformat, $$CORE_ROOT_DIR/OOXML/Projects/Linux/XlsbFormatLib/XlsbFormatLib.pro)
|
||||
addSubProject(docxformat, $$CORE_ROOT_DIR/OOXML/Projects/Linux/DocxFormatLib/DocxFormatLib.pro)
|
||||
addSubProject(pptxformat, $$CORE_ROOT_DIR/OOXML/Projects/Linux/PPTXFormatLib/PPTXFormatLib.pro)
|
||||
addSubProject(xlsbformat, $$CORE_ROOT_DIR/OOXML/Projects/Linux/XlsbFormatLib/XlsbFormatLib.pro)
|
||||
|
||||
addSubProject(docformat, $$CORE_ROOT_DIR/MsBinaryFile/Projects/DocFormatLib/Linux/DocFormatLib.pro)
|
||||
addSubProject(pptformat, $$CORE_ROOT_DIR/MsBinaryFile/Projects/PPTFormatLib/Linux/PPTFormatLib.pro)
|
||||
addSubProject(xlsformat, $$CORE_ROOT_DIR/MsBinaryFile/Projects/XlsFormatLib/Linux/XlsFormatLib.pro)
|
||||
addSubProject(vbaformat, $$CORE_ROOT_DIR/MsBinaryFile/Projects/VbaFormatLib/Linux/VbaFormatLib.pro)
|
||||
addSubProject(docformat, $$CORE_ROOT_DIR/MsBinaryFile/Projects/DocFormatLib/Linux/DocFormatLib.pro)
|
||||
addSubProject(pptformat, $$CORE_ROOT_DIR/MsBinaryFile/Projects/PPTFormatLib/Linux/PPTFormatLib.pro)
|
||||
addSubProject(xlsformat, $$CORE_ROOT_DIR/MsBinaryFile/Projects/XlsFormatLib/Linux/XlsFormatLib.pro)
|
||||
addSubProject(vbaformat, $$CORE_ROOT_DIR/MsBinaryFile/Projects/VbaFormatLib/Linux/VbaFormatLib.pro)
|
||||
|
||||
addSubProject(txtxmlformat, $$CORE_ROOT_DIR/TxtFile/Projects/Linux/TxtXmlFormatLib.pro)
|
||||
addSubProject(rtfformat, $$CORE_ROOT_DIR/RtfFile/Projects/Linux/RtfFormatLib.pro)
|
||||
addSubProject(odffile, $$CORE_ROOT_DIR/OdfFile/Projects/Linux/OdfFormatLib.pro)
|
||||
|
||||
addSubProject(cfcpp, $$CORE_ROOT_DIR/Common/cfcpp/cfcpp.pro)
|
||||
addSubProject(bindocument, $$CORE_ROOT_DIR/OOXML/Projects/Linux/BinDocument/BinDocument.pro)
|
||||
addSubProject(txtxmlformat, $$CORE_ROOT_DIR/TxtFile/Projects/Linux/TxtXmlFormatLib.pro)
|
||||
addSubProject(rtfformat, $$CORE_ROOT_DIR/RtfFile/Projects/Linux/RtfFormatLib.pro)
|
||||
addSubProject(odffile, $$CORE_ROOT_DIR/OdfFile/Projects/Linux/OdfFormatLib.pro)
|
||||
|
||||
addSubProject(bindocument, $$CORE_ROOT_DIR/OOXML/Projects/Linux/BinDocument/BinDocument.pro)
|
||||
|
||||
addSubProject(x2t, $$CORE_ROOT_DIR/X2tConverter/build/Qt/X2tConverter.pro,\
|
||||
docxformat pptxformat xlsbformat docformat pptformat xlsformat vbaformat txtxmlformat rtfformat odffile cfcpp bindocument fb2file epubfile docxrenderer)
|
||||
addSubProject(x2t, $$CORE_ROOT_DIR/X2tConverter/build/Qt/X2tConverter.pro,\
|
||||
docxformat pptxformat xlsbformat docformat pptformat xlsformat vbaformat txtxmlformat rtfformat odffile cfcpp bindocument fb2file epubfile docxrenderer)
|
||||
}
|
||||
|
||||
!no_use_common_binary {
|
||||
addSubProject(allfontsgen, $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/AllFontsGen.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(allthemesgen, $$CORE_ROOT_DIR/DesktopEditor/allthemesgen/allthemesgen.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(docbuilder, $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/docbuilder.pro,\
|
||||
kernel unicodeconverter graphics doctrenderer)
|
||||
addSubProject(allfontsgen, $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/AllFontsGen.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(allthemesgen, $$CORE_ROOT_DIR/DesktopEditor/allthemesgen/allthemesgen.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(docbuilder, $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/docbuilder.pro,\
|
||||
kernel unicodeconverter graphics doctrenderer)
|
||||
addSubProject(pluginsmanager, $$CORE_ROOT_DIR/DesktopEditor/pluginsmanager/pluginsmanager.pro,\
|
||||
kernel)
|
||||
addSubProject(vboxtester, $$CORE_ROOT_DIR/DesktopEditor/vboxtester/vboxtester.pro,\
|
||||
kernel)
|
||||
}
|
||||
|
||||
!no_tests {
|
||||
addSubProject(standardtester, $$CORE_ROOT_DIR/Test/Applications/StandardTester/standardtester.pro)
|
||||
addSubProject(x2ttester, $$CORE_ROOT_DIR/Test/Applications/x2tTester/x2ttester.pro)
|
||||
addSubProject(standardtester, $$CORE_ROOT_DIR/Test/Applications/StandardTester/standardtester.pro)
|
||||
addSubProject(x2ttester, $$CORE_ROOT_DIR/Test/Applications/x2tTester/x2ttester.pro)
|
||||
addSubProject(metafiletester, $$CORE_ROOT_DIR/Test/Applications/MetafileTester/MetafileTester.pro)
|
||||
|
||||
#TODO:
|
||||
!linux_arm64:addSubProject(ooxml_crypt, $$CORE_ROOT_DIR/OfficeCryptReader/ooxml_crypt/ooxml_crypt.pro)
|
||||
#TODO:
|
||||
!linux_arm64:addSubProject(ooxml_crypt, $$CORE_ROOT_DIR/OfficeCryptReader/ooxml_crypt/ooxml_crypt.pro)
|
||||
}
|
||||
|
||||
core_and_multimedia {
|
||||
addSubProject(videoplayer, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/videoplayerlib.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(videoplayer, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/videoplayerlib.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
}
|
||||
desktop {
|
||||
message(desktop)
|
||||
addSubProject(hunspell, $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro)
|
||||
addSubProject(ooxmlsignature, $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/ooxmlsignature.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(documentscore, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore.pro,\
|
||||
kernel unicodeconverter graphics hunspell ooxmlsignature htmlrenderer pdffile djvufile xpsfile)
|
||||
addSubProject(documentscore_helper, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore_helper.pro,\
|
||||
documentscore)
|
||||
!core_mac {
|
||||
addSubProject(qtdocumentscore, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/qtascdocumentscore.pro,\
|
||||
documentscore)
|
||||
}
|
||||
message(desktop)
|
||||
addSubProject(hunspell, $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro)
|
||||
addSubProject(ooxmlsignature, $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/ooxmlsignature.pro,\
|
||||
kernel unicodeconverter graphics)
|
||||
addSubProject(documentscore, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore.pro,\
|
||||
kernel unicodeconverter graphics hunspell ooxmlsignature htmlrenderer pdffile djvufile xpsfile)
|
||||
addSubProject(documentscore_helper, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore_helper.pro,\
|
||||
documentscore)
|
||||
!core_mac {
|
||||
addSubProject(qtdocumentscore, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/qtascdocumentscore.pro,\
|
||||
documentscore)
|
||||
}
|
||||
|
||||
!no_desktop_apps {
|
||||
core_windows:addSubProject(projicons, $$ROOT_DIR/desktop-apps/win-linux/extras/projicons/ProjIcons.pro,\
|
||||
documentscore videoplayer)
|
||||
addSubProject(desktopapp, $$ROOT_DIR/desktop-apps/win-linux/ASCDocumentEditor.pro,\
|
||||
documentscore videoplayer)
|
||||
}
|
||||
!no_desktop_apps {
|
||||
core_windows:addSubProject(projicons, $$ROOT_DIR/desktop-apps/win-linux/extras/projicons/ProjIcons.pro,\
|
||||
documentscore videoplayer)
|
||||
core_windows:!build_xp:addSubProject(updatedaemon, $$ROOT_DIR/desktop-apps/win-linux/extras/update-daemon/UpdateDaemon.pro)
|
||||
addSubProject(desktopapp, $$ROOT_DIR/desktop-apps/win-linux/ASCDocumentEditor.pro,\
|
||||
documentscore videoplayer)
|
||||
}
|
||||
}
|
||||
|
||||
mobile {
|
||||
message(mobile)
|
||||
!desktop {
|
||||
addSubProject(hunspell, $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro)
|
||||
}
|
||||
message(mobile)
|
||||
!desktop {
|
||||
addSubProject(hunspell, $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro)
|
||||
}
|
||||
}
|
||||
|
||||
osign {
|
||||
addSubProject(osign, $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/osign/lib/osign.pro)
|
||||
}
|
||||
|
||||
4
defaults
4
defaults
@ -1,3 +1,3 @@
|
||||
sdkjs-plugin="photoeditor, macros, ocr, translator, thesaurus, youtube, highlightcode"
|
||||
sdkjs-plugin-server="speech, zotero, mendeley"
|
||||
sdkjs-plugin="photoeditor, macros, ocr, translator, thesaurus, youtube, highlightcode, zotero"
|
||||
sdkjs-plugin-server="speech, zotero, mendeley, speechrecognition, drawio"
|
||||
sdkjs-addons="sdkjs-forms"
|
||||
|
||||
@ -3,11 +3,17 @@ RUN apt-get update -y && \
|
||||
apt-get install git -y \
|
||||
python3 -y \
|
||||
openjdk-11-jdk -y \
|
||||
bzip2 -y \
|
||||
npm -y && \
|
||||
npm install -g grunt-cli -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
|
||||
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
|
||||
|
||||
@ -1,50 +1,219 @@
|
||||
# Docker
|
||||
|
||||
This directory containing instruction for developers,
|
||||
who want to change something in sdkjs or web-apps module,
|
||||
who want to change something in sdkjs or web-apps or server module,
|
||||
but don't want to compile pretty compilcated core product to make those changes.
|
||||
|
||||
## Installing ONLYOFFICE Docs
|
||||
## System requirements
|
||||
|
||||
## How to use - Linux or macOS
|
||||
### Windows
|
||||
|
||||
**Note**: You need the latest Docker version installed.
|
||||
You need the latest
|
||||
[Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
|
||||
installed.
|
||||
|
||||
You might need to pull **onlyoffice/documentserver** image:
|
||||
**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 develop Docker Images
|
||||
|
||||
To create a image with the ability to include external non-minified sdkjs code,
|
||||
use the following commands:
|
||||
|
||||
### Clone development environment to work dir
|
||||
|
||||
```bash
|
||||
git clone https://github.com/ONLYOFFICE/build_tools.git
|
||||
```
|
||||
|
||||
### Modify Docker Images
|
||||
|
||||
**Note**: Do not prefix docker command with sudo.
|
||||
[This](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
|
||||
instruction show how to use docker without sudo.
|
||||
|
||||
```bash
|
||||
docker pull onlyoffice/documentserver
|
||||
```
|
||||
|
||||
### Create develop image
|
||||
|
||||
To create a image with the ability to include external non-minified sdkjs code,
|
||||
use the following command:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/ONLYOFFICE/build_tools.git
|
||||
cd build_tools/develop
|
||||
docker pull onlyoffice/documentserver
|
||||
docker build -t documentserver-develop .
|
||||
```
|
||||
|
||||
**Note**: The dot at the end is required.
|
||||
|
||||
### Connecting external folders
|
||||
**Note**: Sometimes script may fail due to network errors. Just restart it.
|
||||
|
||||
To connect 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
|
||||
## Clone development modules
|
||||
|
||||
Clone development modules to the work dir
|
||||
|
||||
* `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
|
||||
docker run -i -t -d -p 80:80 --restart=always \
|
||||
-v /host-dir/sdkjs:/var/www/onlyoffice/documentserver/sdkjs \
|
||||
-v /host-dir/web-apps:/var/www/onlyoffice/documentserver/web-apps documentserver-develop
|
||||
cd ../..
|
||||
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 folders `server` is optional
|
||||
|
||||
**Note**: ONLYOFFICE server uses port 80.
|
||||
Look for another application using port 80 and stop it
|
||||
|
||||
**Note**: Server start with `sdkjs` and `web-apps` takes 15 minutes
|
||||
and takes 20 minutes with `server`
|
||||
|
||||
**Note**: Run command from work dir with development modules
|
||||
|
||||
### docker run on Windows (PowerShell)
|
||||
|
||||
**Note**: Run PowerShell as administrator to fix EACCES error when installing
|
||||
node_modules
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
### 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
|
||||
|
||||
```bash
|
||||
[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 localhost page.
|
||||
It may block some scripts (like Analytics.js)
|
||||
|
||||
## Modify sources
|
||||
|
||||
### To change something in `sdkjs` do the following steps
|
||||
|
||||
1)Edit source file. Let's insert an image url into each open document.
|
||||
Following command inserts (in case of problems, you can replace URL)
|
||||
`this.AddImageUrl(['http://localhost/example/images/logo.png']);`
|
||||
after event
|
||||
`this.sendEvent('asc_onDocumentContentReady');`
|
||||
in file
|
||||
`sdkjs/common/apiBase.js`
|
||||
|
||||
### change sdkjs on Windows (PowerShell)
|
||||
|
||||
```bash
|
||||
(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
|
||||
```
|
||||
|
||||
### change sdkjs on Linux or 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)Delete browser cache or hard reload the page `Ctrl + Shift + R`
|
||||
|
||||
3)Open new file in browser
|
||||
|
||||
### To change something in `server` do the following steps
|
||||
|
||||
1)Edit source file. Let's send `"Hello World!"`
|
||||
chart message every time a document is opened.
|
||||
Following command inserts
|
||||
`yield* onMessage(ctx, conn, {"message": "Hello World!"});`
|
||||
in function
|
||||
`sendAuthInfo`
|
||||
in file
|
||||
`server/DocService/sources/DocsCoServer.js`
|
||||
|
||||
### change server on Windows (PowerShell)
|
||||
|
||||
```bash
|
||||
(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
|
||||
```
|
||||
|
||||
### change server on Linux or 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 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 new file in 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
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
### 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
|
||||
```
|
||||
|
||||
@ -2,11 +2,56 @@
|
||||
|
||||
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
|
||||
|
||||
base.cmd_in_dir(sys.argv[1] + '/build_tools/', 'python3', ['configure.py'])
|
||||
config.parse()
|
||||
git_dir = sys.argv[1];
|
||||
|
||||
build_js.build_js_develop(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)
|
||||
|
||||
12
make.py
12
make.py
@ -33,7 +33,7 @@ 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")], True)
|
||||
|
||||
@ -71,16 +71,12 @@ make_common.make()
|
||||
|
||||
# build updmodule for desktop (only for windows version)
|
||||
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') + "-1/apps")
|
||||
config.extend_option("qmake_addon", "URL_WEBAPPS_HELP=https://download.onlyoffice.com/install/desktop/editors/help/v" + base.get_env('PRODUCT_VERSION') + "/apps")
|
||||
|
||||
if "windows" == base.host_platform():
|
||||
config.extend_option("config", "updmodule")
|
||||
config.extend_option("qmake_addon", "LINK=https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.json")
|
||||
|
||||
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
base.set_env("VIDEO_PLAYER_VLC_DIR", base_dir + "/../desktop-sdk/ChromiumBasedEditors/videoplayerlib/vlc")
|
||||
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()
|
||||
|
||||
@ -22,23 +22,24 @@ parser.add_argument("-B", "--build", dest="build", type=str,
|
||||
args = parser.parse_args()
|
||||
|
||||
# vars
|
||||
common.workspace_dir = utils.get_abspath(utils.get_script_dir(__file__) + "/..")
|
||||
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
|
||||
common.version = args.version if (args.version is not None) else utils.get_env("PRODUCT_VERSION", "1.0.0")
|
||||
common.build = args.build if (args.build is not None) else utils.get_env("BUILD_NUMBER", "1")
|
||||
common.channel = utils.get_env("BUILD_CHANNEL", "other")
|
||||
common.version = args.version if args.version else utils.get_env("BUILD_VERSION", "0.0.0")
|
||||
common.build = args.build if args.build else utils.get_env("BUILD_NUMBER", "0")
|
||||
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.deploy_data = utils.get_path(common.workspace_dir + "/deploy.txt")
|
||||
common.summary = []
|
||||
common.deploy_data = []
|
||||
utils.log("workspace_dir: " + common.workspace_dir)
|
||||
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))
|
||||
@ -47,6 +48,8 @@ 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:
|
||||
@ -61,18 +64,22 @@ import package_mobile
|
||||
|
||||
# build
|
||||
utils.set_cwd(common.workspace_dir, verbose=True)
|
||||
utils.delete_file("deploy.json")
|
||||
utils.delete_file(common.deploy_data)
|
||||
if "core" in common.targets:
|
||||
package_core.make()
|
||||
if "closuremaps_opensource" in common.targets:
|
||||
package_core.deploy_closuremaps("opensource")
|
||||
if "closuremaps_commercial" in common.targets:
|
||||
package_core.deploy_closuremaps("commercial")
|
||||
if "desktop" in common.targets:
|
||||
package_desktop.make()
|
||||
if "builder" in common.targets:
|
||||
package_builder.make()
|
||||
if "server-community" in common.targets:
|
||||
if "server_community" in common.targets:
|
||||
package_server.make("community")
|
||||
if "server-enterprise" in common.targets:
|
||||
if "server_enterprise" in common.targets:
|
||||
package_server.make("enterprise")
|
||||
if "server-developer" in common.targets:
|
||||
if "server_developer" in common.targets:
|
||||
package_server.make("developer")
|
||||
if "mobile" in common.targets:
|
||||
package_mobile.make()
|
||||
|
||||
448
scripts/base.py
448
scripts/base.py
@ -12,6 +12,9 @@ import config
|
||||
import codecs
|
||||
import re
|
||||
import stat
|
||||
import json
|
||||
|
||||
__file__script__path__ = os.path.dirname( os.path.realpath(__file__))
|
||||
|
||||
# common functions --------------------------------------
|
||||
def get_script_dir(file=""):
|
||||
@ -187,28 +190,56 @@ def copy_dir(src, dst):
|
||||
if is_dir(dst):
|
||||
delete_dir(dst)
|
||||
try:
|
||||
shutil.copytree(get_path(src), get_path(dst))
|
||||
except OSError as e:
|
||||
print('Directory not copied. Error: %s' % e)
|
||||
shutil.copytree(get_path(src), get_path(dst))
|
||||
except:
|
||||
if ("windows" == host_platform()) and copy_dir_windows(src, dst):
|
||||
return
|
||||
print("Directory not copied")
|
||||
return
|
||||
|
||||
def copy_dir_windows(src, dst):
|
||||
if is_dir(dst):
|
||||
delete_dir(dst)
|
||||
err = cmd("robocopy", [get_path(src), get_path(dst), "/e", "/NFL", "/NDL", "/NJH", "/NJS", "/nc", "/ns", "/np"], True)
|
||||
if (1 == err):
|
||||
return True
|
||||
return False
|
||||
|
||||
def delete_dir_with_access_error(path):
|
||||
def delete_file_on_error(func, path, exc_info):
|
||||
if not os.access(path, os.W_OK):
|
||||
os.chmod(path, stat.S_IWUSR)
|
||||
func(path)
|
||||
if ("windows" != host_platform()):
|
||||
if not os.access(path, os.W_OK):
|
||||
os.chmod(path, stat.S_IWUSR)
|
||||
func(path)
|
||||
return
|
||||
elif (0 != path.find("\\\\?\\")):
|
||||
# abspath not work with long names
|
||||
full_path = path
|
||||
drive_pos = full_path.find(":")
|
||||
if (drive_pos < 0) or (drive_pos > 2):
|
||||
full_path = os.getcwd() + "\\" + full_path
|
||||
else:
|
||||
full_path = full_path
|
||||
if (len(full_path) >= 260):
|
||||
full_path = "\\\\?\\" + full_path
|
||||
if not os.access(full_path, os.W_OK):
|
||||
os.chmod(full_path, stat.S_IWUSR)
|
||||
func(full_path)
|
||||
return
|
||||
if not is_dir(path):
|
||||
print("delete warning [folder not exist]: " + path)
|
||||
return
|
||||
shutil.rmtree(get_path(path), ignore_errors=False, onerror=delete_file_on_error)
|
||||
shutil.rmtree(os.path.normpath(get_path(path)), ignore_errors=False, onerror=delete_file_on_error)
|
||||
return
|
||||
|
||||
def delete_dir(path):
|
||||
if not is_dir(path):
|
||||
print("delete warning [folder not exist]: " + path)
|
||||
return
|
||||
shutil.rmtree(get_path(path), ignore_errors=True)
|
||||
if ("windows" == host_platform()):
|
||||
delete_dir_with_access_error(path)
|
||||
else:
|
||||
shutil.rmtree(get_path(path), ignore_errors=True)
|
||||
return
|
||||
|
||||
def copy_lib(src, dst, name):
|
||||
@ -261,44 +292,66 @@ def copy_exe(src, dst, name):
|
||||
copy_file(src + "/" + name + exe_ext, dst + "/" + name + exe_ext)
|
||||
return
|
||||
|
||||
def readFileCommon(path):
|
||||
file_data = ""
|
||||
try:
|
||||
with open(get_path(path), "r") as file:
|
||||
file_data = file.read()
|
||||
except Exception as e:
|
||||
with open(get_path(path), "r", encoding="utf-8") as file:
|
||||
file_data = file.read()
|
||||
return file_data
|
||||
|
||||
def writeFileCommon(path, data):
|
||||
file_data = ""
|
||||
try:
|
||||
with open(get_path(path), "w") as file:
|
||||
file.write(data)
|
||||
except Exception as e:
|
||||
with open(get_path(path), "w", encoding="utf-8") as file:
|
||||
file.write(data)
|
||||
return
|
||||
|
||||
def replaceInFile(path, text, textReplace):
|
||||
if not is_file(path):
|
||||
print("[replaceInFile] file not exist: " + path)
|
||||
return
|
||||
filedata = ""
|
||||
with open(get_path(path), "r") as file:
|
||||
filedata = file.read()
|
||||
filedata = readFileCommon(path)
|
||||
filedata = filedata.replace(text, textReplace)
|
||||
delete_file(path)
|
||||
with open(get_path(path), "w") as file:
|
||||
file.write(filedata)
|
||||
writeFileCommon(path, filedata)
|
||||
return
|
||||
def replaceInFileUtf8(path, text, textReplace):
|
||||
if not is_file(path):
|
||||
print("[replaceInFile] file not exist: " + path)
|
||||
return
|
||||
filedata = ""
|
||||
with open(get_path(path), "rb") as file:
|
||||
filedata = file.read().decode("UTF-8")
|
||||
filedata = filedata.replace(text, textReplace)
|
||||
delete_file(path)
|
||||
with open(get_path(path), "wb") as file:
|
||||
file.write(filedata.encode("UTF-8"))
|
||||
return
|
||||
def replaceInFileRE(path, pattern, textReplace):
|
||||
if not is_file(path):
|
||||
print("[replaceInFile] file not exist: " + path)
|
||||
return
|
||||
filedata = ""
|
||||
with open(get_path(path), "r") as file:
|
||||
filedata = file.read()
|
||||
filedata = readFileCommon(path)
|
||||
filedata = re.sub(pattern, textReplace, filedata)
|
||||
delete_file(path)
|
||||
with open(get_path(path), "w") as file:
|
||||
file.write(filedata)
|
||||
writeFileCommon(path, filedata)
|
||||
return
|
||||
|
||||
def readFile(path):
|
||||
if not is_file(path):
|
||||
return ""
|
||||
filedata = ""
|
||||
with open(get_path(path), "r") as file:
|
||||
filedata = file.read()
|
||||
return filedata
|
||||
return readFileCommon(path)
|
||||
|
||||
def writeFile(path, data):
|
||||
if is_file(path):
|
||||
delete_file(path)
|
||||
with open(get_path(path), "w") as file:
|
||||
file.write(data)
|
||||
writeFileCommon(path, data)
|
||||
return
|
||||
|
||||
# system cmd methods ------------------------------------
|
||||
@ -440,9 +493,10 @@ def set_cwd(dir):
|
||||
return
|
||||
|
||||
# git ---------------------------------------------------
|
||||
def git_update(repo, is_no_errors=False, is_current_dir=False):
|
||||
def git_update(repo, is_no_errors=False, is_current_dir=False, git_owner=""):
|
||||
print("[git] update: " + repo)
|
||||
url = "https://github.com/ONLYOFFICE/" + repo + ".git"
|
||||
owner = git_owner if git_owner else "ONLYOFFICE"
|
||||
url = "https://github.com/" + owner + "/" + repo + ".git"
|
||||
if config.option("git-protocol") == "ssh":
|
||||
url = "git@github.com:ONLYOFFICE/" + repo + ".git"
|
||||
folder = get_script_dir() + "/../../" + repo
|
||||
@ -479,6 +533,7 @@ def get_repositories():
|
||||
result["web-apps"] = [False, False]
|
||||
result.update(get_web_apps_addons())
|
||||
result["dictionaries"] = [False, False]
|
||||
result["core-fonts"] = [False, False]
|
||||
|
||||
if config.check_option("module", "builder"):
|
||||
result["document-templates"] = [False, False]
|
||||
@ -493,9 +548,6 @@ def get_repositories():
|
||||
result.update(get_server_addons())
|
||||
result["document-server-integration"] = [False, False]
|
||||
result["document-templates"] = [False, False]
|
||||
|
||||
if (config.check_option("module", "server") or config.check_option("platform", "ios")):
|
||||
result["core-fonts"] = [False, False]
|
||||
|
||||
get_branding_repositories(result)
|
||||
return result
|
||||
@ -592,6 +644,20 @@ def get_gcc_version():
|
||||
def qt_setup(platform):
|
||||
compiler = config.check_compiler(platform)
|
||||
qt_dir = config.option("qt-dir") if (-1 == platform.find("_xp")) else config.option("qt-dir-xp")
|
||||
|
||||
# qt bug
|
||||
if (host_platform() == "mac"):
|
||||
for compiler_folder in glob.glob(qt_dir + "/*"):
|
||||
if is_dir(compiler_folder):
|
||||
old_path_file = compiler_folder + "/mkspecs/features/toolchain.prf"
|
||||
new_path_file = compiler_folder + "/mkspecs/features/toolchain.prf.bak"
|
||||
if (is_file(old_path_file) and not is_file(new_path_file)):
|
||||
try:
|
||||
copy_file(old_path_file, new_path_file)
|
||||
copy_file(get_script_dir() + "/../tools/mac/toolchain.prf", old_path_file)
|
||||
except IOError as e:
|
||||
print("Unable to copy file: " + old_path_file)
|
||||
|
||||
compiler_platform = compiler["compiler"] if platform_is_32(platform) else compiler["compiler_64"]
|
||||
qt_dir = qt_dir + "/" + compiler_platform
|
||||
|
||||
@ -616,6 +682,37 @@ def qt_version():
|
||||
qt_dir = qt_dir.split("/")[-3]
|
||||
return "".join(i for i in qt_dir if (i.isdigit() or i == "."))
|
||||
|
||||
def check_congig_option_with_platfom(platform, option_name):
|
||||
if config.check_option("config", option_name):
|
||||
return True
|
||||
if (0 == platform.find("win")) and config.check_option("config_addon_windows", option_name):
|
||||
return True
|
||||
elif (0 == platform.find("linux")) and config.check_option("config_addon_linux", option_name):
|
||||
return True
|
||||
elif (0 == platform.find("mac")) and config.check_option("config_addon_macos", option_name):
|
||||
return True
|
||||
elif (0 == platform.find("ios")) and config.check_option("config_addon_ios", option_name):
|
||||
return True
|
||||
elif (0 == platform.find("android")) and config.check_option("config_addon_android", option_name):
|
||||
return True
|
||||
return False
|
||||
|
||||
def qt_config_platform_addon(platform):
|
||||
config_addon = ""
|
||||
if (0 == platform.find("win")):
|
||||
config_addon += (" " + config.option("config_addon_windows"))
|
||||
elif (0 == platform.find("linux")):
|
||||
config_addon += (" " + config.option("config_addon_linux"))
|
||||
elif (0 == platform.find("mac")):
|
||||
config_addon += (" " + config.option("config_addon_macos"))
|
||||
elif (0 == platform.find("ios")):
|
||||
config_addon += (" " + config.option("config_addon_ios"))
|
||||
elif (0 == platform.find("android")):
|
||||
config_addon += (" " + config.option("config_addon_android"))
|
||||
if (config_addon == " "):
|
||||
config_addon = ""
|
||||
return config_addon
|
||||
|
||||
def qt_config(platform):
|
||||
config_param = config.option("module") + " " + config.option("config") + " " + config.option("features")
|
||||
config_param_lower = config_param.lower()
|
||||
@ -633,14 +730,21 @@ def qt_config(platform):
|
||||
if config.check_option("module", "mobile"):
|
||||
config_param += " support_web_socket"
|
||||
|
||||
is_disable_pch = False
|
||||
if ("ios" == platform):
|
||||
config_param += " disable_precompiled_header"
|
||||
is_disable_pch = True
|
||||
if (0 == platform.find("android")):
|
||||
is_disable_pch = True
|
||||
if not config.check_option("config", "debug"):
|
||||
is_disable_pch = True
|
||||
|
||||
if is_disable_pch:
|
||||
config_param += " disable_precompiled_header"
|
||||
|
||||
if ("linux_arm64" == platform):
|
||||
config_param += " linux_arm64"
|
||||
|
||||
config_param += qt_config_platform_addon(platform)
|
||||
return config_param
|
||||
|
||||
def qt_major_version():
|
||||
@ -737,7 +841,7 @@ def app_make():
|
||||
return "make"
|
||||
|
||||
# doctrenderer.config
|
||||
def generate_doctrenderer_config(path, root, product, vendor = ""):
|
||||
def generate_doctrenderer_config(path, root, product, vendor = "", dictionaries = ""):
|
||||
content = "<Settings>\n"
|
||||
|
||||
content += ("<file>" + root + "sdkjs/common/Native/native.js</file>\n")
|
||||
@ -756,6 +860,9 @@ def generate_doctrenderer_config(path, root, product, vendor = ""):
|
||||
content += ("<file>" + vendor_dir + "xregexp/xregexp-all-min.js</file>\n")
|
||||
content += ("<sdkjs>" + root + "sdkjs</sdkjs>\n")
|
||||
|
||||
if ("" != dictionaries):
|
||||
content += ("<dictionaries>" + dictionaries + "</dictionaries>\n")
|
||||
|
||||
if (False): # old html file
|
||||
content += ("<htmlfile>" + vendor_dir + "jquery/jquery.min.js</htmlfile>\n")
|
||||
if ("desktop" == product):
|
||||
@ -769,7 +876,7 @@ def generate_doctrenderer_config(path, root, product, vendor = ""):
|
||||
file.close()
|
||||
return
|
||||
|
||||
def generate_plist(path):
|
||||
def generate_plist_framework_folder(file):
|
||||
bundle_id_url = "com.onlyoffice."
|
||||
if ("" != get_env("PUBLISHER_BUNDLE_ID")):
|
||||
bundle_id_url = get_env("PUBLISHER_BUNDLE_ID")
|
||||
@ -782,43 +889,52 @@ def generate_plist(path):
|
||||
for n in bundle_version_natural:
|
||||
bundle_version.append(n)
|
||||
|
||||
for file in glob.glob(path + '/**/*.framework', recursive=True):
|
||||
if not is_dir(file):
|
||||
continue
|
||||
name = os.path.basename(file)
|
||||
name = name.replace(".framework", "")
|
||||
name = os.path.basename(file)
|
||||
name = name.replace(".framework", "")
|
||||
|
||||
content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
content += "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
content += "<plist version=\"1.0\">\n"
|
||||
content += "<dict>\n"
|
||||
content += "\t<key>CFBundleExecutable</key>\n"
|
||||
content += ("\t<string>" + name + "</string>\n")
|
||||
content += "\t<key>CFBundleGetInfoString</key>\n"
|
||||
content += "\t<string>Created by " + bundle_creator + "</string>\n"
|
||||
content += "\t<key>CFBundleIdentifier</key>\n"
|
||||
content += "\t<string>" + bundle_id_url + correct_bundle_identifier(name) + "</string>\n"
|
||||
content += "\t<key>CFBundlePackageType</key>\n"
|
||||
content += "\t<string>FMWK</string>\n"
|
||||
content += "\t<key>CFBundleShortVersionString</key>\n"
|
||||
content += "\t<string>" + bundle_version[0] + "." + bundle_version[1] + "</string>\n"
|
||||
content += "\t<key>CFBundleSignature</key>\n"
|
||||
content += "\t<string>????</string>\n"
|
||||
content += "\t<key>CFBundleVersion</key>\n"
|
||||
content += "\t<string>" + bundle_version[0] + "." + bundle_version[1] + "." + bundle_version[2] + "</string>\n"
|
||||
content += "\t<key>MinimumOSVersion</key>\n"
|
||||
content += "\t<string>13.0</string>\n"
|
||||
content += "</dict>\n"
|
||||
content += "</plist>"
|
||||
content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
content += "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
content += "<plist version=\"1.0\">\n"
|
||||
content += "<dict>\n"
|
||||
content += "\t<key>CFBundleExecutable</key>\n"
|
||||
content += ("\t<string>" + name + "</string>\n")
|
||||
content += "\t<key>CFBundleGetInfoString</key>\n"
|
||||
content += "\t<string>Created by " + bundle_creator + "</string>\n"
|
||||
content += "\t<key>CFBundleIdentifier</key>\n"
|
||||
content += "\t<string>" + bundle_id_url + correct_bundle_identifier(name) + "</string>\n"
|
||||
content += "\t<key>CFBundlePackageType</key>\n"
|
||||
content += "\t<string>FMWK</string>\n"
|
||||
content += "\t<key>CFBundleShortVersionString</key>\n"
|
||||
content += "\t<string>" + bundle_version[0] + "." + bundle_version[1] + "</string>\n"
|
||||
content += "\t<key>CFBundleSignature</key>\n"
|
||||
content += "\t<string>????</string>\n"
|
||||
content += "\t<key>CFBundleVersion</key>\n"
|
||||
content += "\t<string>" + bundle_version[0] + "." + bundle_version[1] + "." + bundle_version[2] + "</string>\n"
|
||||
content += "\t<key>MinimumOSVersion</key>\n"
|
||||
content += "\t<string>13.0</string>\n"
|
||||
content += "</dict>\n"
|
||||
content += "</plist>"
|
||||
|
||||
fileDst = file + "/Info.plist"
|
||||
if is_file(fileDst):
|
||||
delete_file(fileDst)
|
||||
fileDst = file + "/Info.plist"
|
||||
if is_file(fileDst):
|
||||
delete_file(fileDst)
|
||||
|
||||
fileInfo = codecs.open(fileDst, "w", "utf-8")
|
||||
fileInfo.write(content)
|
||||
fileInfo.close()
|
||||
|
||||
fileInfo = codecs.open(fileDst, "w", "utf-8")
|
||||
fileInfo.write(content)
|
||||
fileInfo.close()
|
||||
return
|
||||
|
||||
def generate_plist(path):
|
||||
src_folder = path
|
||||
if ("/" != path[-1:]):
|
||||
src_folder += "/"
|
||||
src_folder += "*"
|
||||
for file in glob.glob(src_folder):
|
||||
if (is_dir(file)):
|
||||
if file.endswith(".framework"):
|
||||
generate_plist_framework_folder(file)
|
||||
else:
|
||||
generate_plist(file)
|
||||
return
|
||||
|
||||
def correct_bundle_identifier(bundle_identifier):
|
||||
@ -1057,6 +1173,14 @@ def mac_correct_rpath_x2t(dir):
|
||||
cmd("chmod", ["-v", "+x", "./allthemesgen"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./allthemesgen"], True)
|
||||
mac_correct_rpath_binary("./allthemesgen", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "graphics", "kernel_network", "doctrenderer"])
|
||||
if is_file("./pluginsmanager"):
|
||||
cmd("chmod", ["-v", "+x", "./pluginsmanager"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./pluginsmanager"], True)
|
||||
mac_correct_rpath_binary("./pluginsmanager", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network"])
|
||||
if is_file("./vboxtester"):
|
||||
cmd("chmod", ["-v", "+x", "./vboxtester"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./vboxtester"], True)
|
||||
mac_correct_rpath_binary("./vboxtester", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network"])
|
||||
os.chdir(cur_dir)
|
||||
return
|
||||
|
||||
@ -1141,15 +1265,47 @@ def copy_sdkjs_plugin(src_dir, dst_dir, name, is_name_as_guid=False, is_desktop_
|
||||
if is_dir(dst_dir_path):
|
||||
delete_dir(dst_dir_path)
|
||||
create_dir(dst_dir_path)
|
||||
copy_dir_content(src_dir_path, dst_dir + "/" + guid, "", ".git")
|
||||
copy_dir_content(src_dir_path, dst_dir_path, "", ".git")
|
||||
if is_desktop_local:
|
||||
for file in glob.glob(dst_dir + "/" + guid + "/*.html"):
|
||||
for file in glob.glob(dst_dir_path + "/*.html"):
|
||||
replaceInFile(file, "https://onlyoffice.github.io/sdkjs-plugins/", "../")
|
||||
dst_deploy_dir = dst_dir_path + "/deploy"
|
||||
if is_dir(dst_deploy_dir):
|
||||
delete_dir(dst_deploy_dir)
|
||||
return
|
||||
|
||||
def copy_sdkjs_plugins(dst_dir, is_name_as_guid=False, is_desktop_local=False):
|
||||
plugins_dir = get_script_dir() + "/../../onlyoffice.github.io/sdkjs-plugins/content"
|
||||
def copy_marketplace_plugin(dst_dir, is_name_as_guid=False, is_desktop_local=False, is_store_copy=False):
|
||||
git_dir = __file__script__path__ + "/../.."
|
||||
if False:
|
||||
# old version
|
||||
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", dst_dir, "manager", is_name_as_guid, is_desktop_local)
|
||||
return
|
||||
src_dir_path = git_dir + "/onlyoffice.github.io/store/plugin"
|
||||
name = "marketplace"
|
||||
if is_name_as_guid:
|
||||
name = "{AA2EA9B6-9EC2-415F-9762-634EE8D9A95E}"
|
||||
|
||||
dst_dir_path = dst_dir + "/" + name
|
||||
if is_dir(dst_dir_path):
|
||||
delete_dir(dst_dir_path)
|
||||
create_dir(dst_dir_path)
|
||||
|
||||
copy_dir_content(src_dir_path, dst_dir_path)
|
||||
if is_desktop_local:
|
||||
for file in glob.glob(dst_dir_path + "/*.html"):
|
||||
replaceInFile(file, "https://onlyoffice.github.io/sdkjs-plugins/", "../")
|
||||
|
||||
if is_store_copy:
|
||||
copy_dir(git_dir + "/onlyoffice.github.io/store", dst_dir_path + "/store")
|
||||
delete_dir(dst_dir_path + "/store/plugin")
|
||||
delete_dir(dst_dir_path + "/store/plugin-dev")
|
||||
return
|
||||
|
||||
def copy_sdkjs_plugins(dst_dir, is_name_as_guid=False, is_desktop_local=False, isXp=False):
|
||||
plugins_dir = __file__script__path__ + "/../../onlyoffice.github.io/sdkjs-plugins/content"
|
||||
plugins_list_config = config.option("sdkjs-plugin")
|
||||
if isXp:
|
||||
plugins_list_config="photoeditor, macros, drawio, highlightcode, doc2md"
|
||||
if ("" == plugins_list_config):
|
||||
return
|
||||
plugins_list = plugins_list_config.rsplit(", ")
|
||||
@ -1158,7 +1314,7 @@ def copy_sdkjs_plugins(dst_dir, is_name_as_guid=False, is_desktop_local=False):
|
||||
return
|
||||
|
||||
def copy_sdkjs_plugins_server(dst_dir, is_name_as_guid=False, is_desktop_local=False):
|
||||
plugins_dir = get_script_dir() + "/../../onlyoffice.github.io/sdkjs-plugins/content"
|
||||
plugins_dir = __file__script__path__ + "/../../onlyoffice.github.io/sdkjs-plugins/content"
|
||||
plugins_list_config = config.option("sdkjs-plugin-server")
|
||||
if ("" == plugins_list_config):
|
||||
return
|
||||
@ -1185,6 +1341,14 @@ def support_old_versions_plugins(out_dir):
|
||||
delete_file(out_dir + "/plugins-ui.js")
|
||||
return
|
||||
|
||||
def generate_sdkjs_plugin_list(dst):
|
||||
plugins_list = config.option("sdkjs-plugin").rsplit(", ") \
|
||||
+ config.option("sdkjs-plugin-server").rsplit(", ")
|
||||
with open(get_path(dst), 'w') as file:
|
||||
dump = json.dumps(sorted(plugins_list), indent=4)
|
||||
file.write(re.sub(r"^(\s{4})", '\t', dump, 0, re.MULTILINE))
|
||||
return
|
||||
|
||||
def get_xcode_major_version():
|
||||
version = run_command("xcodebuild -version")['stdout']
|
||||
return int(version.split('.')[0][6:])
|
||||
@ -1287,17 +1451,16 @@ def copy_v8_files(core_dir, deploy_dir, platform, is_xp=False):
|
||||
if (-1 != config.option("config").find("use_javascript_core")):
|
||||
return
|
||||
directory_v8 = core_dir + "/Common/3dParty"
|
||||
|
||||
if is_xp:
|
||||
directory_v8 += "/v8/v8_xp"
|
||||
|
||||
if (-1 != config.option("config").lower().find("v8_version_89")) and not is_xp:
|
||||
directory_v8 += "/v8_89/v8/out.gn/"
|
||||
else:
|
||||
directory_v8 += "/v8/v8/out.gn/"
|
||||
|
||||
if is_xp:
|
||||
copy_files(directory_v8 + platform + "/release/icudt*.dll", deploy_dir + "/")
|
||||
return
|
||||
|
||||
if config.check_option("config", "v8_version_60"):
|
||||
directory_v8 += "/v8/v8/out.gn/"
|
||||
else:
|
||||
directory_v8 += "/v8_89/v8/out.gn/"
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
copy_files(directory_v8 + platform + "/release/icudt*.dat", deploy_dir + "/")
|
||||
@ -1305,10 +1468,10 @@ def copy_v8_files(core_dir, deploy_dir, platform, is_xp=False):
|
||||
copy_files(directory_v8 + platform + "/icudt*.dat", deploy_dir + "/")
|
||||
return
|
||||
|
||||
def clone_marketplace_plugin(out_dir, is_name_as_guid=False):
|
||||
def clone_marketplace_plugin(out_dir, is_name_as_guid=False, is_replace_paths=False, is_delete_git_dir=True, git_owner=""):
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(out_dir)
|
||||
git_update("onlyoffice.github.io", False, True)
|
||||
git_update("onlyoffice.github.io", False, True, git_owner)
|
||||
os.chdir(old_cur)
|
||||
|
||||
dst_dir_name = "marketplace"
|
||||
@ -1325,9 +1488,14 @@ def clone_marketplace_plugin(out_dir, is_name_as_guid=False):
|
||||
|
||||
if is_dir(dst_dir_path):
|
||||
delete_dir(dst_dir_path)
|
||||
|
||||
copy_dir(out_dir + "/onlyoffice.github.io/store/plugin", dst_dir_path)
|
||||
delete_dir_with_access_error(out_dir + "/onlyoffice.github.io")
|
||||
|
||||
if is_replace_paths:
|
||||
for file in glob.glob(dst_dir_path + "/*.html"):
|
||||
replaceInFile(file, "https://onlyoffice.github.io/sdkjs-plugins/", "../")
|
||||
|
||||
if is_delete_git_dir:
|
||||
delete_dir_with_access_error(out_dir + "/onlyoffice.github.io")
|
||||
return
|
||||
|
||||
def correctPathForBuilder(path):
|
||||
@ -1388,3 +1556,119 @@ def convert_ios_framework_to_xcframework_folder(folder, libs):
|
||||
for lib in libs:
|
||||
convert_ios_framework_to_xcframework(folder, lib)
|
||||
return
|
||||
|
||||
def change_elf_rpath(path, origin):
|
||||
# excludes ---
|
||||
if (-1 != path.find("libicudata.so.58")):
|
||||
return
|
||||
# ------------
|
||||
tools_dir = get_script_dir() + "/../tools/linux/elf/"
|
||||
result_obj = run_command(tools_dir + "readelf -d '" + path + "' | grep R*PATH")
|
||||
result = result_obj["stdout"]
|
||||
result_error = result_obj["stderr"]
|
||||
if (result_error != ""):
|
||||
return
|
||||
if (-1 != result.find("Error:")) or (-1 != result.find(" ELF ")):
|
||||
return
|
||||
is_rpath = True
|
||||
if (-1 != result.find("Library runpath: [")):
|
||||
is_rpath = False
|
||||
old_path = run_command(tools_dir + "patchelf --print-rpath '" + path + "'")['stdout']
|
||||
if (-1 != old_path.find(origin)):
|
||||
return
|
||||
new_path = old_path
|
||||
new_path = new_path.replace("$ORIGIN", "\$ORIGIN")
|
||||
if ("" != new_path):
|
||||
new_path += ":"
|
||||
new_path += origin
|
||||
if (-1 != old_path.find("$ORIGIN/converter")) or (-1 != path.find("/desktopeditors/converter")):
|
||||
new_path += (":" + origin + "/converter")
|
||||
if (-1 != old_path.find("$ORIGIN/system")):
|
||||
new_path += (":" + origin + "/system")
|
||||
if is_rpath:
|
||||
cmd(tools_dir + "patchelf", ["--force-rpath", "--set-rpath", new_path, path], True)
|
||||
else:
|
||||
cmd(tools_dir + "patchelf", ["--set-rpath", new_path, path], True)
|
||||
#print("[" + os.path.basename(path) + "] old: " + old_path + "; new: " + new_path)
|
||||
return
|
||||
|
||||
def correct_elf_rpath_directory(directory, origin, is_recursion = True):
|
||||
for file in glob.glob(directory + "/*"):
|
||||
if is_file(file):
|
||||
change_elf_rpath(file, origin)
|
||||
elif is_dir(file) and is_recursion:
|
||||
correct_elf_rpath_directory(file, origin)
|
||||
return
|
||||
|
||||
def is_need_build_js():
|
||||
if "osign" == config.option("module"):
|
||||
return False
|
||||
return True
|
||||
|
||||
def copy_dictionaries(src, dst, is_hyphen = True, is_spell = True):
|
||||
if (False == is_hyphen) and (False == is_spell):
|
||||
return
|
||||
|
||||
if not is_dir(dst):
|
||||
create_dir(dst)
|
||||
|
||||
src_folder = src
|
||||
if ("/" != src[-1:]):
|
||||
src_folder += "/"
|
||||
src_folder += "*"
|
||||
for file in glob.glob(src_folder):
|
||||
if is_file(file):
|
||||
copy_file(file, dst)
|
||||
continue
|
||||
|
||||
basename = os.path.basename(file)
|
||||
if (".git" == basename):
|
||||
continue
|
||||
|
||||
if (True == is_hyphen) and (True == is_spell):
|
||||
copy_dir(file, dst + "/" + basename)
|
||||
continue
|
||||
|
||||
is_spell_present = is_file(file + "/" + basename + ".dic")
|
||||
is_hyphen_present = is_file(file + "/hyph_" + basename + ".dic")
|
||||
|
||||
is_dir_need = False
|
||||
if (is_hyphen and is_hyphen_present) or (is_spell and is_spell_present):
|
||||
is_dir_need = True
|
||||
|
||||
if not is_dir_need:
|
||||
continue
|
||||
|
||||
lang_folder = dst + "/" + basename
|
||||
create_dir(lang_folder)
|
||||
|
||||
if is_hyphen and is_hyphen_present:
|
||||
copy_dir_content(file, lang_folder, "hyph_", "")
|
||||
|
||||
if is_spell and is_spell_present:
|
||||
copy_dir_content(file, lang_folder, "", "hyph_")
|
||||
|
||||
if is_file(dst + "/en_US/en_US_thes.dat"):
|
||||
delete_file(dst + "/en_US/en_US_thes.dat")
|
||||
delete_file(dst + "/en_US/en_US_thes.idx")
|
||||
|
||||
if is_file(dst + "/ru_RU/ru_RU_oo3.dic"):
|
||||
delete_file(dst + "/ru_RU/ru_RU_oo3.dic")
|
||||
delete_file(dst + "/ru_RU/ru_RU_oo3.aff")
|
||||
|
||||
if is_file(dst + "/uk_UA/th_uk_UA.dat"):
|
||||
delete_file(dst + "/uk_UA/th_uk_UA.dat")
|
||||
delete_file(dst + "/uk_UA/th_uk_UA.idx")
|
||||
|
||||
return
|
||||
|
||||
def check_module_version(actual_version, clear_func):
|
||||
module_file = "./module.version"
|
||||
current_module_version = readFile(module_file)
|
||||
if (actual_version == current_module_version):
|
||||
return
|
||||
if is_file(module_file):
|
||||
delete_file(module_file)
|
||||
writeFile(module_file, actual_version)
|
||||
clear_func()
|
||||
return
|
||||
|
||||
@ -27,6 +27,8 @@ def correct_sdkjs_licence(directory):
|
||||
def make():
|
||||
if ("1" == base.get_env("OO_NO_BUILD_JS")):
|
||||
return
|
||||
if not base.is_need_build_js():
|
||||
return
|
||||
|
||||
base.set_env('NODE_ENV', 'production')
|
||||
|
||||
@ -53,8 +55,6 @@ def make():
|
||||
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")
|
||||
if not base.is_file(out_dir + "/desktop/sdkjs/common/AllFonts.js"):
|
||||
base.copy_file(base_dir + "/../sdkjs/common/HtmlFileInternal/AllFonts.js", out_dir + "/desktop/sdkjs/common/AllFonts.js")
|
||||
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")
|
||||
@ -65,7 +65,8 @@ def make():
|
||||
|
||||
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", False)
|
||||
@ -73,44 +74,39 @@ def make():
|
||||
base.create_dir(out_dir + "/mobile/sdkjs")
|
||||
vendor_dir_src = base_dir + "/../web-apps/vendor/"
|
||||
sdk_dir_src = base_dir + "/../sdkjs/deploy/sdkjs/"
|
||||
|
||||
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/mobile/sdkjs/banners_word.js")
|
||||
|
||||
prefix_js = [
|
||||
vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs-native/common/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"
|
||||
]
|
||||
|
||||
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs/cell/native/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/mobile/sdkjs/banners_cell.js")
|
||||
postfix_js = [
|
||||
base_dir + "/../sdkjs/common/libfont/engine/fonts_native.js",
|
||||
base_dir + "/../sdkjs/common/Charts/ChartStyles.js"
|
||||
]
|
||||
|
||||
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/mobile/sdkjs/banners_slide.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_word.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js"], out_dir + "/mobile/sdkjs/word/script.bin")
|
||||
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_cell.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js"], out_dir + "/mobile/sdkjs/cell/script.bin")
|
||||
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_slide.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js"], out_dir + "/mobile/sdkjs/slide/script.bin")
|
||||
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_word.js")
|
||||
base.delete_file(out_dir + "/mobile/sdkjs/banners_cell.js")
|
||||
base.delete_file(out_dir + "/mobile/sdkjs/banners_slide.js")
|
||||
base.delete_file(out_dir + "/mobile/sdkjs/banners.js")
|
||||
return
|
||||
|
||||
# JS build
|
||||
def _run_npm(directory):
|
||||
return base.cmd_in_dir(directory, "npm", ["install"])
|
||||
|
||||
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"])
|
||||
|
||||
@ -139,13 +135,16 @@ def build_sdk_desktop(directory):
|
||||
def build_sdk_builder(directory):
|
||||
#_run_npm_cli(directory)
|
||||
_run_npm(directory)
|
||||
_run_grunt(directory, get_build_param() + 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)
|
||||
_run_grunt(directory, get_build_param(minimize) + ["--mobile=true"] + base.sdkjs_addons_param())
|
||||
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_js_develop(root_dir):
|
||||
@ -154,18 +153,18 @@ def build_js_develop(root_dir):
|
||||
if (external_folder != ""):
|
||||
external_folder = "/" + external_folder
|
||||
|
||||
_run_npm(root_dir + external_folder + "/sdkjs/build")
|
||||
_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())
|
||||
_run_npm(root_dir + external_folder + "/web-apps/build")
|
||||
_run_npm(root_dir + external_folder + "/web-apps/build/sprites")
|
||||
_run_npm_ci(root_dir + external_folder + "/web-apps/build/sprites")
|
||||
_run_grunt(root_dir + external_folder + "/web-apps/build/sprites", [])
|
||||
|
||||
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", ["install"])
|
||||
base.cmd("npm", ["ci"])
|
||||
base.cmd("npm", ["run", "deploy-word"])
|
||||
base.cmd("npm", ["run", "deploy-cell"])
|
||||
base.cmd("npm", ["run", "deploy-slide"])
|
||||
|
||||
@ -14,6 +14,9 @@ parser.add_option("--output",
|
||||
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):
|
||||
@ -32,7 +35,11 @@ def write_version_files(output_dir):
|
||||
# parse configuration
|
||||
config.parse()
|
||||
config.parse_defaults()
|
||||
config.extend_option("jsminimize", "0")
|
||||
|
||||
isMinimize = False
|
||||
if ("1" == options.minimize or "true" == options.minimize):
|
||||
isMinimize = True
|
||||
config.set_option("jsminimize", "disable")
|
||||
|
||||
branding = config.option("branding-name")
|
||||
if ("" == branding):
|
||||
@ -46,41 +53,33 @@ if (options.output):
|
||||
|
||||
base.create_dir(out_dir)
|
||||
|
||||
build_js.build_sdk_native(base_dir + "/../sdkjs/build")
|
||||
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/"
|
||||
|
||||
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/banners_word.js")
|
||||
prefix_js = [
|
||||
vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs-native/common/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"
|
||||
]
|
||||
|
||||
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs/cell/native/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/banners_cell.js")
|
||||
postfix_js = [
|
||||
base_dir + "/../sdkjs/common/libfont/engine/fonts_native.js",
|
||||
base_dir + "/../sdkjs/common/Charts/ChartStyles.js"
|
||||
]
|
||||
|
||||
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
|
||||
vendor_dir_src + "underscore/underscore-min.js",
|
||||
base_dir + "/../sdkjs/common/Native/native.js",
|
||||
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
|
||||
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
|
||||
out_dir + "/banners_slide.js")
|
||||
base.join_scripts(prefix_js, out_dir + "/banners.js")
|
||||
|
||||
base.create_dir(out_dir + "/word")
|
||||
base.join_scripts([out_dir + "/banners_word.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js"], out_dir + "/word/script.bin")
|
||||
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_cell.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js"], out_dir + "/cell/script.bin")
|
||||
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_slide.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js"], out_dir + "/slide/script.bin")
|
||||
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_word.js")
|
||||
base.delete_file(out_dir + "/banners_cell.js")
|
||||
base.delete_file(out_dir + "/banners_slide.js")
|
||||
base.delete_file(out_dir + "/banners.js")
|
||||
|
||||
# Write sdk version mark file if needed
|
||||
if (options.write_version):
|
||||
|
||||
@ -16,8 +16,7 @@ def make():
|
||||
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,18 +29,16 @@ 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 = "node14"
|
||||
pkg_target = "node16"
|
||||
|
||||
if ("linux" == base.host_platform()):
|
||||
pkg_target += "-linux"
|
||||
@ -51,16 +48,26 @@ def make():
|
||||
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_dir + "/DocService", "pkg", [".", "-t", pkg_target, "--options", "max_old_space_size=4096", "-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"])
|
||||
|
||||
example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs"
|
||||
base.delete_dir(example_dir + "/node_modules")
|
||||
base.cmd_in_dir(example_dir, "npm", ["install"])
|
||||
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
|
||||
base.cmd_in_dir(addon_dir, "npm", ["ci"])
|
||||
base.cmd_in_dir(addon_dir, "npm", ["run", "build"])
|
||||
|
||||
def build_server_develop():
|
||||
server_dir = base.get_script_dir() + "/../../server"
|
||||
base.cmd_in_dir(server_dir, "npm", ["install"])
|
||||
base.cmd_in_dir(server_dir, "npm", ["ci"])
|
||||
base.cmd_in_dir(server_dir, "grunt", ["develop", "-v"] + base.server_addons_param())
|
||||
|
||||
@ -69,23 +69,19 @@ def parse():
|
||||
if check_option("platform", "android"):
|
||||
options["platform"] += " android_arm64_v8a android_armv7 android_x86 android_x86_64"
|
||||
|
||||
#if check_option("platform", "ios"):
|
||||
# extend_option("config", "core_ios_32")
|
||||
|
||||
# check vs-version
|
||||
if ("" == option("vs-version")):
|
||||
options["vs-version"] = "2015"
|
||||
|
||||
# enable v8 8.9 version, if compiler support sources
|
||||
if ("linux" == host_platform) and (5004 <= base.get_gcc_version()) and not check_option("platform", "android"):
|
||||
extend_option("config", "v8_version_89")
|
||||
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", "v8_version_89")
|
||||
extend_option("config", "vs2019")
|
||||
extend_option("config", "vs2019")
|
||||
|
||||
if check_option("platform", "linux_arm64"):
|
||||
extend_option("config", "v8_version_89")
|
||||
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) and ("" == option("vs-path")):
|
||||
@ -111,10 +107,23 @@ def parse():
|
||||
if not "arm64-toolchain-bin" in options:
|
||||
options["arm64-toolchain-bin"] = "/usr/bin"
|
||||
|
||||
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")
|
||||
|
||||
if check_option("config", "bundle_xcframeworks"):
|
||||
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
|
||||
|
||||
def check_compiler(platform):
|
||||
@ -173,6 +182,9 @@ 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):
|
||||
@ -210,4 +222,28 @@ def parse_defaults():
|
||||
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
|
||||
|
||||
@ -20,7 +20,8 @@ import hunspell
|
||||
import glew
|
||||
import harfbuzz
|
||||
import hyphen
|
||||
import socket_io
|
||||
import googletest
|
||||
import libvlc
|
||||
|
||||
def check_android_ndk_macos_arm(dir):
|
||||
if base.is_dir(dir + "/darwin-x86_64") and not base.is_dir(dir + "/darwin-arm64"):
|
||||
@ -45,9 +46,13 @@ def make():
|
||||
harfbuzz.make()
|
||||
glew.make()
|
||||
hyphen.make()
|
||||
socket_io.make()
|
||||
googletest.make()
|
||||
|
||||
if config.check_option("build-libvlc", "1"):
|
||||
libvlc.make()
|
||||
|
||||
if config.check_option("module", "mobile"):
|
||||
curl.make()
|
||||
if (config.check_option("platform", "android")):
|
||||
curl.make()
|
||||
websocket.make()
|
||||
return
|
||||
|
||||
@ -73,6 +73,8 @@ def make():
|
||||
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"])
|
||||
|
||||
@ -15,54 +15,74 @@ def make():
|
||||
|
||||
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32", "mac_64", "mac_arm64"]
|
||||
|
||||
url = "http://d2ettrnqo7v976.cloudfront.net/cef/4280/"
|
||||
|
||||
for platform in platforms:
|
||||
if not config.check_option("platform", platform):
|
||||
continue
|
||||
|
||||
url = "http://d2ettrnqo7v976.cloudfront.net/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("./cef_binary.7z.data")
|
||||
old_data_url = base.readFile(archive_name_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_platform, "./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 (0 != platform.find("mac")):
|
||||
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 (0 == platform.find("mac")):
|
||||
base.cmd("mv", ["Chromium Embedded Framework.framework", "build/Chromium Embedded Framework.framework"])
|
||||
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)
|
||||
|
||||
|
||||
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
|
||||
@ -5,23 +5,44 @@ sys.path.append('../..')
|
||||
import config
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
import icu_android
|
||||
|
||||
def fetch_icu(major, minor):
|
||||
base.cmd("git", ["clone", "--depth", "1", "--branch", "maint/maint-" + major, "https://github.com/unicode-org/icu.git", "./icu2"])
|
||||
base.copy_dir("./icu2/icu4c", "./icu")
|
||||
base.delete_dir_with_access_error("icu2")
|
||||
#base.cmd("svn", ["export", "https://github.com/unicode-org/icu/tags/release-" + icu_major + "-" + icu_minor + "/icu4c", "./icu", "--non-interactive", "--trust-server-cert"])
|
||||
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")
|
||||
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
icu_android.make()
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu"
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
icu_major = "58"
|
||||
icu_minor = "2"
|
||||
base.check_module_version("3", clear_module)
|
||||
|
||||
if (-1 != config.option("platform").find("android")):
|
||||
icu_android.make()
|
||||
|
||||
icu_major = "58"
|
||||
icu_minor = "3"
|
||||
|
||||
if not base.is_dir("icu"):
|
||||
base.cmd("svn", ["export", "https://github.com/unicode-org/icu/tags/release-" + icu_major + "-" + icu_minor + "/icu4c", "./icu", "--non-interactive", "--trust-server-cert"])
|
||||
fetch_icu(icu_major, icu_minor)
|
||||
|
||||
if ("windows" == base.host_platform()):
|
||||
platformToolset = "v140"
|
||||
@ -66,6 +87,7 @@ def make():
|
||||
base.create_dir(base_dir + "/icu/cross_build")
|
||||
os.chdir("icu/cross_build")
|
||||
base.cmd("./../source/runConfigureICU", ["Linux", "--prefix=" + base_dir + "/icu/cross_build_install"])
|
||||
base.replaceInFile("./../source/icudefs.mk.in", "LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)", "LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS) -static-libstdc++ -static-libgcc")
|
||||
base.cmd("make", ["-j4"])
|
||||
base.cmd("make", ["install"], True)
|
||||
base.create_dir(base_dir + "/linux_64")
|
||||
|
||||
@ -5,11 +5,18 @@ sys.path.append('../..')
|
||||
import base
|
||||
import os
|
||||
|
||||
def fetch_icu(major, minor):
|
||||
base.cmd("git", ["clone", "--depth", "1", "--branch", "maint/maint-" + major, "https://github.com/unicode-org/icu.git", "./icu2"])
|
||||
base.copy_dir("./icu2/icu4c", "./icu")
|
||||
base.delete_dir_with_access_error("icu2")
|
||||
#base.cmd("svn", ["export", "https://github.com/unicode-org/icu/tags/release-" + icu_major + "-" + icu_minor + "/icu4c", "./icu", "--non-interactive", "--trust-server-cert"])
|
||||
return
|
||||
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu/android"
|
||||
|
||||
toolshains_dir = current_dir + "/toolchains"
|
||||
icu_major = "58"
|
||||
icu_minor = "2"
|
||||
icu_minor = "3"
|
||||
icu_is_shared = False
|
||||
|
||||
current_path = base.get_env("PATH")
|
||||
@ -77,11 +84,11 @@ def make():
|
||||
os.chdir(current_dir)
|
||||
|
||||
if not base.is_dir("icu"):
|
||||
base.cmd("svn", ["export", "https://github.com/unicode-org/icu/tags/release-" + icu_major + "-" + icu_minor + "/icu4c", "./icu", "--non-interactive", "--trust-server-cert"])
|
||||
fetch_icu(icu_major, icu_minor)
|
||||
if ("linux" == base.host_platform()):
|
||||
base.replaceInFile(current_dir + "/icu/source/i18n/digitlst.cpp", "xlocale", "locale")
|
||||
#if ("mac" == base.host_platform()):
|
||||
# base.replaceInFile(current_dir + "/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 ("mac" == base.host_platform()):
|
||||
base.replaceInFile(current_dir + "/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 not base.is_dir(current_dir + "/icu/cross_build"):
|
||||
base.create_dir(current_dir + "/icu/cross_build")
|
||||
|
||||
@ -35,7 +35,7 @@ def restore_icu_defs(current_dir):
|
||||
return
|
||||
|
||||
icu_major = "58"
|
||||
icu_minor = "2"
|
||||
icu_minor = "3"
|
||||
|
||||
current_dir_old = os.getcwd()
|
||||
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/icu"
|
||||
|
||||
121
scripts/core_common/modules/libvlc.py
Normal file
121
scripts/core_common/modules/libvlc.py
Normal file
@ -0,0 +1,121 @@
|
||||
#!/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"
|
||||
|
||||
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"):
|
||||
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
|
||||
@ -19,15 +19,16 @@ def make():
|
||||
|
||||
print("[fetch & build]: openssl")
|
||||
|
||||
if (-1 != config.option("platform").find("android") or -1 != config.option("platform").find("ios")):
|
||||
openssl_mobile.make()
|
||||
return
|
||||
|
||||
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/openssl"
|
||||
old_cur = os.getcwd()
|
||||
os.chdir(base_dir)
|
||||
|
||||
base.common_check_version("openssl", "3", 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"])
|
||||
@ -41,7 +42,7 @@ def make():
|
||||
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")
|
||||
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)
|
||||
@ -49,7 +50,7 @@ def make():
|
||||
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")
|
||||
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)
|
||||
@ -62,7 +63,7 @@ def make():
|
||||
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")
|
||||
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)
|
||||
@ -70,7 +71,7 @@ def make():
|
||||
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")
|
||||
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)
|
||||
@ -79,11 +80,12 @@ def make():
|
||||
return
|
||||
|
||||
if (-1 != config.option("platform").find("linux")) and not base.is_dir("../build/linux_64"):
|
||||
base.cmd("./config", ["no-shared", "no-asm", "--prefix=" + old_cur_dir + "/build/linux_64", "--openssldir=" + old_cur_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"])
|
||||
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")
|
||||
base.cmd("make", ["install"])
|
||||
base.cmd("make", ["clean"], True)
|
||||
# TODO: support x86
|
||||
|
||||
if (-1 != config.option("platform").find("linux_arm64")) and not base.is_dir("../build/linux_arm64"):
|
||||
@ -94,14 +96,14 @@ def make():
|
||||
if ("" == cross_compiler_arm64):
|
||||
cross_compiler_arm64 = "/usr/bin"
|
||||
cross_compiler_arm64_prefix = cross_compiler_arm64 + "/" + base.get_prefix_cross_compiler_arm64()
|
||||
base.cmd("./Configure", ["linux-aarch64", "--cross-compile-prefix=" + cross_compiler_arm64_prefix, "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", "--cross-compile-prefix=" + cross_compiler_arm64_prefix, "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 (-1 != config.option("platform").find("mac")) and not base.is_dir("../build/mac_64"):
|
||||
base.cmd("./Configure", ["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("./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"):
|
||||
@ -119,7 +121,7 @@ def make():
|
||||
},\n\
|
||||
\"darwin64-x86_64-cc\" => {"
|
||||
base.replaceInFile(base_dir + "/openssl2/Configurations/10-main.conf", replace1, replace2)
|
||||
base.cmd("./Configure", ["no-shared", "no-asm", "darwin64-arm64-cc", "--prefix=" + old_cur_dir + "/build/mac_arm64", "--openssldir=" + old_cur_dir + "/build/mac_arm64"])
|
||||
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)
|
||||
|
||||
@ -6,6 +6,22 @@ import config
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
import glob
|
||||
|
||||
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"
|
||||
@ -13,4 +29,26 @@ def make():
|
||||
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", ["submodule", "init"])
|
||||
base.cmd_in_dir(base_dir + "/socket.io-client-cpp", "git", ["submodule", "update"])
|
||||
|
||||
# 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
|
||||
|
||||
@ -68,9 +68,9 @@ def make():
|
||||
if ("mac" == base.host_platform()) and (-1 == config.option("config").find("use_v8")):
|
||||
return
|
||||
|
||||
use_v8_89 = False
|
||||
if (-1 != config.option("config").lower().find("v8_version_89")):
|
||||
use_v8_89 = True
|
||||
use_v8_89 = True
|
||||
if config.check_option("config", "v8_version_60"):
|
||||
use_v8_89 = False
|
||||
|
||||
if (use_v8_89):
|
||||
v8_89.make()
|
||||
@ -93,6 +93,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"):
|
||||
@ -179,6 +180,7 @@ def make():
|
||||
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\""])
|
||||
@ -224,13 +226,17 @@ 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!!!
|
||||
if base.is_file("depot_tools/cipd.ps1"):
|
||||
base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64")
|
||||
|
||||
# old variant
|
||||
#path_to_python2 = "/depot_tools/win_tools-2_7_13_chromium7_bin/python/bin"
|
||||
path_to_python2 = "/depot_tools/bootstrap-2@3_8_10_chromium_23_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"]])
|
||||
|
||||
@ -265,6 +271,14 @@ def make_xp():
|
||||
" 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"])
|
||||
|
||||
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&) {}
|
||||
};
|
||||
};
|
||||
@ -7,6 +7,23 @@ import base
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
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"
|
||||
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.writeFile("./depot_tools/bootstrap/manifest.txt", content)
|
||||
return
|
||||
|
||||
def make_args(args, platform, is_64=True, is_debug=False):
|
||||
args_copy = args[:]
|
||||
if is_64:
|
||||
@ -24,6 +41,8 @@ def make_args(args, platform, is_64=True, is_debug=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")
|
||||
|
||||
@ -31,7 +50,7 @@ def make_args(args, platform, is_64=True, is_debug=False):
|
||||
args_copy.append("is_clang=true")
|
||||
args_copy.append("use_sysroot=false")
|
||||
if (platform == "windows"):
|
||||
args_copy.append("is_clang=false")
|
||||
args_copy.append("is_clang=false")
|
||||
|
||||
return "--args=\"" + " ".join(args_copy) + "\""
|
||||
|
||||
@ -44,12 +63,40 @@ def ninja_windows_make(args, is_64=True, is_debug=False):
|
||||
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"])
|
||||
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()
|
||||
@ -61,6 +108,7 @@ def make():
|
||||
os.chdir(base_dir)
|
||||
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"]
|
||||
|
||||
@ -70,18 +118,28 @@ def make():
|
||||
|
||||
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"])
|
||||
os.chdir("../")
|
||||
base.cmd("./depot_tools/gclient", ["sync", "-r", "remotes/branch-heads/8.9"], True)
|
||||
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 ("windows" == base.host_platform()):
|
||||
base.replaceInFile("v8/build/config/win/BUILD.gn", ":static_crt", ":dynamic_crt")
|
||||
|
||||
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")
|
||||
else:
|
||||
base.replaceInFile("depot_tools/gclient_paths.py", "@functools.lru_cache", "")
|
||||
|
||||
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")
|
||||
|
||||
@ -112,7 +170,9 @@ def make():
|
||||
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)
|
||||
@ -120,7 +180,9 @@ def make():
|
||||
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)
|
||||
|
||||
@ -6,11 +6,13 @@ import config
|
||||
import base
|
||||
import ixwebsocket
|
||||
import socketrocket
|
||||
import socket_io
|
||||
|
||||
config_file = base.get_script_dir() + "/../../core/Common/WebSocket/websocket.pri"
|
||||
|
||||
def make():
|
||||
ixwebsocket.make()
|
||||
socketrocket.make()
|
||||
#ixwebsocket.make()
|
||||
#socketrocket.make()
|
||||
socket_io.make()
|
||||
|
||||
return
|
||||
|
||||
@ -7,6 +7,7 @@ import deploy_builder
|
||||
import deploy_server
|
||||
import deploy_core
|
||||
import deploy_mobile
|
||||
import deploy_osign
|
||||
|
||||
def make():
|
||||
if config.check_option("module", "desktop"):
|
||||
@ -19,4 +20,6 @@ def make():
|
||||
deploy_core.make()
|
||||
if config.check_option("module", "mobile"):
|
||||
deploy_mobile.make()
|
||||
if config.check_option("module", "osign"):
|
||||
deploy_osign.make()
|
||||
return
|
||||
|
||||
@ -51,8 +51,8 @@ def make():
|
||||
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)
|
||||
#if (native_platform == "linux_64"):
|
||||
# base.generate_check_linux_system(git_dir + "/build_tools", root_dir)
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
@ -79,9 +79,12 @@ def make():
|
||||
|
||||
# app
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "docbuilder")
|
||||
base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder")
|
||||
base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder", "", "./dictionaries")
|
||||
base.copy_dir(git_dir + "/document-templates/new/en-US", root_dir + "/empty")
|
||||
|
||||
# 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")
|
||||
base.create_dir(root_dir + "/sdkjs/vendor")
|
||||
@ -92,6 +95,8 @@ 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):
|
||||
|
||||
@ -55,10 +55,15 @@ def make():
|
||||
|
||||
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")
|
||||
|
||||
# dictionaries
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", archive_dir + "/dictionaries", True, False)
|
||||
|
||||
if base.is_file(archive_dir + ".7z"):
|
||||
base.delete_file(archive_dir + ".7z")
|
||||
|
||||
@ -4,6 +4,19 @@ 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"
|
||||
@ -41,35 +54,36 @@ 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", "kernel_network")
|
||||
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", "PdfFile")
|
||||
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", "HtmlFile2")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlRenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "Fb2File")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "EpubFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "DocxRenderer")
|
||||
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", root_dir + "/cmap.bin")
|
||||
|
||||
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", "HtmlFile2")
|
||||
base.copy_lib(build_libraries_path, root_dir + "/converter", "HtmlRenderer")
|
||||
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", "DocxRenderer")
|
||||
|
||||
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")
|
||||
#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")
|
||||
base.copy_file(git_dir + "/desktop-apps/common/converter/package.config", root_dir + "/converter/package.config")
|
||||
#base.copy_file(git_dir + "/desktop-apps/common/converter/package.config", root_dir + "/converter/package.config")
|
||||
|
||||
if (0 == platform.find("linux")):
|
||||
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", root_dir + "/converter/libicudata.so.58")
|
||||
@ -81,37 +95,48 @@ def make():
|
||||
|
||||
# doctrenderer
|
||||
if isWindowsXP:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir + "/converter", "doctrenderer")
|
||||
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")
|
||||
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.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop", "", "../dictionaries")
|
||||
base.copy_dir(git_dir + "/document-templates/new", root_dir + "/converter/empty")
|
||||
|
||||
# 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)
|
||||
|
||||
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 + ("/xp" if isWindowsXP else ""), 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, "ooxmlsignature")
|
||||
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")
|
||||
@ -123,9 +148,7 @@ def make():
|
||||
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("Qt5Widgets", root_dir)
|
||||
base.qt_copy_lib("Qt5Network", root_dir)
|
||||
base.qt_copy_lib("Qt5OpenGL", root_dir)
|
||||
|
||||
@ -134,13 +157,17 @@ def make():
|
||||
base.qt_copy_plugin("imageformats", root_dir)
|
||||
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("printsupport", 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")):
|
||||
@ -148,61 +175,51 @@ def make():
|
||||
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)
|
||||
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")
|
||||
|
||||
if ("" != base.get_env("VIDEO_PLAYER_VLC_DIR")):
|
||||
vlc_dir = git_dir + "/desktop-sdk/ChromiumBasedEditors/videoplayerlib/vlc/"
|
||||
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_file(vlc_dir + platform + "/bin/libvlc.dll", root_dir + "/libvlc.dll")
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlccore.dll", root_dir + "/libvlccore.dll")
|
||||
base.copy_file(vlc_dir + platform + "/bin/VLCQtCore.dll", root_dir + "/VLCQtCore.dll")
|
||||
base.copy_file(vlc_dir + platform + "/bin/VLCQtWidgets.dll", root_dir + "/VLCQtWidgets.dll")
|
||||
else:
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlc.so", root_dir + "/libvlc.so")
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlc.so.5", root_dir + "/libvlc.so.5")
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlccore.so", root_dir + "/libvlccore.so")
|
||||
base.copy_file(vlc_dir + platform + "/bin/libvlccore.so.8", root_dir + "/libvlccore.so.8")
|
||||
base.copy_file(vlc_dir + platform + "/bin/VLCQtCore.so", root_dir + "/VLCQtCore.so")
|
||||
base.copy_file(vlc_dir + platform + "/bin/VLCQtWidgets.so", root_dir + "/VLCQtWidgets.so")
|
||||
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(core_build_dir + "/lib/" + platform + "/mediaplayer/xp", root_dir, "videoplayer")
|
||||
base.copy_lib(build_libraries_path + "/mediaplayer/xp", root_dir, "videoplayer")
|
||||
else:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform + "/mediaplayer", root_dir, "videoplayer")
|
||||
|
||||
base.copy_dir(vlc_dir + platform + "/bin/plugins", root_dir + "/plugins")
|
||||
base.copy_lib(build_libraries_path + "/mediaplayer", root_dir, "videoplayer")
|
||||
else:
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "videoplayer")
|
||||
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")
|
||||
base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/resources/local", root_dir + "/editors/sdkjs/common/Images/local")
|
||||
|
||||
# desktopeditors-help
|
||||
root_help_dir = root_dir + "-help"
|
||||
if (base.is_dir(root_help_dir)):
|
||||
base.delete_dir(root_help_dir)
|
||||
for i in ["documenteditor", "presentationeditor", "spreadsheeteditor"]:
|
||||
base.copy_dir(
|
||||
base_dir + "/js/" + branding + "/desktop/web-apps/apps/%s/main/resources/help" % i,
|
||||
root_help_dir + "/editors/web-apps/apps/%s/main/resources/help" % i)
|
||||
|
||||
if ("1" != config.option("preinstalled-help") and not isWindowsXP):
|
||||
# remove help from install until web-apps containes help
|
||||
base.delete_dir(root_dir + "/editors/web-apps/apps/documenteditor/main/resources/help")
|
||||
base.delete_dir(root_dir + "/editors/web-apps/apps/presentationeditor/main/resources/help")
|
||||
base.delete_dir(root_dir + "/editors/web-apps/apps/spreadsheeteditor/main/resources/help")
|
||||
|
||||
base.create_dir(root_dir + "/editors/sdkjs-plugins")
|
||||
base.copy_sdkjs_plugins(root_dir + "/editors/sdkjs-plugins", True, 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")
|
||||
@ -214,14 +231,20 @@ def make():
|
||||
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)
|
||||
|
||||
|
||||
base.copy_file(base_dir + "/js/" + branding + "/desktop/index.html", root_dir + "/index.html")
|
||||
base.copy_dir(git_dir + "/desktop-apps/common/loginpage/providers", root_dir + "/providers")
|
||||
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")):
|
||||
|
||||
@ -6,6 +6,18 @@ 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():
|
||||
@ -82,6 +94,8 @@ def make():
|
||||
# correct ios frameworks
|
||||
if ("ios" == platform):
|
||||
base.generate_plist(root_dir)
|
||||
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)
|
||||
@ -95,8 +109,11 @@ def make():
|
||||
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")
|
||||
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")
|
||||
|
||||
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.generate_plist(root_dir)
|
||||
|
||||
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
|
||||
@ -40,24 +40,22 @@ def make():
|
||||
|
||||
build_server_dir = root_dir + '/server'
|
||||
server_dir = base.get_script_dir() + "/../../server"
|
||||
bin_server_dir = server_dir + "/build/server"
|
||||
|
||||
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")
|
||||
|
||||
qt_dir = base.qt_setup(native_platform)
|
||||
platform = native_platform
|
||||
@ -87,10 +85,10 @@ def make():
|
||||
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")
|
||||
|
||||
if (native_platform == "linux_64"):
|
||||
base.generate_check_linux_system(git_dir + "/build_tools", converter_dir)
|
||||
#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")
|
||||
base.generate_doctrenderer_config(converter_dir + "/DoctRenderer.config", "../../../", "server", "", "../../../dictionaries")
|
||||
|
||||
# icu
|
||||
if (0 == platform.find("win")):
|
||||
@ -121,31 +119,32 @@ def make():
|
||||
|
||||
# plugins
|
||||
base.create_dir(js_dir + "/sdkjs-plugins")
|
||||
base.copy_sdkjs_plugins(js_dir + "/sdkjs-plugins", False, True)
|
||||
base.copy_sdkjs_plugins_server(js_dir + "/sdkjs-plugins", False, True)
|
||||
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")
|
||||
|
||||
base.clone_marketplace_plugin(root_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") and "onlyoffice" != config.option("branding")):
|
||||
branding_dir = git_dir + '/' + config.option("branding") + '/server'
|
||||
|
||||
#dictionaries
|
||||
spellchecker_dictionaries = root_dir + '/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'
|
||||
@ -204,15 +203,15 @@ def make():
|
||||
base.delete_dir(root_dir_snap)
|
||||
base.create_dir(root_dir_snap)
|
||||
base.copy_dir(root_dir, root_dir_snap)
|
||||
base.copy_dir(bin_server_dir + '/DocService/node_modules', root_dir_snap + '/server/DocService/node_modules')
|
||||
base.copy_dir(bin_server_dir + '/DocService/sources', root_dir_snap + '/server/DocService/sources')
|
||||
base.copy_dir(bin_server_dir + '/DocService/public', root_dir_snap + '/server/DocService/public')
|
||||
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(bin_server_dir + '/FileConverter/node_modules', root_dir_snap + '/server/FileConverter/node_modules')
|
||||
base.copy_dir(bin_server_dir + '/FileConverter/sources', root_dir_snap + '/server/FileConverter/sources')
|
||||
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(bin_server_dir + '/Common/node_modules', root_dir_snap + '/server/Common/node_modules')
|
||||
base.copy_dir(bin_server_dir + '/Common/sources', root_dir_snap + '/server/Common/sources')
|
||||
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)
|
||||
|
||||
@ -61,13 +61,13 @@ def make():
|
||||
print("Core is up to date. ---------------------------------------")
|
||||
print("-----------------------------------------------------------")
|
||||
|
||||
base.generate_doctrenderer_config("./DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/")
|
||||
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")
|
||||
|
||||
base.support_old_versions_plugins(git_dir + "/sdkjs-plugins")
|
||||
base.clone_marketplace_plugin(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")
|
||||
@ -144,8 +144,10 @@ def make():
|
||||
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_file = git_dir + "/document-server-integration/web/documentserver-example/nodejs/config/local-development-" + base.host_platform() + ".json"
|
||||
base.writeFile(json_file, json.dumps({"server": example_config}, indent=2))
|
||||
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
|
||||
|
||||
@ -66,6 +66,28 @@ class CDependencies:
|
||||
res += ['--remove-path', item]
|
||||
return res
|
||||
|
||||
def check__docker_dependencies():
|
||||
if (host_platform == 'windows' and not check_vc_components()):
|
||||
return False
|
||||
if (host_platform == 'mac'):
|
||||
return True
|
||||
|
||||
checksResult = CDependencies()
|
||||
checksResult.append(check_nodejs())
|
||||
checksResult.append(check_7z())
|
||||
if (len(checksResult.install) > 0):
|
||||
install_args = ['install.py']
|
||||
install_args += checksResult.get_uninstall()
|
||||
install_args += checksResult.get_removepath()
|
||||
install_args += checksResult.get_install()
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
install_args[0] = './scripts/develop/' + install_args[0]
|
||||
if (host_platform == 'windows'):
|
||||
code = libwindows.sudo(unicode(sys.executable), install_args)
|
||||
elif (host_platform == 'linux'):
|
||||
get_updates()
|
||||
base.cmd_in_dir(base_dir + "/../../", 'python', install_args, False)
|
||||
|
||||
def check_dependencies():
|
||||
if (host_platform == 'windows' and not check_vc_components()):
|
||||
return False
|
||||
@ -168,21 +190,21 @@ def check_nodejs():
|
||||
nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:])
|
||||
nodejs_cur_version_minor = int(nodejs_version.split('.')[1])
|
||||
print('Installed Node.js version: ' + nodejs_version[1:])
|
||||
nodejs_min_version = '14.14'
|
||||
nodejs_min_version = '18'
|
||||
nodejs_min_version_minor = 0
|
||||
major_minor_min_version = nodejs_min_version.split('.')
|
||||
nodejs_min_version_major = int(major_minor_min_version[0])
|
||||
if len(major_minor_min_version) > 1:
|
||||
nodejs_min_version_minor = int(major_minor_min_version[1])
|
||||
nodejs_max_version = '14'
|
||||
nodejs_max_version = ""
|
||||
nodejs_max_version_minor = float("inf")
|
||||
major_minor_max_version = nodejs_max_version.split('.')
|
||||
nodejs_max_version_major = int(major_minor_max_version[0])
|
||||
# nodejs_max_version_major = int(major_minor_max_version[0])
|
||||
nodejs_max_version_major = float("inf")
|
||||
if len(major_minor_max_version) > 1:
|
||||
nodejs_max_version_minor = int(major_minor_max_version[1])
|
||||
|
||||
if (nodejs_min_version_major > nodejs_cur_version_major or nodejs_cur_version_major > nodejs_max_version_major):
|
||||
print('Installed Node.js version must be 14.14 to 14.x')
|
||||
isNeedReinstall = True
|
||||
elif (nodejs_min_version_major == nodejs_cur_version_major):
|
||||
if (nodejs_min_version_minor > nodejs_cur_version_minor):
|
||||
@ -192,7 +214,7 @@ def check_nodejs():
|
||||
isNeedReinstall = True
|
||||
|
||||
if (True == isNeedReinstall):
|
||||
print('Installed Node.js version must be 14.14 to 14.x')
|
||||
print('Installed Node.js version must be 18 or higher.')
|
||||
if (host_platform == 'windows'):
|
||||
dependence.append_uninstall('Node.js')
|
||||
dependence.append_install('Node.js')
|
||||
@ -209,18 +231,24 @@ def check_java():
|
||||
dependence = CDependencies()
|
||||
|
||||
base.print_info('Check installed Java')
|
||||
java_version = base.run_command('java -version')['stderr']
|
||||
java_info = base.run_command('java -version')['stderr']
|
||||
|
||||
if (java_version.find('64-Bit') != -1):
|
||||
version_pos = java_info.find('version "')
|
||||
java_v = 0
|
||||
if (version_pos != -1):
|
||||
try:
|
||||
java_v = float(java_info[version_pos + len('version "'): version_pos + len('version "') + 2])
|
||||
except:
|
||||
pass
|
||||
|
||||
if (java_info.find('64-Bit') != -1 and java_v >= 11):
|
||||
print('Installed Java is valid')
|
||||
return dependence
|
||||
|
||||
if (java_version.find('32-Bit') != -1):
|
||||
print('Installed Java must be x64')
|
||||
else:
|
||||
print('Java not found')
|
||||
|
||||
dependence.append_install('Java')
|
||||
else:
|
||||
print('Requires Java version 11+ x64-bit')
|
||||
dependence.append_install('Java')
|
||||
if (version_pos != -1):
|
||||
dependence.append_uninstall('Java')
|
||||
|
||||
return dependence
|
||||
|
||||
def get_erlang_path_to_bin():
|
||||
@ -825,6 +853,7 @@ def installProgram(sName):
|
||||
print(install_command)
|
||||
code = os.system(install_command)
|
||||
base.delete_file(file_name)
|
||||
|
||||
elif (host_platform == 'linux'):
|
||||
if (sName in install_special):
|
||||
code = install_special[sName]()
|
||||
@ -899,7 +928,7 @@ def install_postgresql():
|
||||
return code
|
||||
|
||||
def install_nodejs():
|
||||
os.system('curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -')
|
||||
os.system('curl -sSL https://deb.nodesource.com/setup_18.x | sudo -E bash -')
|
||||
base.print_info("Install node.js...")
|
||||
install_command = 'yes | sudo apt install nodejs'
|
||||
print(install_command)
|
||||
@ -908,8 +937,8 @@ def install_nodejs():
|
||||
downloads_list = {
|
||||
'Windows': {
|
||||
'Git': 'https://github.com/git-for-windows/git/releases/download/v2.29.0.windows.1/Git-2.29.0-64-bit.exe',
|
||||
'Node.js': 'https://nodejs.org/download/release/v14.17.6/node-v14.17.6-x64.msi',
|
||||
'Java': 'https://javadl.oracle.com/webapps/download/AutoDL?BundleId=242990_a4634525489241b9a9e1aa73d9e118e6',
|
||||
'Node.js': 'https://nodejs.org/dist/v18.17.1/node-v18.17.1-x64.msi',
|
||||
'Java': 'https://aka.ms/download-jdk/microsoft-jdk-11.0.18-windows-x64.msi',
|
||||
'RabbitMQ': 'https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.9/rabbitmq-server-3.8.9.exe',
|
||||
'Erlang': 'http://erlang.org/download/otp_win64_23.1.exe',
|
||||
'VC2019x64': 'https://aka.ms/vs/17/release/vc_redist.x64.exe',
|
||||
@ -944,7 +973,6 @@ uninstall_special = {
|
||||
install_params = {
|
||||
'BuildTools': '--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --quiet --wait',
|
||||
'Git': '/VERYSILENT /NORESTART',
|
||||
'Java': '/s',
|
||||
'MySQLServer': {
|
||||
'port': '3306',
|
||||
'user': 'root',
|
||||
@ -963,4 +991,3 @@ install_params = {
|
||||
uninstall_params = {
|
||||
'PostgreSQL': '--mode unattended --unattendedmodeui none'
|
||||
}
|
||||
|
||||
|
||||
@ -10,11 +10,15 @@ import config_server as develop_config_server
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
def make():
|
||||
if ("1" != config.option("develop")):
|
||||
return
|
||||
if not dependence.check_dependencies():
|
||||
exit(1)
|
||||
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()
|
||||
@ -22,5 +26,12 @@ def make():
|
||||
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)
|
||||
|
||||
@ -6,6 +6,9 @@ import os
|
||||
import base
|
||||
import dependence
|
||||
import traceback
|
||||
import develop
|
||||
|
||||
base_dir = base.get_script_dir(__file__)
|
||||
|
||||
def install_module(path):
|
||||
base.print_info('Install: ' + path)
|
||||
@ -41,56 +44,94 @@ def start_linux_services():
|
||||
os.system('sudo service rabbitmq-server restart')
|
||||
|
||||
def run_integration_example():
|
||||
base.cmd_in_dir('../../../document-server-integration/web/documentserver-example/nodejs', 'python', ['run-develop.py'])
|
||||
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 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):
|
||||
platform = base.host_platform()
|
||||
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']
|
||||
|
||||
base.print_info('Build modules')
|
||||
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-user', 'root', '--db-pass', 'onlyoffice'] + 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:
|
||||
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()
|
||||
|
||||
make_start()
|
||||
make_configure(args)
|
||||
make_install()
|
||||
make_run()
|
||||
|
||||
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']
|
||||
|
||||
base.print_info('Build modules')
|
||||
if ("linux" == platform):
|
||||
base.cmd_in_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('../../', '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-user', 'root', '--db-pass', 'onlyoffice'] + args)
|
||||
|
||||
base.cmd_in_dir('../../', 'python', ['make.py'])
|
||||
|
||||
run_integration_example()
|
||||
|
||||
base.create_dir('../../../server/App_Data')
|
||||
|
||||
install_module('../../../server/DocService')
|
||||
install_module('../../../server/Common')
|
||||
install_module('../../../server/FileConverter')
|
||||
|
||||
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('../../../server/DocService', ['sources/server.js'])
|
||||
# run_module('../../../server/DocService', ['sources/gc.js'])
|
||||
run_module('../../../server/FileConverter', ['sources/convertermaster.js'])
|
||||
# run_module('../../../server/SpellChecker', ['sources/server.js'])
|
||||
except SystemExit:
|
||||
input("Ignoring SystemExit. Press Enter to continue...")
|
||||
exit(0)
|
||||
|
||||
179
scripts/license_checker/Readme.md
Normal file
179
scripts/license_checker/Readme.md
Normal file
@ -0,0 +1,179 @@
|
||||
# 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"
|
||||
```
|
||||
|
||||
* `licensePath` specifies the path to the license template.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"licensePath": "build_tools/scripts/license_checker/license_template.txt"
|
||||
```
|
||||
|
||||
* `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"]
|
||||
```
|
||||
|
||||
* `startMultiComm` the line that starts the multiline comment.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"startMultiComm": "/*"
|
||||
```
|
||||
|
||||
* `endMultiComm` the line that ends the multiline comment.
|
||||
You should carefully consider the formatting
|
||||
of the string, all spaces are taken into account.
|
||||
This affects how the license check works.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"endMultiComm": " */"
|
||||
```
|
||||
|
||||
Space at the beginning for a prettier comment.
|
||||
|
||||
* `prefix` the line on which each comment
|
||||
line will begin, except for the
|
||||
beginning and end.
|
||||
**For example:**
|
||||
|
||||
```json
|
||||
"prefix": " *"
|
||||
```
|
||||
|
||||
Space at the beginning for a prettier comment.
|
||||
* `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",
|
||||
]
|
||||
```
|
||||
|
||||
Any number of configurations can be
|
||||
specified, they can overlap
|
||||
if we need to check
|
||||
files in the same folder in different ways.
|
||||
|
||||
227
scripts/license_checker/config.json
Normal file
227
scripts/license_checker/config.json
Normal file
@ -0,0 +1,227 @@
|
||||
{
|
||||
"basePath": "../../../",
|
||||
"reportFolder": "build_tools/scripts/license_checker/reports",
|
||||
"licensePath": "build_tools/scripts/license_checker/header.license",
|
||||
"printChecking": false,
|
||||
"printReports": false,
|
||||
"fix": ["OUTDATED"],
|
||||
"configs": [
|
||||
{
|
||||
"dir": "core",
|
||||
"fileExtensions": [".h", ".c", ".hpp", ".cpp", ".hxx", ".cxx", ".cs", ".js", ".m", ".mm", ".license"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"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/HtmlFile2",
|
||||
"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"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"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"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"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"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "sdkjs-ooxml",
|
||||
"fileExtensions": [".js"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "web-apps",
|
||||
"fileExtensions": [".js"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor",
|
||||
"search"
|
||||
],
|
||||
"ignoreListDir": [
|
||||
"web-apps/apps/common/mobile",
|
||||
"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/mods/perfect-scrollbar.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"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"ignoreListDirName": [
|
||||
"node_modules",
|
||||
"vendor"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "server",
|
||||
"fileExtensions": [".js"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"ignoreListDir": [
|
||||
"server/FileConverter/bin"
|
||||
],
|
||||
"ignoreListDirName": [
|
||||
"node_modules"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "server-lockstorage",
|
||||
"fileExtensions": [".js"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"ignoreListDirName": [
|
||||
"node_modules"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "server-license",
|
||||
"fileExtensions": [".js"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"ignoreListDirName": [
|
||||
"node_modules"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "server-license-key",
|
||||
"fileExtensions": [".js"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"ignoreListDirName": [
|
||||
"node_modules"
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir": "editors-ios",
|
||||
"fileExtensions": [".h", ".c", ".hpp", ".cpp", ".hxx", ".cxx", ".m", ".mm"],
|
||||
"startMultiComm": "/*",
|
||||
"endMultiComm": " */",
|
||||
"prefix": " *",
|
||||
"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"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
28
scripts/license_checker/header.license
Normal file
28
scripts/license_checker/header.license
Normal file
@ -0,0 +1,28 @@
|
||||
(c) Copyright Ascensio System SIA 2010-2023
|
||||
|
||||
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
|
||||
360
scripts/license_checker/license_checker.py
Normal file
360
scripts/license_checker/license_checker.py
Normal file
@ -0,0 +1,360 @@
|
||||
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.
|
||||
startMultiComm: characters to start a multi-line comment.
|
||||
endMultiComm: characters to end a multi-line comment.
|
||||
prefix: prefix for multiline comments
|
||||
ignoreListDir: Ignored folder paths.
|
||||
ignoreListDirName: Ignored folder names.
|
||||
ignoreListFile: Ignored file paths.
|
||||
allowListFile: allow file paths.
|
||||
"""
|
||||
def __init__(self,
|
||||
dir: str,
|
||||
fileExtensions: list[str],
|
||||
startMultiComm: str,
|
||||
endMultiComm: str,
|
||||
prefix: str = '',
|
||||
allowListFile: list[str] = [],
|
||||
ignoreListDir: list[str] = [],
|
||||
ignoreListDirName: list[str] = [],
|
||||
ignoreListFile: list[str] = []) -> None:
|
||||
|
||||
self._dir = dir
|
||||
self._fileExtensions = fileExtensions
|
||||
self._startMultiComm = startMultiComm
|
||||
self._endMultiComm = endMultiComm
|
||||
self._prefix = prefix
|
||||
self._allowListFile = allowListFile
|
||||
self._ignoreListDir = ignoreListDir
|
||||
self._ignoreListDirName = ignoreListDirName
|
||||
self._ignoreListFile = ignoreListFile
|
||||
|
||||
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 getPrefix(self) -> str:
|
||||
return self._prefix
|
||||
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'
|
||||
LICENSE_TEMPLATE_PATH: str = _json.get('licensePath') or 'build_tools/scripts/license_checker/header.license'
|
||||
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)
|
||||
|
||||
with open(LICENSE_TEMPLATE_PATH, 'r') as f:
|
||||
LICENSE: list[str] = f.readlines()
|
||||
if not LICENSE:
|
||||
raise Exception(f'Error getting license template. Cannot read {LICENSE_TEMPLATE_PATH} file. Is not it empty?')
|
||||
|
||||
def getLicense(start: str, prefix: str, end: str) -> list[str]:
|
||||
"""Returns a valid license for any kind of comment prefix."""
|
||||
result = [start]
|
||||
for i in LICENSE:
|
||||
if i == '\n':
|
||||
result.append(prefix)
|
||||
else:
|
||||
result.append(f'{" ".join([prefix, i.strip()])}')
|
||||
result.append(prefix)
|
||||
result.append(end)
|
||||
return result
|
||||
|
||||
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 getLicense(self):
|
||||
return getLicense(start=self._config.getStartMultiComm(), prefix=self._config.getPrefix(), end=self._config.getEndMultiComm())
|
||||
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.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].strip('\n')):
|
||||
invalidLinesCount += 1
|
||||
lastWrongLine = i
|
||||
if (invalidLinesCount == 1):
|
||||
r = r'\d\d\d\d\-\d\d\d\d'
|
||||
testDate = re.search(r, test[lastWrongLine])
|
||||
licenseDate = re.search(r, license[lastWrongLine])
|
||||
|
||||
if testDate and licenseDate:
|
||||
testDate = testDate.group()
|
||||
licenseDate = licenseDate.group()
|
||||
else:
|
||||
return Report(pathToFile=pathToFile,
|
||||
error=Error(errorType=ErrorType.INVALID_LICENSE),
|
||||
message=f'Something wrong...')
|
||||
|
||||
testLastYear = testDate.split('-')[1]
|
||||
licenseLastYear = licenseDate.split('-')[1]
|
||||
if (int(testLastYear) < int(licenseLastYear)):
|
||||
return Report(pathToFile=pathToFile,
|
||||
error=Error(errorType=ErrorType.OUTDATED),
|
||||
message=f'Found date {testDate}, expected {licenseDate}')
|
||||
else:
|
||||
return Report(pathToFile=pathToFile,
|
||||
error=Error(errorType=ErrorType.INVALID_LICENSE),
|
||||
message=f"Found something similar to the date: {testDate}, but it's not correct. Expected: {licenseDate}")
|
||||
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._checker.getLicense()
|
||||
file.writelines(map(lambda x: "".join([x, '\n']), license))
|
||||
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._checker.getLicense()
|
||||
file.writelines(map(lambda x: "".join([x, '\n']), 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') 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')
|
||||
|
||||
@ -11,16 +11,16 @@ 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_package_name = company_name + "-" + desktop_product_name_s
|
||||
desktop_vcredist_list = ["2022"]
|
||||
desktop_update_changes_list = {
|
||||
"en": "changes",
|
||||
"ru": "changes_ru"
|
||||
}
|
||||
desktop_changes_dir = "desktop-apps/win-linux/package/windows/update/changes"
|
||||
desktop_changes_url = "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/changes"
|
||||
desktop_updates_url = "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/updates"
|
||||
|
||||
if utils.is_macos():
|
||||
desktop_package_name = "ONLYOFFICE"
|
||||
|
||||
@ -9,57 +9,42 @@ def make():
|
||||
utils.log_h1("BUILDER")
|
||||
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 aws_s3_upload(files, key, ptype=None):
|
||||
if not files:
|
||||
return False
|
||||
def s3_upload(files, dst):
|
||||
if not files: return False
|
||||
ret = True
|
||||
key = "builder/" + key
|
||||
for file in files:
|
||||
args = ["aws"]
|
||||
if hasattr(branding, "s3_endpoint_url"):
|
||||
args += ["--endpoint-url=" + branding.s3_endpoint_url]
|
||||
args += [
|
||||
"s3", "cp", "--no-progress", "--acl", "public-read",
|
||||
file, "s3://" + branding.s3_bucket + "/" + key
|
||||
]
|
||||
if common.os_family == "windows":
|
||||
upload = utils.cmd(*args, verbose=True)
|
||||
else:
|
||||
upload = utils.sh(" ".join(args), verbose=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.add_deploy_data(key)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
ret &= upload
|
||||
if upload and ptype is not None:
|
||||
full_key = key
|
||||
if full_key.endswith("/"): full_key += utils.get_basename(file)
|
||||
utils.add_deploy_data(
|
||||
"builder", ptype, file, full_key,
|
||||
branding.s3_bucket, branding.s3_region
|
||||
)
|
||||
return ret
|
||||
|
||||
def make_windows():
|
||||
global inno_file, zip_file, suffix, key_prefix
|
||||
utils.set_cwd("document-builder-package")
|
||||
|
||||
prefix = common.platforms[common.platform]["prefix"]
|
||||
company = branding.company_name.lower()
|
||||
product = branding.builder_product_name.replace(" ","").lower()
|
||||
prefix = common.platformPrefixes[common.platform]
|
||||
company = branding.company_name
|
||||
product = branding.builder_product_name.replace(" ","")
|
||||
source_dir = "..\\build_tools\\out\\%s\\%s\\%s" % (prefix, company, product)
|
||||
package_name = company + "_" + product
|
||||
package_name = company + "-" + product
|
||||
package_version = common.version + "." + common.build
|
||||
suffix = {
|
||||
"windows_x64": "x64",
|
||||
"windows_x86": "x86",
|
||||
"windows_x64_xp": "x64_xp",
|
||||
"windows_x86_xp": "x86_xp"
|
||||
"windows_x86": "x86"
|
||||
}[common.platform]
|
||||
zip_file = "%s_%s_%s.zip" % (package_name, package_version, suffix)
|
||||
inno_file = "%s_%s_%s.exe" % (package_name, package_version, suffix)
|
||||
zip_file = "%s-%s-%s-%s.zip" % (company, product, package_version, suffix)
|
||||
inno_file = "%s-%s-%s-%s.exe" % (company, product, package_version, suffix)
|
||||
|
||||
if common.clean:
|
||||
utils.log_h2("builder clean")
|
||||
@ -85,9 +70,7 @@ def make_zip():
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("builder zip deploy")
|
||||
ret = aws_s3_upload(
|
||||
["build\\" + zip_file], "win/generic/%s/" % common.channel, "Portable"
|
||||
)
|
||||
ret = s3_upload(["build\\" + zip_file], "builder/win/generic/")
|
||||
utils.set_summary("builder zip deploy", ret)
|
||||
return
|
||||
|
||||
@ -96,28 +79,60 @@ def make_inno():
|
||||
utils.log_h3(inno_file)
|
||||
|
||||
args = [
|
||||
"-Arch " + suffix,
|
||||
"-Version " + common.version,
|
||||
"-Build " + common.build
|
||||
"-Arch", suffix,
|
||||
"-Version", common.version,
|
||||
"-Build", common.build
|
||||
]
|
||||
if not branding.onlyoffice:
|
||||
args.append("-Branding '..\\..\\%s\\document-builder-package\\exe'" % common.branding)
|
||||
args += [
|
||||
"-Branding", "%s\\%s\\document-builder-package\\exe" % (common.workspace_dir, common.branding)
|
||||
]
|
||||
if common.sign:
|
||||
args.append("-Sign")
|
||||
args.append("-CertName '%s'" % branding.cert_name)
|
||||
args += [
|
||||
"-Sign",
|
||||
"-CertName", branding.cert_name
|
||||
]
|
||||
ret = utils.ps1(
|
||||
".\\make_inno.ps1", args, creates="build\\" + inno_file, verbose=True
|
||||
"make_inno.ps1", args, creates="build\\" + inno_file, verbose=True
|
||||
)
|
||||
utils.set_summary("builder inno build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("builder inno deploy")
|
||||
ret = aws_s3_upload(
|
||||
["build\\" + inno_file], "win/inno/%s/" % common.channel, "Installer"
|
||||
)
|
||||
ret = s3_upload(["build\\" + inno_file], "builder/win/inno/")
|
||||
utils.set_summary("builder inno deploy", ret)
|
||||
return
|
||||
|
||||
def make_macos():
|
||||
company = branding.company_name.lower()
|
||||
product = branding.builder_product_name.replace(" ","").lower()
|
||||
source_dir = "build_tools/out/%s/%s/%s" % (common.prefix, company, product)
|
||||
arch_list = {
|
||||
"darwin_x86_64": "x86_64",
|
||||
"darwin_arm64": "arm64"
|
||||
}
|
||||
suffix = arch_list[common.platform]
|
||||
builder_tar = "../%s-%s-%s-%s-%s.tar.xz" % \
|
||||
(company, product, common.version, common.build, suffix)
|
||||
|
||||
utils.set_cwd(source_dir)
|
||||
|
||||
if common.clean:
|
||||
utils.log_h2("builder clean")
|
||||
utils.delete_files("../*.tar*")
|
||||
|
||||
utils.log_h2("builder build")
|
||||
ret = utils.sh("tar --xz -cvf %s *" % builder_tar, creates=builder_tar, verbose=True)
|
||||
utils.set_summary("builder build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("builder deploy")
|
||||
ret = s3_upload([builder_tar], "builder/mac/")
|
||||
utils.set_summary("builder deploy", ret)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
def make_linux():
|
||||
utils.set_cwd("document-builder-package")
|
||||
|
||||
@ -130,35 +145,25 @@ def make_linux():
|
||||
ret = utils.sh("make clean && make " + " ".join(make_args), verbose=True)
|
||||
utils.set_summary("builder build", ret)
|
||||
|
||||
rpm_arch = "x86_64"
|
||||
if common.platform == "linux_aarch64": rpm_arch = "aarch64"
|
||||
|
||||
if common.deploy:
|
||||
utils.log_h2("builder deploy")
|
||||
if ret:
|
||||
if "tar" in branding.builder_make_targets:
|
||||
utils.log_h2("builder tar deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("tar/*.tar.gz"),
|
||||
"linux/generic/%s/" % common.channel,
|
||||
"Portable"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("tar/*.tar.gz"),
|
||||
"builder/linux/generic/")
|
||||
utils.set_summary("builder tar deploy", ret)
|
||||
if "deb" in branding.builder_make_targets:
|
||||
utils.log_h2("builder deb deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("deb/*.deb"),
|
||||
"linux/debian/%s/" % common.channel,
|
||||
"Debian"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("deb/*.deb"),
|
||||
"builder/linux/debian/")
|
||||
utils.set_summary("builder deb deploy", ret)
|
||||
if "rpm" in branding.builder_make_targets:
|
||||
utils.log_h2("builder rpm deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("rpm/builddir/RPMS/" + rpm_arch + "/*.rpm"),
|
||||
"linux/rhel/%s/" % common.channel,
|
||||
"CentOS"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("rpm/builddir/RPMS/*/*.rpm"),
|
||||
"builder/linux/rhel/")
|
||||
utils.set_summary("builder rpm deploy", ret)
|
||||
else:
|
||||
if "tar" in branding.builder_make_targets:
|
||||
|
||||
@ -1,49 +1,17 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
platforms = {
|
||||
"windows_x64": { "title": "Windows x64", "prefix": "win_64" },
|
||||
"windows_x64_xp": { "title": "Windows x64 XP", "prefix": "win_64_xp" },
|
||||
"windows_x86": { "title": "Windows x86", "prefix": "win_32" },
|
||||
"windows_x86_xp": { "title": "Windows x86 XP", "prefix": "win_32_xp" },
|
||||
"darwin_x86_64": { "title": "macOS x86_64", "prefix": "mac_64" },
|
||||
"darwin_x86_64_v8": { "title": "macOS x86_64 V8", "prefix": "mac_64" },
|
||||
"darwin_arm64": { "title": "macOS arm64", "prefix": "mac_arm64" },
|
||||
"linux_x86_64": { "title": "Linux x86_64", "prefix": "linux_64" },
|
||||
"linux_aarch64": { "title": "Linux aarch64", "prefix": "linux_arm64" },
|
||||
"android": { "title": "Android" }
|
||||
platformPrefixes = {
|
||||
"windows_x64": "win_64",
|
||||
"windows_x86": "win_32",
|
||||
"windows_x64_xp": "win_64_xp",
|
||||
"windows_x86_xp": "win_32_xp",
|
||||
"darwin_x86_64": "mac_64",
|
||||
"darwin_arm64": "mac_arm64",
|
||||
"darwin_x86_64_v8": "mac_64",
|
||||
"linux_x86_64": "linux_64",
|
||||
"linux_aarch64": "linux_arm64",
|
||||
"linux_x86_64_cef": "linux_64",
|
||||
}
|
||||
|
||||
out_dir = "build_tools/out"
|
||||
tsa_server = "http://timestamp.digicert.com"
|
||||
vcredist_links = {
|
||||
"2022": {
|
||||
"x64": {
|
||||
"url": "https://aka.ms/vs/17/release/vc_redist.x64.exe",
|
||||
"md5": "703bd677778f2a1ba1eb4338bac3b868"
|
||||
},
|
||||
"x86": {
|
||||
"url": "https://aka.ms/vs/17/release/vc_redist.x86.exe",
|
||||
"md5": "732d0ac9cd31b8136f1c8e72efec1636"
|
||||
}
|
||||
},
|
||||
"2015": {
|
||||
"x64": {
|
||||
"url": "https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe",
|
||||
"md5": "27b141aacc2777a82bb3fa9f6e5e5c1c"
|
||||
},
|
||||
"x86": {
|
||||
"url": "https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe",
|
||||
"md5": "1a15e6606bac9647e7ad3caa543377cf"
|
||||
}
|
||||
},
|
||||
"2013": {
|
||||
"x64": {
|
||||
"url": "https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe",
|
||||
"md5": "96b61b8e069832e6b809f24ea74567ba"
|
||||
},
|
||||
"x86": {
|
||||
"url": "https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe",
|
||||
"md5": "0fc525b6b7b96a87523daa7a0013c69d"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ def make():
|
||||
return
|
||||
|
||||
def make_core():
|
||||
prefix = common.platforms[common.platform]["prefix"]
|
||||
prefix = common.platformPrefixes[common.platform]
|
||||
company = branding.company_name.lower()
|
||||
repos = {
|
||||
"windows_x64": { "repo": "windows", "arch": "x64", "version": common.version + "." + common.build },
|
||||
@ -26,34 +26,54 @@ def make_core():
|
||||
repo = repos[common.platform]
|
||||
branch = utils.get_env("BRANCH_NAME")
|
||||
core_7z = utils.get_path("build_tools/out/%s/%s/core.7z" % (prefix, company))
|
||||
dest_version = "%s/core/%s/%s/%s/" % (repo["repo"], branch, repo["version"], repo["arch"])
|
||||
dest_latest = "%s/core/%s/%s/%s/" % (repo["repo"], branch, "latest", repo["arch"])
|
||||
dest_version = "%s/core/%s/%s/%s" % (repo["repo"], branch, repo["version"], repo["arch"])
|
||||
dest_latest = "%s/core/%s/%s/%s" % (repo["repo"], branch, "latest", repo["arch"])
|
||||
|
||||
if branch is None:
|
||||
utils.log_err("BRANCH_NAME variable is undefined")
|
||||
utils.set_summary("core deploy", False)
|
||||
return
|
||||
if not utils.is_file(core_7z):
|
||||
utils.log_err("core.7z does not exist")
|
||||
utils.log_err("file not exist: " + core_7z)
|
||||
utils.set_summary("core deploy", False)
|
||||
return
|
||||
|
||||
utils.log_h2("core deploy")
|
||||
args = ["aws", "s3", "cp", "--acl", "public-read", "--no-progress",
|
||||
core_7z, "s3://" + branding.s3_bucket + "/" + dest_version + "core.7z"]
|
||||
if common.os_family == "windows":
|
||||
ret = utils.cmd(*args, verbose=True)
|
||||
else:
|
||||
ret = utils.sh(" ".join(args), verbose=True)
|
||||
ret = utils.s3_upload(
|
||||
core_7z,
|
||||
"s3://" + branding.s3_bucket + "/" + dest_version + "/core.7z")
|
||||
if ret:
|
||||
utils.add_deploy_data("core", "Archive", core_7z, dest_version + "core.7z", branding.s3_bucket, branding.s3_region)
|
||||
args = ["aws", "s3", "sync", "--delete",
|
||||
"--acl", "public-read", "--no-progress",
|
||||
"s3://" + branding.s3_bucket + "/" + dest_version,
|
||||
"s3://" + branding.s3_bucket + "/" + dest_latest]
|
||||
if common.os_family == "windows":
|
||||
ret &= utils.cmd(*args, verbose=True)
|
||||
else:
|
||||
ret &= utils.sh(" ".join(args), verbose=True)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_version + "/core.7z")
|
||||
utils.add_deploy_data(dest_version + "/core.7z")
|
||||
ret = utils.s3_sync(
|
||||
"s3://" + branding.s3_bucket + "/" + dest_version + "/",
|
||||
"s3://" + branding.s3_bucket + "/" + dest_latest + "/",
|
||||
delete=True)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_latest + "/core.7z")
|
||||
utils.set_summary("core deploy", ret)
|
||||
return
|
||||
|
||||
def deploy_closuremaps(license):
|
||||
if not common.deploy: return
|
||||
utils.log_h1("CLOSURE MAPS")
|
||||
utils.set_cwd(utils.get_path("sdkjs/build/maps"))
|
||||
|
||||
maps = utils.glob_path("*.js.map")
|
||||
if not maps:
|
||||
utils.log_err("files do not exist")
|
||||
utils.set_summary("closure maps " + license + " deploy", False)
|
||||
return
|
||||
|
||||
utils.log_h2("closure maps " + license + " deploy")
|
||||
ret = True
|
||||
for f in maps:
|
||||
key = "closure-maps/%s/%s/%s/%s" % (license, common.version, common.build, f)
|
||||
upload = utils.s3_upload(f, "s3://" + branding.s3_bucket + "/" + key)
|
||||
ret &= upload
|
||||
if upload:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
utils.add_deploy_data(key)
|
||||
utils.set_summary("closure maps " + license + " deploy", ret)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import re
|
||||
import package_utils as utils
|
||||
import package_common as common
|
||||
import package_branding as branding
|
||||
@ -18,31 +19,16 @@ def make():
|
||||
utils.log("Unsupported host OS")
|
||||
return
|
||||
|
||||
def aws_s3_upload(files, key, ptype=None):
|
||||
if not files:
|
||||
return False
|
||||
def s3_upload(files, dst):
|
||||
if not files: return False
|
||||
ret = True
|
||||
key = "desktop/" + key
|
||||
for file in files:
|
||||
args = ["aws"]
|
||||
if hasattr(branding, "s3_endpoint_url"):
|
||||
args += ["--endpoint-url=" + branding.s3_endpoint_url]
|
||||
args += [
|
||||
"s3", "cp", "--no-progress", "--acl", "public-read",
|
||||
file, "s3://" + branding.s3_bucket + "/" + key
|
||||
]
|
||||
if common.os_family == "windows":
|
||||
upload = utils.cmd(*args, verbose=True)
|
||||
else:
|
||||
upload = utils.sh(" ".join(args), verbose=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.add_deploy_data(key)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
ret &= upload
|
||||
if upload and ptype is not None:
|
||||
full_key = key
|
||||
if full_key.endswith("/"): full_key += utils.get_basename(file)
|
||||
utils.add_deploy_data(
|
||||
"desktop", ptype, file, full_key,
|
||||
branding.s3_bucket, branding.s3_region
|
||||
)
|
||||
return ret
|
||||
|
||||
#
|
||||
@ -50,39 +36,33 @@ def aws_s3_upload(files, key, ptype=None):
|
||||
#
|
||||
|
||||
def make_windows():
|
||||
global package_version, iscc_args, source_dir, source_help_dir, \
|
||||
inno_file, inno_help_file, inno_update_file, advinst_file, zip_file, \
|
||||
arch_list, inno_arch_list
|
||||
global package_version, arch_list, source_dir, branding_dir, desktop_dir, viewer_dir, \
|
||||
inno_file, inno_sa_file, inno_update_file, inno_update_file_new, advinst_file
|
||||
utils.set_cwd("desktop-apps\\win-linux\\package\\windows")
|
||||
|
||||
prefix = common.platforms[common.platform]["prefix"]
|
||||
company = branding.company_name.lower()
|
||||
product = branding.desktop_product_name.replace(" ","").lower()
|
||||
package_name = branding.desktop_package_name
|
||||
package_version = common.version + "." + common.build
|
||||
source_dir = "..\\..\\..\\..\\build_tools\\out\\%s\\%s\\%s" % (prefix, company, product)
|
||||
arch_list = {
|
||||
"windows_x64": "x64",
|
||||
"windows_x64_xp": "x64",
|
||||
"windows_x86": "x86",
|
||||
"windows_x86_xp": "x86"
|
||||
}
|
||||
inno_arch_list = {
|
||||
"windows_x64": "64",
|
||||
"windows_x86": "32",
|
||||
"windows_x64_xp": "64",
|
||||
"windows_x86_xp": "32"
|
||||
}
|
||||
suffix = arch_list[common.platform]
|
||||
if common.platform.endswith("_xp"): suffix += "_xp"
|
||||
zip_file = "%s_%s_%s.zip" % (package_name, package_version, suffix)
|
||||
inno_file = "%s_%s_%s.exe" % (package_name, package_version, suffix)
|
||||
inno_help_file = "%s_Help_%s_%s.exe" % (package_name, package_version, suffix)
|
||||
inno_update_file = "update\\editors_update_%s.exe" % suffix
|
||||
advinst_file = "%s_%s_%s.msi" % (package_name, package_version, suffix)
|
||||
if common.platform.endswith("_xp"): suffix += "-xp"
|
||||
inno_file = "%s-%s-%s.exe" % (package_name, package_version, suffix)
|
||||
inno_sa_file = "%s-Standalone-%s-%s.exe" % (package_name, package_version, suffix)
|
||||
inno_update_file = "update\\editors_update_%s.exe" % suffix.replace("-","_")
|
||||
inno_update_file_new = "%s-Update-%s-%s.exe" % (package_name, package_version, suffix)
|
||||
advinst_file = "%s-%s-%s.msi" % (package_name, package_version, suffix)
|
||||
if branding.onlyoffice:
|
||||
branding_dir = "."
|
||||
else:
|
||||
branding_dir = common.workspace_dir + "\\" + common.branding + "\\desktop-apps\\win-linux\\package\\windows"
|
||||
|
||||
if common.clean:
|
||||
utils.log_h2("desktop clean")
|
||||
utils.delete_dir("build")
|
||||
# utils.delete_dir("data\\vcredist")
|
||||
utils.delete_dir("DesktopEditors-cache")
|
||||
utils.delete_files("*.exe")
|
||||
@ -94,26 +74,30 @@ def make_windows():
|
||||
utils.delete_files("update\\*.xml")
|
||||
utils.delete_files("update\\*.html")
|
||||
|
||||
utils.log_h2("copy arifacts")
|
||||
source_dir = "%s\\build_tools\\out\\%s\\%s" \
|
||||
% (common.workspace_dir, common.prefix, branding.company_name)
|
||||
utils.create_dir("build")
|
||||
desktop_dir = "build\\" + branding.desktop_product_name_s
|
||||
utils.copy_dir(source_dir + "\\" + branding.desktop_product_name_s, desktop_dir)
|
||||
if not branding.onlyoffice:
|
||||
viewer_dir = "build\\" + branding.viewer_product_name_s
|
||||
utils.copy_dir(source_dir + "\\" + branding.viewer_product_name_s, viewer_dir)
|
||||
|
||||
make_zip()
|
||||
|
||||
vcdl = True
|
||||
vcdl &= download_vcredist("2013")
|
||||
vcdl &= download_vcredist("2022")
|
||||
|
||||
if not vcdl:
|
||||
if not download_vcredist():
|
||||
utils.set_summary("desktop inno build", False)
|
||||
# utils.set_summary("desktop inno help build", False)
|
||||
utils.set_summary("desktop inno standalone build", False)
|
||||
utils.set_summary("desktop inno update build", False)
|
||||
utils.set_summary("desktop advinst build", False)
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
make_inno()
|
||||
# make_inno_help()
|
||||
make_inno_update()
|
||||
|
||||
if common.platform == "windows_x64":
|
||||
make_winsparkle_files()
|
||||
make_update_files()
|
||||
|
||||
if common.platform in ["windows_x64", "windows_x86"]:
|
||||
make_advinst()
|
||||
@ -123,264 +107,224 @@ def make_windows():
|
||||
|
||||
def make_zip():
|
||||
utils.log_h2("desktop zip build")
|
||||
ret = utils.cmd(
|
||||
"7z", "a", "-y", zip_file, source_dir + "\\*",
|
||||
creates=zip_file, verbose=True
|
||||
)
|
||||
|
||||
args = [
|
||||
"-Target", common.platform,
|
||||
"-BuildDir", "build",
|
||||
"-DesktopDir", branding.desktop_product_name_s
|
||||
]
|
||||
if not branding.onlyoffice:
|
||||
args += ["-MultimediaDir", branding.viewer_product_name_s]
|
||||
args += ["-BrandingDir", branding_dir]
|
||||
if branding.onlyoffice and not common.platform.endswith("_xp"):
|
||||
args += ["-ExcludeHelp"]
|
||||
if common.sign:
|
||||
args += ["-Sign", "-CertName", branding.cert_name]
|
||||
ret = utils.ps1("make_zip.ps1", args, verbose=True)
|
||||
utils.set_summary("desktop zip build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("desktop zip deploy")
|
||||
ret = aws_s3_upload(
|
||||
[zip_file],
|
||||
"win/generic/%s/" % common.channel,
|
||||
"Portable"
|
||||
)
|
||||
ret = s3_upload(utils.glob_path("*.zip"), "desktop/win/generic/")
|
||||
utils.set_summary("desktop zip deploy", ret)
|
||||
return
|
||||
|
||||
def download_vcredist(year):
|
||||
utils.log_h2("vcredist " + year + " download")
|
||||
def download_vcredist():
|
||||
vcredist = {
|
||||
# Microsoft Visual C++ 2015-2022 Redistributable - 14.38.33135
|
||||
"windows_x64": {
|
||||
"url": "https://aka.ms/vs/17/release/vc_redist.x64.exe",
|
||||
"md5": "a8a68bcc74b5022467f12587baf1ef93"
|
||||
},
|
||||
"windows_x86": {
|
||||
"url": "https://aka.ms/vs/17/release/vc_redist.x86.exe",
|
||||
"md5": "9882a328c8414274555845fa6b542d1e"
|
||||
},
|
||||
# Microsoft Visual C++ 2015-2019 Redistributable - 14.27.29114
|
||||
"windows_x64_xp": {
|
||||
"url": "https://download.visualstudio.microsoft.com/download/pr/722d59e4-0671-477e-b9b1-b8da7d4bd60b/591CBE3A269AFBCC025681B968A29CD191DF3C6204712CBDC9BA1CB632BA6068/VC_redist.x64.exe",
|
||||
"md5": "bc8e3e714b727b3bb18614bd6a51a3d3"
|
||||
},
|
||||
"windows_x86_xp": {
|
||||
"url": "https://download.visualstudio.microsoft.com/download/pr/c168313d-1754-40d4-8928-18632c2e2a71/D305BAA965C9CD1B44EBCD53635EE9ECC6D85B54210E2764C8836F4E9DEFA345/VC_redist.x86.exe",
|
||||
"md5": "ec3bee79a85ae8e3581a8c181b336d1e"
|
||||
}
|
||||
}
|
||||
vcredist_file = "data\\vcredist_%s.exe" % arch_list[common.platform]
|
||||
|
||||
arch = arch_list[common.platform]
|
||||
link = common.vcredist_links[year][arch]["url"]
|
||||
md5 = common.vcredist_links[year][arch]["md5"]
|
||||
vcredist_file = "data\\vcredist\\vcredist_%s_%s.exe" % (year, arch)
|
||||
|
||||
utils.log_h2(vcredist_file)
|
||||
utils.create_dir(utils.get_dirname(vcredist_file))
|
||||
ret = utils.download_file(link, vcredist_file, md5, verbose=True)
|
||||
utils.set_summary("vcredist " + year + " download", ret)
|
||||
utils.log_h2("vcredist download " + vcredist_file)
|
||||
ret = utils.download_file(
|
||||
vcredist[common.platform]["url"],
|
||||
vcredist_file,
|
||||
vcredist[common.platform]["md5"],
|
||||
verbose=True)
|
||||
utils.set_summary("vcredist download", ret)
|
||||
return ret
|
||||
|
||||
def make_inno():
|
||||
global iscc_args
|
||||
utils.log_h2("desktop inno build")
|
||||
utils.log_h3(inno_file)
|
||||
|
||||
inno_arch_list = {
|
||||
"windows_x64": "64",
|
||||
"windows_x86": "32",
|
||||
"windows_x64_xp": "64",
|
||||
"windows_x86_xp": "32"
|
||||
}
|
||||
iscc_args = [
|
||||
"/Qp",
|
||||
"/DVERSION=" + package_version,
|
||||
"/DsAppVersion=" + package_version,
|
||||
"/DDEPLOY_PATH=" + source_dir,
|
||||
"/D_ARCH=" + inno_arch_list[common.platform]
|
||||
"/DDEPLOY_PATH=" + desktop_dir,
|
||||
"/DARCH=" + arch_list[common.platform],
|
||||
"/D_ARCH=" + inno_arch_list[common.platform],
|
||||
]
|
||||
if branding.onlyoffice:
|
||||
iscc_args.append("/D_ONLYOFFICE=1")
|
||||
else:
|
||||
iscc_args.append("/DsBrandingFolder=" + \
|
||||
utils.get_abspath(common.workspace_dir + "\\" + common.branding + "\\desktop-apps"))
|
||||
if common.platform in ["windows_x64_xp", "windows_x86_xp"]:
|
||||
if common.platform.endswith("_xp"):
|
||||
iscc_args.append("/D_WIN_XP=1")
|
||||
if common.sign:
|
||||
iscc_args.append("/DENABLE_SIGNING=1")
|
||||
iscc_args.append("/Sbyparam=signtool.exe sign /v /n $q" + \
|
||||
iscc_args.append("/Sbyparam=signtool.exe sign /a /v /n $q" + \
|
||||
branding.cert_name + "$q /t " + common.tsa_server + " $f")
|
||||
args = ["iscc"] + iscc_args + ["common.iss"]
|
||||
ret = utils.cmd(*args, creates=inno_file, verbose=True)
|
||||
utils.set_summary("desktop inno build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
if branding.onlyoffice and not common.platform.endswith("_xp"):
|
||||
args = ["iscc"] + iscc_args + ["/DEMBED_HELP", "/DsPackageEdition=Standalone", "common.iss"]
|
||||
ret = utils.cmd(*args, creates=inno_sa_file, verbose=True)
|
||||
utils.set_summary("desktop inno standalone build", ret)
|
||||
|
||||
if not (hasattr(branding, 'desktop_updates_skip_iss_wrapper') and branding.desktop_updates_skip_iss_wrapper):
|
||||
args = ["iscc"] + iscc_args + ["/DTARGET_NAME=" + inno_file, "update_common.iss"]
|
||||
ret = utils.cmd(*args, creates=inno_update_file, verbose=True)
|
||||
utils.set_summary("desktop inno update build", ret)
|
||||
|
||||
if common.deploy:
|
||||
utils.log_h2("desktop inno deploy")
|
||||
ret = aws_s3_upload(
|
||||
[inno_file],
|
||||
"win/inno/%s/%s/" % (common.version, common.build),
|
||||
"Installer"
|
||||
)
|
||||
ret = s3_upload([inno_file], "desktop/win/inno/")
|
||||
utils.set_summary("desktop inno deploy", ret)
|
||||
return
|
||||
|
||||
def make_inno_help():
|
||||
utils.log_h2("desktop inno help build")
|
||||
utils.log_h3(inno_help_file)
|
||||
if branding.onlyoffice and not common.platform.endswith("_xp"):
|
||||
utils.log_h2("desktop inno standalone deploy")
|
||||
ret = s3_upload([inno_sa_file], "desktop/win/inno/")
|
||||
utils.set_summary("desktop inno standalone deploy", ret)
|
||||
|
||||
args = [
|
||||
"iscc",
|
||||
"/Qp",
|
||||
"/DsAppVersion=" + package_version,
|
||||
"/DDEPLOY_PATH=" + source_help_dir,
|
||||
"/D_ARCH=" + inno_arch_list[common.platform]
|
||||
]
|
||||
if branding.onlyoffice:
|
||||
args.append("/D_ONLYOFFICE=1")
|
||||
else:
|
||||
args.append("/DsBrandingFolder=" + \
|
||||
utils.get_abspath(common.workspace_dir + "\\" + common.branding + "\\desktop-apps"))
|
||||
if common.sign:
|
||||
args.append("/DENABLE_SIGNING=1")
|
||||
args.append("/Sbyparam=signtool.exe sign /v /n $q" + \
|
||||
branding.cert_name + "$q /t " + common.tsa_server + " $f")
|
||||
args.append("help.iss")
|
||||
ret = utils.cmd(*args, creates=inno_help_file, verbose=True)
|
||||
utils.set_summary("desktop inno help build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("desktop inno help deploy")
|
||||
ret = aws_s3_upload(
|
||||
[inno_help_file],
|
||||
"win/inno/%s/%s/" % (common.version, common.build),
|
||||
"Installer"
|
||||
)
|
||||
utils.set_summary("desktop inno help deploy", ret)
|
||||
return
|
||||
|
||||
def make_inno_update():
|
||||
utils.log_h2("desktop inno update build")
|
||||
utils.log_h2(inno_update_file)
|
||||
|
||||
args = ["iscc"] + iscc_args + ["/DTARGET_NAME=" + inno_file, "update_common.iss"]
|
||||
ret = utils.cmd(*args, creates=inno_update_file, verbose=True)
|
||||
utils.set_summary("desktop inno update build", ret)
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("desktop inno update deploy")
|
||||
ret = aws_s3_upload(
|
||||
[inno_update_file],
|
||||
"win/inno/%s/%s/" % (common.version, common.build),
|
||||
"WinSparkle"
|
||||
)
|
||||
if utils.is_file(inno_update_file):
|
||||
ret = s3_upload(
|
||||
[inno_update_file], "desktop/win/inno/" + inno_update_file_new)
|
||||
elif utils.is_file(inno_file):
|
||||
ret = s3_upload(
|
||||
[inno_file], "desktop/win/inno/" + inno_update_file_new)
|
||||
else:
|
||||
ret = False
|
||||
utils.set_summary("desktop inno update deploy", ret)
|
||||
return
|
||||
|
||||
def make_winsparkle_files():
|
||||
utils.log_h2("desktop winsparkle files build")
|
||||
def make_update_files():
|
||||
utils.log_h2("desktop update files build")
|
||||
|
||||
if branding.onlyoffice:
|
||||
awk_branding = "update/branding.awk"
|
||||
else:
|
||||
awk_branding = "../../../../" + common.branding + \
|
||||
"/desktop-apps/win-linux/package/windows/update/branding.awk"
|
||||
awk_args = [
|
||||
"-v", "Version=" + common.version,
|
||||
"-v", "Build=" + common.build,
|
||||
"-v", "Branch=" + common.channel,
|
||||
"-v", "Timestamp=" + common.timestamp,
|
||||
"-i", awk_branding
|
||||
]
|
||||
changes_dir = common.workspace_dir + "\\" + utils.get_path(branding.desktop_changes_dir) + "\\" + common.version
|
||||
|
||||
appcast = "update/appcast.xml"
|
||||
utils.log_h3(appcast)
|
||||
args = ["env", "LANG=en_US.UTF-8", "awk", "-v", "Prod=1"] + \
|
||||
awk_args + ["-f", "update/appcast.xml.awk"]
|
||||
appcast_result = utils.cmd_output(*args, verbose=True)
|
||||
utils.write_file(appcast, appcast_result)
|
||||
|
||||
appcast_test = "update/appcast-test.xml"
|
||||
utils.log_h3(appcast_test)
|
||||
args = ["env", "LANG=en_US.UTF-8", "awk"] + \
|
||||
awk_args + ["-f", "update/appcast.xml.awk"]
|
||||
appcast_result = utils.cmd_output(*args, verbose=True)
|
||||
utils.write_file(appcast_test, appcast_result)
|
||||
|
||||
if branding.onlyoffice:
|
||||
changes_dir = "update/changes/" + common.version
|
||||
else:
|
||||
changes_dir = "../../../../" + common.branding + \
|
||||
"/desktop-apps/win-linux/package/windows/update/changes/" + common.version
|
||||
for lang, base in branding.desktop_update_changes_list.items():
|
||||
changes = "update/%s.html" % base
|
||||
if lang == "en": encoding = "en_US.UTF-8"
|
||||
elif lang == "ru": encoding = "ru_RU.UTF-8"
|
||||
utils.log_h3(changes)
|
||||
changes_file = "%s/%s.html" % (changes_dir, lang)
|
||||
args = ["env", "LANG=" + encoding, "awk"] + awk_args + \
|
||||
["-f", "update/changes.html.awk", changes_file]
|
||||
|
||||
if utils.is_exist(changes_file):
|
||||
changes_result = utils.cmd_output(*args, verbose=True)
|
||||
utils.write_file(changes, changes_result)
|
||||
else:
|
||||
utils.log("! file not exist: " + changes_file)
|
||||
|
||||
if common.deploy:
|
||||
utils.log_h2("desktop winsparkle files deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("update/*.xml") + utils.glob_path("update/*.html"),
|
||||
"win/inno/%s/%s/" % (common.version, common.build),
|
||||
"WinSparkle"
|
||||
)
|
||||
utils.set_summary("desktop winsparkle files deploy", ret)
|
||||
if common.deploy and utils.glob_path(changes_dir + "\\*.html"):
|
||||
utils.log_h2("desktop update files deploy")
|
||||
ret = s3_upload(
|
||||
utils.glob_path(changes_dir + "\\*.html"),
|
||||
"desktop/win/update/%s/%s/" % (common.version, common.build))
|
||||
utils.set_summary("desktop update files deploy", ret)
|
||||
return
|
||||
|
||||
def make_advinst():
|
||||
utils.log_h2("desktop advinst build")
|
||||
utils.log_h3(advinst_file)
|
||||
|
||||
arch = arch_list[common.platform]
|
||||
msi_build = {
|
||||
"windows_x64": "MsiBuild64",
|
||||
"windows_x86": "MsiBuild32"
|
||||
}[common.platform]
|
||||
|
||||
if not branding.onlyoffice:
|
||||
branding_path = common.workspace_dir + "\\" + common.branding
|
||||
multimedia_dir = common.workspace_dir + "\\" + common.branding + "\\multimedia"
|
||||
utils.copy_file(branding_dir + "\\dictionary.ail", "dictionary.ail")
|
||||
utils.copy_dir_content(branding_dir + "\\data", "data", ".bmp")
|
||||
utils.copy_dir_content(branding_dir + "\\data", "data", ".png")
|
||||
utils.copy_dir_content(
|
||||
branding_path + "\\desktop-apps\\win-linux\\package\\windows\\data", "data", ".bmp")
|
||||
utils.copy_dir_content(
|
||||
branding_path + "\\desktop-apps\\win-linux\\package\\windows\\data", "data", ".png")
|
||||
utils.copy_dir_content(
|
||||
branding_path + "\\desktop-apps\\win-linux\\extras\\projicons\\res",
|
||||
"..\\..\\extras\\projicons\\res", ".ico")
|
||||
branding_dir + "\\..\\..\\extras\\projicons\\res",
|
||||
"..\\..\\extras\\projicons\\res",
|
||||
".ico")
|
||||
utils.copy_file(
|
||||
branding_path + "\\desktop-apps\\win-linux\\package\\windows\\dictionary.ail",
|
||||
"dictionary.ail")
|
||||
utils.copy_file(
|
||||
branding_path + "\\desktop-apps\\common\\package\\license\\eula_" + common.branding + ".rtf",
|
||||
branding_dir + "\\..\\..\\..\\common\\package\\license\\eula_" + common.branding + ".rtf",
|
||||
"..\\..\\..\\common\\package\\license\\agpl-3.0.rtf")
|
||||
utils.copy_file(
|
||||
branding_path + "\\multimedia\\videoplayer\\icons\\" + common.branding + ".ico",
|
||||
"..\\..\\extras\\projicons\\res\\media.ico")
|
||||
multimedia_dir + "\\imageviewer\\icons\\ico\\" + common.branding + ".ico",
|
||||
"..\\..\\extras\\projicons\\res\\icons\\gallery.ico")
|
||||
utils.copy_file(
|
||||
branding_path + "\\multimedia\\imageviewer\\icons\\ico\\" + common.branding + ".ico",
|
||||
"..\\..\\extras\\projicons\\res\\gallery.ico")
|
||||
multimedia_dir + "\\videoplayer\\icons\\" + common.branding + ".ico",
|
||||
"..\\..\\extras\\projicons\\res\\icons\\media.ico")
|
||||
|
||||
utils.write_file(desktop_dir + "\\converter\\package.config", "package=msi")
|
||||
|
||||
aic_content = [";aic"]
|
||||
if not common.sign:
|
||||
aic_content += [
|
||||
"ResetSig"
|
||||
]
|
||||
if arch == "x86":
|
||||
aic_content += [
|
||||
"SetPackageType x86",
|
||||
"SetAppdir -buildname DefaultBuild -path [ProgramFilesFolder][MANUFACTURER_INSTALL_FOLDER]\\[PRODUCT_INSTALL_FOLDER]",
|
||||
'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x64)"',
|
||||
'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x64)"'
|
||||
]
|
||||
if arch == "x64":
|
||||
aic_content += [
|
||||
'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x86)"',
|
||||
'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x86)"'
|
||||
]
|
||||
if branding.onlyoffice:
|
||||
for path in utils.glob_path(desktop_dir + "\\editors\\web-apps\\apps\\*\\main\\resources\\help"):
|
||||
utils.delete_dir(path)
|
||||
aic_content += [
|
||||
"DelFolder CUSTOM_PATH"
|
||||
]
|
||||
else:
|
||||
utils.replace_in_file('DesktopEditors.aip','(<ROW Property="UpgradeCode" Value=")(.*)("/>)', r'\1%s\3' % (branding.desktop_upgrade_code))
|
||||
aic_content += [
|
||||
"SetProperty UpgradeCode=\"" + branding.desktop_upgrade_code + "\"",
|
||||
"AddUpgradeCode {47EEF706-B0E4-4C43-944B-E5F914B92B79} \
|
||||
-min_ver 7.1.1 -include_min_ver \
|
||||
-max_ver 7.2.2 -include_max_ver \
|
||||
-include_lang 1049 \
|
||||
-property_name UPGRADE_2 -enable_migrate",
|
||||
"DelLanguage 1029 -buildname DefaultBuild",
|
||||
"DelLanguage 1031 -buildname DefaultBuild",
|
||||
"DelLanguage 1041 -buildname DefaultBuild",
|
||||
"DelLanguage 1046 -buildname DefaultBuild",
|
||||
"DelLanguage 2070 -buildname DefaultBuild",
|
||||
"DelLanguage 1060 -buildname DefaultBuild",
|
||||
"DelLanguage 1036 -buildname DefaultBuild",
|
||||
"DelLanguage 3082 -buildname DefaultBuild",
|
||||
"DelLanguage 1033 -buildname DefaultBuild",
|
||||
"DelLanguage 1029 -buildname " + msi_build,
|
||||
"DelLanguage 1031 -buildname " + msi_build,
|
||||
"DelLanguage 1041 -buildname " + msi_build,
|
||||
"DelLanguage 1046 -buildname " + msi_build,
|
||||
"DelLanguage 2070 -buildname " + msi_build,
|
||||
"DelLanguage 1060 -buildname " + msi_build,
|
||||
"DelLanguage 1036 -buildname " + msi_build,
|
||||
"DelLanguage 3082 -buildname " + msi_build,
|
||||
"DelLanguage 1033 -buildname " + msi_build,
|
||||
"SetCurrentFeature ExtendedFeature",
|
||||
"NewSync CUSTOM_PATH " + source_dir + "\\..\\MediaViewer",
|
||||
"UpdateFile CUSTOM_PATH\\ImageViewer.exe " + source_dir + "\\..\\MediaViewer\\ImageViewer.exe",
|
||||
"UpdateFile CUSTOM_PATH\\VideoPlayer.exe " + source_dir + "\\..\\MediaViewer\\VideoPlayer.exe",
|
||||
"NewSync CUSTOM_PATH " + viewer_dir,
|
||||
"UpdateFile CUSTOM_PATH\\ImageViewer.exe " + viewer_dir + "\\ImageViewer.exe",
|
||||
"UpdateFile CUSTOM_PATH\\VideoPlayer.exe " + viewer_dir + "\\VideoPlayer.exe",
|
||||
"SetProperty ProductName=\"" + branding.desktop_product_name_full + "\"",
|
||||
"SetProperty ASCC_REG_PREFIX=" + branding.ascc_reg_prefix
|
||||
]
|
||||
if common.platform == "windows_x86":
|
||||
aic_content += [
|
||||
"SetComponentAttribute -feature_name ExtendedFeature -unset -64bit_component"
|
||||
]
|
||||
if common.platform == "windows_x86":
|
||||
aic_content += [
|
||||
"SetComponentAttribute -feature_name MainFeature -unset -64bit_component",
|
||||
"SetComponentAttribute -feature_name FileProgIds -unset -64bit_component",
|
||||
"SetComponentAttribute -feature_name FileOpenWith -unset -64bit_component",
|
||||
"SetComponentAttribute -feature_name FileProgramCapatibilities -unset -64bit_component",
|
||||
"SetComponentAttribute -feature_name FileTypeAssociations -unset -64bit_component",
|
||||
"SetComponentAttribute -feature_name FileNewTemplates -unset -64bit_component"
|
||||
]
|
||||
aic_content += [
|
||||
"AddOsLc -buildname DefaultBuild -arch " + arch,
|
||||
"SetCurrentFeature MainFeature",
|
||||
"NewSync APPDIR " + source_dir,
|
||||
"UpdateFile APPDIR\\DesktopEditors.exe " + source_dir + "\\DesktopEditors.exe",
|
||||
"NewSync APPDIR " + desktop_dir,
|
||||
"UpdateFile APPDIR\\DesktopEditors.exe " + desktop_dir + "\\DesktopEditors.exe",
|
||||
"UpdateFile APPDIR\\updatesvc.exe " + desktop_dir + "\\updatesvc.exe",
|
||||
"SetProperty VERSION=\"" + package_version + "\"",
|
||||
"SetProperty VERSION_SHORT=\"" + re.sub(r"^(\d+\.\d+).+", "\\1", package_version) + "\"",
|
||||
"SetVersion " + package_version,
|
||||
"SetPackageName " + advinst_file + " -buildname DefaultBuild",
|
||||
"Rebuild -buildslist DefaultBuild"
|
||||
"SetPackageName " + advinst_file + " -buildname " + msi_build,
|
||||
"Rebuild -buildslist " + msi_build
|
||||
]
|
||||
utils.write_file("DesktopEditors.aic", "\r\n".join(aic_content), "utf-8-sig")
|
||||
ret = utils.cmd("AdvancedInstaller.com", "/execute", \
|
||||
@ -389,11 +333,7 @@ def make_advinst():
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("desktop advinst deploy")
|
||||
ret = aws_s3_upload(
|
||||
[advinst_file],
|
||||
"win/advinst/%s/" % common.channel,
|
||||
"Installer"
|
||||
)
|
||||
ret = s3_upload([advinst_file], "desktop/win/advinst/")
|
||||
utils.set_summary("desktop advinst deploy", ret)
|
||||
return
|
||||
|
||||
@ -403,7 +343,7 @@ def make_advinst():
|
||||
|
||||
def make_macos():
|
||||
global package_name, build_dir, branding_dir, updates_dir, changes_dir, \
|
||||
suffix, lane, scheme, app_version
|
||||
suffix, lane, scheme, released_updates_dir
|
||||
package_name = branding.desktop_package_name
|
||||
build_dir = branding.desktop_build_dir
|
||||
branding_dir = branding.desktop_branding_dir
|
||||
@ -416,45 +356,58 @@ def make_macos():
|
||||
}[common.platform]
|
||||
lane = "release_" + suffix
|
||||
scheme = package_name + "-" + suffix
|
||||
sparkle_updates = False
|
||||
|
||||
utils.set_cwd(branding_dir)
|
||||
|
||||
if common.clean:
|
||||
utils.log("\n=== Clean\n")
|
||||
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")
|
||||
|
||||
plist_path = "%s/%s/ONLYOFFICE/Resources/%s-%s/Info.plist" \
|
||||
% (common.workspace_dir, branding.desktop_branding_dir, branding.desktop_package_name, suffix)
|
||||
current_version = utils.sh_output(
|
||||
'/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ' + plist_path,
|
||||
verbose=True).rstrip()
|
||||
current_build = utils.sh_output(
|
||||
'/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" ' + plist_path,
|
||||
verbose=True).rstrip()
|
||||
app_version = current_version
|
||||
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)
|
||||
|
||||
appcast_url = branding.sparkle_base_url + "/" + suffix + "/" + branding.desktop_package_name.lower() + ".xml"
|
||||
release_version = utils.sh_output(
|
||||
'curl -Ls ' + appcast_url + ' 2> /dev/null' \
|
||||
+ ' | xmllint --xpath "/rss/channel/item[1]/enclosure/@*[name()=\'sparkle:shortVersionString\']" -' \
|
||||
+ ' | cut -f2 -d\\\"',
|
||||
verbose=True).rstrip()
|
||||
release_build = utils.sh_output(
|
||||
'curl -Ls ' + appcast_url + ' 2> /dev/null' \
|
||||
+ ' | xmllint --xpath "/rss/channel/item[1]/enclosure/@*[name()=\'sparkle:version\']" -' \
|
||||
+ ' | cut -f2 -d\\\"',
|
||||
verbose=True).rstrip()
|
||||
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)
|
||||
|
||||
utils.log("CURRENT=" + current_version + "(" + current_build + ")" \
|
||||
+ "\nRELEASE=" + release_version + "(" + release_build + ")")
|
||||
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:
|
||||
if int(current_build) > int(release_build):
|
||||
make_sparkle_updates()
|
||||
else:
|
||||
utils.log(release_build + " <= " + current_build)
|
||||
if dmg and sparkle_updates:
|
||||
make_sparkle_updates()
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
@ -471,39 +424,30 @@ def make_dmg():
|
||||
|
||||
if common.deploy and dmg:
|
||||
utils.log_h2("desktop dmg deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("build/*.dmg"),
|
||||
"mac/%s/%s/%s/" % (suffix, common.version, common.build),
|
||||
"Disk Image"
|
||||
)
|
||||
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)
|
||||
|
||||
utils.log_h2("desktop zip deploy")
|
||||
ret = aws_s3_upload(
|
||||
["build/%s-%s.zip" % (scheme, app_version)],
|
||||
"mac/%s/%s/%s/" % (suffix, common.version, common.build),
|
||||
"Archive"
|
||||
)
|
||||
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 deploy", ret)
|
||||
return dmg
|
||||
|
||||
def make_sparkle_updates():
|
||||
utils.log_h2("desktop sparkle files build")
|
||||
|
||||
zip_filename = scheme + '-' + app_version
|
||||
zip_filename = scheme + '-' + common.version
|
||||
macos_zip = "build/" + zip_filename + ".zip"
|
||||
updates_storage_dir = "%s/%s/_updates" % (utils.get_env('ARCHIVES_DIR'), scheme)
|
||||
utils.create_dir(updates_dir)
|
||||
utils.copy_file(macos_zip, updates_dir)
|
||||
utils.copy_dir_content(updates_storage_dir, updates_dir, ".zip")
|
||||
utils.copy_file(
|
||||
changes_dir + "/" + app_version + "/ReleaseNotes.html",
|
||||
updates_dir + "/" + zip_filename + ".html"
|
||||
)
|
||||
utils.copy_file(
|
||||
changes_dir + "/" + app_version + "/ReleaseNotesRU.html",
|
||||
updates_dir + "/" + zip_filename + ".ru.html"
|
||||
)
|
||||
utils.copy_dir_content(released_updates_dir, updates_dir, ".zip")
|
||||
|
||||
for file in utils.glob_path(changes_dir + "/" + common.version + "/*.html"):
|
||||
filename = utils.get_basename(file).replace("changes", zip_filename)
|
||||
utils.copy_file(file, updates_dir + "/" + filename)
|
||||
|
||||
sparkle_base_url = "%s/%s/updates/" % (branding.sparkle_base_url, suffix)
|
||||
ret = utils.sh(
|
||||
@ -516,19 +460,6 @@ def make_sparkle_updates():
|
||||
)
|
||||
utils.set_summary("desktop sparkle files build", ret)
|
||||
|
||||
# utils.log_h3("edit sparkle appcast links")
|
||||
# appcast_url = branding.sparkle_base_url + "/" + suffix
|
||||
# appcast = "%s/%s.xml" % (updates_dir, package_name.lower())
|
||||
# for lang, base in update_changes_list.items():
|
||||
# if base == "ReleaseNotes":
|
||||
# utils.replace_in_file(appcast,
|
||||
# r'(<sparkle:releaseNotesLink>.+/).+(\.html</sparkle:releaseNotesLink>)',
|
||||
# "\\1" + base + "\\2")
|
||||
# else:
|
||||
# utils.replace_in_file(appcast,
|
||||
# r'(<sparkle:releaseNotesLink xml:lang="' + lang + r'">).+(\.html</sparkle:releaseNotesLink>)',
|
||||
# "\\1" + base + "\\2")
|
||||
|
||||
utils.log("")
|
||||
utils.log_h3("generate checksums")
|
||||
utils.sh(
|
||||
@ -542,22 +473,12 @@ def make_sparkle_updates():
|
||||
|
||||
if common.deploy:
|
||||
utils.log_h2("desktop sparkle files deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("build/update/*.delta") \
|
||||
+ utils.glob_path("build/update/*.xml") \
|
||||
+ utils.glob_path("build/update/*.html"),
|
||||
"mac/%s/%s/%s/" % (suffix, common.version, common.build),
|
||||
"Sparkle"
|
||||
)
|
||||
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)
|
||||
|
||||
utils.log_h2("desktop checksums deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("build/update/*.txt"),
|
||||
"mac/%s/%s/%s/" % (suffix, common.version, common.build),
|
||||
"Checksums"
|
||||
)
|
||||
utils.set_summary("desktop checksums deploy", ret)
|
||||
return
|
||||
|
||||
#
|
||||
@ -576,71 +497,52 @@ def make_linux():
|
||||
ret = utils.sh("make clean && make " + " ".join(make_args), verbose=True)
|
||||
utils.set_summary("desktop build", ret)
|
||||
|
||||
rpm_arch = "x86_64"
|
||||
rpm_arch = "*"
|
||||
if common.platform == "linux_aarch64": rpm_arch = "aarch64"
|
||||
|
||||
if common.deploy:
|
||||
utils.log_h2("desktop deploy")
|
||||
if ret:
|
||||
utils.log_h2("desktop tar deploy")
|
||||
if "tar" in branding.desktop_make_targets:
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("tar/*.tar.gz") + utils.glob_path("tar/*.tar.xz"),
|
||||
"linux/generic/%s/" % common.channel,
|
||||
"Portable"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("tar/*.tar*"),
|
||||
"desktop/linux/generic/")
|
||||
utils.set_summary("desktop tar deploy", ret)
|
||||
if "deb" in branding.desktop_make_targets:
|
||||
utils.log_h2("desktop deb deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("deb/*.deb"),
|
||||
"linux/debian/%s/" % common.channel,
|
||||
"Debian"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("deb/*.deb"),
|
||||
"desktop/linux/debian/")
|
||||
utils.set_summary("desktop deb deploy", ret)
|
||||
if "deb-astra" in branding.desktop_make_targets:
|
||||
utils.log_h2("desktop deb-astra deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("deb-astra/*.deb"),
|
||||
"linux/astra/",
|
||||
"Astra Linux Signed"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("deb-astra/*.deb"),
|
||||
"desktop/linux/astra/")
|
||||
utils.set_summary("desktop deb-astra deploy", ret)
|
||||
if "rpm" in branding.desktop_make_targets:
|
||||
utils.log_h2("desktop rpm deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("rpm/builddir/RPMS/" + rpm_arch + "/*.rpm") \
|
||||
+ utils.glob_path("rpm/builddir/RPMS/noarch/*.rpm"),
|
||||
"linux/rhel/%s/" % common.channel,
|
||||
"CentOS"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("rpm/builddir/RPMS/" + rpm_arch + "/*.rpm"),
|
||||
"desktop/linux/rhel/")
|
||||
utils.set_summary("desktop rpm deploy", ret)
|
||||
if "suse-rpm" in branding.desktop_make_targets:
|
||||
utils.log_h2("desktop suse-rpm deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("suse-rpm/builddir/RPMS/" + rpm_arch + "/*.rpm") \
|
||||
+ utils.glob_path("suse-rpm/builddir/RPMS/noarch/*.rpm"),
|
||||
"linux/suse/%s/" % common.channel,
|
||||
"SUSE Linux"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("suse-rpm/builddir/RPMS/" + rpm_arch + "/*.rpm"),
|
||||
"desktop/linux/suse/")
|
||||
utils.set_summary("desktop suse-rpm deploy", ret)
|
||||
if "apt-rpm" in branding.desktop_make_targets:
|
||||
utils.log_h2("desktop apt-rpm deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("apt-rpm/builddir/RPMS/" + rpm_arch + "/*.rpm") \
|
||||
+ utils.glob_path("apt-rpm/builddir/RPMS/noarch/*.rpm"),
|
||||
"linux/altlinux/%s/" % common.channel,
|
||||
"ALT Linux"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("apt-rpm/builddir/RPMS/" + rpm_arch + "/*.rpm"),
|
||||
"desktop/linux/altlinux/")
|
||||
utils.set_summary("desktop apt-rpm deploy", ret)
|
||||
if "urpmi" in branding.desktop_make_targets:
|
||||
utils.log_h2("desktop urpmi deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("urpmi/builddir/RPMS/" + rpm_arch + "/*.rpm") \
|
||||
+ utils.glob_path("urpmi/builddir/RPMS/noarch/*.rpm"),
|
||||
"linux/rosa/%s/" % common.channel,
|
||||
"ROSA"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("urpmi/builddir/RPMS/" + rpm_arch + "/*.rpm"),
|
||||
"desktop/linux/rosa/")
|
||||
utils.set_summary("desktop urpmi deploy", ret)
|
||||
else:
|
||||
if "tar" in branding.desktop_make_targets:
|
||||
|
||||
@ -15,30 +15,24 @@ def make():
|
||||
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)
|
||||
|
||||
zip_file = "build-" + common.version + "-" + common.build + ".zip"
|
||||
s3_key = "mobile/android/%s/%s" % (common.channel, zip_file)
|
||||
|
||||
utils.log_h2("mobile build")
|
||||
ret = utils.sh("zip -r " + zip_file + " ./android* ./js", verbose=True)
|
||||
utils.set_summary("mobile build", ret)
|
||||
|
||||
if common.deploy:
|
||||
utils.log_h2("mobile deploy")
|
||||
if ret:
|
||||
ret = utils.sh(
|
||||
"aws s3 cp --acl public-read --no-progress " \
|
||||
+ zip_file + " s3://" + branding.s3_bucket + "/" + s3_key,
|
||||
verbose=True
|
||||
)
|
||||
if ret:
|
||||
utils.add_deploy_data(
|
||||
"mobile", "Android", zip_file, s3_key,
|
||||
branding.s3_bucket, branding.s3_region
|
||||
)
|
||||
utils.log_h2("mobile deploy")
|
||||
key = "mobile/android/" + zip_file
|
||||
ret = utils.s3_upload(zip_file, "s3://" + branding.s3_bucket + "/" + key)
|
||||
if ret:
|
||||
utils.add_deploy_data(key)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
utils.set_summary("mobile deploy", ret)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
|
||||
@ -14,31 +14,16 @@ def make(edition):
|
||||
utils.log("Unsupported host OS")
|
||||
return
|
||||
|
||||
def aws_s3_upload(files, key, edition, ptype=None):
|
||||
if not files:
|
||||
return False
|
||||
def s3_upload(files, dst):
|
||||
if not files: return False
|
||||
ret = True
|
||||
key = "server/" + key
|
||||
for file in files:
|
||||
args = ["aws"]
|
||||
if hasattr(branding, "s3_endpoint_url"):
|
||||
args += ["--endpoint-url=" + branding.s3_endpoint_url]
|
||||
args += [
|
||||
"s3", "cp", "--no-progress", "--acl", "public-read",
|
||||
file, "s3://" + branding.s3_bucket + "/" + key
|
||||
]
|
||||
if common.os_family == "windows":
|
||||
upload = utils.cmd(*args, verbose=True)
|
||||
else:
|
||||
upload = utils.sh(" ".join(args), verbose=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.add_deploy_data(key)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
ret &= upload
|
||||
if upload and ptype is not None:
|
||||
full_key = key
|
||||
if full_key.endswith("/"): full_key += utils.get_basename(file)
|
||||
utils.add_deploy_data(
|
||||
"server_" + edition, ptype, file, full_key,
|
||||
branding.s3_bucket, branding.s3_region
|
||||
)
|
||||
return ret
|
||||
|
||||
def make_windows(edition):
|
||||
@ -60,12 +45,7 @@ def make_windows(edition):
|
||||
|
||||
if common.deploy and ret:
|
||||
utils.log_h2("server " + edition + " inno deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("exe/*.exe"),
|
||||
"win/inno/%s/" % common.channel,
|
||||
edition,
|
||||
"Installer"
|
||||
)
|
||||
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)
|
||||
@ -89,47 +69,31 @@ def make_linux(edition):
|
||||
ret = utils.sh("make clean && make " + " ".join(make_args), verbose=True)
|
||||
utils.set_summary("server " + edition + " build", ret)
|
||||
|
||||
rpm_arch = "x86_64"
|
||||
if common.platform == "linux_aarch64": rpm_arch = "aarch64"
|
||||
|
||||
if common.deploy:
|
||||
utils.log_h2("server " + edition + " deploy")
|
||||
if ret:
|
||||
if "deb" in branding.server_make_targets:
|
||||
utils.log_h2("server " + edition + " deb deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("deb/*.deb"),
|
||||
"linux/debian/%s/" % common.channel,
|
||||
edition,
|
||||
"Debian"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("deb/*.deb"),
|
||||
"server/linux/debian/")
|
||||
utils.set_summary("server " + edition + " deb deploy", ret)
|
||||
if "rpm" in branding.server_make_targets:
|
||||
utils.log_h2("server " + edition + " rpm deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("rpm/builddir/RPMS/" + rpm_arch + "/*.rpm"),
|
||||
"linux/rhel/%s/" % common.channel,
|
||||
edition,
|
||||
"CentOS"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("rpm/builddir/RPMS/*/*.rpm"),
|
||||
"server/linux/rhel/")
|
||||
utils.set_summary("server " + edition + " rpm deploy", ret)
|
||||
if "apt-rpm" in branding.server_make_targets:
|
||||
utils.log_h2("server " + edition + " apt-rpm deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("apt-rpm/builddir/RPMS/" + rpm_arch + "/*.rpm"),
|
||||
"linux/altlinux/%s/" % common.channel,
|
||||
edition,
|
||||
"ALT Linux"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("apt-rpm/builddir/RPMS/*/*.rpm"),
|
||||
"server/linux/altlinux/")
|
||||
utils.set_summary("server " + edition + " apt-rpm deploy", ret)
|
||||
if "tar" in branding.server_make_targets:
|
||||
utils.log_h2("server " + edition + " snap deploy")
|
||||
ret = aws_s3_upload(
|
||||
utils.glob_path("*.tar.gz"),
|
||||
"linux/generic/%s/" % common.channel,
|
||||
edition,
|
||||
"Snap"
|
||||
)
|
||||
ret = s3_upload(
|
||||
utils.glob_path("*.tar.gz"),
|
||||
"server/linux/snap/")
|
||||
utils.set_summary("server " + edition + " snap deploy", ret)
|
||||
else:
|
||||
if "deb" in branding.server_make_targets:
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
import codecs
|
||||
import glob
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
@ -13,6 +12,7 @@ import subprocess
|
||||
import sys
|
||||
import time
|
||||
import package_common as common
|
||||
import base
|
||||
|
||||
def host_platform():
|
||||
return platform.system().lower()
|
||||
@ -107,11 +107,25 @@ def glob_file(path):
|
||||
return glob.glob(path)[0]
|
||||
return
|
||||
|
||||
def get_md5(path):
|
||||
def get_hash_sha256(path):
|
||||
if os.path.exists(path):
|
||||
md5_hash = hashlib.md5()
|
||||
md5_hash.update(open(path, "rb").read())
|
||||
return md5_hash.hexdigest()
|
||||
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):
|
||||
@ -158,7 +172,7 @@ def copy_file(src, dst, verbose=True):
|
||||
log(" src: " + src)
|
||||
log(" dst: " + dst)
|
||||
if is_file(dst):
|
||||
delete_file(dst)
|
||||
delete_file(dst, False)
|
||||
if not is_file(src):
|
||||
log_err("file not exist: " + src)
|
||||
return
|
||||
@ -191,12 +205,7 @@ def copy_dir(src, dst, override=True, verbose=True):
|
||||
log(" src: " + src)
|
||||
log(" dst: " + dst)
|
||||
log(" override: " + str(override))
|
||||
if is_dir(dst):
|
||||
delete_dir(dst)
|
||||
try:
|
||||
shutil.copytree(get_path(src), get_path(dst))
|
||||
except OSError as e:
|
||||
log_err('directory not copied. Error: %s' % e)
|
||||
base.copy_dir(src, dst)
|
||||
return
|
||||
|
||||
def copy_dir_content(src, dst, filter_include = "", filter_exclude = "", verbose=True):
|
||||
@ -219,7 +228,7 @@ def copy_dir_content(src, dst, filter_include = "", filter_exclude = "", verbose
|
||||
if is_file(file):
|
||||
copy_file(file, dst, verbose=False)
|
||||
elif is_dir(file):
|
||||
copy_dir(file, dst + "/" + basename)
|
||||
copy_dir(file, dst + "/" + basename, verbose=False)
|
||||
return
|
||||
|
||||
def delete_file(path, verbose=True):
|
||||
@ -258,20 +267,9 @@ def set_summary(target, status):
|
||||
common.summary.append({target: status})
|
||||
return
|
||||
|
||||
def add_deploy_data(product, ptype, src, dst, bucket, region):
|
||||
common.deploy_data.append({
|
||||
"platform": common.platforms[common.platform]["title"],
|
||||
"product": product,
|
||||
"type": ptype,
|
||||
# "local": get_path(src),
|
||||
"size": get_file_size(get_path(src)),
|
||||
"bucket": bucket,
|
||||
"region": region,
|
||||
"key": dst
|
||||
})
|
||||
file = open(get_path(common.workspace_dir + "/deploy.json"), 'w')
|
||||
file.write(json.dumps(common.deploy_data, sort_keys=True, indent=4))
|
||||
file.close()
|
||||
def add_deploy_data(key):
|
||||
with open(common.deploy_data, 'a+') as f:
|
||||
f.write(key + "\n")
|
||||
return
|
||||
|
||||
def cmd(*args, **kwargs):
|
||||
@ -287,12 +285,12 @@ def cmd(*args, **kwargs):
|
||||
return False
|
||||
if kwargs.get("chdir") and is_dir(kwargs["chdir"]):
|
||||
oldcwd = get_cwd()
|
||||
set_cwd(kwargs["chdir"])
|
||||
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)
|
||||
set_cwd(oldcwd, verbose=False)
|
||||
return ret
|
||||
|
||||
def cmd_output(*args, **kwargs):
|
||||
@ -321,11 +319,11 @@ def powershell(*args, **kwargs):
|
||||
|
||||
def ps1(file, args=[], **kwargs):
|
||||
if kwargs.get("verbose"):
|
||||
log_h2("powershell cmdlet: " + file + " " + " ".join(args))
|
||||
log("- ps1: " + file + " " + " ".join(args))
|
||||
if kwargs.get("creates") and is_exist(kwargs["creates"]):
|
||||
return True
|
||||
ret = subprocess.call(
|
||||
["powershell", file] + args, stderr=subprocess.STDOUT, shell=True
|
||||
["powershell", "-File", file] + args, stderr=subprocess.STDOUT, shell=True
|
||||
) == 0
|
||||
return ret
|
||||
|
||||
@ -336,7 +334,7 @@ def download_file(url, path, md5, verbose=False):
|
||||
log(" path: " + url)
|
||||
log(" md5: " + md5)
|
||||
if is_file(path):
|
||||
if get_md5(path) == md5:
|
||||
if get_hash_md5(path) == md5:
|
||||
log_err("file already exist (match checksum)")
|
||||
return True
|
||||
else:
|
||||
@ -346,7 +344,7 @@ def download_file(url, path, md5, verbose=False):
|
||||
"(New-Object System.Net.WebClient).DownloadFile('%s','%s')" % (url, path),
|
||||
verbose=True
|
||||
)
|
||||
md5_new = get_md5(path)
|
||||
md5_new = get_hash_md5(path)
|
||||
if md5 != md5_new:
|
||||
log_err("checksum didn't match (%s != %s)" % (md5, md5_new))
|
||||
return False
|
||||
@ -365,18 +363,63 @@ def sh(command, **kwargs):
|
||||
return False
|
||||
if kwargs.get("chdir") and is_dir(kwargs["chdir"]):
|
||||
oldcwd = get_cwd()
|
||||
set_cwd(kwargs["chdir"])
|
||||
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)
|
||||
set_cwd(oldcwd, verbose=False)
|
||||
return ret
|
||||
|
||||
def sh_output(command, **kwargs):
|
||||
if kwargs.get("verbose"):
|
||||
log("- sh_output:")
|
||||
log(" command: " + command)
|
||||
return subprocess.check_output(
|
||||
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_sync(src, dst, **kwargs):
|
||||
args = ["aws"]
|
||||
if kwargs.get("endpoint_url"):
|
||||
args += ["--endpoint-url", kwargs["endpoint_url"]]
|
||||
args += ["s3", "sync", "--no-progress"]
|
||||
if kwargs.get("acl"):
|
||||
args += ["--acl", kwargs["acl"]]
|
||||
if kwargs.get("delete") and kwargs["delete"]:
|
||||
args += ["--delete"]
|
||||
args += [src, dst]
|
||||
if is_windows():
|
||||
ret = cmd(*args, verbose=True)
|
||||
else:
|
||||
ret = sh(" ".join(args), verbose=True)
|
||||
return ret
|
||||
|
||||
4
tests/puppeteer/config_chrome.json
Normal file
4
tests/puppeteer/config_chrome.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"browser" : "chrome",
|
||||
"browserUrl" : "C:/Program Files/Google/Chrome/Application/chrome.exe"
|
||||
}
|
||||
4
tests/puppeteer/config_firefox.json
Normal file
4
tests/puppeteer/config_firefox.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"browser" : "firefox",
|
||||
"browserUrl" : "C:/Program Files/Mozilla Firefox/firefox.exe"
|
||||
}
|
||||
9
tests/puppeteer/install.py
Normal file
9
tests/puppeteer/install.py
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
|
||||
os.environ["PUPPETEER_SKIP_CHROMIUM_DOWNLOAD"] = "true"
|
||||
base.cmd("npm", ["i", "puppeteer"])
|
||||
64
tests/puppeteer/run.py
Normal file
64
tests/puppeteer/run.py
Normal file
@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
import json
|
||||
|
||||
def get_tests_in_dir(directory):
|
||||
files = []
|
||||
for file in glob.glob(directory + "/*.js"):
|
||||
if base.is_file(file):
|
||||
files.append(file)
|
||||
elif is_dir(file):
|
||||
files += get_tests_in_dir(file)
|
||||
return files
|
||||
|
||||
params = sys.argv[1:]
|
||||
if (0 == len(params)):
|
||||
print("use: run.py path_to_config [path_to_test]")
|
||||
exit(0)
|
||||
|
||||
config_path = params[0]
|
||||
test_file = "./tests"
|
||||
|
||||
if (1 < len(params)):
|
||||
test_file = params[1]
|
||||
|
||||
tests_array = [test_file]
|
||||
if base.is_dir(test_file):
|
||||
tests_array = get_tests_in_dir(test_file)
|
||||
|
||||
config_content = "{}"
|
||||
with open(config_path, "r") as config_path_loader:
|
||||
config_content = config_path_loader.read()
|
||||
|
||||
print(config_content)
|
||||
|
||||
config = json.loads(config_content)
|
||||
os.environ["PUPPETEER_SKIP_CHROMIUM_DOWNLOAD"] = "true"
|
||||
if "browser" in config:
|
||||
print("browser: " + config["browser"])
|
||||
os.environ["PUPPETEER_PRODUCT"] = config["browser"]
|
||||
|
||||
if "browserUrl" in config:
|
||||
print("browserUrl: " + config["browserUrl"])
|
||||
os.environ["PUPPETEER_EXECUTABLE_PATH"] = config["browserUrl"]
|
||||
|
||||
if not base.is_dir("./work_directory"):
|
||||
base.create_dir("./work_directory")
|
||||
base.create_dir("./work_directory/cache")
|
||||
base.create_dir("./work_directory/downloads")
|
||||
|
||||
for test in tests_array:
|
||||
print("run test: " + test)
|
||||
run_file = test + ".runned.js"
|
||||
base.copy_file("./tester.js", run_file)
|
||||
test_content = base.readFile(test)
|
||||
test_content = test_content.replace("await Tester.", "Tester.")
|
||||
test_content = test_content.replace("Tester.", "await Tester.")
|
||||
base.replaceInFile(run_file, "\"%%CODE%%\"", test_content)
|
||||
base.cmd("node", [run_file])
|
||||
base.delete_file(run_file)
|
||||
171
tests/puppeteer/tester.js
Normal file
171
tests/puppeteer/tester.js
Normal file
@ -0,0 +1,171 @@
|
||||
const puppeteer = require('puppeteer')
|
||||
const pathfs = require('path')
|
||||
const fs = require('fs');
|
||||
|
||||
function TesterImpl()
|
||||
{
|
||||
this.browser = null;
|
||||
this.page = null;
|
||||
this.width = 1500;
|
||||
this.height = 800;
|
||||
this.pixelRatio = 1;
|
||||
|
||||
this.cacheDir = pathfs.resolve("./work_directory/cache");
|
||||
this.downloadsDir = pathfs.resolve("./work_directory/downloads");
|
||||
this.downloadCounter = 0;
|
||||
|
||||
this.load = async function(url)
|
||||
{
|
||||
const head = { x: 100, y: 200 };
|
||||
this.browser = await puppeteer.launch({
|
||||
headless: false,
|
||||
product: process.env["PUPPETEER_PRODUCT"],
|
||||
args: [
|
||||
"--disable-infobars",
|
||||
`--window-size=${this.width+head.x},${this.height+head.y}`,
|
||||
"--disk-cache-dir=" + this.cacheDir
|
||||
],
|
||||
defaultViewport : {width: this.width, height: this.height, deviceScaleFactor : this.pixelRatio }
|
||||
});
|
||||
|
||||
this.page = await this.browser.newPage();
|
||||
await this.page.setViewport({ width: this.width, height: this.height });
|
||||
let waitObject = (process.env["PUPPETEER_PRODUCT"] === "firefox") ? { waitUntil: "networkidle0", timeout: 15000 } : {};
|
||||
await this.page.goto(url + "&autotest=enabled", waitObject);
|
||||
console.log("[tester] pageLoaded");
|
||||
return this.page;
|
||||
};
|
||||
|
||||
this.close = async function(nosleep)
|
||||
{
|
||||
if (true !== nosleep)
|
||||
await this.waitAutosave();
|
||||
await this.browser.close();
|
||||
};
|
||||
|
||||
this.sleep = async function(ms)
|
||||
{
|
||||
return await new Promise(resolve => setTimeout(resolve, ms));
|
||||
};
|
||||
|
||||
this.waitEditor = async function()
|
||||
{
|
||||
// TODO: wait first onEndRecalculate
|
||||
await this.sleep(5000);
|
||||
console.log("[tester] editorReady");
|
||||
};
|
||||
|
||||
this.waitAutosave = async function()
|
||||
{
|
||||
await this.sleep(5000);
|
||||
};
|
||||
|
||||
this.evaluateInMainFrame = async function(code)
|
||||
{
|
||||
return await this.page.evaluate(code);
|
||||
};
|
||||
this.evaluateInEditorFrame = async function(code)
|
||||
{
|
||||
const frame = await this.page.frames().find(frame => frame.name() === 'frameEditor');
|
||||
if (!frame)
|
||||
return;
|
||||
return await frame.evaluate(code);
|
||||
};
|
||||
|
||||
this.click = async function(id)
|
||||
{
|
||||
let res = await this.evaluateInEditorFrame("document.getElementById(\"" + id + "\").click(); \"[tester] clicked: " + id + "\"");
|
||||
//console.log(res);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.mouseClick = async function(x, y, options)
|
||||
{
|
||||
let res = await this.page.mouse.click(x, y, options);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.eval = async function(code)
|
||||
{
|
||||
let res = await this.evaluateInEditorFrame(code);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.keyDown = async function(key)
|
||||
{
|
||||
// https://pptr.dev/api/puppeteer.keyinput
|
||||
let res = await this.page.keyboard.down(key);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.keyUp = async function(key)
|
||||
{
|
||||
// https://pptr.dev/api/puppeteer.keyinput
|
||||
let res = await this.page.keyboard.up(key);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.keyClick = async function(key)
|
||||
{
|
||||
// https://pptr.dev/api/puppeteer.keyinput
|
||||
let res = await this.page.keyboard.down(key);
|
||||
res = await this.page.keyboard.up(key);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.keyPress = async function(key)
|
||||
{
|
||||
// https://pptr.dev/api/puppeteer.keyinput
|
||||
let res = await this.page.keyboard.press(key);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.input = async function(text)
|
||||
{
|
||||
let res = await this.page.keyboard.type(text);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.downloadFile = async function(format, path)
|
||||
{
|
||||
const tmpDir = pathfs.resolve(this.downloadsDir, "./tmp" + this.downloadCounter++);
|
||||
fs.mkdirSync(tmpDir);
|
||||
|
||||
// emulate download
|
||||
const client = await this.page.target().createCDPSession();
|
||||
await client.send("Page.setDownloadBehavior", {
|
||||
behavior: "allow",
|
||||
downloadPath: tmpDir
|
||||
});
|
||||
|
||||
await this.evaluateInEditorFrame("document.querySelectorAll('[data-layout-name=\"toolbar-file\"]')[0].click();");
|
||||
await this.sleep(200);
|
||||
await this.evaluateInEditorFrame("document.getElementsByClassName(\"svg-format-" + format + "\")[0].click();");
|
||||
await this.sleep(200);
|
||||
await this.evaluateInEditorFrame("document.getElementById(\"fm-btn-return\").click();");
|
||||
|
||||
await this.sleep(2000);
|
||||
|
||||
const files = fs.readdirSync(tmpDir);
|
||||
fs.copyFileSync(pathfs.resolve(tmpDir, "./" + files[0]), pathfs.resolve(path));
|
||||
fs.rmSync(tmpDir, { recursive: true, force: true });
|
||||
};
|
||||
}
|
||||
|
||||
const Tester = new TesterImpl;
|
||||
|
||||
try {
|
||||
(async () => {
|
||||
"%%CODE%%"
|
||||
})();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
27
tests/puppeteer/tests/bold.js
Normal file
27
tests/puppeteer/tests/bold.js
Normal file
@ -0,0 +1,27 @@
|
||||
Tester.load("path_to_file");
|
||||
Tester.waitEditor();
|
||||
|
||||
// down Enter
|
||||
Tester.keyClick("Enter");
|
||||
|
||||
// type text
|
||||
Tester.input("Hello World!");
|
||||
|
||||
Tester.keyPress("ArrowLeft");
|
||||
Tester.keyDown("Shift");
|
||||
for (let i = 0; i < 5; i++)
|
||||
Tester.keyPress("ArrowLeft");
|
||||
Tester.keyUp("Shift");
|
||||
|
||||
// bold
|
||||
Tester.click("id-toolbar-btn-bold");
|
||||
// italic
|
||||
Tester.mouseClick(115, 105);
|
||||
|
||||
// if needed
|
||||
Tester.waitAutosave();
|
||||
|
||||
Tester.downloadFile("docx", "./work_directory/new.docx")
|
||||
Tester.downloadFile("odt", "./work_directory/new.odt")
|
||||
|
||||
Tester.close(true);
|
||||
@ -1,10 +1,10 @@
|
||||
## Overview
|
||||
# Overview
|
||||
|
||||
**change_autor.py** is a tool for change autor and last modifiend in all documents in folder.
|
||||
**change_autor.py** is a tool for change autor and last modifiend in all documents in folder.
|
||||
|
||||
## How to use
|
||||
|
||||
1. Place the files to be changed in a folder, e.g. **input**.
|
||||
1. Place the files to be changed in a folder, e.g. **input**.
|
||||
2. Create a folder in which the modified files will be stored, e.g. **output**.
|
||||
3. Call the file *change_autor.py* as shown below.
|
||||
|
||||
@ -17,10 +17,11 @@ ________________________
|
||||
|
||||
## How to use
|
||||
|
||||
1. Place the files to be changed in a folder, e.g. **input**.
|
||||
1. Place the files to be changed in a folder, e.g. **input**.
|
||||
2. Create a folder in which the converted files will be stored, e.g. **output**.
|
||||
3. Call the file *convert_directory.py* as shown below.
|
||||
|
||||
```bash
|
||||
convert_directory.py path_to_builder_directory path_to_input_folder path_to_output_folder format_ext
|
||||
convert_directory.py path_to_builder_directory
|
||||
path_to_input_folder path_to_output_folder format_ext
|
||||
```
|
||||
@ -125,9 +125,20 @@ def getFormatByFile(file_path):
|
||||
def convertFile(directory_x2t, file_input, file_output, convert_params):
|
||||
cur_path = os.getcwd()
|
||||
|
||||
# fonts directory -----------------------------------
|
||||
directory_fonts = directory_x2t + "/sdkjs/common"
|
||||
if not base.is_file(directory_fonts + "/AllFonts.js"):
|
||||
directory_fonts_local = ""
|
||||
if "windows" == base.host_platform():
|
||||
directory_fonts_local = os.getenv("LOCALAPPDATA") + "/ONLYOFFICE/docbuilder"
|
||||
else:
|
||||
directory_fonts_local = os.path.expanduser('~') + "/.local/share/ONLYOFFICE/docbuilder"
|
||||
|
||||
if not base.is_file(directory_fonts + "/AllFonts.js") and not base.is_file(directory_fonts_local + "/AllFonts.js"):
|
||||
base.cmd_in_dir(directory_x2t, "docbuilder", [], True)
|
||||
|
||||
if base.is_file(directory_fonts_local + "/AllFonts.js"):
|
||||
directory_fonts = directory_fonts_local
|
||||
# ---------------------------------------------------
|
||||
|
||||
temp_dir = os.getcwd().replace("\\", "/") + "/temp"
|
||||
if base.is_dir(temp_dir):
|
||||
|
||||
35
tools/common/convert_directory_test.py
Normal file
35
tools/common/convert_directory_test.py
Normal file
@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
import convert_common
|
||||
|
||||
params = sys.argv[1:]
|
||||
|
||||
if (5 > len(params)):
|
||||
print("use: convert_directory.py path_to_builder_directory path_to_sdkjs_directory editor_type path_to_input_files_directory path_to_output_files_directory")
|
||||
exit(0)
|
||||
|
||||
cur_path = os.getcwd()
|
||||
base.configure_common_apps()
|
||||
|
||||
directory_x2t = params[0].replace("\\", "/")
|
||||
directory_sdkjs = params[1].replace("\\", "/")
|
||||
editor_type = params[2].replace("\\", "/")
|
||||
directory_input = params[3].replace("\\", "/")
|
||||
directory_output = params[4].replace("\\", "/")
|
||||
|
||||
input_files = [os.path.join(dirpath, f)
|
||||
for dirpath, dirnames, files in os.walk(directory_input)
|
||||
for f in files]
|
||||
|
||||
output_len = len(input_files)
|
||||
output_cur = 1
|
||||
for input_file in input_files:
|
||||
print("process [" + str(output_cur) + " of " + str(output_len) + "]: " + str(input_file.encode("utf-8")))
|
||||
output_file = os.path.join(directory_output, os.path.basename(input_file))
|
||||
base.cmd_in_dir(directory_x2t, "test", [directory_sdkjs, editor_type, input_file, output_file], True)
|
||||
output_cur += 1
|
||||
@ -36,10 +36,21 @@ if base.is_dir(temp_dir):
|
||||
base.delete_dir(temp_dir)
|
||||
base.create_dir(temp_dir)
|
||||
|
||||
# fonts directory -----------------------------------
|
||||
directory_fonts = directory_x2t + "/sdkjs/common"
|
||||
if not base.is_file(directory_fonts + "/AllFonts.js"):
|
||||
directory_fonts_local = ""
|
||||
if "windows" == base.host_platform():
|
||||
directory_fonts_local = os.getenv("LOCALAPPDATA") + "/ONLYOFFICE/docbuilder"
|
||||
else:
|
||||
directory_fonts_local = os.path.expanduser('~') + "/.local/share/ONLYOFFICE/docbuilder"
|
||||
|
||||
if not base.is_file(directory_fonts + "/AllFonts.js") and not base.is_file(directory_fonts_local + "/AllFonts.js"):
|
||||
base.cmd_in_dir(directory_x2t, "docbuilder", [], True)
|
||||
|
||||
if base.is_file(directory_fonts_local + "/AllFonts.js"):
|
||||
directory_fonts = directory_fonts_local
|
||||
# ---------------------------------------------------
|
||||
|
||||
json_params = "{'spreadsheetLayout':{'fitToWidth':1,'fitToHeight':1},"
|
||||
json_params += "'documentLayout':{'drawPlaceHolders':true,'drawFormHighlight':true,'isPrint':true}}"
|
||||
json_params = json_params.replace("'", """)
|
||||
@ -61,7 +72,7 @@ for input_file in input_files:
|
||||
xml_convert += u"<m_oThumbnail>"
|
||||
xml_convert += u"<first>false</first>"
|
||||
if ((0 != th_width) and (0 != th_height)):
|
||||
xml_convert += u"<aspect>0</aspect>"
|
||||
xml_convert += u"<aspect>16</aspect>"
|
||||
xml_convert += (u"<width>" + str(th_width) + u"</width>")
|
||||
xml_convert += (u"<height>" + str(th_height) + u"</height>")
|
||||
xml_convert += u"</m_oThumbnail>"
|
||||
|
||||
@ -20,7 +20,7 @@ def get_branch_name(directory):
|
||||
def install_qt():
|
||||
# qt
|
||||
if not base.is_file("./qt_source_5.9.9.tar.xz"):
|
||||
base.download("https://download.qt.io/archive/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz", "./qt_source_5.9.9.tar.xz")
|
||||
base.download("https://download.qt.io/new_archive/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz", "./qt_source_5.9.9.tar.xz")
|
||||
|
||||
if not base.is_dir("./qt-everywhere-opensource-src-5.9.9"):
|
||||
base.cmd("tar", ["-xf", "./qt_source_5.9.9.tar.xz"])
|
||||
@ -56,9 +56,9 @@ def install_qt():
|
||||
base.cmd_in_dir("./qt-everywhere-opensource-src-5.9.9", "make", ["install"])
|
||||
return
|
||||
|
||||
if not base.is_file("./node_js_setup_10.x"):
|
||||
if not base.is_file("./node_js_setup_14.x"):
|
||||
print("install dependencies...")
|
||||
deps.install_deps()
|
||||
deps.install_deps()
|
||||
|
||||
if not base.is_dir("./qt_build"):
|
||||
print("install qt...")
|
||||
|
||||
@ -54,15 +54,15 @@ def install_deps():
|
||||
print("Installed Node.js version: " + str(nodejs_cur_version_major) + "." + str(nodejs_cur_version_minor))
|
||||
except:
|
||||
nodejs_cur = 1
|
||||
if (nodejs_cur < 10020):
|
||||
print("Node.js version cannot be less 10.20")
|
||||
if (nodejs_cur < 14000):
|
||||
print("Node.js version cannot be less 14")
|
||||
print("Reinstall")
|
||||
if (base.is_dir("./node_js_setup_10.x")):
|
||||
base.delete_dir("./node_js_setup_10.x")
|
||||
if (base.is_dir("./node_js_setup_14.x")):
|
||||
base.delete_dir("./node_js_setup_14.x")
|
||||
base.cmd("sudo", ["apt-get", "remove", "--purge", "-y", "nodejs"])
|
||||
base.download("https://deb.nodesource.com/setup_10.x", "./node_js_setup_10.x")
|
||||
base.download("https://deb.nodesource.com/setup_14.x", "./node_js_setup_14.x")
|
||||
base.cmd('curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -')
|
||||
base.cmd("sudo", ["bash", "./node_js_setup_10.x"])
|
||||
base.cmd("sudo", ["bash", "./node_js_setup_14.x"])
|
||||
base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"])
|
||||
base.cmd("sudo", ["npm", "install", "-g", "npm@6"])
|
||||
else:
|
||||
@ -73,16 +73,14 @@ def install_deps():
|
||||
|
||||
# java
|
||||
java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-11-jdk"], True)
|
||||
if (0 != java_error):
|
||||
java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"], True)
|
||||
if (0 != java_error):
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "software-properties-common"])
|
||||
base.cmd("sudo", ["add-apt-repository", "-y", "ppa:openjdk-r/ppa"])
|
||||
base.cmd("sudo", ["apt-get", "update"])
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-8-jdk"])
|
||||
base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-11-jdk"])
|
||||
base.cmd("sudo", ["update-alternatives", "--config", "java"])
|
||||
base.cmd("sudo", ["update-alternatives", "--config", "javac"])
|
||||
|
||||
|
||||
base.writeFile("./packages_complete", "complete")
|
||||
return
|
||||
|
||||
|
||||
21
tools/linux/elf/build.py
Executable file
21
tools/linux/elf/build.py
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../../scripts')
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
base.cmd("git", ["clone", "https://github.com/NixOS/patchelf.git", "patchelf_dir"])
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir("patchelf_dir")
|
||||
base.cmd("git", ["checkout", "tags/0.17.2"])
|
||||
base.cmd("./bootstrap.sh")
|
||||
base.cmd("./configure")
|
||||
base.replaceInFile("./src/Makefile.am", "AM_CXXFLAGS = ", "AM_CXXFLAGS = -static-libstdc++ -static-libgcc ")
|
||||
base.cmd("make")
|
||||
os.chdir(cur_dir)
|
||||
if base.is_file("./patchelf"):
|
||||
base.delete_file("./patchelf")
|
||||
base.copy_file("./patchelf_dir/src/patchelf", "./patchelf")
|
||||
base.delete_dir("patchelf_dir")
|
||||
BIN
tools/linux/elf/patchelf
Executable file
BIN
tools/linux/elf/patchelf
Executable file
Binary file not shown.
BIN
tools/linux/elf/readelf
Executable file
BIN
tools/linux/elf/readelf
Executable file
Binary file not shown.
BIN
tools/linux/sysroot/ubuntu14/libdbus-1.so.3
Normal file
BIN
tools/linux/sysroot/ubuntu14/libdbus-1.so.3
Normal file
Binary file not shown.
24
tools/linux/use_system_qt.py
Executable file
24
tools/linux/use_system_qt.py
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
def make():
|
||||
if base.is_dir("./system_qt"):
|
||||
return
|
||||
|
||||
# TODO: check all places...
|
||||
|
||||
base.create_dir("./system_qt")
|
||||
base.create_dir("./system_qt/gcc_64")
|
||||
base.cmd("ln", ["-s", "/usr/lib/x86_64-linux-gnu/qt5/bin", "./system_qt/gcc_64/bin"])
|
||||
base.cmd("ln", ["-s", "/usr/lib/x86_64-linux-gnu", "./system_qt/gcc_64/lib"])
|
||||
base.cmd("ln", ["-s", "/usr/lib/x86_64-linux-gnu/qt5/plugins", "./system_qt/gcc_64/plugins"])
|
||||
return
|
||||
|
||||
if __name__ == "__main__":
|
||||
make()
|
||||
|
||||
445
tools/mac/toolchain.prf
Normal file
445
tools/mac/toolchain.prf
Normal file
@ -0,0 +1,445 @@
|
||||
defineTest(qtToolchainError) {
|
||||
msg = \
|
||||
$$1 \
|
||||
"===================" \
|
||||
$$2 \
|
||||
"===================" \
|
||||
$$3
|
||||
error($$join(msg, $$escape_expand(\\n)))
|
||||
}
|
||||
|
||||
defineTest(qtCompilerError) {
|
||||
!cross_compile: \
|
||||
what =
|
||||
else: host_build: \
|
||||
what = " host"
|
||||
else: \
|
||||
what = " target"
|
||||
qtToolchainError("Cannot run$$what compiler '$$1'. Output:", $$2, \
|
||||
"Maybe you forgot to setup the environment?")
|
||||
}
|
||||
|
||||
cross_compile:host_build: \
|
||||
target_prefix = QMAKE_HOST_CXX
|
||||
else: \
|
||||
target_prefix = QMAKE_CXX
|
||||
|
||||
#
|
||||
# Determine and cache the compiler version
|
||||
#
|
||||
|
||||
defineReplace(qtVariablesFromMSVC) {
|
||||
ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec)
|
||||
!equals(ec, 0): qtCompilerError($$1, $$ret)
|
||||
return($$ret)
|
||||
}
|
||||
|
||||
defineReplace(qtVariablesFromGCC) {
|
||||
ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \
|
||||
2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec)
|
||||
!equals(ec, 0): qtCompilerError($$1, $$ret)
|
||||
return($$ret)
|
||||
}
|
||||
|
||||
isEmpty($${target_prefix}.COMPILER_MACROS) {
|
||||
msvc {
|
||||
clang_cl {
|
||||
# We need to obtain the cl.exe version first
|
||||
vars = $$qtVariablesFromMSVC(cl)
|
||||
for (v, vars) {
|
||||
isEmpty(v)|contains(v, $${LITERAL_HASH}.*): next()
|
||||
eval($$v)
|
||||
}
|
||||
isEmpty(QMAKE_MSC_FULL_VER): error("Could not determine the Visual Studio version")
|
||||
|
||||
QMAKE_CFLAGS_MSVC_COMPAT = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", \
|
||||
"-fms-compatibility-version=\\1.\\2.\\3")
|
||||
cache($${target_prefix}.QMAKE_CFLAGS_MSVC_COMPAT, set stash, QMAKE_CFLAGS_MSVC_COMPAT)
|
||||
$${target_prefix}.COMPILER_MACROS += QMAKE_CFLAGS_MSVC_COMPAT
|
||||
vars = $$qtVariablesFromMSVC($$QMAKE_CXX, $$QMAKE_CFLAGS_MSVC_COMPAT)
|
||||
} else {
|
||||
vars = $$qtVariablesFromMSVC($$QMAKE_CXX)
|
||||
}
|
||||
} else: gcc|ghs {
|
||||
vars = $$qtVariablesFromGCC($$QMAKE_CXX)
|
||||
}
|
||||
for (v, vars) {
|
||||
!contains(v, "[A-Z_]+ = .*"): next()
|
||||
# Set both <varname> for the outer scope ...
|
||||
eval($$v)
|
||||
v ~= s/ .*//
|
||||
isEmpty($$v): error("Compiler produced empty value for $${v}.")
|
||||
# ... and save QMAKE_(HOST_)?CXX.<varname> in the cache.
|
||||
cache($${target_prefix}.$$v, set stash, $$v)
|
||||
$${target_prefix}.COMPILER_MACROS += $$v
|
||||
}
|
||||
cache($${target_prefix}.COMPILER_MACROS, set stash)
|
||||
} else {
|
||||
# load from the cache
|
||||
for (i, $${target_prefix}.COMPILER_MACROS): \
|
||||
$$i = $$eval($${target_prefix}.$$i)
|
||||
}
|
||||
|
||||
# Populate QMAKE_COMPILER_DEFINES and some compatibility variables.
|
||||
# The $$format_number() calls strip leading zeros to avoid misinterpretation as octal.
|
||||
QMAKE_COMPILER_DEFINES += __cplusplus=$$QT_COMPILER_STDCXX
|
||||
!isEmpty(QMAKE_MSC_VER): \
|
||||
QMAKE_COMPILER_DEFINES += _MSC_VER=$$QMAKE_MSC_VER _MSC_FULL_VER=$$QMAKE_MSC_FULL_VER
|
||||
!isEmpty(QMAKE_ICC_VER): \
|
||||
QMAKE_COMPILER_DEFINES += __INTEL_COMPILER=$$QMAKE_ICC_VER __INTEL_COMPILER_UPDATE=$$QMAKE_ICC_UPDATE_VER
|
||||
!isEmpty(QMAKE_APPLE_CC): \
|
||||
QMAKE_COMPILER_DEFINES += __APPLE_CC__=$$QMAKE_APPLE_CC
|
||||
!isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION): \
|
||||
QMAKE_COMPILER_DEFINES += __clang__ \
|
||||
__clang_major__=$$QMAKE_APPLE_CLANG_MAJOR_VERSION \
|
||||
__clang_minor__=$$QMAKE_APPLE_CLANG_MINOR_VERSION \
|
||||
__clang_patchlevel__=$$QMAKE_APPLE_CLANG_PATCH_VERSION
|
||||
!isEmpty(QMAKE_CLANG_MAJOR_VERSION): \
|
||||
QMAKE_COMPILER_DEFINES += __clang__ \
|
||||
__clang_major__=$$QMAKE_CLANG_MAJOR_VERSION \
|
||||
__clang_minor__=$$QMAKE_CLANG_MINOR_VERSION \
|
||||
__clang_patchlevel__=$$QMAKE_CLANG_PATCH_VERSION
|
||||
!isEmpty(QMAKE_GCC_MAJOR_VERSION): \
|
||||
QMAKE_COMPILER_DEFINES += \
|
||||
__GNUC__=$$QMAKE_GCC_MAJOR_VERSION \
|
||||
__GNUC_MINOR__=$$QMAKE_GCC_MINOR_VERSION \
|
||||
__GNUC_PATCHLEVEL__=$$QMAKE_GCC_PATCH_VERSION
|
||||
!isEmpty(QMAKE_GHS_VERSION): \
|
||||
QMAKE_COMPILER_DEFINES += __ghs__ __GHS_VERSION_NUMBER=$$QMAKE_GHS_VERSION
|
||||
|
||||
QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT
|
||||
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT
|
||||
|
||||
clang_cl|intel_icl {
|
||||
include(../common/msvc-based-version.conf)
|
||||
} else: msvc {
|
||||
include(../common/msvc-version.conf)
|
||||
}
|
||||
|
||||
#
|
||||
# Determine and cache the default search paths
|
||||
#
|
||||
|
||||
defineReplace(qtMakeExpand) {
|
||||
out = "$$1"
|
||||
for(ever) {
|
||||
m = $$replace(out, ".*\\$\\(EXPORT_([^)]+)\\).*", \\1)
|
||||
equals(m, $$out): \
|
||||
return($$out)
|
||||
out = $$replace(out, "\\$\\(EXPORT_$$m\\)", $$eval($$m))
|
||||
}
|
||||
}
|
||||
|
||||
defineReplace(qtSplitPathList) {
|
||||
paths = $$split(1, $$QMAKE_DIRLIST_SEP)
|
||||
ret =
|
||||
for (p, paths): \
|
||||
ret += $$clean_path($$p)
|
||||
return($$ret)
|
||||
}
|
||||
|
||||
defineReplace(qtNmakePathList) {
|
||||
paths =
|
||||
for (p, 1): \
|
||||
paths += $$shell_path($$p)
|
||||
paths ~= s,$${LITERAL_HASH},^$${LITERAL_HASH},g
|
||||
paths ~= s,\\$,\$\$,g
|
||||
return($$join(paths, $$QMAKE_DIRLIST_SEP))
|
||||
}
|
||||
|
||||
msvc {
|
||||
arch = $$lower($$VCPROJ_ARCH)
|
||||
equals(arch, x64): \ # may be "win32" or undefined
|
||||
arch = amd64
|
||||
else: !equals(arch, arm):!equals(arch, arm64): \ # may be "win32" or undefined
|
||||
arch = x86
|
||||
# Consider only ARM64 desktop builds to be cross-builds -
|
||||
# the host is assumed to be Intel and capable of running the target
|
||||
# executables (so building for x64 on x86 will break).
|
||||
equals(arch, arm64): \
|
||||
CONFIG += msvc_cross
|
||||
}
|
||||
|
||||
isEmpty($${target_prefix}.INCDIRS) {
|
||||
#
|
||||
# Get default include and library paths from compiler
|
||||
#
|
||||
wasm {
|
||||
# wasm compiler does not work here, just use defaults
|
||||
} else: gcc {
|
||||
cmd_suffix = "<$$QMAKE_SYSTEM_NULL_DEVICE >$$QMAKE_SYSTEM_NULL_DEVICE"
|
||||
equals(QMAKE_HOST.os, Windows): \
|
||||
cmd_prefix = "set LC_ALL=C&"
|
||||
else: \
|
||||
cmd_prefix = "LC_ALL=C"
|
||||
|
||||
cxx_flags = $$QMAKE_CXXFLAGS
|
||||
|
||||
# Manually inject the sysroot for Apple Platforms because its resolution
|
||||
# normally does not happen until default_post.prf. This is especially
|
||||
# important for moc to gain the correct default include directory list.
|
||||
# While technically incorrect but without any likely practical effect,
|
||||
# UIKit simulator platforms will see the device SDK's sysroot in
|
||||
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
|
||||
darwin {
|
||||
uikit {
|
||||
# Clang doesn't automatically pick up the architecture, just because
|
||||
# we're passing the iOS sysroot below, and we will end up building the
|
||||
# test for the host architecture, resulting in linker errors when
|
||||
# linking against the iOS libraries. We work around this by passing
|
||||
# the architecture explicitly.
|
||||
cxx_flags += -arch $$first(QMAKE_APPLE_DEVICE_ARCHS)
|
||||
}
|
||||
|
||||
uikit:macx-xcode: \
|
||||
cxx_flags += -isysroot $$sdk_path_device.value
|
||||
else: \
|
||||
cxx_flags += -isysroot $$QMAKE_MAC_SDK_PATH
|
||||
}
|
||||
|
||||
rim_qcc: \
|
||||
# Need the cc1plus and ld command lines to pick up the paths
|
||||
cxx_flags += $$QMAKE_LFLAGS_SHLIB -o $$QMAKE_SYSTEM_NULL_DEVICE -v
|
||||
else: darwin:clang: \
|
||||
# Need to link to pick up library paths
|
||||
cxx_flags += -g0 $$QMAKE_LFLAGS_SHLIB -o /dev/null -v -Wl,-v
|
||||
else: \
|
||||
# Just preprocess, might not pick up library paths
|
||||
cxx_flags += -E -v
|
||||
|
||||
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec)
|
||||
!equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output)
|
||||
|
||||
rim_qcc {
|
||||
for (line, output) {
|
||||
contains(line, "^[^ ]*cc1plus .*") {
|
||||
take_next = false
|
||||
for (parameter, $$list($$line)) {
|
||||
$$take_next {
|
||||
QMAKE_DEFAULT_INCDIRS += $$clean_path($$parameter)
|
||||
take_next = false
|
||||
} else: equals(parameter, "-isystem") {
|
||||
take_next = true
|
||||
}
|
||||
}
|
||||
} else: contains(line, "^[^ ]*-ld .*") {
|
||||
for (parameter, $$list($$line)) {
|
||||
contains(parameter, "^-L.*") {
|
||||
parameter ~= s/^-L//
|
||||
QMAKE_DEFAULT_LIBDIRS += $$clean_path($$parameter)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
add_includes = false
|
||||
add_libraries = false
|
||||
for (line, output) {
|
||||
line ~= s/^[ \\t]*// # remove leading spaces
|
||||
contains(line, "LIBRARY_PATH=.*") {
|
||||
line ~= s/^LIBRARY_PATH=// # remove leading LIBRARY_PATH=
|
||||
equals(QMAKE_HOST.os, Windows): \
|
||||
paths = $$split(line, ;)
|
||||
else: \
|
||||
paths = $$split(line, $$QMAKE_DIRLIST_SEP)
|
||||
for (path, paths): \
|
||||
QMAKE_DEFAULT_LIBDIRS += $$clean_path($$path)
|
||||
} else: contains(line, "Library search paths:") {
|
||||
add_libraries = true
|
||||
} else: contains(line, "$${LITERAL_HASH}include <.*") { # #include <...> search starts here:
|
||||
add_includes = true
|
||||
} else: contains(line, "End of search.*") {
|
||||
add_includes = false
|
||||
} else: $$add_libraries {
|
||||
# We assume all library search paths are absolute
|
||||
!contains(line, "^/.*") {
|
||||
add_libraries = false
|
||||
next()
|
||||
}
|
||||
QMAKE_DEFAULT_LIBDIRS += $$clean_path($$line)
|
||||
} else: $$add_includes {
|
||||
!contains(line, ".* \\(framework directory\\)"): \
|
||||
QMAKE_DEFAULT_INCDIRS += $$clean_path($$line)
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!darwin:clang)|intel_icc {
|
||||
# Clang on a non-Apple system (that is, a system without ld64 -- say, with GNU ld
|
||||
# or gold under Linux) will not print any library search path. Need to use another
|
||||
# invocation with different options (which in turn doesn't print include search
|
||||
# paths, so it can't just be used in place of the above code).
|
||||
# What's more, -print-search-dirs can't be used on clang on Apple because it
|
||||
# won't print all the library paths (only the clang-internal ones).
|
||||
output = $$system("$$cmd_prefix $$QMAKE_LINK $$QMAKE_LFLAGS -print-search-dirs", lines, ec)
|
||||
!equals(ec, 0): qtCompilerError($$QMAKE_LINK, $$output)
|
||||
|
||||
for (line, output) {
|
||||
contains(line, "^libraries: .*") {
|
||||
line ~= s,^libraries: ,,
|
||||
equals(QMAKE_HOST.os, Windows) {
|
||||
# clang (7.x) on Windows uses the wrong path list separator ...
|
||||
line ~= s,:(?![/\\\\]),;,
|
||||
paths = $$split(line, ;)
|
||||
} else {
|
||||
paths = $$split(line, $$QMAKE_DIRLIST_SEP)
|
||||
}
|
||||
for (path, paths): \
|
||||
QMAKE_DEFAULT_LIBDIRS += $$clean_path($$replace(path, ^=, $$[SYSROOT]))
|
||||
}
|
||||
}
|
||||
}
|
||||
isEmpty(QMAKE_DEFAULT_INCDIRS): \
|
||||
!integrity: \
|
||||
error("failed to parse default include paths from compiler output")
|
||||
isEmpty(QMAKE_DEFAULT_LIBDIRS): \
|
||||
!integrity:!darwin: \
|
||||
error("failed to parse default library paths from compiler output")
|
||||
QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS)
|
||||
} else: ghs {
|
||||
cmd = $$QMAKE_CXX $$QMAKE_CXXFLAGS -$${LITERAL_HASH} -o /tmp/fake_output /tmp/fake_input.cpp
|
||||
output = $$system("$$cmd", blob, ec)
|
||||
!equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output)
|
||||
output ~= s/\\\\\\n {8}//g
|
||||
output = $$split(output, $$escape_expand(\\n))
|
||||
for (line, output) {
|
||||
contains(line, "^[^ ]+/ecom[^ ]+ .* /tmp/fake_input\\.cpp") {
|
||||
for (parameter, $$list($$line)) {
|
||||
contains(parameter, "^(-I|--include_no_mmd=|--sys_include=).*") {
|
||||
parameter ~= s/^(-I|--include_no_mmd=|--sys_include=)//
|
||||
QMAKE_DEFAULT_INCDIRS += $$clean_path($$parameter)
|
||||
}
|
||||
}
|
||||
} else: contains(line, "^[^ ]+/elxr .*") {
|
||||
for (parameter, $$list($$line)) {
|
||||
contains(parameter, "^-L.*") {
|
||||
parameter ~= s/^-L//
|
||||
QMAKE_DEFAULT_LIBDIRS += $$clean_path($$parameter)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else: msvc_cross {
|
||||
# Use a batch file, because %VAR% in the system() call expands to
|
||||
# the pre-script-call value, and !VAR! cannot be enabled outside
|
||||
# a batch file without invoking another shell instance.
|
||||
cmd = $$system_quote($$system_path($$PWD/data/dumpvcvars.bat))
|
||||
|
||||
hostArch = $$QMAKE_HOST.arch
|
||||
equals(hostArch, x86_64): \
|
||||
hostArch = amd64
|
||||
!equals(arch, $$hostArch): \
|
||||
arch = $${hostArch}_$$arch
|
||||
|
||||
isEmpty(MSVC_VER): \
|
||||
error("Mkspec does not specify MSVC_VER. Cannot continue.")
|
||||
versionAtLeast(MSVC_VER, 15.0) {
|
||||
dir = $$(VSINSTALLDIR)
|
||||
isEmpty(dir) {
|
||||
version_parts = $$split(MSVC_VER, .)
|
||||
MSVC_NEXT_MAJOR = $$num_add($$first(version_parts), 1)
|
||||
vswhere = "$$getenv(ProgramFiles\(x86\))/Microsoft Visual Studio/Installer/vswhere.exe"
|
||||
!exists($$vswhere): \
|
||||
error("Could not find $$vswhere")
|
||||
vswhere = $$system_quote($$system_path($$vswhere))
|
||||
# -version parameter: A version range for instances to find. 15.0 will get all versions >= 15.0
|
||||
# Example: [15.0,16.0) will find versions 15.*.
|
||||
dir = $$system("$$vswhere -latest -version [$$MSVC_VER,$${MSVC_NEXT_MAJOR}.0] -property installationPath")
|
||||
}
|
||||
isEmpty(dir): \
|
||||
error("Failed to find the Visual Studio installation directory.")
|
||||
cmd += $$system_quote($$dir\\VC\\Auxiliary\\Build\\vcvarsall.bat) $$arch
|
||||
} else {
|
||||
dir = $$(VCINSTALLDIR)
|
||||
isEmpty(dir): \
|
||||
dir = $$read_registry(HKLM, \
|
||||
"Software\\Microsoft\\VisualStudio\\$$MSVC_VER\\Setup\\VC\\ProductDir", 32)
|
||||
isEmpty(dir): \
|
||||
error("Failed to find the Visual C installation directory.")
|
||||
cmd += $$system_quote($$dir\\vcvarsall.bat) $$arch
|
||||
}
|
||||
|
||||
isEmpty(WINSDK_VER): \
|
||||
error("Mkspec does not specify WINSDK_VER. Cannot continue.")
|
||||
# We prefer the environment variable, because that may work around
|
||||
# a broken registry entry after uninstalling a newer SDK.
|
||||
# However, we do that only if the major+minor SDK version matches
|
||||
# the one requested by the mkspec, as we might be building for a
|
||||
# newer target than the host.
|
||||
winsdk_ver = $$(WindowsSDKVersion)
|
||||
!isEmpty(winsdk_ver) {
|
||||
winsdk_ver ~= s,\\\\$,, # Work around SDK breakage.
|
||||
!equals(WINSDK_VER, $$replace(winsdk_ver, ^(\\d+\\.\\d+).*$, \\1)): \
|
||||
winsdk_ver =
|
||||
}
|
||||
!isEmpty(winsdk_ver) {
|
||||
cmd += $$winsdk_ver
|
||||
} else {
|
||||
winsdk_ver = $$read_registry(HKLM, \
|
||||
"Software\\Microsoft\\Microsoft SDKs\\Windows\\v$$WINSDK_VER\\ProductVersion", 32)
|
||||
isEmpty(winsdk_ver): \
|
||||
error("Windows SDK $$WINSDK_VER requested by mkspec is not installed. Cannot continue.")
|
||||
cmd += $${winsdk_ver}.0
|
||||
}
|
||||
|
||||
output = $$system("$$cmd 2>&1", lines, ec)
|
||||
!equals(ec, 0): \
|
||||
qtToolchainError("SDK setup script failed. Output:", $$output, \
|
||||
"Command was: $$cmd")
|
||||
lines = $$output
|
||||
for(ever) {
|
||||
isEmpty(lines): \
|
||||
break()
|
||||
line = $$take_first(lines)
|
||||
equals(line, "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="): \
|
||||
break()
|
||||
}
|
||||
!count(lines, 3): \
|
||||
qtToolchainError("SDK setup script returned unexpected output:", $$output, \
|
||||
"Command was: $$cmd")
|
||||
|
||||
# These contain only paths for the target.
|
||||
QMAKE_DEFAULT_INCDIRS = $$qtSplitPathList($$member(lines, 0))
|
||||
QMAKE_DEFAULT_LIBDIRS = $$qtSplitPathList($$member(lines, 1))
|
||||
# PATH is inherently for the host, and paths that are not shadowed
|
||||
# by vcvarsall.bat are assumed to contain only tools that work for
|
||||
# both host and target builds.
|
||||
QMAKE_DEFAULT_PATH = $$qtSplitPathList($$member(lines, 2))
|
||||
# We de-duplicate, because the script just prepends to the paths for
|
||||
# the host, some of which are identical to the ones for the target.
|
||||
QMAKE_DEFAULT_PATH = $$unique(QMAKE_DEFAULT_PATH)
|
||||
} else: msvc {
|
||||
LIB = $$getenv("LIB")
|
||||
QMAKE_DEFAULT_LIBDIRS = $$split(LIB, $$QMAKE_DIRLIST_SEP)
|
||||
INCLUDE = $$getenv("INCLUDE")
|
||||
QMAKE_DEFAULT_INCDIRS = $$split(INCLUDE, $$QMAKE_DIRLIST_SEP)
|
||||
}
|
||||
|
||||
unix:!darwin:if(!cross_compile|host_build) {
|
||||
isEmpty(QMAKE_DEFAULT_INCDIRS): QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include
|
||||
isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib
|
||||
}
|
||||
|
||||
# cache() complains about undefined variables and doesn't persist empty ones.
|
||||
!isEmpty(QMAKE_DEFAULT_INCDIRS): \
|
||||
cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS)
|
||||
!isEmpty(QMAKE_DEFAULT_LIBDIRS): \
|
||||
cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS)
|
||||
!isEmpty(QMAKE_DEFAULT_PATH): \
|
||||
cache($${target_prefix}.PATH, set stash, QMAKE_DEFAULT_PATH)
|
||||
} else {
|
||||
QMAKE_DEFAULT_INCDIRS = $$eval($${target_prefix}.INCDIRS)
|
||||
QMAKE_DEFAULT_LIBDIRS = $$eval($${target_prefix}.LIBDIRS)
|
||||
QMAKE_DEFAULT_PATH = $$eval($${target_prefix}.PATH)
|
||||
}
|
||||
|
||||
msvc_cross {
|
||||
qmake_inc_exp.name = INCLUDE
|
||||
qmake_inc_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_INCDIRS)
|
||||
qmake_lib_exp.name = LIB
|
||||
qmake_lib_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_LIBDIRS)
|
||||
qmake_path_exp.name = PATH
|
||||
qmake_path_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_PATH)
|
||||
QMAKE_EXPORTED_VARIABLES += qmake_inc_exp qmake_lib_exp qmake_path_exp
|
||||
}
|
||||
|
||||
unset(target_prefix)
|
||||
Reference in New Issue
Block a user