Compare commits

..

245 Commits

Author SHA1 Message Date
07a9f8aab1 Merge branch 'develop' into feature/appimage-build 2023-07-06 12:19:07 +03:00
1d37344d01 Merge pull request #707 from ONLYOFFICE/feature/vboxtester
build
2023-07-02 00:44:30 +03:00
a5e412ee85 Add vboxtexter to deploy 2023-07-02 00:43:46 +03:00
bdd1d765bf Add macos builder archive deploy (#706) 2023-06-30 21:13:22 +05:00
68de1c72e7 Fix check action (#704) 2023-06-29 15:48:56 +05:00
2062bd0b92 Fix package build (#703) 2023-06-29 15:48:44 +05:00
0f1dcb88d4 Merge pull request #701 from ONLYOFFICE/fix/nodejsV
Updated max permitted node.js version
2023-06-29 08:23:16 +03:00
12500bbd70 Changed node.js minor version 2023-06-29 10:31:06 +08:00
7bc15e05d6 Updated max ermitted node.js version 2023-06-28 21:50:24 +08:00
84a8032233 Add files to gitignore 2023-06-28 11:47:25 +03:00
67a4ab0dfe Merge pull request #700 from ONLYOFFICE/feature/tests
Add tests for editors
2023-06-28 11:41:20 +03:00
eff25a9245 Merge branch 'release/v7.4.0' into develop 2023-06-28 11:07:28 +03:00
5497cb527b Disable precompiled version on release build 2023-06-27 18:49:41 +03:00
9e6010f650 Fix win update deploy (#697) 2023-06-21 18:34:00 +05:00
8d4ff54463 Fix bug #63097
Fix bug 63097
2023-06-21 16:51:17 +05:00
a3f2ec8161 Fix bug #63077
Fix bug 63077
2023-06-20 15:09:31 +05:00
e811ce765c Add tests for editors 2023-06-12 22:31:18 +03:00
c17037ef65 Change link to qt 2023-06-12 12:10:09 +03:00
bd3682f4f1 Package build fix (#691)
* Fix upload errors

* Fix inno help build
2023-06-08 13:16:05 +05:00
28767c0f2d Fix desktop help signing (#690)
Fix bug 62938
2023-06-07 18:10:42 +05:00
f70431f7a5 build 2023-06-06 15:00:28 +03:00
26448858e8 Package build small fix (#689) 2023-06-06 16:07:49 +05:00
fc2d4a45ca Package scripts fix (#688) 2023-06-06 14:48:37 +05:00
478f4b86e7 Restore desktop help installer (#687) 2023-06-06 13:59:34 +05:00
5e8f7aa52d Package build fix (#686) 2023-06-05 20:50:08 +05:00
c9b9cb5846 Add core-fonts repo for all modules 2023-06-05 12:29:05 +03:00
06a1b12069 Revert "Fix support python 2.7"
This reverts commit 815adb0856.
2023-06-05 09:01:16 +03:00
815adb0856 Fix support python 2.7 2023-06-05 07:06:26 +03:00
ef22f84ab1 Merge remote-tracking branch 'remotes/origin/fix/bug-59392' into release/v7.4.0
# Conflicts:
#	scripts/base.py
#	scripts/deploy_desktop.py
#	scripts/develop/config_server.py
2023-06-05 01:15:48 +03:00
596e7bf617 Add default fonts to deploy 2023-06-03 00:13:45 +03:00
a19609f5b1 Add desktop standalone package build (#685)
* Fix desktop help deploy

* Fix zip

* Fix inno build

* Fix msi build
2023-06-02 18:54:12 +05:00
2ad21f9cd0 [desktop] fix build package 2023-06-01 15:12:40 +03:00
e91c9f06dd [desktop] fix option name 2023-05-31 19:07:49 +03:00
d8e1cfe702 [desktop] debug building update's package 2023-05-31 14:48:25 +03:00
4949a8d464 Fix appcast stuff (#684) 2023-05-30 20:35:28 +05:00
121c624026 Remove debug staff 2023-05-29 12:44:47 +03:00
0ba5118b5e Do not remove marketplace directory 2023-05-28 21:40:22 +03:00
80d3824150 Update v8 version for android 2023-05-28 16:55:51 +05:00
5bf74fda13 Fix packages md5 command (#682) 2023-05-26 14:02:24 +05:00
a9cbfe93d0 Push md5 sums to S3 (#681) 2023-05-25 21:55:22 +05:00
e4d30cb842 Fix for local fonts directory 2023-05-25 13:49:17 +03:00
9b81677fbf Update patchelf 2023-05-24 20:59:19 +03:00
ce9762da73 Update patchelf and add build script 2023-05-24 11:56:33 +03:00
cb96902786 Add flag for convertaion to images 2023-05-20 22:40:27 +03:00
750d5efc0e Refactoring 2023-05-19 16:43:25 +03:00
929ebf6e0e Merge pull request #679 from ONLYOFFICE/fix/remove-deploy
Remove deploy folders
2023-05-18 18:03:02 +05:00
3d446a5d30 Merge branch 'release/v7.4.0' into fix/remove-deploy 2023-05-18 15:03:14 +03:00
978fe74291 Update base.py 2023-05-18 15:02:53 +03:00
04a5f4667a Fix plugin list format (#677) 2023-05-17 20:33:35 +05:00
095bbc9d19 Update vcredist checksums (#674) (#675) 2023-05-17 16:19:41 +05:00
2478eb6873 Update vcredist checksums (#674) 2023-05-17 13:15:33 +05:00
d1b490b59a Remove sdkjs-plugins from server deploy (#673)
* Remove sdkjs-plugins from server deploy

* Generation plugin list json

* Fix filename
2023-05-16 20:05:10 +05:00
01158bb16a Fix typo 2023-05-16 10:23:33 +03:00
dd583cb908 Enable bundle_xcframeworks by default for ios build 2023-05-16 10:18:34 +03:00
702952740f Use v8 9.9 version instead of 6.0 on macOS (use_v8 version) 2023-05-15 17:40:32 +05:00
99741d0805 Merge pull request #672 from ONLYOFFICE/merge-hotfix
Merge branch hotfix/v7.3.3 into develop
2023-05-15 12:38:52 +05:00
fcec89bf9c Merge branch 'hotfix/v7.3.3' into develop 2023-05-15 10:28:28 +03:00
dab33a829b Merge branch 'release/v7.4.0' of github.com:ONLYOFFICE/build_tools into release/v7.4.0 2023-05-02 17:22:34 +03:00
dc08890d4c Merge branch 'hotfix/v7.3.3' into release/v7.4.0 2023-05-02 17:22:16 +03:00
40c5192c1c Fix cef103 for new systems 2023-05-02 17:17:23 +03:00
06c0ef6dde Small fix 2023-05-02 17:13:22 +03:00
cb1ad31c86 Add cef103 for old mac systems (enable with use_v8 flag) 2023-05-02 17:04:19 +03:00
8fbf7485dc Merge pull request #666 from ONLYOFFICE/release/v7.4.0
Fix build arm64 version
2023-05-02 02:57:21 +05:00
c03aa9cbfd Fix build arm64 version 2023-05-02 00:55:35 +03:00
063ffc6ece Merge pull request #665 from ONLYOFFICE/release/v7.4.0
Release/v7.4.0
2023-04-28 21:37:19 +05:00
b5881ef5b4 Merge pull request #664 from ONLYOFFICE/feature/pmutility
pluginsmanager deploy
2023-04-28 20:44:01 +05:00
91582bc164 Package changelogs refactoring (#663) 2023-04-28 19:13:08 +05:00
c11b53bba9 pluginsmanager deploy 2023-04-28 11:59:57 +03:00
362d82e32c Disable warnings by default 2023-04-27 14:38:38 +03:00
a024ff4899 Enable clean openssl by version for ios & android 2023-04-27 10:05:30 +03:00
fb3dda807e Merge pull request #662 from ONLYOFFICE/release/v7.4.0
Release/v7.4.0
2023-04-27 01:55:46 +05:00
98a4dbddfc Fix build v8 not on windows 2023-04-22 16:14:57 +03:00
e2f0d4b643 Merge pull request #661 from ONLYOFFICE/feature/googletest
Feature/googletest
2023-04-22 00:09:39 +03:00
ad67f0de2c Fix build msi package for x86 platform (#660) 2023-04-21 18:14:43 +05:00
6df78fb8c0 Fix typo. Removed unnecessary imports from googletest.py 2023-04-21 15:31:07 +04:00
b75f9cc039 Remove build gtests (move sources to pri file) 2023-04-21 14:02:05 +03:00
776b50945f Set update flag for md2 alg 2023-04-21 13:53:09 +03:00
6bdfc8a141 Create use_system_qt.py 2023-04-21 01:51:35 +03:00
88fc4a26ed Add support build with system qt on linux 2023-04-21 01:51:11 +03:00
904fee3f53 Fix build with python >= 3.10 2023-04-21 01:50:11 +03:00
784a9928cd Add midl file to deploy 2023-04-21 01:21:18 +03:00
493b79a18c Added googletest module to 3dParty 2023-04-20 22:52:59 +04:00
503ae7679f Fix closure maps deploy (#659)
* Fix closure maps deploy

* Small fix
2023-04-20 20:15:45 +05:00
873b1f3774 Fix deploy desktop inno update (#658) 2023-04-20 19:42:49 +05:00
e9e7e7a4c7 Enabled MD2 in openssl builds 2023-04-20 18:24:09 +04:00
e508edb680 Refactoring desktop inno update (#657) 2023-04-19 19:35:21 +05:00
334ad55548 Fix powershell args (#656) 2023-04-19 14:51:56 +05:00
d14816d18e Fix desktop zip build (#655) 2023-04-19 13:28:18 +05:00
204f9fbe51 Merge pull request #653 from ONLYOFFICE/feature/storeK0R0L
testing from K0R0L fork in desktop
2023-04-18 18:09:08 +03:00
6d8b407872 testing from K0R0L fork in desktop 2023-04-18 17:50:28 +03:00
0f5dab8095 [desktop] fix copying package info to dest path 2023-04-18 09:56:58 +03:00
e1271a62cf [desktop] refactoring 2023-04-16 14:33:26 +03:00
549e182867 [desktop] added reserved url for updates 2023-04-16 14:21:10 +03:00
59f8e39092 Fix linux_arm64 build 2023-04-15 08:06:53 +03:00
5ff3c615e9 Merge pull request #652 from ONLYOFFICE/feature/newpm
deploy new plugin manager
2023-04-14 18:54:16 +03:00
00300d80c2 Fix indents 2023-04-14 18:53:48 +03:00
7dd97a8490 Refactoring deploy plugins in desktop 2023-04-14 18:50:01 +03:00
f39cfe8a22 Merge pull request #651 from ONLYOFFICE/feature/automate-update
Update linux automate script
2023-04-14 18:31:35 +03:00
3251c1125f deploy new plugin manager 2023-04-14 16:10:01 +03:00
a7f0f1611f Update linux automate script 2023-04-14 16:00:52 +03:00
cf1f0bdb63 Fix typo 2023-04-14 15:54:14 +03:00
b7808a8fa6 Refactoring & enable old v8 for old macOS 2023-04-14 14:22:26 +03:00
7184016b62 Deploy small fix (#650) 2023-04-14 13:52:04 +05:00
cb137bb28a Fix typo 2023-04-14 10:50:18 +03:00
5309911e2b Fix typo 2023-04-14 09:43:31 +03:00
101949ba1c Correct default v8 version 2023-04-14 00:07:14 +03:00
1431d3a541 Package deploy refactoring (#649)
* Deploy closure maps (#635)

* Package deploy refactoring
2023-04-13 19:06:56 +05:00
c04ef86daf [develop] Use npm ci instead of npm ci when building sdk 2023-04-13 13:51:40 +03:00
f780bef0a9 Merge pull request #646 from ONLYOFFICE/fix/java_version
Added checking Java version to 11+ x64-bit
2023-04-13 14:41:49 +05:00
014b74bb1d Merge pull request #647 from ONLYOFFICE/release/v7.4.0
Release/v7.4.0
2023-04-13 10:20:53 +03:00
2578d22b93 Added checking Java version to 11+ x64-bit 2023-04-13 09:29:46 +03:00
b91cbf1233 enable vs 2019 by default 2023-04-12 15:49:40 +03:00
55955b7731 v8 patch for debug build (remove after update v8 version) 2023-04-12 11:26:39 +03:00
484c9dc910 Changes for use _ITERATOR_DEBUG_LEVEL in debug by default 2023-04-12 11:21:53 +03:00
c235a78634 Fix builder package name (#644) 2023-04-10 17:09:56 +05:00
09bf6684d3 Correct old v8 for build in debug mode 2023-04-09 13:34:41 +03:00
ea0a80e4d1 [windows] Use _ITERATOR_DEBUG_LEVEL=0 in debug build 2023-04-08 22:22:42 +03:00
52e706d212 Fix package names (#643) 2023-04-07 20:53:42 +05:00
55f8633cce Merge pull request #642 from ONLYOFFICE/feature/add-desktop-subproj
[desktop] skip build update service for win xp
2023-04-07 18:00:58 +03:00
11fa48d1b0 [desktop] skip build update service for win xp 2023-04-07 17:08:54 +03:00
a3d7c0bbcd Merge pull request #641 from ONLYOFFICE/feature/add-desktop-subproj
[desktop] build update service for win package
2023-04-07 15:49:29 +03:00
32af7d10c6 [desktop] build update service for win package 2023-04-07 15:45:44 +03:00
1241e7e868 Remove .system directory from deploy 2023-04-07 09:45:29 +03:00
0a8601ca79 Change icu build script 2023-04-07 09:40:09 +03:00
8fa8424f24 Remove cmap file 2023-04-02 16:42:50 +03:00
c7465ba9ee Add library for ubuntu14 2023-03-30 12:25:34 +03:00
604e627233 Add excludes for elf paths 2023-03-28 10:28:34 +03:00
7c1f957275 Add rpath to elf tools 2023-03-28 01:28:32 +03:00
ad762c667b Fix elf tools 2023-03-28 00:30:43 +03:00
25148a4ccc Fix rpath 2023-03-27 14:42:58 +03:00
803fa4781b Update patchelf 2023-03-27 13:21:52 +03:00
d1133a01a8 Add script for change origin in rpath/runpath 2023-03-27 00:18:48 +03:00
63cdb366ba Fix rpath for old systems 2023-03-26 21:08:38 +03:00
585d1bfba9 Add tools 2023-03-26 20:59:49 +03:00
fb9d1e69a4 Merge pull request #634 from ONLYOFFICE/feature/license-checker
Feature/license checker
2023-03-24 13:30:34 +03:00
98f84e8740 Update hard-coded version to v7.4.0 2023-03-23 08:38:14 +00:00
75d975f91d Autoselect best cert for inno installer signing (#640) 2023-03-21 20:07:54 +05:00
0cebd3646f Merge pull request #639 from ONLYOFFICE/fix/sio
Add PING_TIMEOUT_INTERVAL param
2023-03-16 20:54:42 +03:00
7633022d82 Add PING_TIMEOUT_INTERVAL param 2023-03-16 22:53:57 +05:00
8f146582a4 Merge pull request #637 from ONLYOFFICE/feature/v7.4
Feature/v7.4
2023-03-15 12:42:21 +03:00
59bb27998f Fix build 2023-03-12 14:00:06 +05:00
d45cd9932b revert test 2023-03-10 21:23:37 +03:00
58b6a91f65 test action 2023-03-10 21:21:25 +03:00
942875d1a1 fix actions 2023-03-10 21:20:33 +03:00
bcb38f8731 Deploy closure maps (#635) 2023-03-06 18:10:58 +05:00
ad53559b4f Developing 2023-03-04 09:39:48 +03:00
6b740baf73 revert actions 2023-03-02 17:28:29 +03:00
1ada97c409 fix actions 2023-03-02 17:26:10 +03:00
89caa5f87c fix docs 2023-03-02 17:24:38 +03:00
1badc69477 fix doc 2023-03-02 17:10:01 +03:00
6769ade9a9 fix doc 2023-03-02 17:07:35 +03:00
0e783f0413 fix docs 2023-03-02 17:05:48 +03:00
577ab77f1d [build] fix docs 2023-03-02 17:01:43 +03:00
7ee44be072 fix docs 2023-03-02 16:57:36 +03:00
fa7bbaf98b fix doc 2023-03-02 16:53:21 +03:00
672fcfdb6d add test doc 2023-03-02 16:50:00 +03:00
fc01b4ad8a [build] changed check 2023-03-02 16:49:17 +03:00
ca7f0f5951 deleted test doc 2023-03-02 16:44:11 +03:00
f003ad3277 [build] changed paths 2023-03-02 16:43:28 +03:00
dc6f59943f test doc 2023-03-02 16:38:03 +03:00
ee51adb675 [build] revert base.py 2023-03-02 16:35:31 +03:00
5406c24771 [build] revert base.py 2023-03-02 16:34:33 +03:00
d9c768c2d0 [build] fix deleted semicolons 2023-03-02 16:19:50 +03:00
d876c4d100 [build] small fix 2023-03-02 15:32:37 +03:00
894aaa9fa9 Merge pull request #633 from ONLYOFFICE/develop
Develop
2023-03-02 15:30:24 +03:00
010f22ea3b Revert "[build] added checks for plugins"
This reverts commit 72cf0a5837.
2023-03-02 15:24:40 +03:00
0a560c9594 Revert "[develop] Add plugins deploy for developer version"
This reverts commit 03d371d9fc.
2023-03-02 15:23:57 +03:00
7e53c18f5b Fix removing locale help 2023-03-02 12:05:49 +05:00
f0a3325ab8 [license] Update address in Copyright 2023-03-01 23:38:07 +03:00
a18b226ea2 Add help from common directory 2023-03-01 19:27:08 +05:00
4112c88c1b Generate closure compiler maps (#632) 2023-03-01 13:15:12 +05:00
abda397c9f Remove exteranal providers on winXP 2023-03-01 10:58:27 +03:00
ba0c7173c9 [license] Update config; Fix bug with bom, leading space; and minor changes 2023-02-28 15:20:59 +03:00
0c40287764 Merge pull request #629 from ONLYOFFICE/hotfix/v7.3.3
Hotfix/v7.3.3
2023-02-20 20:20:23 +05:00
05902d88a7 Update vcredist checksums (#628) 2023-02-17 20:07:25 +05:00
228b00d5c7 Setting up Info.plist version (#627)
* Setting up Info.plist version

* Small fix
2023-02-16 17:44:19 +05:00
6c2ce95b0e Fix test appcast links (#626) 2023-02-14 21:19:24 +05:00
fcb7ece378 Merge pull request #624 from ONLYOFFICE/hotfix/v7.3.2
Merge branch hotfix/v7.3.2 into hotfix/v7.3.3
2023-02-14 20:19:34 +05:00
65ef84179f Update hard-coded version to v7.3.3
(cherry picked from commit b7aa164ed8)
2023-02-14 18:18:21 +03:00
0811018560 Merge branch hotfix/v7.3.2 into develop 2023-02-14 07:52:35 +00:00
1a70ce90f9 Allow 32-bit msi only on 32-bit system (#621) 2023-02-10 17:34:31 +05:00
cd011035ff [develop] Add correct_plugins_branding to develop start; and minor changes 2023-02-10 00:17:25 +03:00
b7aa164ed8 Update hard-coded version to v7.3.3 2023-02-08 08:35:15 +00:00
cecf304ace Update hard-coded version to v7.3.2 2023-02-08 08:31:39 +00:00
ce60b83e65 Update win appcast generation (#619) 2023-02-08 13:27:22 +05:00
892ddc8a79 fix path 2023-02-07 18:02:54 +03:00
de237fb4af fix deploy 2023-02-07 17:35:12 +03:00
d60fc52e74 fix comments 2023-02-07 17:31:08 +03:00
1c8e702399 [fix] fix prev 2023-02-07 01:57:42 +03:00
c2dc35e857 fix prev commit 2023-02-07 01:56:10 +03:00
2067e12bdf [build] fix bug 59392 2023-02-07 01:54:21 +03:00
7764d4ba30 Merge remote-tracking branch 'origin/hotfix/v7.3.2' into develop 2023-02-06 23:28:38 +03:00
719a198e55 Merge pull request #617 from ONLYOFFICE/hotfix/v7.3.1
Hotfix/v7.3.1
2023-02-05 13:11:07 +05:00
8eac35df75 fix package building for desktop 2023-02-05 10:06:11 +03:00
975972885a Merge branch release/v7.3.0 into develop 2023-02-02 13:29:00 +00:00
056da4b782 Merge branch release/v7.3.0 into master 2023-02-02 13:28:57 +00:00
0de3c26200 Update hard-coded version to v7.3.1 2023-02-02 08:08:32 +00:00
f5539cf79f Fix build (ninja missing) 2023-02-02 09:56:09 +03:00
a0bdca62b5 Disable unused modules 2023-02-01 23:27:47 +03:00
ad996d39d2 Merge pull request #614 from ONLYOFFICE/feature/change-desktop-updates-build
[desktop] changed building updates for desktop
2023-02-02 00:15:44 +05:00
d393b9ea90 [desktop] changed building updates for desktop 2023-02-01 22:09:31 +03:00
3ae37d764b [build] fix 2023-02-01 12:40:24 +03:00
6b15d7fca2 [build] add marketplace plugin at ignore 2023-02-01 12:26:19 +03:00
d8167ea9dd [build] fix plugins 2023-02-01 12:22:12 +03:00
6efb0cfccf Merge pull request #613 from ONLYOFFICE/release/v7.3.0
Merge release/v7.3.0 into hotfix/v7.3.0
2023-02-01 12:35:24 +05:00
19ac16ff62 Fix DesktopEditorsHelp installer build [2] (#612)
* Fix DesktopEditorsHelp installer build

* Small fix
2023-02-01 12:29:54 +05:00
1710df79f2 [build] fix prev commit 2023-02-01 07:24:49 +03:00
72cf0a5837 [build] added checks for plugins 2023-02-01 06:48:36 +03:00
468f1788b8 Add support no tls version socket.io 2023-01-31 22:58:47 +05:00
36b5e1b5d7 Fix DesktopEditorsHelp installer build (#610) 2023-01-31 20:27:03 +05:00
03d371d9fc [develop] Add plugins deploy for developer version 2023-01-31 14:17:08 +03:00
4b50455a22 Merge branch release/v7.3.0 into master 2023-01-31 07:56:10 +00:00
5250de602c Enable DesktopEditorsHelp installer build (#608) 2023-01-30 17:39:24 +05:00
ffb88cdf57 Remove depends to python3 2023-01-28 23:45:57 +05:00
06773a22c9 [build] license_checker small fix 2023-01-26 17:57:31 +03:00
6ddcbc7c18 fix 2023-01-25 13:45:16 +03:00
1cdc9142df license_checker readme added 2023-01-25 13:30:15 +03:00
3bc88c4bf3 fix license checker 2023-01-24 22:14:10 +03:00
c4b21c554f [build] updated license checker 2023-01-24 22:06:28 +03:00
f7bbe2d9f7 [build] license checker fix docs 2023-01-20 16:43:30 +03:00
92760b2835 [build] license checker updated config options
Added ignoreListDirName
2023-01-20 16:41:28 +03:00
379718dbf9 [build] fix license_checker
deleted unused ignore
2023-01-20 15:54:44 +03:00
787d690c41 [build] license checker added config for repos 2023-01-20 14:43:29 +03:00
32f124517a [build] small fix license checker 2023-01-19 18:09:28 +03:00
f501a6ebac [build] license checker is ready
(tested only for sdkjs)
2023-01-19 17:53:11 +03:00
2f632a0f8d init commit 2023-01-17 12:35:47 +03:00
306703e677 Merge branch 'release/v7.3.0' into develop 2023-01-02 14:54:40 +03:00
256edf489c Merge pull request #598 from ONLYOFFICE/feature/package-develop-fix
Merge release/v7.3.0 package fixes
2023-01-02 14:53:08 +03:00
655837f8cd Merge release/v7.3.0 package fixes 2023-01-01 23:17:14 +03:00
ef43e6a9a4 Remove not used websocket engine 2023-01-01 19:55:25 +03:00
8fa222a9b9 Merge branch hotfix/v7.2.2 into develop 2022-12-27 13:43:24 +00:00
0e90989998 Small fix (#590) 2022-12-23 22:51:34 +03:00
dd9a8b9df5 Fix develop (#588)
* Fix msi build (#583)

* Add packages upload s3 endpoint url option (#584)

* Fix package build (#585)

* Refactoring package scripts (#587)

* Refactoring logs

* Refactoring packages

* Small fix
2022-12-23 20:11:12 +03:00
d758cd1e7d Merge branch hotfix/v7.2.2 into master 2022-12-20 07:54:28 +00:00
ad83a772a1 Merge commit 'ab838ae3ba50283cd683a1bbaa7ac256d28cc256' into develop 2022-12-12 12:30:30 +03:00
1ad42f671a Merge pull request #574 from ONLYOFFICE/release/v7.3.0
Fix previous commit
2022-11-23 14:02:48 +03:00
b3ab757416 Merge pull request #572 from ONLYOFFICE/release/v7.3.0
Release/v7.3.0
2022-11-23 10:52:33 +03:00
65571cfa06 Release/v7.3.0 (#569)
* Delete quotes in AddUpgradeCode action (#555)

* Add feature switches (#553)

* Update vcredist checksums (#556)

* Fix macos package script (#558)

* Fix macos package script

* Small fix

* Small fix

* [desktop] skip WinSparkle from deploy

* Fix macos package build (#561)

* Add build mobile package (#562)

* Fix packages build (#563)

* Fix macOS ARM package build (#564)

* Updated script for generation plugin macros documentation.

* Fix core archive

* Small fix

* Add macOS ARM core archive build (#568)

Co-authored-by: Eugene Kozyrev <67453079+EugeneKozyrev@users.noreply.github.com>
Co-authored-by: Maxim Kadushkin <maxim.kadushkin@onlyoffice.com>
Co-authored-by: Nikita Khromov <nikita.khromov@onlyoffice.com>
Co-authored-by: Oleg Korshul <Oleg.Korshul@onlyoffice.com>
2022-11-18 18:20:00 +03:00
4fd5d6a814 Merge pull request #560 from ONLYOFFICE/feature/merge-hotfix
Merge branch hotfix/v7.2.1 into develop
2022-11-11 15:42:04 +03:00
c68c365261 Merge branch 'hotfix/v7.2.1' into develop 2022-11-11 15:39:31 +03:00
d2d7dc0717 Update vcredist checksums (#557) 2022-11-09 18:33:47 +03:00
e50a0e84f2 Delete quotes in AddUpgradeCode action (#555) 2022-11-07 16:00:15 +03:00
746cf0161e Merge branch 'develop' into feature/appimage-build 2022-09-22 16:59:36 +03:00
d957a878af Build appimage 2022-07-15 13:05:38 +03:00
22ec9b2dbb Add repositories 2022-07-11 11:09:44 +03:00
63 changed files with 2196 additions and 954 deletions

View File

@ -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.*

View File

@ -3,9 +3,12 @@ name: Markdown check
on:
workflow_dispatch:
push:
branches:
- '*'
paths:
- '*.md'
- 'develop/*.md'
- 'scripts/**.md'
jobs:
markdownlint:
@ -14,8 +17,5 @@ jobs:
- uses: actions/checkout@v3
- uses: DavidAnson/markdownlint-cli2-action@v9
with:
command: config
globs: |
.markdownlint.jsonc
*.md
develop/*.md
globs: '*.md,develop/*.md,scripts/**.md'
separator: ','

5
.gitignore vendored
View File

@ -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

View File

@ -1,5 +0,0 @@
{
"line-length": {
"code_block_line_length": 300
}
}

175
build.pro
View File

@ -9,119 +9,124 @@ include($$PWD/common.pri)
CONFIG += ordered
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)
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)
#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)
}
}

View File

@ -3,17 +3,11 @@ RUN apt-get update -y && \
apt-get install git -y \
python3 -y \
openjdk-11-jdk -y \
bzip2 -y \
npm -y && \
npm install -g grunt grunt-cli -y && \
npm install -g grunt-cli -y && \
ln -s /usr/bin/python3 /usr/bin/python && \
ln -s /usr/bin/pip3 /usr/bin/pip && \
git clone --depth 1 -b feature/docker-instruction https://github.com/ONLYOFFICE/build_tools.git var/www/onlyoffice/documentserver/build_tools && \
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

View File

@ -1,219 +1,50 @@
# Docker
This directory containing instruction for developers,
who want to change something in sdkjs or web-apps or server module,
who want to change something in sdkjs or web-apps module,
but don't want to compile pretty compilcated core product to make those changes.
## System requirements
## Installing ONLYOFFICE Docs
### Windows
## How to use - Linux or macOS
You need the latest
[Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
installed.
**Note**: You need the latest Docker version installed.
**Note**: Docker Desktop does not start automatically after installation.
You should manually start the **Docker Desktop** application.
**Note**: If you have problems running Docker Desktop with the
"Use WSL 2 instead of Hyper-V" installation option,
try reinstalling it without this option.
### Linux or macOS
You need the latest
[Docker](https://docs.docker.com/engine/install/)
version installed.
## Create 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 -b feature/docker-instruction https://github.com/ONLYOFFICE/build_tools.git
```
### Modify Docker Images
You might need to pull **onlyoffice/documentserver** image:
**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
cd build_tools/develop
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 build -t documentserver-develop .
```
**Note**: The dot at the end is required.
**Note**: Sometimes script may fail due to network errors. Just restart it.
### Connecting external folders
## Clone development modules
Clone development modules to the work dir
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
* `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
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
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
```

View File

@ -2,56 +2,11 @@
import sys
sys.path.append(sys.argv[1] + '/build_tools/scripts')
sys.path.append(sys.argv[1] + '/build_tools/scripts/develop')
import build_js
import run_server
import config
import base
git_dir = sys.argv[1];
base.print_info('argv :'+' '.join(sys.argv))
base.cmd_in_dir(git_dir + '/build_tools/', 'python3', ['configure.py', '--develop', '1'] + sys.argv[2:])
base.cmd_in_dir(sys.argv[1] + '/build_tools/', 'python3', ['configure.py'])
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/")
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)
build_js.build_js_develop(sys.argv[1])

View File

@ -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)
@ -75,9 +75,8 @@ if config.check_option("module", "desktop"):
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")
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")
if ("windows" == base.host_platform()):
base.set_env("VIDEO_PLAYER_VLC_DIR", base_dir + "/../desktop-sdk/ChromiumBasedEditors/videoplayerlib/vlc")

View File

@ -25,6 +25,7 @@ args = parser.parse_args()
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
@ -39,6 +40,7 @@ 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))
@ -64,6 +66,10 @@ utils.set_cwd(common.workspace_dir, verbose=True)
utils.delete_file("deploy.json")
if "core" in common.targets:
package_core.make()
if "closure-maps-os" in common.targets:
package_core.deploy_closure_maps("opensource")
if "closure-maps-com" in common.targets:
package_core.deploy_closure_maps("commercial")
if "desktop" in common.targets:
package_desktop.make()
if "builder" in common.targets:

View File

@ -12,6 +12,7 @@ import config
import codecs
import re
import stat
import json
# common functions --------------------------------------
def get_script_dir(file=""):
@ -440,9 +441,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 +481,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 +496,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
@ -633,9 +633,15 @@ 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):
@ -769,7 +775,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 +788,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 +1072,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,10 +1164,13 @@ 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):
@ -1185,6 +1211,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 +1321,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 +1338,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 +1358,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 +1426,47 @@ 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

View File

@ -111,6 +111,9 @@ def make():
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,7 +142,7 @@ 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):
@ -154,7 +157,7 @@ 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")

View File

@ -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):
@ -211,3 +220,23 @@ def parse_defaults():
else:
options[name] = defaults_options[name]
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

View File

@ -20,7 +20,7 @@ import hunspell
import glew
import harfbuzz
import hyphen
import socket_io
import googletest
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 +45,10 @@ def make():
harfbuzz.make()
glew.make()
hyphen.make()
socket_io.make()
googletest.make()
if config.check_option("module", "mobile"):
curl.make()
if (config.check_option("platform", "android")):
curl.make()
websocket.make()
return

View File

@ -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"])

View File

@ -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)

View 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

View File

@ -66,6 +66,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")

View File

@ -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)

View File

@ -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

View File

@ -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()
@ -179,6 +179,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\""])
@ -265,6 +266,7 @@ def make_xp():
" replaceInFile(file, '<RuntimeLibrary>MultiThreaded</RuntimeLibrary>', '<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>')",
]);
# 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"])

View 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&) {}
};
};

View File

@ -24,6 +24,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 +33,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) + "\""
@ -50,6 +52,28 @@ def ninja_windows_make(args, is_64=True, is_debug=False):
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()
@ -70,12 +94,17 @@ 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")
@ -83,6 +112,10 @@ def make():
if not base.is_file("v8/src/base/platform/wrappers.cc"):
base.writeFile("v8/src/base/platform/wrappers.cc", "#include \"src/base/platform/wrappers.h\"\n")
if 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")
gn_args = ["v8_static_library=true",
@ -112,7 +145,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 +155,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)

View File

@ -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

View File

@ -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")):
@ -92,6 +92,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):

View File

@ -55,9 +55,11 @@ 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")
if base.is_file(archive_dir + ".7z"):

View File

@ -4,6 +4,33 @@ import config
import base
import os
import platform
import glob
def deploy_marketplace_plugin(git_dir, root_dir):
# old manager
#base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "manager", True)
# plugin manager with local paths
sys_plugins_dir = root_dir + "/editors/sdkjs-plugins"
base.clone_marketplace_plugin(sys_plugins_dir, True, True, False)
# store with local paths
manager_dir = sys_plugins_dir + "/{AA2EA9B6-9EC2-415F-9762-634EE8D9A95E}"
store_dir_path = manager_dir + "/store"
if base.is_dir(store_dir_path):
base.delete_dir(store_dir_path)
base.create_dir(store_dir_path)
base.copy_dir_content(sys_plugins_dir + "/onlyoffice.github.io/store", store_dir_path, "", ".git")
base.delete_dir(store_dir_path + "/plugin")
base.delete_file(store_dir_path + "/build.bat")
for file in glob.glob(store_dir_path + "/*.html"):
base.replaceInFile(file, "https://onlyoffice.github.io/sdkjs-plugins/", "../../")
base.delete_dir_with_access_error(sys_plugins_dir + "/onlyoffice.github.io")
return
def make():
base_dir = base.get_script_dir() + "/../out"
@ -55,21 +82,20 @@ def make():
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")
if ("ios" == platform):
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, 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")
@ -97,10 +123,16 @@ def make():
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")):
@ -152,6 +184,8 @@ def make():
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")):
@ -186,21 +220,6 @@ def make():
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)
# remove some default plugins
@ -214,14 +233,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)
deploy_marketplace_plugin(git_dir, root_dir)
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")
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")):

View File

@ -86,6 +86,16 @@ def make():
if (0 == platform.find("mac")):
base.mac_correct_rpath_x2t(root_dir)
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 (0 == platform.find("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")
for native_platform in platforms:
if native_platform == "android":
# make full version
@ -95,6 +105,8 @@ def make():
base.create_dir(root_dir)
# js
base.copy_dir(base_dir + "/js/" + branding + "/mobile/sdkjs", root_dir + "/sdkjs")
# fonts
base.copy_dir(base_dir + "/js/" + branding + "/mobile/fonts", root_dir + "/fonts")
# app
base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder")
libs_dir = root_dir + "/lib"

View File

@ -87,8 +87,8 @@ 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")
@ -121,8 +121,11 @@ 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)
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")
@ -136,7 +139,9 @@ def make():
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'

View File

@ -67,7 +67,7 @@ def make():
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.clone_marketplace_plugin(git_dir + "/sdkjs-plugins", False, False, False)
if not base.is_dir(git_dir + "/fonts"):
base.create_dir(git_dir + "/fonts")
@ -144,10 +144,8 @@ 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_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))
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))
os.chdir(old_cur)
return

View File

@ -66,28 +66,6 @@ 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
@ -196,7 +174,7 @@ def check_nodejs():
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 = '18'
nodejs_max_version_minor = float("inf")
major_minor_max_version = nodejs_max_version.split('.')
nodejs_max_version_major = int(major_minor_max_version[0])
@ -204,7 +182,7 @@ def check_nodejs():
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')
print('Installed Node.js version must be 14.14 to 18.x')
isNeedReinstall = True
elif (nodejs_min_version_major == nodejs_cur_version_major):
if (nodejs_min_version_minor > nodejs_cur_version_minor):
@ -231,18 +209,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():
@ -847,6 +831,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]()
@ -931,7 +916,7 @@ 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',
'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',
@ -966,7 +951,6 @@ uninstall_special = {
install_params = {
'BuildTools': '--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --quiet --wait',
'Git': '/VERYSILENT /NORESTART',
'Java': '/s',
'MySQLServer': {
'port': '3306',
'user': 'root',
@ -985,4 +969,3 @@ install_params = {
uninstall_params = {
'PostgreSQL': '--mode unattended --unattendedmodeui none'
}

View File

@ -10,15 +10,11 @@ import config_server as develop_config_server
base_dir = base.get_script_dir(__file__)
def build_docker_server():
dependence.check__docker_dependencies()
build_develop_server()
def build_docker_sdk_web_apps(dir):
dependence.check__docker_dependencies()
build_js.build_js_develop(dir)
def build_develop_server():
def make():
if ("1" != config.option("develop")):
return
if not dependence.check_dependencies():
exit(1)
build_server.build_server_develop()
build_js.build_js_develop(base_dir + "/../../..")
develop_config_server.make()
@ -26,12 +22,5 @@ def build_develop_server():
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)

View File

@ -35,8 +35,12 @@ config.parse_defaults()
repositories = base.get_repositories()
# Add other repositories
if (config.check_option("module", "desktop")):
repositories['appimage-desktopeditors'] = [False, False]
if config.check_option("module", "builder"):
repositories['document-builder-package'] = [False, False]
repositories['appimage-documentbuilder'] = [False, False]
if (config.check_option("module", "server")):
repositories['document-server-package'] = [False, False]

View File

@ -6,9 +6,6 @@ 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)
@ -44,94 +41,56 @@ def start_linux_services():
os.system('sudo service rabbitmq-server restart')
def run_integration_example():
if base.is_exist(base_dir + '/../../../document-server-integration/web/documentserver-example/nodejs'):
base.cmd_in_dir(base_dir + '/../../../document-server-integration/web/documentserver-example/nodejs', 'python', ['run-develop.py'])
base.cmd_in_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:
make_start()
make_configure(args)
make_install()
make_run()
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()
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)

View 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.

View File

@ -0,0 +1,223 @@
{
"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": " *",
"ignoreListDir": [
"server/FileConverter/bin"
],
"ignoreListDirName": [
"node_modules"
]
},
{
"dir": "server-license",
"fileExtensions": [".js"],
"startMultiComm": "/*",
"endMultiComm": " */",
"prefix": " *",
"ignoreListDir": [
"server/FileConverter/bin"
],
"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"
]
}
]
}

View 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

View 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')

View File

@ -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"

View File

@ -9,6 +9,8 @@ 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:
@ -21,11 +23,16 @@ def aws_s3_upload(files, key, ptype=None):
ret = True
key = "builder/" + key
for file in files:
if not utils.is_file(file):
utils.log_err("file not exist: " + file)
ret &= False
continue
args = ["aws"]
if hasattr(branding, "s3_endpoint_url"):
args += ["--endpoint-url=" + branding.s3_endpoint_url]
args += [
"s3", "cp", "--no-progress", "--acl", "public-read",
"--metadata", "md5=" + utils.get_md5(file),
file, "s3://" + branding.s3_bucket + "/" + key
]
if common.os_family == "windows":
@ -36,30 +43,25 @@ def aws_s3_upload(files, key, ptype=None):
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
)
utils.add_deploy_data("builder", ptype, file, full_key)
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 +87,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 = aws_s3_upload(["build\\" + zip_file], "win/generic/", "Portable")
utils.set_summary("builder zip deploy", ret)
return
@ -96,28 +96,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 = aws_s3_upload(["build\\" + inno_file], "win/inno/", "Installer")
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 = aws_s3_upload([builder_tar], "mac/", "Portable")
utils.set_summary("builder deploy", ret)
utils.set_cwd(common.workspace_dir)
return
def make_linux():
utils.set_cwd("document-builder-package")
@ -140,24 +172,21 @@ def make_linux():
utils.log_h2("builder tar deploy")
ret = aws_s3_upload(
utils.glob_path("tar/*.tar.gz"),
"linux/generic/%s/" % common.channel,
"Portable"
"linux/generic/", "Portable"
)
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"
"linux/debian/", "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"
"linux/rhel/", "CentOS"
)
utils.set_summary("builder rpm deploy", ret)
else:
@ -168,5 +197,27 @@ def make_linux():
if "rpm" in branding.builder_make_targets:
utils.set_summary("builder rpm deploy", False)
utils.set_cwd(common.workspace_dir)
make_appimage()
return
def make_appimage():
if not onlyoffice:
return
if not utils.is_file("document-builder-package/deb/onlyoffice-documentbuilder_%s-%s_amd64.deb" % (common.version, common.build))
return
utils.set_cwd("appimage-documentbuilder")
rc = utils.sh("make clean", verbose=True)
common.summary["builder appimage clean"] = rc
# args = []
# if common.platform == "linux_aarch64":
# args += ["-e", "UNAME_M=aarch64"]
rc = utils.sh("make testing", verbose=True)
common.summary["builder appimage build"] = rc
utils.set_cwd(common.workspace_dir)
return

View File

@ -1,16 +1,30 @@
#!/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" }
platformTitles = {
"windows_x64": "Windows x64",
"windows_x86": "Windows x86",
"windows_x64_xp": "Windows x64 XP",
"windows_x86_xp": "Windows x86 XP",
"darwin_x86_64": "macOS x86_64",
"darwin_arm64": "macOS arm64",
"darwin_x86_64_v8": "macOS x86_64 V8",
"linux_x86_64": "Linux x86_64",
"linux_aarch64": "Linux aarch64",
"linux_x86_64_cef": "Linux x86_64 cef107",
"android": "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"
@ -19,11 +33,11 @@ vcredist_links = {
"2022": {
"x64": {
"url": "https://aka.ms/vs/17/release/vc_redist.x64.exe",
"md5": "703bd677778f2a1ba1eb4338bac3b868"
"md5": "077f0abdc2a3881d5c6c774af821f787"
},
"x86": {
"url": "https://aka.ms/vs/17/release/vc_redist.x86.exe",
"md5": "732d0ac9cd31b8136f1c8e72efec1636"
"md5": "ae427c1329c3b211a6d09f8d9506eb74"
}
},
"2015": {

View File

@ -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 },
@ -34,19 +34,20 @@ def make_core():
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",
"--metadata", "md5=" + utils.get_md5(core_7z),
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)
if ret:
utils.add_deploy_data("core", "Archive", core_7z, dest_version + "core.7z", branding.s3_bucket, branding.s3_region)
utils.add_deploy_data("core", "Archive", core_7z, dest_version + "core.7z")
args = ["aws", "s3", "sync", "--delete",
"--acl", "public-read", "--no-progress",
"s3://" + branding.s3_bucket + "/" + dest_version,
@ -57,3 +58,44 @@ def make_core():
ret &= utils.sh(" ".join(args), verbose=True)
utils.set_summary("core deploy", ret)
return
def deploy_closure_maps(license):
if not common.deploy: return
utils.log_h1("CLOSURE MAPS")
utils.set_cwd(utils.get_path("sdkjs/build/maps"))
branch = utils.get_env("BRANCH_NAME")
maps = utils.glob_path("*.js.map")
if branch is None:
utils.log_err("BRANCH_NAME variable is undefined")
utils.set_summary("closure maps " + license + " deploy", False)
return
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")
dest = "closure-maps/%s/%s/%s" % (common.version, common.build, license)
ret = True
for file in maps:
args = ["aws"]
if hasattr(branding, "s3_endpoint_url"):
args += ["--endpoint-url=" + branding.s3_endpoint_url]
args += [
"s3", "cp", "--no-progress", "--metadata", "md5=" + utils.get_md5(file),
file, "s3://" + branding.s3_bucket + "/" + dest + "/"
]
if common.os_family == "windows":
upload = utils.cmd(*args, verbose=True)
else:
upload = utils.sh(" ".join(args), verbose=True)
ret &= upload
if upload:
utils.add_deploy_data("core", "Closure maps " + license, file, dest + "/" + file)
utils.set_summary("closure maps " + license + " deploy", ret)
utils.set_cwd(common.workspace_dir)
return

View File

@ -5,6 +5,7 @@ import os
import package_utils as utils
import package_common as common
import package_branding as branding
import config
def make():
utils.log_h1("DESKTOP")
@ -24,11 +25,16 @@ def aws_s3_upload(files, key, ptype=None):
ret = True
key = "desktop/" + key
for file in files:
if not utils.is_file(file):
utils.log_err("file not exist: " + file)
ret &= False
continue
args = ["aws"]
if hasattr(branding, "s3_endpoint_url"):
args += ["--endpoint-url=" + branding.s3_endpoint_url]
args += [
"s3", "cp", "--no-progress", "--acl", "public-read",
"--metadata", "md5=" + utils.get_md5(file),
file, "s3://" + branding.s3_bucket + "/" + key
]
if common.os_family == "windows":
@ -39,10 +45,7 @@ def aws_s3_upload(files, key, ptype=None):
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
)
utils.add_deploy_data("desktop", ptype, file, full_key)
return ret
#
@ -50,39 +53,30 @@ 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, desktop_dir, viewer_dir, \
inno_file, inno_help_file, inno_sa_file, inno_update_file, advinst_file, zip_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"
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_sa_file = "%s-Standalone-%s-%s.exe" % (package_name, package_version, suffix)
inno_update_file = "update\\editors_update_%s.exe" % suffix.replace("-","_")
advinst_file = "%s-%s-%s.msi" % (package_name, package_version, suffix)
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,6 +88,16 @@ 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
@ -102,18 +106,16 @@ def make_windows():
if not vcdl:
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,19 +125,20 @@ 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 = ["-DesktopPath", desktop_dir, "-OutFile", zip_file]
if common.sign:
args += ["-Sign", "-CertName", branding.cert_name]
if branding.onlyoffice and not common.platform.endswith("_xp"):
args += ["-ExcludeHelp"]
ret = utils.ps1(
"make_zip.ps1", args, creates=zip_file, 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 = aws_s3_upload([zip_file], "win/generic/", "Portable")
utils.set_summary("desktop zip deploy", ret)
return
@ -154,156 +157,100 @@ def download_vcredist(year):
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 + ["help.iss"]
ret = utils.cmd(*args, creates=inno_help_file, verbose=True)
utils.set_summary("desktop inno help build", ret)
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 = aws_s3_upload([inno_file], "win/inno/","Installer")
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 help deploy")
ret = aws_s3_upload([inno_help_file], "win/inno/","Installer")
utils.set_summary("desktop inno help 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)
utils.log_h2("desktop inno standalone deploy")
ret = aws_s3_upload([inno_sa_file], "win/inno/","Installer")
utils.set_summary("desktop inno standalone deploy", 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(
if utils.is_file(inno_update_file):
ret = aws_s3_upload(
[inno_update_file],
"win/inno/%s/%s/" % (common.version, common.build),
"WinSparkle"
)
"Update"
)
elif utils.is_file(inno_file):
ret = aws_s3_upload(
[inno_file],
"win/inno/%s/%s/%s" % (common.version, common.build, utils.get_basename(inno_update_file)),
"Update"
)
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")
if common.deploy and utils.glob_path(changes_dir + "\\*.html"):
utils.log_h2("desktop update 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.glob_path(changes_dir + "\\*.html"),
"win/update/%s/%s/" % (common.version, common.build),
"Update"
)
utils.set_summary("desktop winsparkle files deploy", ret)
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]
@ -334,19 +281,26 @@ def make_advinst():
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 += [
"SetPackageType x64 -buildname DefaultBuild",
"AddOsLc -buildname DefaultBuild -arch x64",
"DelOsLc -buildname DefaultBuild -arch x86",
'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x86)"',
'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x86)"'
]
if arch == "x86":
aic_content += [
"SetPackageType x86 -buildname DefaultBuild",
"AddOsLc -arch x86 -buildname DefaultBuild",
"DelOsLc -arch x64 -buildname DefaultBuild",
"SetAppdir -path [ProgramFilesFolder][MANUFACTURER_INSTALL_FOLDER]\\[PRODUCT_INSTALL_FOLDER] -buildname DefaultBuild",
'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x64)"',
'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x64)"'
]
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"
]
@ -368,16 +322,17 @@ def make_advinst():
"DelLanguage 3082 -buildname DefaultBuild",
"DelLanguage 1033 -buildname DefaultBuild",
"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
]
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",
"SetVersion " + package_version,
"SetPackageName " + advinst_file + " -buildname DefaultBuild",
"Rebuild -buildslist DefaultBuild"
@ -389,11 +344,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 = aws_s3_upload([advinst_file], "win/advinst/", "Installer")
utils.set_summary("desktop advinst deploy", ret)
return
@ -420,41 +371,44 @@ def make_macos():
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
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(
release_bundle_version_string = 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(
release_bundle_version = 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()
utils.log("CURRENT=" + current_version + "(" + current_build + ")" \
+ "\nRELEASE=" + release_version + "(" + release_build + ")")
app_version = common.version
bundle_version = str(int(release_bundle_version) + 1)
plist_path = "%s/%s/ONLYOFFICE/Resources/%s-%s/Info.plist" \
% (common.workspace_dir, branding.desktop_branding_dir, branding.desktop_package_name, suffix)
utils.sh('/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString %s" %s' \
% (common.version, plist_path), verbose=True)
utils.sh('/usr/libexec/PlistBuddy -c "Set :CFBundleVersion %s" %s' \
% (bundle_version, plist_path), verbose=True)
utils.log("RELEASE=" + release_bundle_version_string + "(" + release_bundle_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)
make_sparkle_updates()
utils.set_cwd(common.workspace_dir)
return
@ -473,7 +427,7 @@ def make_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),
"mac/%s/%s/%s/" % (common.version, common.build, suffix),
"Disk Image"
)
utils.set_summary("desktop dmg deploy", ret)
@ -481,7 +435,7 @@ def make_dmg():
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),
"mac/%s/%s/%s/" % (common.version, common.build, suffix),
"Archive"
)
utils.set_summary("desktop zip deploy", ret)
@ -496,14 +450,10 @@ def make_sparkle_updates():
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"
)
for file in utils.glob_path(changes_dir + "/" + app_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(
@ -546,7 +496,7 @@ def make_sparkle_updates():
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),
"mac/%s/%s/%s/" % (common.version, common.build, suffix),
"Sparkle"
)
utils.set_summary("desktop sparkle files deploy", ret)
@ -554,7 +504,7 @@ def make_sparkle_updates():
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),
"mac/%s/%s/%s/" % (common.version, common.build, suffix),
"Checksums"
)
utils.set_summary("desktop checksums deploy", ret)
@ -585,25 +535,22 @@ def make_linux():
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"
utils.glob_path("tar/*.tar*"),
"linux/generic/", "Portable"
)
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"
"linux/debian/", "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"
"linux/astra/", "Astra Linux Special Edition"
)
utils.set_summary("desktop deb-astra deploy", ret)
if "rpm" in branding.desktop_make_targets:
@ -611,8 +558,7 @@ def make_linux():
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"
"linux/rhel/", "CentOS"
)
utils.set_summary("desktop rpm deploy", ret)
if "suse-rpm" in branding.desktop_make_targets:
@ -620,8 +566,7 @@ def make_linux():
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"
"linux/suse/", "SUSE Linux"
)
utils.set_summary("desktop suse-rpm deploy", ret)
if "apt-rpm" in branding.desktop_make_targets:
@ -629,8 +574,7 @@ def make_linux():
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"
"linux/altlinux/", "ALT Linux"
)
utils.set_summary("desktop apt-rpm deploy", ret)
if "urpmi" in branding.desktop_make_targets:
@ -638,8 +582,7 @@ def make_linux():
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"
"linux/rosa/", "ROSA"
)
utils.set_summary("desktop urpmi deploy", ret)
else:
@ -658,5 +601,27 @@ def make_linux():
if "urpmi" in branding.desktop_make_targets:
utils.set_summary("desktop urpmi deploy", False)
utils.set_cwd(common.workspace_dir)
make_appimage()
return
def make_appimage():
if not onlyoffice:
return
if not utils.is_file("desktop-apps/win-linux/package/linux/deb/onlyoffice-desktopeditors_%s-%s_amd64.deb" % (common.version, common.build))
return
utils.set_cwd("appimage-desktopeditors")
rc = utils.sh("make clean", verbose=True)
common.summary["desktop appimage clean"] = rc
# args = []
# if common.platform == "linux_aarch64":
# args += ["-e", "UNAME_M=aarch64"]
rc = utils.sh("make testing", verbose=True)
common.summary["desktop appimage build"] = rc
utils.set_cwd(common.workspace_dir)
return

View File

@ -20,7 +20,7 @@ def make_mobile():
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)
s3_key = "mobile/android/" + zip_file
utils.log_h2("mobile build")
ret = utils.sh("zip -r " + zip_file + " ./android* ./js", verbose=True)
@ -28,17 +28,18 @@ def make_mobile():
if common.deploy:
utils.log_h2("mobile deploy")
if ret:
if not utils.is_file(zip_file):
utils.log_err("file not exist: " + zip_file)
ret = False
elif ret:
ret = utils.sh(
"aws s3 cp --acl public-read --no-progress " \
+ "--metadata md5=" + utils.get_md5(zip_file) + " " \
+ 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.add_deploy_data("mobile", "Android", zip_file, s3_key)
utils.set_summary("mobile deploy", ret)
utils.set_cwd(common.workspace_dir)

View File

@ -20,11 +20,16 @@ def aws_s3_upload(files, key, edition, ptype=None):
ret = True
key = "server/" + key
for file in files:
if not utils.is_file(file):
utils.log_err("file not exist: " + file)
ret &= False
continue
args = ["aws"]
if hasattr(branding, "s3_endpoint_url"):
args += ["--endpoint-url=" + branding.s3_endpoint_url]
args += [
"s3", "cp", "--no-progress", "--acl", "public-read",
"--metadata", "md5=" + utils.get_md5(file),
file, "s3://" + branding.s3_bucket + "/" + key
]
if common.os_family == "windows":
@ -35,10 +40,7 @@ def aws_s3_upload(files, key, edition, ptype=None):
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
)
utils.add_deploy_data("server_" + edition, ptype, file, full_key)
return ret
def make_windows(edition):
@ -62,9 +64,7 @@ def make_windows(edition):
utils.log_h2("server " + edition + " inno deploy")
ret = aws_s3_upload(
utils.glob_path("exe/*.exe"),
"win/inno/%s/" % common.channel,
edition,
"Installer"
"win/inno/", edition, "Installer"
)
utils.set_summary("server " + edition + " inno deploy", ret)
@ -99,36 +99,28 @@ def make_linux(edition):
utils.log_h2("server " + edition + " deb deploy")
ret = aws_s3_upload(
utils.glob_path("deb/*.deb"),
"linux/debian/%s/" % common.channel,
edition,
"Debian"
"linux/debian/", edition, "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"
"linux/rhel/", edition, "CentOS"
)
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"
"linux/altlinux/", edition, "ALT Linux"
)
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"
"linux/generic/", edition, "Snap"
)
utils.set_summary("server " + edition + " snap deploy", ret)
else:

View File

@ -219,7 +219,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,15 +258,13 @@ def set_summary(target, status):
common.summary.append({target: status})
return
def add_deploy_data(product, ptype, src, dst, bucket, region):
def add_deploy_data(product, ptype, src, dst):
common.deploy_data.append({
"platform": common.platforms[common.platform]["title"],
"platform": common.platformTitles[common.platform],
"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')
@ -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

View File

@ -0,0 +1,4 @@
{
"browser" : "chrome",
"browserUrl" : "C:/Program Files/Google/Chrome/Application/chrome.exe"
}

View File

@ -0,0 +1,4 @@
{
"browser" : "firefox",
"browserUrl" : "C:/Program Files/Mozilla Firefox/firefox.exe"
}

View 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
View 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
View 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);
}

View 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);

View File

@ -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
```

View File

@ -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):

View File

@ -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("'", "&quot;")
@ -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>"

View File

@ -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...")

View File

@ -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
View 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

Binary file not shown.

BIN
tools/linux/elf/readelf Executable file

Binary file not shown.

Binary file not shown.

24
tools/linux/use_system_qt.py Executable file
View 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()

View File

@ -1 +1 @@
7.3.0
7.4.0