Compare commits

..

284 Commits

Author SHA1 Message Date
82b9c58ac6 [develop] Fix markdown errors 2023-10-05 13:22:28 +03:00
069829dcce [develop] Fix Dockerfile. Allow branding command line params 2023-10-05 13:09:59 +03:00
7b0d4d3b7e [develop] Add note 2023-08-22 01:01:02 +03:00
72740c6d09 [develop] Fix markdown errors 2023-08-17 10:48:23 +03:00
804aa2d36e [develop] Fix markdown errors 2023-08-17 10:42:08 +03:00
8f02dff4d0 [develop] Add ALLOW_PRIVATE_IP_ADDRESS (to fix http://localhost/example/images/logo.png insertion) 2023-08-17 10:35:11 +03:00
43f07c191c [develop] Fix typo 2023-08-17 09:36:21 +03:00
bbb9e52376 [develop] Add check__docker_dependencies call for external sdkjs and web-apps 2023-08-17 09:24:34 +03:00
6dd9204dce [develop] Fix missing platform 2023-04-20 17:36:38 +03:00
b91b6d5a23 [develop] Fix linux path 2023-04-18 23:40:43 +03:00
6e836ed988 [develop] Fix Dockerfile 2023-02-02 00:54:05 +03:00
2d0148df5e [develop] Fix Dockerfile 2023-02-01 23:49:33 +03:00
aee3f4879e [develop] Fix new supervisor config path 2023-02-01 23:29:53 +03:00
be11cbabeb [develop] Edit readme for linux 2023-02-01 17:06:36 +03:00
41343b310b [develop] Update Dockerfile and instruction 2023-01-31 23:56:53 +03:00
06ce6912a2 [develop] Fix readme 2023-01-29 00:26:55 +03:00
22eca507a4 [develop] Fix readme 2023-01-28 23:01:23 +03:00
9195f92b13 [develop] Update readme 2023-01-27 14:06:14 +03:00
200b4625d8 [linter] Fix gitflow 2023-01-26 17:51:48 +03:00
dc5b10f5ce [linter] Fix gitflow 2023-01-26 17:49:14 +03:00
c50ac3620d [linter] Set code_block_line_length linter rule to 300 2023-01-26 17:43:21 +03:00
60147414b4 [develop] Fix readme(linter) 2023-01-26 17:24:33 +03:00
60110fa69a [develop] Fix readme(linter) 2023-01-26 17:15:57 +03:00
1521310097 [develop] Fix readme(linter) 2023-01-26 17:14:22 +03:00
a2dc8256cb [develop] Fix readme(linter) 2023-01-26 17:09:19 +03:00
9ba2c2a792 [develop] Fix readme(linter) 2023-01-26 17:01:32 +03:00
0b55af5455 [develop] Modify readme 2023-01-26 16:43:04 +03:00
e1fcf60f29 [develop] Edit readme to mount server volume; Set up debug logging and start test example in docker by default; 2023-01-26 15:21:27 +03:00
151c691af2 changed source for desktop updates info (#607) 2023-01-24 14:03:38 +05:00
9f00f08c30 Fix bug 60569 2023-01-23 10:52:50 +03:00
3e2c03d3a3 Fix ios build 2023-01-22 19:21:28 +05:00
cd1c420fae Fix typo 2023-01-22 13:38:37 +05:00
c4d592be20 Small refactoring 2023-01-22 13:29:19 +05:00
808e470b27 Add support bundle_xcframeworks flag 2023-01-22 13:26:54 +05:00
597b8a67e2 Small fix desktop packages (#606)
* Fix generate_appcast command

* Fix html changes generation
2023-01-16 19:09:44 +03:00
f21689f8dd Changed node.js version to download. 2023-01-13 12:57:17 +03:00
9bd3f170e5 Merge pull request #600 from ONLYOFFICE/fix/bug58644
Fix bug 58644
2023-01-11 16:12:34 +03:00
34e9c614b8 Fix desktop macos build (#601) 2023-01-11 15:50:02 +03:00
960db59935 Update markdownlint action (#602) 2023-01-11 15:47:13 +03:00
d57efcf0fe Fix bug 58644 2023-01-10 14:32:19 +03:00
d8ac434e7e Fix desktop macos build (#596)
* Fix curl follow redirects

* Build sparkle updates for success dmg build
2022-12-29 19:08:28 +03:00
6907fadce3 Merge branch hotfix/v7.2.2 into release/v7.3.0 2022-12-27 14:42:26 +00:00
fc05ba6f4d Optimize linux build targets (#593)
* Small fix

* Optimize linux build targets

* Fix linux deploy targets

* Small fix

* Small fix
2022-12-27 00:00:55 +03:00
3c6d7edea0 Fix desktop macos build (#592)
* Fix uploads

* Fix sh args

* Fix macos build

* Small fix

* Small fix
2022-12-26 17:13:11 +03:00
908f2efd43 Fix typo (#591) 2022-12-25 23:33:19 +03:00
329ba4a62d Small fix (#589) 2022-12-23 22:48:44 +03:00
feac842b8a Refactoring package scripts (#587)
* Refactoring logs

* Refactoring packages

* Small fix
2022-12-23 20:08:53 +03:00
2916e4e625 Update hard-coded version to v7.3.0 2022-12-22 08:44:30 +00:00
b8bee2a9fe Fix package build (#585) 2022-12-19 13:56:18 +03:00
25b6af331e Update version file 2022-12-16 21:22:40 +03:00
65e9994963 [ios] Fix Info.plist for xcframework 2022-12-16 19:32:05 +03:00
cd8ced38f2 Build SocketRocket as xcframework 2022-12-16 19:31:35 +03:00
f6e35f7250 Add packages upload s3 endpoint url option (#584) 2022-12-15 15:04:55 +03:00
29299704aa Fix msi build (#583) 2022-12-12 18:22:48 +03:00
ba5a532da0 Temporary remove project from linux_arm64 build 2022-12-09 11:24:12 +03:00
ab838ae3ba Merge branch 'hotfix/v7.2.2' into release/v7.3.0 2022-12-08 20:41:56 +03:00
4dedb18137 Add new app for core 2022-12-07 14:48:26 +03:00
0c18cbc758 Fix android build 2022-12-06 22:27:48 +03:00
c012a8045f Disable precompiled headers for mobile arches 2022-12-06 19:48:51 +03:00
536b64a63d Fix package reports (#581) 2022-12-06 19:36:49 +03:00
6b6b91c083 Add socketio library checkout 2022-12-06 17:06:14 +03:00
d4cd2d83d4 Fix package build (#580) 2022-12-03 16:04:40 +03:00
606b73d92f Fixes from hotfix (#579) 2022-12-02 15:27:45 +03:00
75543fe126 Fix package build (#578) 2022-12-01 14:45:20 +03:00
41e5f53c45 Fix package upload (#577) 2022-12-01 01:18:26 +03:00
626efceaee Fix package upload (#576) 2022-11-30 21:00:15 +03:00
9d0596089d Update package upload (#575)
* Update package upload

* Small fix
2022-11-30 19:31:32 +03:00
9d17f14fbb Fix run developer docker 2022-11-29 11:30:05 +03:00
2c407117dd Fix previous commit 2022-11-23 14:02:27 +03:00
6667c03ff6 Merge pull request #571 from ONLYOFFICE/feature/pdffile
Feature/pdffile
2022-11-22 20:56:23 +03:00
91b75fcae5 Merge remote-tracking branch 'origin/release/v7.3.0' into feature/pdffile 2022-11-22 16:49:27 +03:00
048a54716f Merge pull request #570 from ONLYOFFICE/feature/refactoringX2T
Fix build
2022-11-22 14:43:04 +03:00
694d562a80 [ios] Add xcframeworks to mobile deploy 2022-11-20 21:43:50 +03:00
a12f5dba9f Fix build 2022-11-18 22:20:17 +03:00
7841606a41 Add macOS ARM core archive build (#568) 2022-11-18 18:14:39 +03:00
cf67d1cb77 Merge pull request #566 from ONLYOFFICE/feature/core-archive-fix
Fix core archive
2022-11-17 14:28:57 +03:00
255ecd64b2 Small fix 2022-11-17 12:56:15 +03:00
96913b568f Fix core archive 2022-11-17 12:22:29 +03:00
9c046cf10f Merge pull request #565 from ONLYOFFICE/fix/scriptMacros
Updated script for generation plugin macros documentation.
2022-11-17 10:24:43 +03:00
68367474d0 Updated script for generation plugin macros documentation. 2022-11-17 12:19:48 +05:00
ab77f6d936 Fix macOS ARM package build (#564) 2022-11-15 15:24:54 +03:00
8dadf0dada Fix packages build (#563) 2022-11-14 16:11:24 +03:00
f074914f1b Add build mobile package (#562) 2022-11-11 17:46:41 +03:00
110981066e Fix macos package build (#561) 2022-11-11 16:17:18 +03:00
6195485cc7 [desktop] skip WinSparkle from deploy 2022-11-11 11:32:29 +03:00
f13471428c Fix macos package script (#558)
* Fix macos package script

* Small fix

* Small fix
2022-11-10 15:56:27 +03:00
55f1a05d17 Update vcredist checksums (#556) 2022-11-09 18:28:26 +03:00
173b81c288 Add feature switches (#553) 2022-11-08 10:24:51 +02:00
1269d0234d Add ASCC_REG_PREFIX substitution (#554) 2022-11-08 10:20:55 +02:00
62a8e2f72a PdfFile instead of PdfReader and PdfWriter 2022-11-08 09:41:57 +03:00
0307890bf3 Delete quotes in AddUpgradeCode action (#555) 2022-11-07 15:33:56 +03:00
998daaa8d0 Merge pull request #552 from ONLYOFFICE/release/v7.3.0
Release/v7.3.0
2022-11-05 12:58:07 +03:00
0b4faf9c80 Merge pull request #551 from ONLYOFFICE/feature/docbuilder.com
docbuilder.com paths fix
2022-11-05 12:26:31 +03:00
bafeadd809 docbuilder.com paths fix 2022-11-05 02:48:34 +03:00
ecab59b715 Merge pull request #549 from ONLYOFFICE/develop
Develop
2022-11-04 22:21:07 +03:00
0edb21a44b Merge pull request #548 from ONLYOFFICE/feature/docbuilder.com
docbuilder.com build fix
2022-11-04 20:15:03 +03:00
652fa57245 docbuilder.com build fix 2022-11-04 19:34:43 +03:00
108f7bd8f7 Merge pull request #547 from ONLYOFFICE/develop
Develop
2022-11-04 15:00:06 +03:00
fce06d28a2 Fix build for new xcode 2022-11-04 14:56:34 +03:00
62169f91db Change minimum ios version 2022-11-03 21:56:32 +03:00
2d2f1ec7d1 fix build (#546) 2022-11-02 18:45:05 +03:00
3a60d08eb3 Disable x32 arches by default for ios 2022-11-02 17:01:39 +03:00
04f8f175b9 Change function name (#545) 2022-11-02 10:24:31 +03:00
c687a4ae5b Bugfix #59471/Fix a bug of package cannot be installed if installed a newer version (#544)
* Add AddUpgradeCode action

* Delete detect flag
2022-11-01 17:01:12 +03:00
c19c692ace fix build 2022-10-28 10:29:43 +03:00
8e71fa736b Disable 32bit arches for ios 2022-10-27 12:35:24 +03:00
e76fc53e85 Updated script for generate documenation 2022-10-26 12:04:37 +05:00
dc548da9eb Changed python to python3 in run_build.js 2022-10-24 19:27:31 +05:00
c618c0a6c3 Update run_build_js.py 2022-10-24 14:52:53 +03:00
6e4c75144a Update python version 2022-10-21 12:52:44 +03:00
c1f7e8f471 Merge branch hotfix/v7.2.1 into master 2022-10-20 13:04:51 +00:00
fe098a7ee7 Add desktop help installer build / Fix bug 58536 (#541) 2022-10-18 18:33:27 +03:00
aced6c5119 Fix server document-templates files (#540) 2022-10-18 16:58:24 +03:00
abe9b200c9 Merge pull request #539 from ONLYOFFICE/feature/x2ttester
Add x2ttester
2022-10-16 20:01:18 +03:00
8b542376c5 Add x2ttester 2022-10-16 05:23:51 +03:00
b59df7faec Merge pull request #537 from ONLYOFFICE/release/v7.2.0
Merge branch release/v7.2.0 into develop
2022-10-12 18:46:01 +03:00
c9c516daf2 Merge branch 'develop' into release/v7.2.0 2022-10-12 18:25:02 +03:00
94cd21189e Merge branch release/v7.2.0 into hotfix/v7.2.1 2022-10-12 12:26:08 +00:00
4e07941e7a Merge branch release/v7.2.0 into master 2022-10-12 12:26:02 +00:00
a2fcf85e3b Add move_dir method 2022-10-12 10:12:38 +03:00
e830cb9141 Add embed worker to deploy 2022-10-04 15:27:07 +03:00
9bf3985fb2 Fix notes_dst variable (#533) 2022-10-03 11:49:59 +03:00
59ad11b0f4 Update hard-coded version to v7.2.1 2022-09-29 13:14:56 +00:00
ca7d92703e Keep desktop local help for windows xp (#532) 2022-09-29 14:53:39 +03:00
75109ea476 Merge pull request #531 from ONLYOFFICE/hotfix/v7.2.1
Hotfix/v7.2.1
2022-09-28 12:07:51 +03:00
cd040fc148 Create sdkjs-plugins if folder doesn't present 2022-09-28 12:04:15 +03:00
6b62d86151 Merge pull request #530 from ONLYOFFICE/feature/hyphen
Add hyphen
2022-09-28 11:39:10 +03:00
56c6ff289e Fix macOS appcast (#529) 2022-09-27 14:24:20 +03:00
30d331b16e Fix desktop package build (#528) 2022-09-27 14:23:52 +03:00
7f41b96e07 Merge branch release/v7.2.0 into master 2022-09-22 12:16:05 +00:00
f8216e4f6a Merge pull request #523 from ONLYOFFICE/feature/merge-develop
Merge release/v7.2.0 into develop
2022-09-21 11:40:21 +03:00
2e9a66c70c Merge branch 'release/v7.2.0' into feature/merge-develop 2022-09-21 11:37:28 +03:00
41d2dfce6a Small fix macOS package build (#522) 2022-09-20 20:32:15 +03:00
0a712e3a68 Fix macOS generate appcast (#521)
* Fix macOS generate appcast

* Small fix
2022-09-20 18:23:17 +03:00
7455472856 Add hyphen 2022-09-14 18:05:35 +03:00
0eca5a6fba Add macOS package cache clean (#518) 2022-09-14 16:06:47 +03:00
8ab3f20eb8 Fix builder installer build (#517) 2022-09-09 14:54:27 +03:00
634119f66a Add windows builder 32-bit package (#516) 2022-09-08 17:26:15 +03:00
28718191d6 Fix deploy plugins (from store) 2022-09-06 13:59:41 +03:00
f5f40c4746 Add desktopeditors-help deploy (#514)
* Add desktopeditors-help deploy

* Fix desktopeditors-help deploy
2022-08-26 16:03:27 +03:00
f6f832a7dd Correct rpath for docbuilder 2022-08-26 09:49:33 +03:00
e50882881d Fix error code 2022-08-24 17:10:09 +03:00
2937163371 Add executable rights 2022-08-24 16:57:47 +03:00
0e6af8fc1b Add .system directory for old linux 2022-08-24 16:53:45 +03:00
4da15cc3bd Bugfix/Fix a bug of downloading vcredist_2013 2022-08-24 11:41:49 +03:00
96312f29e3 Put away vcredist_2013 removing (#512) 2022-08-23 12:42:03 +03:00
32e2956346 Move plugin-dev files to store repo 2022-08-17 13:21:32 +03:00
be820dc843 Merge pull request #511 from ONLYOFFICE/feature/option-to-skip-help-remove
added option to skip remove help from distrib
2022-08-17 13:17:38 +03:00
1a31d76034 debug 2022-08-17 13:15:07 +03:00
73f0fb77bf added option to skip remove help from distrib 2022-08-17 12:58:51 +03:00
263c857ca2 Change libraries dependencies 2022-08-16 19:43:24 +03:00
21e2a8f72e Fix typo 2022-08-16 13:10:03 +03:00
762eec7bf2 Enable vlc on windows for onlyoffice build 2022-08-16 12:08:45 +03:00
ad388af712 Add .net assembly for builder 2022-08-15 18:28:13 +03:00
6b46c5d2b2 Fix package build (#510)
* Fix json save

* Fix core deploy

* Fix linux deploy
2022-08-12 15:22:33 +03:00
370fa31c11 Fix package build (#509) 2022-08-12 11:09:57 +03:00
29f5c6e111 Packages deploy (#508)
* Improve logs

* Refactoring core

* Add deploy desktop

* Add deploy builder

* Add deploy server

* Other fixes

* Small fix
2022-08-11 18:00:13 +03:00
0e4134b5f8 Merge branch release/v7.2.0 into develop 2022-08-11 11:11:25 +00:00
9e6cd77650 Fix testing appcast urls (#507) 2022-08-10 14:07:58 +03:00
101bbebbe6 Remove '-existingfiles delete' option (#506) 2022-08-10 10:21:40 +03:00
2c27efe936 Feature/Update msi package build (#505)
* Update make_advinst()

* Fix paths

* Fix advinst config

* Add vcredist removing depends on architecture

* Fix advinst return code

* Fix comments

* Add branding to paths

Co-authored-by: Semyon Bezrukov <semen.bezrukov@onlyoffice.com>
2022-08-08 11:46:49 +03:00
6404e71e22 [tools] Escape xml chars 2022-08-05 19:16:38 +03:00
575f835475 Fix builds 2022-08-02 13:32:23 +03:00
ad2cdeebd8 Add package.config copying (#504) 2022-08-02 14:57:19 +05:00
66591ea617 Merge pull request #502 from ONLYOFFICE/feature/fix-params-for-desktop
[desktop] set external help url to linux app binary
2022-07-26 18:48:18 +03:00
e5f4ee1555 Fix deploy new files for builder 2022-07-26 12:01:33 +03:00
b1576abb74 [desktop] set external help url to linux app binary 2022-07-26 11:22:28 +03:00
35aa3e8ee2 Change neew files for builder 2022-07-25 19:39:56 +03:00
9b0c7a1008 Merge pull request #490 from ONLYOFFICE/feature/fix-params-for-desktop
[desktop] fix params for compiling desktop app
2022-07-18 16:05:14 +03:00
ebccbfbbe2 Merge branch 'hotfix/v7.1.1' into release/v7.2.0 2022-07-18 15:45:44 +03:00
48cc6e7f5a Merge branch hotfix/v7.1.1 into develop 2022-07-18 09:55:08 +00:00
e921585baa Merge branch hotfix/v7.1.1 into master 2022-07-18 09:55:05 +00:00
9662f10652 Fix marketpace deploy 2022-07-18 10:58:39 +03:00
9b374f2683 Add marketplace plugin to package (develop/server) 2022-07-15 15:29:40 +03:00
a5eceac4c5 Exclude .git folder from templates 2022-07-13 13:42:51 +03:00
1d26beacfb Clarify development info more (#494)
* Clarify development info more

Without both those folders docker run process is failed
2022-07-11 18:58:05 +03:00
e0352bdc4a Add some more notes 2022-07-11 18:25:46 +03:00
1d50755d9b Clarify develop run commands
We got a discussion to make it simpler with @trofim24
Because before it was not 100% clear that you *need* to
clone `build_tools` repo to run development server
2022-07-11 18:25:46 +03:00
200a3c698a Fix library dependency 2022-07-11 13:18:21 +03:00
3b3fa59307 Fix web-apps help version url (#492) 2022-07-08 17:56:48 +03:00
7530a20cd8 Fix packages module path (#491) 2022-07-08 17:55:33 +03:00
9ac28dfb65 Update hard-coded version to v7.2.0 2022-07-08 13:08:07 +00:00
5b265245a4 Update build.py 2022-07-08 09:58:42 +03:00
9e974d30db [desktop] fix params for compiling desktop app 2022-07-08 09:55:51 +03:00
f3145e0d06 Fix branding (#489) 2022-07-07 14:52:12 +03:00
72a9c18b94 Fix vcredist download (#488) 2022-07-07 14:51:35 +03:00
7b8f8184b0 [desktop] for support external help in web-apps 2022-07-07 00:11:14 +03:00
254b413617 Fix encoding (#487) 2022-07-06 18:03:21 +03:00
efdd2ce743 Fix log encoding (#486) 2022-07-05 21:34:14 +03:00
14522ee010 Remake packages (#485)
* Remove isxdl

* Fix targets bools

* Fix builder base dir

* Update builder innosetup build

* Fix builder build

* Run ps script function

* Fix ps script function

* Print build results

* Fix dict

* Function add_task

* Fix results log

* Add deploy

* Fix deploy

* Add core deploy

* Fix core deploy

* Debug scripts

* Fix workspace_dir

* Refactoring core

* Refactoring core

* Fix platforms

* Refactoring builder

* Small fix

* Fix core

* Fix cmd

* Refactoring builder

* Fix builder

* Fix

* Fix

* Fix server

* Fix builder

* Fix desktop linux

* Fix desktop windows

* Add appcast-prod creation

* Fix appcast

* Fix vcredist verbose

* Fix appcast

* Small fix builder

* Small fix desktop

* Small fix desktop linux

* Fix desktop macos

* Check vc redist md5 sums

* Fix kwargs

* Fix log_h1

* Fix macos fastlane params
2022-07-05 15:34:00 +03:00
b917e0b8d5 Add appcast-prod creation (#484)
* Add appcast-prod creation

* Small fix
2022-07-01 12:17:36 +03:00
d3d53b983a Fixed port of documentserver-example for linux 2022-06-30 12:13:15 +03:00
2a3b6d0ebb Merge pull request #483 from ONLYOFFICE/release/v7.2.0
Add multiprocess option
2022-06-22 21:53:45 +03:00
042bbb364f Add multiprocess option 2022-06-20 11:37:08 +03:00
2bc9e29e4b Merge pull request #481 from ONLYOFFICE/release/v7.2.0
Release/v7.2.0
2022-06-18 18:54:38 +03:00
d7b3d00e82 Merge pull request #480 from ONLYOFFICE/feature/auto89
Feature/auto89
2022-06-18 18:54:18 +03:00
7116d8b916 Fix copy v8 files 2022-06-18 18:52:08 +03:00
cc84676070 Refactoring 2022-06-18 18:44:14 +03:00
206c1da862 Fix gcc version 2022-06-18 18:22:58 +03:00
e575effb05 Fix typo 2022-06-18 17:58:40 +03:00
f01c20dee1 Auto enable v8 8.9 version on linux if gcc >= 5.4 2022-06-18 17:55:16 +03:00
0f2a340c78 Add options for build native js 2022-06-10 18:39:43 +03:00
be58f39505 [vendor] Remove jszip 2022-06-09 19:36:05 +03:00
9976df1185 Fix bug #57402 2022-06-03 12:02:21 +03:00
6140cec905 Fix build boost for windows 2022-06-03 11:41:26 +03:00
53f5910f9b Merge pull request #477 from ONLYOFFICE/feature/releaseText
Feature/release text
2022-06-02 22:28:47 +03:00
7db4a48565 Refactoring DoctRenderer.config 2022-06-01 22:14:50 +03:00
afbe93c5cb Merge branch hotfix/v7.1.1 into master 2022-06-01 16:17:23 +00:00
6c7b08606d Refactoring DoctRenderer.config 2022-06-01 18:25:53 +03:00
75886ff835 Fix macos build targets (#474) 2022-05-31 17:52:34 +03:00
dfd74fbd72 Fix previous commit 2022-05-31 16:20:05 +03:00
e0a597fc4c Add execute rights 2022-05-31 16:12:28 +03:00
ae28bd21d6 Add new module 2022-05-31 16:07:26 +03:00
e1ef29d9a6 Add VbaFormatLib project 2022-05-20 12:56:24 +03:00
554e6489e5 Update hard-coded version to v7.1.1 2022-05-18 16:08:22 +00:00
25030391ed Merge branch release/v7.1.0 into develop 2022-05-16 12:51:15 +00:00
be06b3c2c8 Merge branch release/v7.1.0 into master 2022-05-12 13:16:07 +00:00
5ab1995a23 Fix v8 icudata deploy 2022-04-29 21:25:52 +03:00
287d0e3612 Disabled VS BuildTools check for hunspell on server startup. Since version 7 we have spellchecker local for js. 2022-04-26 16:54:44 +03:00
421ba72564 Remove build artefact 2022-04-26 15:07:57 +03:00
bb6ad49a1c Update Ubuntu requirement in README (#463)
Since https://github.com/ONLYOFFICE/build_tools/pull/455
We use Ubuntu 16.04 as base test, because Ubuntu 14.04 cannot
download QT from Let's Encrypt site
More details in #455
2022-04-13 16:58:04 +03:00
aef52e14b5 Merge pull request #460 from ONLYOFFICE/fix/vc
Updated ver. Microsoft Visual C++ Redistributable (x64)
2022-04-08 10:54:46 +03:00
582d8f54f4 Updated ver. Microsoft Visual C++ Redistributable (x64) 2022-04-08 10:53:00 +03:00
9543f3fced Fixed checking Microsoft Visual C++ Redistributable (x64). 2022-04-08 10:50:07 +03:00
6207b46e4f Updated ver. Microsoft Visual C++ Redistributable (x64) 2022-04-08 10:41:00 +03:00
c7ddae7a62 Add placeholders and forms highlight 2022-04-06 18:26:52 +03:00
7e9823614f Merge pull request #459 from ONLYOFFICE/hotfix/v7.0.2 2022-04-05 18:18:42 +03:00
e93ad56f5b Merge pull request #458 from ONLYOFFICE/hotfix/v7.0.2 2022-04-05 18:17:56 +03:00
2dc02a5bbf Fix merge conflict 2022-04-05 16:29:49 +03:00
bfcc577df1 Merge branch hotfix/v7.0.2 into master 2022-04-05 12:20:30 +00:00
ae65dff284 Fix linux arm64 server build (#456) 2022-03-29 17:06:09 +03:00
773fca881b Update base QA build image to ubuntu 16.04 (#455)
Ubuntu 14.04 is EOLed and there is major problem:
qt is downloaded from
```
https://qt-mirror.dannhauer.de/
```

This host uses LE certificate, but for ubuntu 14.04
new root cert is not aviable
There is several workarounds for this, but they are rather complicated
Like this one:
https://askubuntu.com/a/1366719/39452

No point of making this workaround
2022-03-28 11:35:50 +03:00
a8a3487749 Update hard-coded version to v7.0.2 2022-03-24 07:16:33 +00:00
1505f17d6e Fix print_repositories.py branding (#452) 2022-03-23 16:47:39 +03:00
874d749901 Merge branch hotfix/v7.0.1 into release/v7.1.0 2022-03-23 10:22:22 +00:00
b1a433f267 Merge branch hotfix/v7.0.1 into develop 2022-03-23 09:43:23 +00:00
e31c77d42c Merge branch hotfix/v7.0.1 into master 2022-03-23 09:43:20 +00:00
c6e7679c63 Fix bug 38536 2022-03-21 17:15:10 +03:00
4cb42515c7 Merge pull request #448 from ONLYOFFICE/release/v7.1.0
Release/v7.1.0
2022-03-21 11:48:33 +03:00
43a5557200 Changes for arm 2022-03-21 11:46:45 +03:00
1dec5f5b9a Added information in README.md on how to use convert_directory.py 2022-03-15 15:33:50 +03:00
140b418b1e Update desktop package vcredist (#447) 2022-03-11 17:06:57 +03:00
e06a076e30 Fix update version github action (#446) 2022-03-11 17:04:05 +03:00
e421a16469 Merge branch hotfix/v7.0.1 into master 2022-03-04 08:10:21 +00:00
c01e200a89 Actualize version to 7.1.0 (#439) 2022-03-03 17:08:34 +03:00
b339a50057 Merge pull request #444 from ONLYOFFICE/feature/merge-release
Merge release/v7.1.0 into develop
2022-02-28 16:56:49 +03:00
64425cc1e1 Merge branch 'release/v7.1.0' into feature/merge-release 2022-02-28 16:52:24 +03:00
82187cf17b Merge pull request #442 from ONLYOFFICE/hotfix/v7.0.1
Hotfix/v7.0.1
2022-02-28 16:22:26 +03:00
bc3a6cd4e9 Add param for minimal macos version (icu) 2022-02-28 16:20:10 +03:00
5b54f203b6 Merge branch hotfix/v7.0.1 into master 2022-02-22 08:12:37 +00:00
60a01bd455 Merge pull request #437 from ONLYOFFICE/release/v7.1.0
Release/v7.1.0
2022-02-20 16:48:35 +03:00
623d1a7223 Refactoring arm64 build 2022-02-20 11:17:01 +03:00
d6facc48bf Merge pull request #434 from ONLYOFFICE/feature/changeAutorTool
Added tool for changing autor and last modified in document
2022-02-18 15:43:30 +03:00
902505bf64 Refactoring hunspell module 2022-02-18 12:49:00 +03:00
d2a12e0445 Merge pull request #436 from ONLYOFFICE/release/v7.1.0
Add default path to arm compiler
2022-02-16 19:48:53 +03:00
ca2c87f366 Add default path to arm compiler 2022-02-16 19:43:33 +03:00
fc4ffca529 Merge pull request #435 from ONLYOFFICE/release/v7.1.0
Release/v7.1.0
2022-02-16 17:53:14 +03:00
9b8d7f94d5 Added README.md for change_autor.py 2022-02-14 12:33:26 +03:00
ad1c0d559f Added tool for changing autor and last modified in document 2022-02-14 11:45:00 +03:00
3d793be2a2 Add builder windows build scripts (#430) 2022-02-10 11:45:16 +03:00
41122103ee Fix typo 2022-02-08 21:45:07 +03:00
6d1d674d5a Refactoring 2022-02-08 21:38:10 +03:00
89a5ad9498 Refactoring icu build script 2022-02-07 09:55:22 +03:00
fb4f80589e Fix desktop packages build (#429) 2022-02-02 17:36:49 +03:00
f3688dd303 Desktop packages build (#415)
* Add build packages through make

* Add windows desktop packages

* Refactoring desktop packages

* Refactoring

* Refactoring

* Add UTF-8 support

* Refactoring

* Fix winsparkle files

* Refactoring

* Fix branding

* Add macOS build

* Fix paths

* Fix branding

* Style

* Fix exe & msi build

* Fix winsparkle files

* Fix output

* Small fix

* Fix macOS build

* Fix macOS build
2022-02-01 14:54:23 +03:00
0ba0f82141 Add convertion tools 2022-02-01 12:48:57 +03:00
0e876386e0 Support unicode names 2022-02-01 10:29:44 +03:00
7a115ed3b4 Fix macos branding build (#428) 2022-01-28 17:44:09 +03:00
a497049352 Fix typo 2022-01-20 17:42:12 +03:00
43e0545287 Fix compile 2022-01-20 16:42:05 +03:00
4f7b992e64 Merge pull request #426 from ONLYOFFICE/release/v7.1.0
Release/v7.1.0
2022-01-20 16:41:53 +03:00
83a842037b Fix git long paths on windows
(cherry picked from commit c836ff9bd5)
2022-01-20 16:41:40 +03:00
c836ff9bd5 Fix git long paths on windows 2022-01-18 15:21:42 +03:00
91e0b2089b Merge branch release/v7.0.0 into release/v7.1.0 2022-01-17 14:26:39 +00:00
11c80866c3 Merge branch release/v7.0.0 into develop 2022-01-17 14:26:37 +00:00
203fa4a554 Merge branch release/v7.0.0 into master 2022-01-17 14:18:08 +00:00
c8351fdb89 Fix thumbnail sizes 2022-01-17 08:32:55 +03:00
27ac97d2e0 Add tool for builder 2022-01-14 15:43:14 +03:00
0afe45b296 Upped minimum version of node.js 2022-01-10 17:08:37 +03:00
18f705ba7b Merge pull request #423 from ONLYOFFICE/release/v7.1.0
Release/v7.1.0
2022-01-10 14:31:24 +03:00
77c25b06dc Merge pull request #422 from ONLYOFFICE/feature/arm64
Feature/arm64
2022-01-10 14:30:18 +03:00
fdcfc9f872 . 2022-01-05 11:13:39 +03:00
bc005c4e5f Developing... 2022-01-04 19:03:42 +03:00
1ae3df953c Merge pull request #417 from ONLYOFFICE/hotfix/v6.4.3
Merge branch hotfix/v6.4.3 into release/v7.0.0
2021-12-24 17:21:20 +03:00
66 changed files with 3341 additions and 743 deletions

View File

@ -1,15 +1,21 @@
name: check
on: [push]
name: Markdown check
on:
workflow_dispatch:
push:
paths:
- '*.md'
- 'develop/*.md'
jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: DavidAnson/markdownlint-cli2-action@v9
with:
node-version: 12
- name: Check *.md files by `markdownlint`
run: |
npm install -g markdownlint-cli
markdownlint *.md develop/*.md
command: config
globs: |
.markdownlint.jsonc
*.md
develop/*.md

View File

@ -1,22 +1,31 @@
name: Update hard-coded version
on: create
on: workflow_dispatch
jobs:
update-version:
if: >-
${{ startsWith(github.event.ref, 'hotfix/') ||
startsWith(github.event.ref, 'release/') }}
${{ contains(github.ref, 'refs/heads/hotfix/v') ||
contains(github.ref, 'refs/heads/release/v') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3
with:
token: ${{ secrets.PUSH_TOKEN }}
- name: Set version
run: >-
echo "${{ github.event.ref }}" |
echo "${{ github.ref_name }}" |
awk '{gsub(/.+\/v/,"version=");print;}' >> $GITHUB_ENV
- name: Save version
run: echo "${{ env.version }}" > version
- name: Commit changes
uses: EndBug/add-and-commit@v7
- name: Commit & push changes
uses: EndBug/add-and-commit@v8
with:
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com

5
.markdownlint.jsonc Normal file
View File

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

View File

@ -1,4 +1,4 @@
FROM ubuntu:14.04
FROM ubuntu:16.04
ENV TZ=Etc/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

View File

@ -13,7 +13,7 @@ the `master` branch.
## How to use - Linux
**Note**: The solution has been tested on **Ubuntu 14.04**.
**Note**: The solution has been tested on **Ubuntu 16.04**.
### Installing dependencies

View File

@ -29,24 +29,22 @@ core_android {
}
addSubProject(cryptopp, $$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/cryptopp.pro)
addSubProject(kernel, $$CORE_ROOT_DIR/Common/kernel.pro,\
cryptopp)
addSubProject(unicodeconverter, $$CORE_ROOT_DIR/UnicodeConverter/UnicodeConverter.pro,\
kernel)
cryptopp)
addSubProject(kernel, $$CORE_ROOT_DIR/Common/kernel.pro,\
unicodeconverter)
addSubProject(network, $$CORE_ROOT_DIR/Common/Network/network.pro,\
kernel)
kernel unicodeconverter)
addSubProject(graphics, $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/graphics.pro,\
kernel unicodeconverter)
addSubProject(pdfwriter, $$CORE_ROOT_DIR/PdfWriter/PdfWriter.pro,\
addSubProject(pdffile, $$CORE_ROOT_DIR/PdfFile/PdfFile.pro,\
kernel unicodeconverter graphics)
addSubProject(djvufile, $$CORE_ROOT_DIR/DjVuFile/DjVuFile.pro,\
kernel unicodeconverter graphics pdfwriter)
kernel unicodeconverter graphics pdffile)
addSubProject(xpsfile, $$CORE_ROOT_DIR/XpsFile/XpsFile.pro,\
kernel unicodeconverter graphics pdfwriter)
kernel unicodeconverter graphics pdffile)
addSubProject(htmlrenderer, $$CORE_ROOT_DIR/HtmlRenderer/htmlrenderer.pro,\
kernel unicodeconverter graphics pdfwriter)
addSubProject(pdfreader, $$CORE_ROOT_DIR/PdfReader/PdfReader.pro,\
kernel unicodeconverter graphics pdfwriter htmlrenderer)
kernel unicodeconverter graphics)
addSubProject(docxrenderer, $$CORE_ROOT_DIR/DocxRenderer/DocxRenderer.pro,\
kernel unicodeconverter graphics)
addSubProject(htmlfile2, $$CORE_ROOT_DIR/HtmlFile2/HtmlFile2.pro,\
@ -58,20 +56,26 @@ addSubProject(fb2file, $$CORE_ROOT_DIR/Fb2File/Fb2File.pro,\
addSubProject(epubfile, $$CORE_ROOT_DIR/EpubFile/CEpubFile.pro,\
kernel unicodeconverter graphics htmlfile2)
!no_x2t {
addSubProject(docxformat, $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro)
addSubProject(pptxformat, $$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro)
addSubProject(docxfile, $$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro)
addSubProject(txtxmlformat, $$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/TxtXmlFormatLib.pro)
addSubProject(rtfformat, $$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/RtfFormatLib.pro)
addSubProject(pptformat, $$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro)
addSubProject(docformat, $$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/DocFormatLib.pro)
addSubProject(odffilereader, $$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/OdfFileReaderLib.pro)
addSubProject(odffilewriter, $$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro)
addSubProject(xlsformat, $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro)
addSubProject(xlsbformat, $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/XlsbFormatLib.pro)
addSubProject(x2t, $$CORE_ROOT_DIR/X2tConverter/build/Qt/X2tConverter.pro,\
docxformat pptxformat docxfile txtxmlformat rtfformat pptformat docformat odffilereader odffilewriter xlsformat xlsbformat fb2file epubfile docxrenderer)
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(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(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)
@ -80,8 +84,13 @@ addSubProject(epubfile, $$CORE_ROOT_DIR/EpubFile/CEpubFile.pro,\
addSubProject(docbuilder, $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/docbuilder.pro,\
kernel unicodeconverter graphics doctrenderer)
}
!no_tests {
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)
}
core_and_multimedia {
@ -94,7 +103,7 @@ desktop {
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 pdfwriter pdfreader djvufile xpsfile)
kernel unicodeconverter graphics hunspell ooxmlsignature htmlrenderer pdffile djvufile xpsfile)
addSubProject(documentscore_helper, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore_helper.pro,\
documentscore)
!core_mac {
@ -115,4 +124,4 @@ mobile {
!desktop {
addSubProject(hunspell, $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro)
}
}
}

View File

@ -40,6 +40,7 @@ parser.add_option("--features", action="store", type="string", dest="features",
parser.add_option("--vs-version", action="store", type="string", dest="vs-version", default="2015", help="version of visual studio")
parser.add_option("--vs-path", action="store", type="string", dest="vs-path", default="", help="path to vcvarsall")
parser.add_option("--siteUrl", action="store", type="string", dest="siteUrl", default="127.0.0.1", help="site url")
parser.add_option("--multiprocess", action="store", type="string", dest="multiprocess", default="1", help="provides ability to specify single process for make")
(options, args) = parser.parse_args(arguments)
configOptions = vars(options)

View File

@ -1,11 +1,19 @@
FROM onlyoffice/documentserver:latest
RUN apt-get update -y && \
apt-get install git -y \
python -y \
python3 -y \
openjdk-11-jdk -y \
bzip2 -y \
npm -y && \
npm install -g grunt-cli -y && \
git clone --depth 1 https://github.com/ONLYOFFICE/build_tools.git var/www/onlyoffice/documentserver/build_tools && \
npm install -g grunt grunt-cli -y && \
ln -s /usr/bin/python3 /usr/bin/python && \
ln -s /usr/bin/pip3 /usr/bin/pip && \
git clone --depth 1 -b feature/docker-instruction 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 python /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,46 +1,219 @@
# Docker
This directory containing instruction for developers,
who want to change something in sdkjs or web-apps module,
who want to change something in sdkjs or web-apps or server module,
but don't want to compile pretty compilcated core product to make those changes.
## Installing ONLYOFFICE Docs
## System requirements
## How to use - Linux
### Windows
**Note**: You need the latest Docker version installed.
You need the latest
[Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
installed.
You might need to pull **onlyoffice/documentserver** image:
**Note**: Docker Desktop does not start automatically after installation.
You should manually start the **Docker Desktop** application.
**Note**: If you have problems running Docker Desktop with the
"Use WSL 2 instead of Hyper-V" installation option,
try reinstalling it without this option.
### Linux or macOS
You need the latest
[Docker](https://docs.docker.com/engine/install/)
version installed.
## Create develop Docker Images
To create a image with the ability to include external non-minified sdkjs code,
use the following commands:
### Clone development environment to work dir
```bash
git clone -b feature/docker-instruction https://github.com/ONLYOFFICE/build_tools.git
```
### Modify Docker Images
**Note**: Do not prefix docker command with sudo.
[This](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
instruction show how to use docker without sudo.
```bash
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 from the dockerfile directory:
```bash
docker build -t documentserver-develop .
```
**Note**: The dot at the end is required.
### Connecting external folders
**Note**: Sometimes script may fail due to network errors. Just restart it.
To connect external folders to the container,
you need to pass the "-v" parameter
along with the relative paths to the required folders.
## Clone development modules
**For example, let's connect the external folders "sdkjs" and "web-apps" to the container:**
Clone development modules to the work dir
* `sdkjs` repo is located [here](https://github.com/ONLYOFFICE/sdkjs/)
* `web-apps` repo is located [here](https://github.com/ONLYOFFICE/web-apps/)
* `server` repo is located [here](https://github.com/ONLYOFFICE/server/)
```bash
docker run -i -t -d -p 80:80 --restart=always \
-v /host-dir/sdkjs:/var/www/onlyoffice/documentserver/sdkjs \
-v /host-dir/web-apps:/var/www/onlyoffice/documentserver/web-apps documentserver-develop
cd ../..
git clone https://github.com/ONLYOFFICE/sdkjs.git
git clone https://github.com/ONLYOFFICE/web-apps.git
git clone https://github.com/ONLYOFFICE/server.git
```
## Start server with external folders
To mount external folders to the container,
you need to pass the "-v" parameter
along with the relative paths to the required folders.
The folders `sdkjs` and `web-apps` are required for proper development workflow.
The folders `server` is optional
**Note**: ONLYOFFICE server uses port 80.
Look for another application using port 80 and stop it
**Note**: Server start with `sdkjs` and `web-apps` takes 15 minutes
and takes 20 minutes with `server`
**Note**: Run command from work dir with development modules
### docker run on Windows (PowerShell)
**Note**: Run PowerShell as administrator to fix EACCES error when installing
node_modules
run with `sdkjs` and `web-apps`
```bash
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v $pwd/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $pwd/web-apps:/var/www/onlyoffice/documentserver/web-apps documentserver-develop
```
or run with `sdkjs`, `web-apps` and `server`
```bash
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v $pwd/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $pwd/web-apps:/var/www/onlyoffice/documentserver/web-apps -v $pwd/server:/var/www/onlyoffice/documentserver/server documentserver-develop
```
### docker run on Linux or macOS
run with `sdkjs` and `web-apps`
```bash
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v $(pwd)/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $(pwd)/web-apps:/var/www/onlyoffice/documentserver/web-apps documentserver-develop
```
or run with `sdkjs`, `web-apps` and `server`
```bash
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true -v $(pwd)/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $(pwd)/web-apps:/var/www/onlyoffice/documentserver/web-apps -v $(pwd)/server:/var/www/onlyoffice/documentserver/server documentserver-develop
```
## Open editor
After the server starts successfully, you will see Docker log messages like this
```bash
[Date] [WARN] [localhost] [docId] [userId] nodeJS
```
To try the document editor, open a browser tab and type
[http://localhost/example](http://localhost/example) into the URL bar.
**Note**: Disable **ad blockers** for localhost page.
It may block some scripts (like Analytics.js)
## Modify sources
### To change something in `sdkjs` do the following steps
1)Edit source file. Let's insert an image url into each open document.
Following command inserts (in case of problems, you can replace URL)
`this.AddImageUrl(['http://localhost/example/images/logo.png']);`
after event
`this.sendEvent('asc_onDocumentContentReady');`
in file
`sdkjs/common/apiBase.js`
### change sdkjs on Windows (PowerShell)
```bash
(Get-Content sdkjs/common/apiBase.js) -replace "this\.sendEvent\('asc_onDocumentContentReady'\);", "this.sendEvent('asc_onDocumentContentReady');this.AddImageUrl(['http://localhost/example/images/logo.png']);" | Set-Content sdkjs/common/apiBase.js
```
### change sdkjs on Linux or macOS
```bash
sed -i "s,this.sendEvent('asc_onDocumentContentReady');,this.sendEvent('asc_onDocumentContentReady');this.AddImageUrl(['http://localhost/example/images/logo.png']);," sdkjs/common/apiBase.js
```
2)Delete browser cache or hard reload the page `Ctrl + Shift + R`
3)Open new file in browser
### To change something in `server` do the following steps
1)Edit source file. Let's send `"Hello World!"`
chart message every time a document is opened.
Following command inserts
`yield* onMessage(ctx, conn, {"message": "Hello World!"});`
in function
`sendAuthInfo`
in file
`server/DocService/sources/DocsCoServer.js`
### change server on Windows (PowerShell)
```bash
(Get-Content server/DocService/sources/DocsCoServer.js) -replace 'opt_hasForgotten, opt_openedAt\) \{', 'opt_hasForgotten, opt_openedAt) {yield* onMessage(ctx, conn, {"message": "Hello World!"});' | Set-Content server/DocService/sources/DocsCoServer.js
```
### change server on Linux or macOS
```bash
sed -i 's#opt_hasForgotten, opt_openedAt) {#opt_hasForgotten, opt_openedAt) {yield* onMessage(ctx, conn, {"message": "Hello World!"});#' server/DocService/sources/DocsCoServer.js
```
2)Restart document server process
**Note**: Look for ``CONTAINER_ID`` in the result of ``docker ps``.
```bash
docker exec -it CONTAINER_ID supervisorctl restart all
```
3)Open new file in browser
## Start server with additional functionality(addons)
To get additional functionality and branding you need to connect a branding folder,
additional addon folders and pass command line arguments
For example run with `onlyoffice` branding and
addons:`sdkjs-forms`, `sdkjs-ooxml`, `web-apps-mobile`
### docker run on Windows (PowerShell) with branding
**Note**: Run PowerShell as administrator to fix EACCES error when installing
node_modules
```bash
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true `
-v $pwd/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $pwd/web-apps:/var/www/onlyoffice/documentserver/web-apps `
-v $pwd/onlyoffice:/var/www/onlyoffice/documentserver/onlyoffice -v $pwd/sdkjs-ooxml:/var/www/onlyoffice/documentserver/sdkjs-ooxml -v $pwd/sdkjs-forms:/var/www/onlyoffice/documentserver/sdkjs-forms -v $pwd/web-apps-mobile:/var/www/onlyoffice/documentserver/web-apps-mobile `
documentserver-develop args --branding onlyoffice --branding-url 'https://github.com/ONLYOFFICE/onlyoffice.git' --siteUrl localhost
```
### docker run on Linux or macOS with branding
```bash
docker run -i -t -p 80:80 --restart=always -e ALLOW_PRIVATE_IP_ADDRESS=true \
-v $(pwd)/sdkjs:/var/www/onlyoffice/documentserver/sdkjs -v $(pwd)/web-apps:/var/www/onlyoffice/documentserver/web-apps \
-v $(pwd)/onlyoffice:/var/www/onlyoffice/documentserver/onlyoffice -v $(pwd)/sdkjs-ooxml:/var/www/onlyoffice/documentserver/sdkjs-ooxml -v $(pwd)/sdkjs-forms:/var/www/onlyoffice/documentserver/sdkjs-forms -v $(pwd)/web-apps-mobile:/var/www/onlyoffice/documentserver/web-apps-mobile \
documentserver-develop args --branding onlyoffice --branding-url 'https://github.com/ONLYOFFICE/onlyoffice.git' --siteUrl localhost
```

View File

@ -1,12 +1,57 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
sys.path.append(sys.argv[1] + '/build_tools/scripts')
sys.path.append(sys.argv[1] + '/build_tools/scripts/develop')
import build_js
import run_server
import config
import base
base.cmd_in_dir(sys.argv[1] + '/build_tools/', 'python', ['configure.py'])
config.parse()
git_dir = sys.argv[1];
build_js.build_js_develop(sys.argv[1])
base.print_info('argv :'+' '.join(sys.argv))
base.cmd_in_dir(git_dir + '/build_tools/', 'python3', ['configure.py', '--develop', '1'] + sys.argv[2:])
config.parse()
config.parse_defaults()
if base.is_exist(git_dir + "/server/FileConverter/bin/fonts.log"):
base.print_info('remove font cache to regenerate fonts in external sdkjs volume')
base.delete_file(git_dir + "/server/FileConverter/bin/fonts.log");
# external server volume
if base.is_exist(sys.argv[1] + '/server/DocService/package.json'):
base.print_info('replace supervisor cfg to run docservice and converter from source')
base.replaceInFileRE("/etc/supervisor/conf.d/ds-docservice.conf", "command=.*", "command=node " + git_dir + "/server/DocService/sources/server.js")
base.replaceInFileRE("/app/ds/setup/config/supervisor/ds/ds-docservice.conf", "command=.*", "command=node " + git_dir + "/server/DocService/sources/server.js")
base.replaceInFileRE("/etc/supervisor/conf.d/ds-converter.conf", "command=.*", "command=node " + git_dir + "/server/FileConverter/sources/convertermaster.js")
base.replaceInFileRE("/app/ds/setup/config/supervisor/ds/ds-converter.conf", "command=.*", "command=node " + git_dir + "/server/FileConverter/sources/convertermaster.js")
base.print_info('run_server.run_docker_server')
run_server.run_docker_server();
else:
#Fix theme generation for external sdkjs volume
if base.is_exist(git_dir + "/server/FileConverter/bin/DoctRenderer.config"):
base.print_info('replace DoctRenderer.config for external sdkjs volume')
base.generate_doctrenderer_config(git_dir + "/server/FileConverter/bin/DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/")
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)

21
make.py
View File

@ -70,20 +70,17 @@ if ("1" == base.get_env("OO_ONLY_BUILD_JS")):
make_common.make()
# build updmodule for desktop (only for windows version)
if ("windows" == base.host_platform()) and (config.check_option("module", "desktop")):
config.extend_option("config", "updmodule")
config.extend_option("qmake_addon", "LINK=https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.xml")
if config.check_option("module", "desktop"):
config.extend_option("qmake_addon", "URL_WEBAPPS_HELP=https://download.onlyoffice.com/install/desktop/editors/help/v" + base.get_env('PRODUCT_VERSION') + "-1/apps")
if not base.is_file(base_dir + "/tools/WinSparkle-0.7.0.zip"):
base.cmd("curl.exe", ["https://d2ettrnqo7v976.cloudfront.net/winsparkle/WinSparkle-0.7.0.zip", "--output", base_dir + "/tools/WinSparkle-0.7.0.zip"])
if not base.is_dir(base_dir + "/tools/WinSparkle-0.7.0"):
base.cmd("7z.exe", ["x", base_dir + "/tools/WinSparkle-0.7.0.zip", "-otools"])
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.create_dir(base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle")
#base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/include", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/include")
base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_32")
base.copy_dir(base_dir + "/tools/WinSparkle-0.7.0/x64/Release", base_dir + "/../desktop-apps/win-linux/3dparty/WinSparkle/win_64")
if ("windows" == base.host_platform()):
base.set_env("VIDEO_PLAYER_VLC_DIR", base_dir + "/../desktop-sdk/ChromiumBasedEditors/videoplayerlib/vlc")
# build
build.make()

90
make_package.py Executable file
View File

@ -0,0 +1,90 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append("scripts")
import argparse
import package_common as common
import package_utils as utils
# parse
parser = argparse.ArgumentParser(description="Build packages.")
parser.add_argument("-P", "--platform", dest="platform", type=str,
action="store", help="Defines platform", required=True)
parser.add_argument("-T", "--targets", dest="targets", type=str, nargs="+",
action="store", help="Defines targets", required=True)
parser.add_argument("-R", "--branding", dest="branding", type=str,
action="store", help="Provides branding path")
parser.add_argument("-V", "--version", dest="version", type=str,
action="store", help="Defines version")
parser.add_argument("-B", "--build", dest="build", type=str,
action="store", help="Defines build")
args = parser.parse_args()
# vars
common.workspace_dir = utils.get_abspath(utils.get_script_dir(__file__) + "/..")
common.os_family = utils.host_platform()
common.platform = args.platform
common.targets = args.targets
common.clean = "clean" in args.targets
common.sign = "sign" in args.targets
common.deploy = "deploy" in args.targets
common.version = args.version if (args.version is not None) else utils.get_env("PRODUCT_VERSION", "1.0.0")
common.build = args.build if (args.build is not None) else utils.get_env("BUILD_NUMBER", "1")
common.channel = utils.get_env("BUILD_CHANNEL", "other")
common.branding = args.branding
common.timestamp = utils.get_timestamp()
common.summary = []
common.deploy_data = []
utils.log("workspace_dir: " + common.workspace_dir)
utils.log("os_family: " + common.os_family)
utils.log("platform: " + str(common.platform))
utils.log("targets: " + str(common.targets))
utils.log("clean: " + str(common.clean))
utils.log("sign: " + str(common.sign))
utils.log("deploy: " + str(common.deploy))
utils.log("version: " + common.version)
utils.log("build: " + common.build)
utils.log("branding: " + str(common.branding))
utils.log("timestamp: " + common.timestamp)
# branding
if common.branding is not None:
sys.path.insert(-1, \
utils.get_path("../" + common.branding + "/build_tools/scripts"))
import package_core
import package_desktop
import package_server
import package_builder
import package_mobile
# build
utils.set_cwd(common.workspace_dir, verbose=True)
utils.delete_file("deploy.json")
if "core" in common.targets:
package_core.make()
if "desktop" in common.targets:
package_desktop.make()
if "builder" in common.targets:
package_builder.make()
if "server-community" in common.targets:
package_server.make("community")
if "server-enterprise" in common.targets:
package_server.make("enterprise")
if "server-developer" in common.targets:
package_server.make("developer")
if "mobile" in common.targets:
package_mobile.make()
# summary
utils.log_h1("Build summary")
exitcode = 0
for i in common.summary:
if list(i.values())[0]:
utils.log("[ OK ] " + list(i.keys())[0])
else:
utils.log("[FAILED] " + list(i.keys())[0])
exitcode = 1
exit(exitcode)

View File

@ -1,39 +0,0 @@
#!/usr/bin/env python3
import sys
sys.path.append('scripts')
import optparse
import config
import base
import packages
parser = optparse.OptionParser()
parser.add_option("--branding", action="store", type="string", dest="branding", default="", help="provides branding path")
parser.add_option("--product", action="store", type="string", dest="product", default="", help="defines product")
parser.add_option("--package", action="store", type="string", dest="package", default="", help="defines packages")
(options, args) = parser.parse_args(sys.argv[1:])
configOptions = vars(options)
branding = configOptions["branding"]
product = configOptions["product"]
package_list = configOptions["package"]
base_dir = base.get_script_dir(__file__)
# branding
if ("" != branding):
branding_dir = base_dir + "/../" + branding
if base.is_file(branding_dir + "/build_tools/make_packages.py"):
base.check_build_version(branding_dir + "/build_tools")
base.cmd_in_dir(branding_dir + "/build_tools",
"python", ["make_packages.py",
'--product', product,
'--package', package_list
])
exit(0)
base.check_build_version(base_dir)
# build packages
packages.make(product, package_list)

View File

@ -175,6 +175,14 @@ def create_dir(path):
os.makedirs(path2)
return
def move_dir(src, dst):
if is_dir(dst):
delete_dir(dst)
if is_dir(src):
copy_dir(src, dst)
delete_dir(src)
return
def copy_dir(src, dst):
if is_dir(dst):
delete_dir(dst)
@ -206,6 +214,20 @@ def delete_dir(path):
def copy_lib(src, dst, name):
if (config.check_option("config", "bundle_dylibs")) and is_dir(src + "/" + name + ".framework"):
copy_dir(src + "/" + name + ".framework", dst + "/" + name + ".framework")
if (config.check_option("config", "bundle_xcframeworks")) and is_dir(src + "/simulator/" + name + ".framework"):
create_dir(dst + "/simulator")
copy_dir(src + "/simulator/" + name + ".framework", dst + "/simulator/" + name + ".framework")
cmd("xcodebuild", ["-create-xcframework",
"-framework", dst + "/" + name + ".framework",
"-framework", dst + "/simulator/" + name + ".framework",
"-output", dst + "/" + name + ".xcframework"])
delete_dir(dst + "/" + name + ".framework")
delete_dir(dst + "/simulator/" + name + ".framework")
delete_dir(dst + "/simulator")
return
lib_ext = ".so"
@ -240,6 +262,9 @@ def copy_exe(src, dst, name):
return
def replaceInFile(path, text, textReplace):
if not is_file(path):
print("[replaceInFile] file not exist: " + path)
return
filedata = ""
with open(get_path(path), "r") as file:
filedata = file.read()
@ -249,6 +274,9 @@ def replaceInFile(path, text, textReplace):
file.write(filedata)
return
def replaceInFileRE(path, pattern, textReplace):
if not is_file(path):
print("[replaceInFile] file not exist: " + path)
return
filedata = ""
with open(get_path(path), "r") as file:
filedata = file.read()
@ -447,14 +475,13 @@ def get_repositories():
result["core"] = [False, False]
result["sdkjs"] = [False, False]
result.update(get_sdkjs_addons())
result.update(get_sdkjs_plugins())
result.update(get_sdkjs_plugins_server())
result["onlyoffice.github.io"] = [False, False]
result["web-apps"] = [False, False]
result.update(get_web_apps_addons())
result["dictionaries"] = [False, False]
if config.check_option("module", "builder"):
result["DocumentBuilder"] = [False, False]
result["document-templates"] = [False, False]
if config.check_option("module", "desktop"):
result["desktop-sdk"] = [False, False]
@ -539,12 +566,49 @@ def git_dir():
if ("windows" == host_platform()):
return run_command("git --info-path")['stdout'] + "/../../.."
def get_prefix_cross_compiler_arm64():
cross_compiler_arm64 = config.option("arm64-toolchain-bin")
if is_file(cross_compiler_arm64 + "/aarch64-linux-gnu-g++") and is_file(cross_compiler_arm64 + "/aarch64-linux-gnu-gcc"):
return "aarch64-linux-gnu-"
if is_file(cross_compiler_arm64 + "/aarch64-unknown-linux-gnu-g++") and is_file(cross_compiler_arm64 + "/aarch64-unknown-linux-gnu-gcc"):
return "aarch64-unknown-linux-gnu-"
return ""
def get_gcc_version():
gcc_version_major = 4
gcc_version_minor = 0
gcc_version_str = run_command("gcc -dumpfullversion -dumpversion")['stdout']
if (gcc_version_str != ""):
try:
gcc_ver = gcc_version_str.split(".")
gcc_version_major = int(gcc_ver[0])
gcc_version_minor = int(gcc_ver[1])
except Exception as e:
gcc_version_major = 4
gcc_version_minor = 0
return gcc_version_major * 1000 + gcc_version_minor
# qmake -------------------------------------------------
def qt_setup(platform):
compiler = config.check_compiler(platform)
qt_dir = config.option("qt-dir") if (-1 == platform.find("_xp")) else config.option("qt-dir-xp")
qt_dir = (qt_dir + "/" + compiler["compiler"]) if platform_is_32(platform) else (qt_dir + "/" + compiler["compiler_64"])
compiler_platform = compiler["compiler"] if platform_is_32(platform) else compiler["compiler_64"]
qt_dir = qt_dir + "/" + compiler_platform
if (0 == platform.find("linux_arm")) and not is_dir(qt_dir):
if ("gcc_arm64" == compiler_platform):
qt_dir = config.option("qt-dir") + "/gcc_64"
if ("gcc_arm" == compiler_platform):
qt_dir = config.option("qt-dir") + "/gcc"
set_env("QT_DEPLOY", qt_dir + "/bin")
if ("linux_arm64" == platform):
cross_compiler_arm64 = config.option("arm64-toolchain-bin")
if ("" != cross_compiler_arm64):
set_env("ARM64_TOOLCHAIN_BIN", cross_compiler_arm64)
set_env("ARM64_TOOLCHAIN_BIN_PREFIX", get_prefix_cross_compiler_arm64())
return qt_dir
def qt_version():
@ -568,8 +632,15 @@ def qt_config(platform):
config_param += " apple_silicon use_javascript_core"
if config.check_option("module", "mobile"):
config_param += " support_web_socket"
if (config.option("vs-version") == "2019"):
config_param += " v8_version_89 vs2019"
if ("ios" == platform):
config_param += " disable_precompiled_header"
if (0 == platform.find("android")):
config_param += " disable_precompiled_header"
if ("linux_arm64" == platform):
config_param += " linux_arm64"
return config_param
def qt_major_version():
@ -673,9 +744,9 @@ def generate_doctrenderer_config(path, root, product, vendor = ""):
content += ("<file>" + root + "sdkjs/common/Native/jquery_native.js</file>\n")
if ("server" != product):
content += ("<file>" + root + "sdkjs/common/AllFonts.js</file>\n")
content += ("<allfonts>" + root + "sdkjs/common/AllFonts.js</allfonts>\n")
else:
content += ("<file>./AllFonts.js</file>\n")
content += ("<allfonts>./AllFonts.js</allfonts>\n")
vendor_dir = vendor
if ("" == vendor_dir):
@ -683,27 +754,13 @@ def generate_doctrenderer_config(path, root, product, vendor = ""):
vendor_dir = root + vendor_dir + "/vendor/"
content += ("<file>" + vendor_dir + "xregexp/xregexp-all-min.js</file>\n")
content += ("<htmlfile>" + vendor_dir + "jquery/jquery.min.js</htmlfile>\n")
content += ("<sdkjs>" + root + "sdkjs</sdkjs>\n")
content += "<DoctSdk>\n"
content += ("<file>" + root + "sdkjs/word/sdk-all-min.js</file>\n")
content += ("<file>" + root + "sdkjs/common/libfont/js/fonts.js</file>\n")
content += ("<file>" + root + "sdkjs/word/sdk-all.js</file>\n")
content += "</DoctSdk>\n"
content += "<PpttSdk>\n"
content += ("<file>" + root + "sdkjs/slide/sdk-all-min.js</file>\n")
content += ("<file>" + root + "sdkjs/common/libfont/js/fonts.js</file>\n")
content += ("<file>" + root + "sdkjs/slide/sdk-all.js</file>\n")
content += "</PpttSdk>\n"
content += "<XlstSdk>\n"
content += ("<file>" + root + "sdkjs/cell/sdk-all-min.js</file>\n")
content += ("<file>" + root + "sdkjs/common/libfont/js/fonts.js</file>\n")
content += ("<file>" + root + "sdkjs/cell/sdk-all.js</file>\n")
content += "</XlstSdk>\n"
if ("desktop" == product):
content += "<htmlnoxvfb/>\n"
content += "<htmlfileinternal>./../</htmlfileinternal>\n"
if (False): # old html file
content += ("<htmlfile>" + vendor_dir + "jquery/jquery.min.js</htmlfile>\n")
if ("desktop" == product):
content += "<htmlnoxvfb/>\n"
content += "<htmlfileinternal>./../</htmlfileinternal>\n"
content += "</Settings>"
@ -725,7 +782,7 @@ def generate_plist(path):
for n in bundle_version_natural:
bundle_version.append(n)
for file in glob.glob(path + "/*.framework"):
for file in glob.glob(path + '/**/*.framework', recursive=True):
if not is_dir(file):
continue
name = os.path.basename(file)
@ -750,7 +807,7 @@ def generate_plist(path):
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>10.0</string>\n"
content += "\t<string>13.0</string>\n"
content += "</dict>\n"
content += "</plist>"
@ -799,22 +856,6 @@ def get_web_apps_addons():
result[name] = [True, False]
return result
def get_plugins(plugins_list=""):
result = {}
if ("" == plugins_list):
return result
plugins_list = plugins_list.rsplit(", ")
plugins_dir = get_script_dir() + "/../../sdkjs-plugins"
for name in plugins_list:
result["plugin-" + name] = [True, plugins_dir]
return result
def get_sdkjs_plugins():
return get_plugins(config.option("sdkjs-plugin"))
def get_sdkjs_plugins_server():
return get_plugins(config.option("sdkjs-plugin-server"))
def sdkjs_addons_param():
if ("" == config.option("sdkjs-addons")):
return []
@ -859,9 +900,15 @@ def extract(src, dst):
app = "7za" if ("mac" == host_platform()) else "7z"
return cmd_exe(app, ["x", "-y", src, "-o" + dst])
def extract_unicode(src, dst):
if "windows" == host_platform():
run_as_bat_win_isolate([u"chcp 65001", u"call 7z.exe x -y \"" + src + u"\" \"-o" + dst + u"\"", u"exit"])
return
return extract(src, dst)
def archive_folder(src, dst):
app = "7za" if ("mac" == host_platform()) else "7z"
return cmd_exe(app, ["a", "-r", dst, src])
return cmd_exe(app, ["a", dst, src])
# windows vcvarsall
def _call_vcvarsall_and_return_env(arch):
@ -924,6 +971,20 @@ def run_as_bat(lines, is_no_errors=False):
delete_file(name)
return
def run_as_bat_win_isolate(lines, is_no_errors=False):
file = codecs.open("tmp.bat", "w", "utf-8")
file.write("\n".join(lines))
file.close()
file2 = codecs.open("tmp2.bat", "w", "utf-8")
file2.write("start /wait /min tmp.bat")
file2.close()
cmd("tmp2.bat", [], is_no_errors)
delete_file("tmp.bat")
delete_file("tmp2.bat")
return
def save_as_script(path, lines):
content = "\n".join(lines)
@ -961,7 +1022,7 @@ def get_file_last_modified_url(url):
def mac_correct_rpath_binary(path, libs):
for lib in libs:
cmd("install_name_tool", ["-change", "lib" + lib + ".dylib", "@rpath/lib" + lib + ".dylib", path])
cmd("install_name_tool", ["-change", "lib" + lib + ".dylib", "@rpath/lib" + lib + ".dylib", path], True)
return
def mac_correct_rpath_library(name, libs):
@ -972,23 +1033,22 @@ def mac_correct_rpath_x2t(dir):
os.chdir(dir)
mac_correct_rpath_library("icudata.58", [])
mac_correct_rpath_library("icuuc.58", ["icudata.58"])
mac_correct_rpath_library("UnicodeConverter", ["icuuc.58", "icudata.58", "kernel"])
mac_correct_rpath_library("kernel", [])
mac_correct_rpath_library("kernel_network", ["kernel"])
mac_correct_rpath_library("UnicodeConverter", ["icuuc.58", "icudata.58"])
mac_correct_rpath_library("kernel", ["UnicodeConverter"])
mac_correct_rpath_library("kernel_network", ["UnicodeConverter", "kernel"])
mac_correct_rpath_library("graphics", ["UnicodeConverter", "kernel"])
mac_correct_rpath_library("doctrenderer", ["UnicodeConverter", "kernel", "kernel_network", "graphics"])
mac_correct_rpath_library("HtmlFile2", ["UnicodeConverter", "kernel", "kernel_network", "graphics"])
mac_correct_rpath_library("EpubFile", ["kernel", "HtmlFile2", "graphics"])
mac_correct_rpath_library("EpubFile", ["UnicodeConverter", "kernel", "HtmlFile2", "graphics"])
mac_correct_rpath_library("Fb2File", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("HtmlRenderer", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("PdfWriter", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("DjVuFile", ["kernel", "UnicodeConverter", "graphics", "PdfWriter"])
mac_correct_rpath_library("PdfReader", ["kernel", "UnicodeConverter", "graphics", "PdfWriter", "HtmlRenderer"])
mac_correct_rpath_library("XpsFile", ["kernel", "UnicodeConverter", "graphics", "PdfWriter"])
mac_correct_rpath_library("DocxRenderer", ["kernel", "UnicodeConverter", "graphics"])
mac_correct_rpath_library("PdfFile", ["UnicodeConverter", "kernel", "graphics", "kernel_network"])
mac_correct_rpath_library("DjVuFile", ["UnicodeConverter", "kernel", "graphics", "PdfFile"])
mac_correct_rpath_library("XpsFile", ["UnicodeConverter", "kernel", "graphics", "PdfFile"])
mac_correct_rpath_library("DocxRenderer", ["UnicodeConverter", "kernel", "graphics"])
cmd("chmod", ["-v", "+x", "./x2t"])
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./x2t"], True)
mac_correct_rpath_binary("./x2t", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfWriter", "HtmlRenderer", "PdfReader", "XpsFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer", "DocxRenderer"])
mac_correct_rpath_binary("./x2t", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "HtmlRenderer", "XpsFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer", "DocxRenderer"])
if is_file("./allfontsgen"):
cmd("chmod", ["-v", "+x", "./allfontsgen"])
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./allfontsgen"], True)
@ -1000,15 +1060,24 @@ def mac_correct_rpath_x2t(dir):
os.chdir(cur_dir)
return
def mac_correct_rpath_docbuilder(dir):
cur_dir = os.getcwd()
os.chdir(dir)
cmd("chmod", ["-v", "+x", "./docbuilder"])
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./docbuilder"], True)
mac_correct_rpath_binary("./docbuilder", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "HtmlRenderer", "XpsFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer", "DocxRenderer"])
os.chdir(cur_dir)
return
def mac_correct_rpath_desktop(dir):
mac_correct_rpath_x2t(dir + "/converter")
cur_dir = os.getcwd()
os.chdir(dir)
mac_correct_rpath_library("hunspell", [])
mac_correct_rpath_library("ooxmlsignature", ["kernel"])
mac_correct_rpath_library("ascdocumentscore", ["UnicodeConverter", "kernel", "graphics", "kernel_network", "PdfWriter", "HtmlRenderer", "PdfReader", "XpsFile", "DjVuFile", "hunspell", "ooxmlsignature"])
mac_correct_rpath_library("ascdocumentscore", ["UnicodeConverter", "kernel", "graphics", "kernel_network", "PdfFile", "HtmlRenderer", "XpsFile", "DjVuFile", "hunspell", "ooxmlsignature"])
cmd("install_name_tool", ["-change", "@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework", "@rpath/Chromium Embedded Framework.framework/Chromium Embedded Framework", "libascdocumentscore.dylib"])
mac_correct_rpath_binary("./editors_helper.app/Contents/MacOS/editors_helper", ["ascdocumentscore", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfWriter", "HtmlRenderer", "PdfReader", "XpsFile", "DjVuFile", "hunspell", "ooxmlsignature"])
mac_correct_rpath_binary("./editors_helper.app/Contents/MacOS/editors_helper", ["ascdocumentscore", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "HtmlRenderer", "XpsFile", "DjVuFile", "hunspell", "ooxmlsignature"])
cmd("install_name_tool", ["-add_rpath", "@executable_path/../../../../Frameworks", "./editors_helper.app/Contents/MacOS/editors_helper"], True)
cmd("install_name_tool", ["-add_rpath", "@executable_path/../../../../Resources/converter", "./editors_helper.app/Contents/MacOS/editors_helper"], True)
cmd("chmod", ["-v", "+x", "./editors_helper.app/Contents/MacOS/editors_helper"])
@ -1043,7 +1112,7 @@ def common_check_version(name, good_version, clean_func):
return
def copy_sdkjs_plugin(src_dir, dst_dir, name, is_name_as_guid=False, is_desktop_local=False):
src_dir_path = src_dir + "/plugin-" + name
src_dir_path = src_dir + "/" + name
if not is_dir(src_dir_path):
src_dir_path = src_dir + "/" + name
if not is_file(src_dir_path + "/config.json"):
@ -1079,7 +1148,7 @@ def copy_sdkjs_plugin(src_dir, dst_dir, name, is_name_as_guid=False, is_desktop_
return
def copy_sdkjs_plugins(dst_dir, is_name_as_guid=False, is_desktop_local=False):
plugins_dir = get_script_dir() + "/../../sdkjs-plugins"
plugins_dir = get_script_dir() + "/../../onlyoffice.github.io/sdkjs-plugins/content"
plugins_list_config = config.option("sdkjs-plugin")
if ("" == plugins_list_config):
return
@ -1089,7 +1158,7 @@ def copy_sdkjs_plugins(dst_dir, is_name_as_guid=False, is_desktop_local=False):
return
def copy_sdkjs_plugins_server(dst_dir, is_name_as_guid=False, is_desktop_local=False):
plugins_dir = get_script_dir() + "/../../sdkjs-plugins"
plugins_dir = get_script_dir() + "/../../onlyoffice.github.io/sdkjs-plugins/content"
plugins_list_config = config.option("sdkjs-plugin-server")
if ("" == plugins_list_config):
return
@ -1186,8 +1255,136 @@ def make_sln(directory, args, is_no_errors):
os.environ.update(old_env)
return
def make_sln_project(directory, sln_path):
args = []
args.append(sln_path)
args.append("/Rebuild")
if (config.check_option("platform", "win_64")):
make_sln(directory, args + ["\"Release|x64\""], True)
if True:#(config.check_option("platform", "win_32")):
make_sln(directory, args + ["\"Release|Win32\""], True)
return
def get_android_sdk_home():
ndk_root_path = get_env("ANDROID_NDK_ROOT")
if (-1 != ndk_root_path.find("/ndk/")):
return ndk_root_path + "/../.."
return ndk_root_path + "/.."
def readFileLicence(path):
content = readFile(path)
index = content.find("*/")
if index >= 0:
return content[0:index+2]
return ""
def replaceFileLicence(path, license):
old_licence = readFileLicence(path)
replaceInFile(path, old_licence, license)
return
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 (0 == platform.find("win")):
copy_files(directory_v8 + platform + "/release/icudt*.dat", deploy_dir + "/")
else:
copy_files(directory_v8 + platform + "/icudt*.dat", deploy_dir + "/")
return
def clone_marketplace_plugin(out_dir, is_name_as_guid=False):
old_cur = os.getcwd()
os.chdir(out_dir)
git_update("onlyoffice.github.io", False, True)
os.chdir(old_cur)
dst_dir_name = "marketplace"
if is_name_as_guid:
config_content = readFile(out_dir + "/onlyoffice.github.io/store/plugin/config.json")
index_start = config_content.find("\"asc.{")
index_start += 5
index_end = config_content.find("}", index_start)
index_end += 1
guid = config_content[index_start:index_end]
dst_dir_name = guid
dst_dir_path = out_dir + "/" + dst_dir_name
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")
return
def correctPathForBuilder(path):
replace_value = "../../../build/"
if (config.option("branding") != ""):
replace_value += (config.option("branding") + "/")
replace_value += "lib/"
if (config.check_option("config", "debug")):
replace_value += ("debug/")
if (replace_value == "../../../build/lib/"):
return ""
new_path = path + ".bak"
copy_file(path, new_path)
replaceInFile(path, "../../../build/lib/", replace_value)
return new_path
def restorePathForBuilder(new_path):
if ("" == new_path):
return
old_path = new_path[:-4]
delete_file(old_path)
copy_file(new_path, old_path)
delete_file(new_path);
return
def generate_check_linux_system(build_tools_dir, out_dir):
create_dir(out_dir + "/.system")
copy_file(build_tools_dir + "/tools/linux/check_system/check.sh", out_dir + "/.system/check.sh")
copy_file(build_tools_dir + "/tools/linux/check_system/libstdc++.so.6", out_dir + "/.system/libstdc++.so.6")
return
def convert_ios_framework_to_xcframework(folder, lib):
cur_dir = os.getcwd()
os.chdir(folder)
create_dir(lib + "_xc_tmp")
create_dir(lib + "_xc_tmp/iphoneos")
create_dir(lib + "_xc_tmp/iphonesimulator")
copy_dir(lib + ".framework", lib + "_xc_tmp/iphoneos/" + lib + ".framework")
copy_dir(lib + ".framework", lib + "_xc_tmp/iphonesimulator/" + lib + ".framework")
cmd("xcrun", ["lipo", "-remove", "x86_64", "./" + lib + "_xc_tmp/iphoneos/" + lib + ".framework/" + lib,
"-o", "./" + lib + "_xc_tmp/iphoneos/" + lib + ".framework/" + lib])
cmd("xcrun", ["lipo", "-remove", "arm64", "./" + lib + "_xc_tmp/iphonesimulator/" + lib + ".framework/" + lib,
"-o", "./" + lib + "_xc_tmp/iphonesimulator/" + lib + ".framework/" + lib])
cmd("xcodebuild", ["-create-xcframework",
"-framework", "./" + lib + "_xc_tmp/iphoneos/" + lib + ".framework/",
"-framework", "./" + lib + "_xc_tmp/iphonesimulator/" + lib + ".framework/",
"-output", lib + ".xcframework"])
delete_dir(lib + "_xc_tmp")
os.chdir(cur_dir)
return
def convert_ios_framework_to_xcframework_folder(folder, libs):
for lib in libs:
convert_ios_framework_to_xcframework(folder, lib)
return

View File

@ -5,7 +5,7 @@ import base
import os
import multiprocessing
def make_pro_file(makefiles_dir, pro_file):
def make_pro_file(makefiles_dir, pro_file, qmake_config_addon=""):
platforms = config.option("platform").split()
for platform in platforms:
if not platform in config.platforms:
@ -47,11 +47,13 @@ def make_pro_file(makefiles_dir, pro_file):
# qmake CONFIG+=...
config_param = base.qt_config(platform)
if ("" != qmake_config_addon):
config_param += (" " + qmake_config_addon)
# qmake ADDON
qmake_addon = []
if ("" != config.option("qmake_addon")):
qmake_addon.append(config.option("qmake_addon"))
qmake_addon = config.option("qmake_addon").split()
if not base.is_file(qt_dir + "/bin/qmake") and not base.is_file(qt_dir + "/bin/qmake.exe"):
print("THIS PLATFORM IS NOT SUPPORTED")
@ -79,7 +81,7 @@ def make_pro_file(makefiles_dir, pro_file):
qmake_bat.append("if exist ./" + makefiles_dir + "/build.makefile_" + file_suff + " del /F ./" + makefiles_dir + "/build.makefile_" + file_suff)
qmake_addon_string = ""
if ("" != config.option("qmake_addon")):
qmake_addon_string = " \"" + config.option("qmake_addon") + "\""
qmake_addon_string = " " + (" ").join(["\"" + addon + "\"" for addon in qmake_addon])
qmake_bat.append("call \"" + qt_dir + "/bin/qmake\" -nocache " + pro_file + " \"CONFIG+=" + config_param + "\"" + qmake_addon_string)
if ("1" == config.option("clean")):
qmake_bat.append("call nmake clean -f " + makefiles_dir + "/build.makefile_" + file_suff)
@ -97,25 +99,20 @@ def make_pro_file(makefiles_dir, pro_file):
# make build.pro
def make():
is_no_brandind_build = base.is_file("config")
make_pro_file("makefiles", "build.pro")
if config.check_option("module", "builder") and base.is_windows() and is_no_brandind_build:
if config.check_option("platform", "ios") and config.check_option("config", "bundle_xcframeworks"):
make_pro_file("makefiles", "build.pro", "xcframework_platform_ios_simulator")
if config.check_option("module", "builder") and base.is_windows() and "onlyoffice" == config.branding():
# check replace
replace_path_lib = ""
replace_path_lib_file = os.getcwd() + "/../core/DesktopEditor/doctrenderer/docbuilder.com/docbuilder.h"
option_branding = config.option("branding")
if (option_branding != ""):
replace_path_lib = "../../../build/" + option_branding + "/lib/"
# replace
if (replace_path_lib != ""):
base.replaceInFile(replace_path_lib_file, "../../../build/lib/", replace_path_lib)
new_replace_path = base.correctPathForBuilder(os.getcwd() + "/../core/DesktopEditor/doctrenderer/docbuilder.com/src/docbuilder.h")
if ("2019" == config.option("vs-version")):
base.make_sln("../core/DesktopEditor/doctrenderer/docbuilder.com", ["docbuilder.com_2019.sln", "/Rebuild", "\"Release|x64\""], True)
base.make_sln("../core/DesktopEditor/doctrenderer/docbuilder.com", ["docbuilder.com_2019.sln", "/Rebuild", "\"Release|Win32\""], True)
base.make_sln_project("../core/DesktopEditor/doctrenderer/docbuilder.com/src", "docbuilder.com_2019.sln")
if (True):
new_path_net = base.correctPathForBuilder(os.getcwd() + "/../core/DesktopEditor/doctrenderer/docbuilder.net/src/docbuilder.net.cpp")
base.make_sln_project("../core/DesktopEditor/doctrenderer/docbuilder.net/src", "docbuilder.net.sln")
base.restorePathForBuilder(new_path_net)
else:
base.make_sln("../core/DesktopEditor/doctrenderer/docbuilder.com", ["docbuilder.com.sln", "/Rebuild", "\"Release|x64\""], True)
base.make_sln("../core/DesktopEditor/doctrenderer/docbuilder.com", ["docbuilder.com.sln", "/Rebuild", "\"Release|Win32\""], True)
# restore
if (replace_path_lib != ""):
base.replaceInFile(replace_path_lib_file, replace_path_lib, "../../../build/lib/")
base.make_sln_project("../core/DesktopEditor/doctrenderer/docbuilder.com/src", "docbuilder.com.sln")
base.restorePathForBuilder(new_replace_path)
return

View File

@ -4,6 +4,25 @@ import config
import base
import os
def correct_sdkjs_licence(directory):
branding = config.option("branding")
if "" == branding or "onlyoffice" == branding:
return
license = base.readFileLicence(directory + "/word/sdk-all-min.js")
base.replaceFileLicence(directory + "/common/Charts/ChartStyles.js", license)
base.replaceFileLicence(directory + "/common/hash/hash/engine.js", license)
base.replaceFileLicence(directory + "/common/hash/hash/engine_ie.js", license)
base.replaceFileLicence(directory + "/common/Native/native.js", license)
base.replaceFileLicence(directory + "/common/Native/native_graphics.js", license)
base.replaceFileLicence(directory + "/common/spell/spell/spell.js", license)
base.replaceFileLicence(directory + "/common/spell/spell/spell_ie.js", license)
base.replaceFileLicence(directory + "/pdf/src/engine/drawingfile.js", license)
base.replaceFileLicence(directory + "/pdf/src/engine/drawingfile_ie.js", license)
base.replaceInFile(directory + "/word/sdk-all-min.js", "onlyoffice-spellchecker", "r7-spellchecker")
base.replaceInFile(directory + "/slide/sdk-all-min.js", "onlyoffice-spellchecker", "r7-spellchecker")
base.replaceInFile(directory + "/cell/sdk-all-min.js", "onlyoffice-spellchecker", "r7-spellchecker")
return
# make build.pro
def make():
if ("1" == base.get_env("OO_NO_BUILD_JS")):
@ -25,12 +44,14 @@ def make():
base.create_dir(out_dir + "/builder")
base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/builder/web-apps")
base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/builder/sdkjs")
correct_sdkjs_licence(out_dir + "/builder/sdkjs")
# desktop
if config.check_option("module", "desktop"):
build_sdk_desktop(base_dir + "/../sdkjs/build")
base.create_dir(out_dir + "/desktop")
base.copy_dir(base_dir + "/../sdkjs/deploy/sdkjs", out_dir + "/desktop/sdkjs")
correct_sdkjs_licence(out_dir + "/desktop/sdkjs")
base.copy_dir(base_dir + "/../web-apps/deploy/web-apps", out_dir + "/desktop/web-apps")
if not base.is_file(out_dir + "/desktop/sdkjs/common/AllFonts.js"):
base.copy_file(base_dir + "/../sdkjs/common/HtmlFileInternal/AllFonts.js", out_dir + "/desktop/sdkjs/common/AllFonts.js")
@ -55,7 +76,6 @@ def make():
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
vendor_dir_src + "underscore/underscore-min.js",
base_dir + "/../sdkjs/common/externs/jszip-utils.js",
base_dir + "/../sdkjs/common/Native/native.js",
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
@ -63,7 +83,6 @@ def make():
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
vendor_dir_src + "underscore/underscore-min.js",
base_dir + "/../sdkjs/common/externs/jszip-utils.js",
base_dir + "/../sdkjs/common/Native/native.js",
base_dir + "/../sdkjs/cell/native/common.js",
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
@ -71,7 +90,6 @@ def make():
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
vendor_dir_src + "underscore/underscore-min.js",
base_dir + "/../sdkjs/common/externs/jszip-utils.js",
base_dir + "/../sdkjs/common/Native/native.js",
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
base_dir + "/../sdkjs/common/Native/jquery_native.js"],

View File

@ -1,12 +1,37 @@
#!/usr/bin/env python
import config
import base
import os
import build_js
import config
import optparse
import sys
arguments = sys.argv[1:]
parser = optparse.OptionParser()
parser.add_option("--output",
action="store", type="string", dest="output",
help="Directory for output the build result")
parser.add_option("--write-version",
action="store_true", dest="write_version", default=False,
help="Create version file of build")
(options, args) = parser.parse_args(arguments)
def write_version_files(output_dir):
if (base.is_dir(output_dir)):
last_version_tag = base.run_command('git describe --abbrev=0 --tags')['stdout']
version_numbers=last_version_tag.replace('v', '').split('.')
major=(version_numbers[0:1] or ('0',))[0]
minor=(version_numbers[1:2] or ('0',))[0]
maintenance=(version_numbers[2:3] or ('0',))[0]
build=(version_numbers[3:4] or ('0',))[0]
full_version='%s.%s.%s.%s' % (major, minor, maintenance, build)
for name in ['word', 'cell', 'slide']:
base.writeFile(output_dir + '/%s/sdk.version' % name, full_version)
# parse configuration
config.parse()
config.parse_defaults()
config.extend_option("jsminimize", "0")
branding = config.option("branding-name")
@ -15,6 +40,10 @@ if ("" == branding):
base_dir = base.get_script_dir() + "/.."
out_dir = base_dir + "/../native-sdk/examples/win-linux-mac/build/sdkjs"
if (options.output):
out_dir = options.output
base.create_dir(out_dir)
build_js.build_sdk_native(base_dir + "/../sdkjs/build")
@ -23,7 +52,6 @@ sdk_dir_src = base_dir + "/../sdkjs/deploy/sdkjs/"
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
vendor_dir_src + "underscore/underscore-min.js",
base_dir + "/../sdkjs/common/externs/jszip-utils.js",
base_dir + "/../sdkjs/common/Native/native.js",
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
@ -31,7 +59,6 @@ base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
vendor_dir_src + "underscore/underscore-min.js",
base_dir + "/../sdkjs/common/externs/jszip-utils.js",
base_dir + "/../sdkjs/common/Native/native.js",
base_dir + "/../sdkjs/cell/native/common.js",
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
@ -39,7 +66,6 @@ base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
vendor_dir_src + "underscore/underscore-min.js",
base_dir + "/../sdkjs/common/externs/jszip-utils.js",
base_dir + "/../sdkjs/common/Native/native.js",
base_dir + "/../sdkjs/common/Native/Wrappers/common.js",
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
@ -55,4 +81,7 @@ base.join_scripts([out_dir + "/banners_slide.js", sdk_dir_src + "slide/sdk-all-m
base.delete_file(out_dir + "/banners_word.js")
base.delete_file(out_dir + "/banners_cell.js")
base.delete_file(out_dir + "/banners_slide.js")
# Write sdk version mark file if needed
if (options.write_version):
write_version_files(out_dir)

View File

@ -45,6 +45,8 @@ def make():
if ("linux" == base.host_platform()):
pkg_target += "-linux"
if (-1 != config.option("platform").find("linux_arm64")):
pkg_target += "-arm64"
if ("windows" == base.host_platform()):
pkg_target += "-win"

View File

@ -25,7 +25,7 @@ def parse():
# all platforms
global platforms
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp",
"linux_64", "linux_32",
"linux_64", "linux_32", "linux_arm64",
"mac_64", "mac_arm64",
"ios",
"android_arm64_v8a", "android_armv7", "android_x86", "android_x86_64"]
@ -53,20 +53,40 @@ def parse():
else:
options["platform"] += (" mac_" + bits)
if ("mac" == host_platform) and check_option("platform", "mac_arm64") and (platform.machine() != "arm64"):
if ("mac" == host_platform) and check_option("platform", "mac_arm64") and not base.is_os_arm():
if not check_option("platform", "mac_64"):
options["platform"] = "mac_64 " + options["platform"]
if ("linux" == host_platform) and check_option("platform", "linux_arm64") and not base.is_os_arm():
if not check_option("platform", "linux_64"):
# linux_64 binaries need only for desktop
if check_option("module", "desktop"):
options["platform"] = "linux_64 " + options["platform"]
if check_option("platform", "xp") and ("windows" == host_platform):
options["platform"] += " win_64_xp win_32_xp"
if check_option("platform", "android"):
options["platform"] += " android_arm64_v8a android_armv7 android_x86 android_x86_64"
#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 ("2019" == option("vs-version")):
extend_option("config", "v8_version_89")
extend_option("config", "vs2019")
if check_option("platform", "linux_arm64"):
extend_option("config", "v8_version_89")
# check vs-path
if ("windows" == host_platform) and ("" == option("vs-path")):
programFilesDir = base.get_env("ProgramFiles")
@ -86,7 +106,14 @@ def parse():
if not "sdkjs-plugin" in options:
options["sdkjs-plugin"] = "default"
if not "sdkjs-plugin-server" in options:
options["sdkjs-plugin-server"] = "default"
options["sdkjs-plugin-server"] = "default"
if not "arm64-toolchain-bin" in options:
options["arm64-toolchain-bin"] = "/usr/bin"
if check_option("config", "bundle_xcframeworks"):
if not check_option("config", "bundle_dylibs"):
extend_option("config", "bundle_dylibs")
return
@ -106,6 +133,9 @@ def check_compiler(platform):
elif (0 == platform.find("linux")):
compiler["compiler"] = "gcc"
compiler["compiler_64"] = "gcc_64"
if (0 == platform.find("linux_arm")) and not base.is_os_arm():
compiler["compiler"] = "gcc_arm"
compiler["compiler_64"] = "gcc_arm64"
elif (0 == platform.find("mac")):
compiler["compiler"] = "clang"
compiler["compiler_64"] = "clang_64"

View File

@ -18,6 +18,9 @@ import v8
import html2
import hunspell
import glew
import harfbuzz
import hyphen
import socket_io
def check_android_ndk_macos_arm(dir):
if base.is_dir(dir + "/darwin-x86_64") and not base.is_dir(dir + "/darwin-arm64"):
@ -39,7 +42,11 @@ def make():
v8.make()
html2.make()
hunspell.make(False)
harfbuzz.make()
glew.make()
hyphen.make()
socket_io.make()
if config.check_option("module", "mobile"):
curl.make()
websocket.make()

View File

@ -68,15 +68,17 @@ def make():
if ("windows" == base.host_platform()):
win_toolset = "msvc-14.0"
win_boot_arg = "vc14"
win_vs_version = "vc140"
if (config.option("vs-version") == "2019"):
win_toolset = "msvc-14.2"
win_boot_arg = "vc142"
if (-1 != config.option("platform").find("win_64")) and not base.is_dir("../build/win_64"):
win_vs_version = "vc142"
if (-1 != config.option("platform").find("win_64")) and not base.is_file("../build/win_64/lib/libboost_system-" + win_vs_version + "-mt-x64-1_72.lib"):
base.cmd("bootstrap.bat", [win_boot_arg])
base.cmd("b2.exe", ["headers"])
base.cmd("b2.exe", ["--clean"])
base.cmd("b2.exe", ["--prefix=./../build/win_64", "link=static", "--with-filesystem", "--with-system", "--with-date_time", "--with-regex", "--toolset=" + win_toolset, "address-model=64", "install"])
if (-1 != config.option("platform").find("win_32")) and not base.is_dir("../build/win_32"):
if (-1 != config.option("platform").find("win_32")) and not base.is_file("../build/win_32/lib/libboost_system-" + win_vs_version + "-mt-x32-1_72.lib"):
base.cmd("bootstrap.bat", [win_boot_arg])
base.cmd("b2.exe", ["headers"])
base.cmd("b2.exe", ["--clean"])
@ -84,17 +86,30 @@ def make():
correct_install_includes_win(base_dir, "win_64")
correct_install_includes_win(base_dir, "win_32")
if (-1 != config.option("platform").find("linux")) and not base.is_dir("../build/linux_64"):
if config.check_option("platform", "linux_64") and not base.is_dir("../build/linux_64"):
base.cmd("./bootstrap.sh", ["--with-libraries=filesystem,system,date_time,regex"])
base.cmd("./b2", ["headers"])
base.cmd("./b2", ["--clean"])
base.cmd("./b2", ["--prefix=./../build/linux_64", "link=static", "cxxflags=-fPIC", "install"])
# TODO: support x86
if config.check_option("platform", "linux_arm64") and not base.is_dir("../build/linux_arm64"):
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "linux_arm64")
directory_build = base_dir + "/build/linux_arm64/lib"
base.delete_file(directory_build + "/libboost_system.a")
base.delete_file(directory_build + "/libboost_system.so")
base.copy_files(directory_build + "/linux_arm64/*.a", directory_build)
if (-1 != config.option("platform").find("ios")) and not base.is_dir("../build/ios"):
old_cur2 = os.getcwd()
clang_correct()
os.chdir("../")
base.bash("./boost_ios")
os.chdir(old_cur2)
if (-1 != config.option("platform").find("ios")) and not base.is_dir("../build/ios_xcframework"):
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "ios_xcframework/ios_simulator", "xcframework_platform_ios_simulator")
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"], "ios_xcframework/ios")
if (-1 != config.option("platform").find("android")) and not base.is_dir("../build/android"):
boost_qt.make(os.getcwd(), ["filesystem", "system", "date_time", "regex"])

View File

@ -7,7 +7,7 @@ import base
import os
import build
def make(src_dir, modules, build_platform="android"):
def make(src_dir, modules, build_platform="android", qmake_addon=""):
old_cur = os.getcwd()
print("boost-headers...")
@ -28,7 +28,7 @@ def make(src_dir, modules, build_platform="android"):
pro_file_content.append("PWD_ROOT_DIR = $$PWD")
pro_file_content.append("include($$PWD/../../../../../base.pri)")
pro_file_content.append("")
pro_file_content.append("MAKEFILE=$$PWD/makefiles/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX")
pro_file_content.append("MAKEFILE=$$PWD/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX")
pro_file_content.append("core_debug:MAKEFILE=$$join(MAKEFILE, MAKEFILE, \"\", \"_debug_\")")
pro_file_content.append("build_xp:MAKEFILE=$$join(MAKEFILE, MAKEFILE, \"\", \"_xp\")")
pro_file_content.append("OO_BRANDING_SUFFIX = $$(OO_BRANDING)")
@ -42,7 +42,8 @@ def make(src_dir, modules, build_platform="android"):
pro_file_content.append("")
pro_file_content.append("DESTDIR = $$BOOST_SOURCES/../build/" + build_platform + "/lib/$$CORE_BUILDS_PLATFORM_PREFIX")
base.save_as_script(module_dir + "/" + module + ".pro", pro_file_content)
build.make_pro_file(module_dir + "/makefiles", module_dir + "/" + module + ".pro")
os.chdir(module_dir)
build.make_pro_file("./", module + ".pro", qmake_addon)
os.chdir(old_cur)
return

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
import sys
sys.path.append('../..')
import base
import os
def make():
print("[fetch & build]: harfbuzz")
base.cmd_in_dir(base.get_script_dir() + "/../../core/Common/3dParty/harfbuzz", "./make.py")
return
if __name__ == '__main__':
# manual compile
make()

View File

@ -8,164 +8,17 @@ def make(build_js = True):
old_cur_dir = os.getcwd()
#fetch libhunspell
print("[fetch & build]: hunspell")
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/hunspell"
os.chdir(base_dir)
if not base.is_dir("hunspell"):
last_stable_commit = "8a2fdfe5a6bb1cbafc04b0c8486abcefd17ad903"
repo_path = "https://github.com/hunspell/hunspell.git"
base.cmd("git", ["clone", repo_path])
os.chdir("hunspell")
base.cmd("git", ["checkout", last_stable_commit])
base.replaceInFile("./src/hunspell/filemgr.hxx", "FileMgr& operator=(const FileMgr&);", "FileMgr& operator=(const FileMgr&); \n"
+" #ifdef HUNSPELL_WASM_MODULE \n char* memory;size_t index;size_t size; \n #endif") #custon filemgr support watch filemgr_wrapper_new.cxx
os.chdir("../")
core_common_dir = base.get_script_dir() + "/../../core/Common"
if not build_js:
os.chdir(old_cur_dir)
return
base.configure_common_apps()
os.chdir(core_common_dir + "/3dParty/hunspell")
base.cmd("python", ["./before.py"])
# remove previous version
if base.is_dir("./deploy"):
base.delete_dir("./deploy")
base.create_dir("./deploy")
base.create_dir("./deploy/spell")
if (build_js):
os.chdir(core_common_dir + "/js")
base.cmd("python", ["./make.py", core_common_dir + "/3dParty/hunspell/hunspell.json"])
# fetch emsdk
command_prefix = "" if ("windows" == base.host_platform()) else "./"
if not base.is_dir("emsdk"):
base.cmd("git", ["clone", "https://github.com/emscripten-core/emsdk.git"])
os.chdir("emsdk")
base.cmd(command_prefix + "emsdk", ["install", "latest"])
base.cmd(command_prefix + "emsdk", ["activate", "latest"])
os.chdir("../")
# compile
compiler_flags = ["-o spell.js",
"-O3",
"-fno-exceptions",
"-fno-rtti",
"-s WASM=1",
"-s ALLOW_MEMORY_GROWTH=1",
"-s FILESYSTEM=0",
"-s ENVIRONMENT='web,worker'"]
exported_functions = ["_malloc",
"_free",
"_Spellchecker_Malloc",
"_Spellchecker_Free",
"_Spellchecker_Create",
"_Spellchecker_Destroy",
"_Spellchecker_AddDictionary",
"_Spellchecker_RemoveDicrionary",
"_Spellchecker_Load",
"_Spellchecker_Spell",
"_Spellchecker_Suggest",
"_Spellchecker_RemoveEngine",
"_Spellchecker_TotalAllocatedMemory"]
version_hunspell = 17
libhunspell_src_path = "./hunspell/src/hunspell"
input_sources = ["affentry.cxx",
"affixmgr.cxx",
"csutil.cxx",
"dictmgr.cxx",
"hashmgr.cxx",
"hunspell.cxx",
"hunzip.cxx",
"phonet.cxx",
"replist.cxx",
"suggestmgr.cxx"]
sources = []
for item in input_sources:
if base.is_file(libhunspell_src_path + "/" + item):
sources.append(libhunspell_src_path + "/" + item)
if (13 == version_hunspell):
sources.append("./wasm/src/filemgr_wrapper.cxx")
else:
sources.append("./wasm/src/filemgr_wrapper_new.cxx")
sources.append("./wasm/src/base.cpp")
compiler_flags.append("-I" + libhunspell_src_path)
compiler_flags.append("-DWIN32 -DNDEBUG -DHUNSPELL_STATIC -DBUILDING_LIBHUNSPELL -DHUNSPELL_WASM_MODULE")
# arguments
arguments = ""
for item in compiler_flags:
arguments += (item + " ")
arguments += "-s EXPORTED_FUNCTIONS=\"["
for item in exported_functions:
arguments += ("'" + item + "',")
arguments = arguments[:-1]
arguments += "]\" "
for item in sources:
arguments += (item + " ")
# command
windows_bat = []
if (base.host_platform() == "windows"):
windows_bat.append("call emsdk/emsdk_env.bat")
windows_bat.append("call emcc " + arguments)
else:
windows_bat.append("#!/bin/bash")
windows_bat.append("source ./emsdk/emsdk_env.sh")
windows_bat.append("emcc " + arguments)
base.run_as_bat(windows_bat)
# finalize
base.replaceInFile("./spell.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[function(){self.onEngineInit();}];")
base.replaceInFile("./spell.js", "function getBinaryPromise(){", "function getBinaryPromise2(){")
spell_js_content = base.readFile("./spell.js")
engine_base_js_content = base.readFile("./wasm/js/spell.js")
engine_js_content = engine_base_js_content.replace("//module", spell_js_content)
# write new version
base.writeFile("./deploy/spell/spell.js", engine_js_content)
base.copy_file("spell.wasm", "./deploy/spell/spell.wasm")
# ie asm version
arguments = arguments.replace("WASM=1", "WASM=0")
# command
windows_bat = []
if (base.host_platform() == "windows"):
windows_bat.append("call emsdk/emsdk_env.bat")
windows_bat.append("call emcc " + arguments)
else:
windows_bat.append("#!/bin/bash")
windows_bat.append("source ./emsdk/emsdk_env.sh")
windows_bat.append("emcc " + arguments)
base.run_as_bat(windows_bat)
# finalize
base.replaceInFile("./spell.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[function(){self.onEngineInit();}];")
base.replaceInFile("./spell.js", "function getBinaryPromise(){", "function getBinaryPromise2(){")
spell_js_content = base.readFile("./spell.js")
engine_base_js_content = base.readFile("./wasm/js/spell.js")
engine_base_js_polyfill = base.readFile("./wasm/js/polyfill.js")
engine_js_content = engine_base_js_polyfill + "\n\n" + engine_base_js_content.replace("//module", spell_js_content)
# write new version
base.writeFile("./deploy/spell/spell_ie.js", engine_js_content)
base.copy_file("spell.js.mem", "./deploy/spell/spell.js.mem")
base.copy_file("./wasm/js/code.js", "./deploy/spell.js")
base.copy_file("./wasm/js/index.html", "./deploy/index.html")
base.delete_file("spell.js")
base.delete_file("spell.js.mem")
os.chdir(old_cur_dir)
if __name__ == '__main__':
# manual compile
make(True)

View File

@ -0,0 +1,21 @@
#!/usr/bin/env python
import sys
sys.path.append('../..')
import config
import base
import os
def make():
print("[fetch]: hyphen")
new_dir = base.get_script_dir() + "/../../core/Common/3dParty/hyphen"
old_dir = os.getcwd()
os.chdir(new_dir)
if not base.is_dir("hyphen"):
base.cmd("git", ["clone", "https://github.com/hunspell/hyphen"])
os.chdir(old_dir)
return

View File

@ -53,38 +53,56 @@ def make():
os.chdir(old_cur)
return
platform = ""
if ("linux" == base.host_platform()):
platform = "linux_64"
if not base.is_dir(platform + "/build"):
base.replaceInFile("./icu/source/i18n/digitlst.cpp", "xlocale", "locale")
if not base.is_file("./icu/source/i18n/digitlst.cpp.bak"):
base.copy_file("./icu/source/i18n/digitlst.cpp", "./icu/source/i18n/digitlst.cpp.bak")
base.replaceInFile("./icu/source/i18n/digitlst.cpp", "xlocale", "locale")
if base.is_dir(base_dir + "/linux_64"):
base.delete_dir(base_dir + "/linux_64")
if base.is_dir(base_dir + "/linux_arm64"):
base.delete_dir(base_dir + "/linux_arm64")
if not base.is_dir(base_dir + "/linux_64"):
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.cmd("make", ["-j4"])
base.cmd("make", ["install"], True)
base.create_dir(base_dir + "/linux_64")
base.create_dir(base_dir + "/linux_64/build")
base.copy_file(base_dir + "/icu/cross_build_install/lib/libicudata.so." + icu_major + "." + icu_minor, base_dir + "/linux_64/build/libicudata.so." + icu_major)
base.copy_file(base_dir + "/icu/cross_build_install/lib/libicuuc.so." + icu_major + "." + icu_minor, base_dir + "/linux_64/build/libicuuc.so." + icu_major)
base.copy_dir(base_dir + "/icu/cross_build_install/include", base_dir + "/linux_64/build/include")
if config.check_option("platform", "linux_arm64") and not base.is_dir(base_dir + "/linux_arm64") and not base.is_os_arm():
base.create_dir(base_dir + "/icu/linux_arm64")
os.chdir(base_dir + "/icu/linux_arm64")
base_arm_tool_dir = base.get_prefix_cross_compiler_arm64()
base.cmd("./../source/configure", ["--host=arm-linux", "--prefix=" + base_dir + "/icu/linux_arm64_install", "--with-cross-build=" + base_dir + "/icu/cross_build",
"CC=" + base_arm_tool_dir + "gcc", "CXX=" + base_arm_tool_dir + "g++", "AR=" + base_arm_tool_dir + "ar", "RANLIB=" + base_arm_tool_dir + "ranlib"])
base.cmd("make", ["-j4"])
base.cmd("make", ["install"], True)
base.create_dir(base_dir + "/linux_arm64")
base.create_dir(base_dir + "/linux_arm64/build")
base.copy_file(base_dir + "/icu/linux_arm64_install/lib/libicudata.so." + icu_major + "." + icu_minor, base_dir + "/linux_arm64/build/libicudata.so." + icu_major)
base.copy_file(base_dir + "/icu/linux_arm64_install/lib/libicuuc.so." + icu_major + "." + icu_minor, base_dir + "/linux_arm64/build/libicuuc.so." + icu_major)
base.copy_dir(base_dir + "/icu/linux_arm64_install/include", base_dir + "/linux_arm64/build/include")
os.chdir("../..")
if ("mac" == base.host_platform()):
platform = "mac_64"
if not base.is_dir(platform + "/build"):
if not base.is_file("./icu/source/tools/pkgdata/pkgdata.cpp.bak"):
base.copy_file("./icu/source/tools/pkgdata/pkgdata.cpp", "./icu/source/tools/pkgdata/pkgdata.cpp.bak")
base.replaceInFile("./icu/source/tools/pkgdata/pkgdata.cpp", "cmd, \"%s %s -o %s%s %s %s%s %s %s\",", "cmd, \"%s %s -o %s%s %s %s %s %s %s\",")
if (-1 != config.option("platform").find("ios")):
if not base.is_dir("build"):
base.bash("./icu_ios")
elif (platform == "mac_64") and not base.is_dir(platform + "/build"):
base.cmd_in_dir(base_dir + "/../../../../build_tools/scripts/core_common/modules", "python", ["icu_mac.py"])
elif ("" != platform) and not base.is_dir(platform + "/build"):
base.create_dir(platform)
os.chdir("icu/source")
base.cmd("./runConfigureICU", ["Linux"])
old_dest_dir = base.get_env("DESTDIR")
base.set_env("DESTDIR", base_dir + "/" + platform)
base.cmd("make", ["install"])
if ("" == old_dest_dir):
os.environ.pop("DESTDIR")
else:
base.set_env("DEST_DIR", old_dest_dir)
os.chdir("../..")
base.create_dir(platform + "/build")
if ("linux_64" == platform):
base.copy_file("icu/source/lib/libicudata.so." + icu_major + "." + icu_minor, platform + "/build/libicudata.so." + icu_major)
base.copy_file("icu/source/lib/libicuuc.so." + icu_major + "." + icu_minor, platform + "/build/libicuuc.so." + icu_major)
# mac
if (-1 != config.option("platform").find("mac_")) and not base.is_dir("mac_64/build"):
base.cmd_in_dir(base_dir + "/../../../../build_tools/scripts/core_common/modules", "python", ["icu_mac.py"])
# ios
if (-1 != config.option("platform").find("ios")):
if not base.is_dir("build"):
base.bash("./icu_ios")
os.chdir(old_cur)
return

View File

@ -13,6 +13,8 @@ def change_icu_defs(current_dir, arch):
if arch == "arm64":
param = "-arch arm64 -isysroot " + base.find_mac_sdk()
param += " -mmacosx-version-min=10.12"
base.copy_file(icudef_file, icudef_file_old)
base.replaceInFile(icudef_file, "CFLAGS = ", "CFLAGS = " + param + " ")

View File

@ -126,11 +126,14 @@ def make():
def param_apple(platform, arch):
return ["-G","Xcode", "-DDEPLOYMENT_TARGET=10", "-DENABLE_BITCODE=1", "-DPLATFORM=" + platform, "-DARCHS=" + arch, "-DCMAKE_TOOLCHAIN_FILE=" + CMAKE_TOOLCHAIN_FILE]
def param_apple_ios(platform, arch, params=[]):
return params + ["-G","Xcode", "-DDEPLOYMENT_TARGET=11", "-DENABLE_BITCODE=1", "-DPLATFORM=" + platform, "-DARCHS=" + arch, "-DCMAKE_TOOLCHAIN_FILE=" + CMAKE_TOOLCHAIN_FILE]
if(platform == "ios"):
build_arch("ios", "armv7", param_apple("OS", "armv7"))
build_arch("ios", "arm64", param_apple("OS64", "arm64"))
build_arch("ios", "i386", param_apple("SIMULATOR", "i386"))
build_arch("ios", "x86_64", param_apple("SIMULATOR64", "x86_64"))
#build_arch("ios", "armv7", param_apple("OS", "armv7"))
build_arch("ios", "arm64", param_apple_ios("OS64", "arm64"))
#build_arch("ios", "i386", param_apple_ios("SIMULATOR", "i386"))
build_arch("ios", "x86_64", param_apple_ios("SIMULATOR64", "x86_64", ["-DCMAKE_CXX_FLAGS=-std=c++11"]))
else:
build_arch("mac", "mac_arm64", param_apple("MAC_ARM64", "arm64"))
build_arch("mac", "mac_64", param_apple("MAC", "x86_64"))
@ -144,7 +147,7 @@ def make():
#copy include
prefix_dir = current_dir + "/IXWebSocket/build/ios/"
postfix_dir = ""
if base.is_dir(prefix_dir + "armv7/usr"):
if base.is_dir(prefix_dir + "arm64/usr"):
postfix_dir = "/usr"
if base.is_dir(prefix_dir + "armv7" + postfix_dir + "/include"):
@ -157,10 +160,16 @@ def make():
base.cmd("cp", [ "-r", prefix_dir + "x86_64" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
# Create fat lib
base.cmd("lipo", ["IXWebSocket/build/ios/armv7" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/arm64" + postfix_dir + "/lib/libixwebsocket.a",
"IXWebSocket/build/ios/i386" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/x86_64" + postfix_dir + "/lib/libixwebsocket.a",
"-create", "-output",
"IXWebSocket/build/ios/ixwebsocket-universal/lib/libixwebsocket.a"])
if (True):
base.cmd("lipo", ["IXWebSocket/build/ios/arm64" + postfix_dir + "/lib/libixwebsocket.a",
"IXWebSocket/build/ios/x86_64" + postfix_dir + "/lib/libixwebsocket.a",
"-create", "-output",
"IXWebSocket/build/ios/ixwebsocket-universal/lib/libixwebsocket.a"])
else:
base.cmd("lipo", ["IXWebSocket/build/ios/armv7" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/arm64" + postfix_dir + "/lib/libixwebsocket.a",
"IXWebSocket/build/ios/i386" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/x86_64" + postfix_dir + "/lib/libixwebsocket.a",
"-create", "-output",
"IXWebSocket/build/ios/ixwebsocket-universal/lib/libixwebsocket.a"])
elif (-1 != config.option("platform").find("linux")):

View File

@ -5,6 +5,7 @@ sys.path.append('../..')
import config
import base
import os
import platform
import openssl_mobile
def clean():
@ -85,6 +86,20 @@ def make():
base.cmd("make", ["install"])
# TODO: support x86
if (-1 != config.option("platform").find("linux_arm64")) and not base.is_dir("../build/linux_arm64"):
if ("x86_64" != platform.machine()):
base.copy_dir("../build/linux_64", "../build/linux_arm64")
else:
cross_compiler_arm64 = config.option("arm64-toolchain-bin")
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.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("make", ["build_libs", "install"])

View File

@ -0,0 +1,16 @@
#!/usr/bin/env python
import sys
sys.path.append('../..')
import config
import base
import os
import subprocess
def make():
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/socketio"
if not base.is_dir(base_dir + "/socket.io-client-cpp"):
base.cmd_in_dir(base_dir, "git", ["clone", "https://github.com/socketio/socket.io-client-cpp.git"])
base.cmd_in_dir(base_dir + "/socket.io-client-cpp", "git", ["submodule", "init"])
base.cmd_in_dir(base_dir + "/socket.io-client-cpp", "git", ["submodule", "update"])
return

View File

@ -10,13 +10,17 @@ import config
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/socketrocket"
def buildIOS():
# Build for iphone
base.cmd("xcodebuild", ["archive", "-project", current_dir + "/SocketRocket.xcodeproj", "-scheme", "SocketRocket", "-archivePath", current_dir + "/build/SocketRocket-devices.xcarchive", "-sdk", "iphoneos", "ENABLE_BITCODE=NO", "BUILD_LIBRARY_FOR_DISTRIBUTION=YES", "SKIP_INSTALL=NO"])
base.cmd("xcodebuild", ["-sdk", "iphoneos", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release"])
# Build for simulator
base.cmd("xcodebuild", ["archive", "-project", current_dir + "/SocketRocket.xcodeproj", "-scheme", "SocketRocket", "-archivePath", current_dir + "/build/SocketRocket-simulators.xcarchive", "-sdk", "iphonesimulator", "ENABLE_BITCODE=NO", "BUILD_LIBRARY_FOR_DISTRIBUTION=YES", "SKIP_INSTALL=NO"])
base.cmd("xcodebuild", ["-sdk", "iphonesimulator", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release"])
# Package xcframework
base.cmd("xcodebuild", ["-create-xcframework", "-library", current_dir + "/build/SocketRocket-devices.xcarchive/Products/usr/local/lib/libSocketRocket.a", "-library", current_dir + "/build/SocketRocket-simulators.xcarchive/Products/usr/local/lib/libSocketRocket.a", "-output", current_dir + "/build/SocketRocket.xcframework"])
# Remove arm64 for simulator for SDK 14
base.cmd("lipo", ["-remove", "arm64", "-output", "build/Release-iphonesimulator/libSocketRocket.a", "build/Release-iphonesimulator/libSocketRocket.a"])

View File

@ -26,7 +26,7 @@ def clean():
def is_main_platform():
if (config.check_option("platform", "win_64") or config.check_option("platform", "win_32")):
return True
if (config.check_option("platform", "linux_64") or config.check_option("platform", "linux_32")):
if (config.check_option("platform", "linux_64") or config.check_option("platform", "linux_32") or config.check_option("platform", "linux_arm64")):
return True
if config.check_option("platform", "mac_64"):
return True
@ -42,16 +42,13 @@ def is_xp_platform():
return False
def is_use_clang():
gcc_version = 4
gcc_version_str = base.run_command("gcc -dumpfullversion -dumpversion")['stdout']
if (gcc_version_str != ""):
gcc_version = int(gcc_version_str.split(".")[0])
gcc_version = base.get_gcc_version()
is_clang = "false"
if (gcc_version >= 6):
if (gcc_version >= 6000):
is_clang = "true"
print("gcc major version: " + str(gcc_version) + ", use clang:" + is_clang)
print("gcc version: " + str(gcc_version) + ", use clang:" + is_clang)
return is_clang
def make():
@ -74,8 +71,6 @@ def make():
use_v8_89 = False
if (-1 != config.option("config").lower().find("v8_version_89")):
use_v8_89 = True
if ("windows" == base.host_platform()) and (config.option("vs-version") == "2019"):
use_v8_89 = True
if (use_v8_89):
v8_89.make()

View File

@ -15,6 +15,12 @@ def make_args(args, platform, is_64=True, is_debug=False):
else:
args_copy.append("target_cpu=\\\"x86\\\"")
args_copy.append("v8_target_cpu=\\\"x86\\\"")
if (platform == "linux_arm64"):
args_copy = args[:]
args_copy.append("target_cpu=\\\"arm64\\\"")
args_copy.append("v8_target_cpu=\\\"arm64\\\"")
args_copy.append("use_sysroot=true")
if is_debug:
args_copy.append("is_debug=true")
@ -64,6 +70,10 @@ def make():
if not base.is_dir("v8"):
base.cmd("./depot_tools/fetch", ["v8"], True)
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)
base.cmd("gclient", ["sync", "--force"], True)
@ -90,6 +100,11 @@ def make():
base.cmd2("gn", ["gen", "out.gn/linux_32", make_args(gn_args, "linux", False)])
base.cmd("ninja", ["-C", "out.gn/linux_32"])
if config.check_option("platform", "linux_arm64"):
base.cmd("build/linux/sysroot_scripts/install-sysroot.py", ["--arch=arm64"], False)
base.cmd2("gn", ["gen", "out.gn/linux_arm64", make_args(gn_args, "linux_arm64", False)])
base.cmd("ninja", ["-C", "out.gn/linux_arm64"])
if config.check_option("platform", "mac_64"):
base.cmd2("gn", ["gen", "out.gn/mac_64", make_args(gn_args, "mac")])
base.cmd("ninja", ["-C", "out.gn/mac_64"])

View File

@ -36,8 +36,7 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "UnicodeConverter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel_network")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "graphics")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfWriter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfReader")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DjVuFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "XpsFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlFile2")
@ -45,12 +44,16 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "Fb2File")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "EpubFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "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, "x2t")
else:
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "x2t")
if (native_platform == "linux_64"):
base.generate_check_linux_system(git_dir + "/build_tools", root_dir)
# icu
if (0 == platform.find("win")):
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/icudt58.dll")
@ -68,20 +71,16 @@ def make():
if isWindowsXP:
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir, "doctrenderer")
base.copy_file(core_build_dir + "/lib/" + platform_postfix + "/xp/doctrenderer.lib", root_dir + "/doctrenderer.lib")
base.copy_files(core_dir + "/Common/3dParty/v8/v8_xp/" + platform + "/release/icudt*.dll", root_dir + "/")
else:
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "doctrenderer")
if (0 == platform.find("win")):
base.copy_file(core_build_dir + "/lib/" + platform_postfix + "/doctrenderer.lib", root_dir + "/doctrenderer.lib")
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/")
elif (-1 == config.option("config").find("use_javascript_core")):
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/icudtl.dat")
base.copy_v8_files(core_dir, root_dir, platform, isWindowsXP)
# app
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "docbuilder")
base.generate_doctrenderer_config(root_dir + "/DoctRenderer.config", "./", "builder")
base.copy_dir(git_dir + "/DocumentBuilder/empty", root_dir + "/empty")
base.copy_dir(git_dir + "/DocumentBuilder/samples", root_dir + "/samples")
base.copy_dir(git_dir + "/document-templates/new/en-US", root_dir + "/empty")
# js
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", root_dir + "/sdkjs")
@ -96,9 +95,12 @@ def make():
base.replaceInFile(root_dir + "/include/docbuilder.h", "Q_DECL_EXPORT", "BUILDING_DOCBUILDER")
if ("win_64" == platform):
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/x64/Release/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/deploy/win_64/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.net/deploy/win_64/docbuilder.net.dll", root_dir + "/docbuilder.net.dll")
elif ("win_32" == platform):
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/Win32/Release/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.com/deploy/win_32/docbuilder.com.dll", root_dir + "/docbuilder.com.dll")
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.net/deploy/win_32/docbuilder.net.dll", root_dir + "/docbuilder.net.dll")
# correct ios frameworks
if ("ios" == platform):
@ -106,6 +108,7 @@ def make():
if (0 == platform.find("mac")):
base.mac_correct_rpath_x2t(root_dir)
base.mac_correct_rpath_docbuilder(root_dir)
return

View File

@ -33,13 +33,13 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "HtmlRenderer")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "DjVuFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "XpsFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "PdfReader")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "PdfWriter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "PdfFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "HtmlFile2")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "UnicodeConverter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "Fb2File")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "EpubFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "DocxRenderer")
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", archive_dir + "/cmap.bin")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "x2t")
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", archive_dir + "/sdkjs")
@ -49,19 +49,20 @@ def make():
if ("windows" == base.host_platform()):
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*.dll", archive_dir + "/")
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", archive_dir + "/")
else:
base.copy_files(core_dir + "/Common/3dParty/icu/" + platform + "/build/*", archive_dir + "/")
if (-1 == config.option("config").find("use_javascript_core")):
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", archive_dir + "/")
base.copy_v8_files(core_dir, archive_dir, platform)
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, "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")
if base.is_file(archive_dir + "/core.7z"):
base.delete_file(archive_dir + "/core.7z")
base.archive_folder(archive_dir, archive_dir + "/core.7z")
if base.is_file(archive_dir + ".7z"):
base.delete_file(archive_dir + ".7z")
base.archive_folder(archive_dir + "/*", archive_dir + ".7z")
return

View File

@ -47,8 +47,7 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "kernel_network")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "UnicodeConverter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "graphics")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfWriter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfReader")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "DjVuFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "XpsFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "HtmlFile2")
@ -56,16 +55,21 @@ 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")
# 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")
if (0 == platform.find("linux")):
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.so.58", root_dir + "/converter/libicudata.so.58")
@ -78,13 +82,9 @@ def make():
# doctrenderer
if isWindowsXP:
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + "/xp", root_dir + "/converter", "doctrenderer")
base.copy_files(core_dir + "/Common/3dParty/v8/v8_xp/" + platform + "/release/icudt*.dll", root_dir + "/converter/")
else:
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "doctrenderer")
if (0 == platform.find("win")):
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", root_dir + "/converter/")
elif (-1 == config.option("config").find("use_javascript_core")):
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/converter/icudtl.dat")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "doctrenderer")
base.copy_v8_files(core_dir, root_dir + "/converter", platform, isWindowsXP)
base.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop")
base.copy_dir(git_dir + "/document-templates/new", root_dir + "/converter/empty")
@ -157,13 +157,50 @@ def make():
elif (0 == platform.find("linux")):
base.copy_file(git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors", root_dir + "/DesktopEditors")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "videoplayer")
if ("" != base.get_env("VIDEO_PLAYER_VLC_DIR")):
vlc_dir = git_dir + "/desktop-sdk/ChromiumBasedEditors/videoplayerlib/vlc/"
if (0 == platform.find("win")):
base.copy_file(vlc_dir + platform + "/bin/libvlc.dll", root_dir + "/libvlc.dll")
base.copy_file(vlc_dir + platform + "/bin/libvlccore.dll", root_dir + "/libvlccore.dll")
base.copy_file(vlc_dir + platform + "/bin/VLCQtCore.dll", root_dir + "/VLCQtCore.dll")
base.copy_file(vlc_dir + platform + "/bin/VLCQtWidgets.dll", root_dir + "/VLCQtWidgets.dll")
else:
base.copy_file(vlc_dir + platform + "/bin/libvlc.so", root_dir + "/libvlc.so")
base.copy_file(vlc_dir + platform + "/bin/libvlc.so.5", root_dir + "/libvlc.so.5")
base.copy_file(vlc_dir + platform + "/bin/libvlccore.so", root_dir + "/libvlccore.so")
base.copy_file(vlc_dir + platform + "/bin/libvlccore.so.8", root_dir + "/libvlccore.so.8")
base.copy_file(vlc_dir + platform + "/bin/VLCQtCore.so", root_dir + "/VLCQtCore.so")
base.copy_file(vlc_dir + platform + "/bin/VLCQtWidgets.so", root_dir + "/VLCQtWidgets.so")
if isWindowsXP:
base.copy_lib(core_build_dir + "/lib/" + platform + "/mediaplayer/xp", root_dir, "videoplayer")
else:
base.copy_lib(core_build_dir + "/lib/" + platform + "/mediaplayer", root_dir, "videoplayer")
base.copy_dir(vlc_dir + platform + "/bin/plugins", root_dir + "/plugins")
else:
base.copy_lib(core_build_dir + "/lib/" + platform_postfix + ("/xp" if isWindowsXP else ""), root_dir, "videoplayer")
base.create_dir(root_dir + "/editors")
base.copy_dir(base_dir + "/js/" + branding + "/desktop/sdkjs", root_dir + "/editors/sdkjs")
base.copy_dir(base_dir + "/js/" + branding + "/desktop/web-apps", root_dir + "/editors/web-apps")
base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/resources/local", root_dir + "/editors/sdkjs/common/Images/local")
# desktopeditors-help
root_help_dir = root_dir + "-help"
if (base.is_dir(root_help_dir)):
base.delete_dir(root_help_dir)
for i in ["documenteditor", "presentationeditor", "spreadsheeteditor"]:
base.copy_dir(
base_dir + "/js/" + branding + "/desktop/web-apps/apps/%s/main/resources/help" % i,
root_help_dir + "/editors/web-apps/apps/%s/main/resources/help" % i)
if ("1" != config.option("preinstalled-help") and not isWindowsXP):
# remove help from install until web-apps containes help
base.delete_dir(root_dir + "/editors/web-apps/apps/documenteditor/main/resources/help")
base.delete_dir(root_dir + "/editors/web-apps/apps/presentationeditor/main/resources/help")
base.delete_dir(root_dir + "/editors/web-apps/apps/spreadsheeteditor/main/resources/help")
base.create_dir(root_dir + "/editors/sdkjs-plugins")
base.copy_sdkjs_plugins(root_dir + "/editors/sdkjs-plugins", True, True)
# remove some default plugins
@ -197,7 +234,6 @@ def make():
base.delete_file(root_dir + "/converter/icudtl.dat")
if (0 == platform.find("win")):
base.copy_lib(git_dir + "/desktop-apps/win-linux/3dparty/WinSparkle/" + platform, root_dir, "WinSparkle")
base.delete_file(root_dir + "/cef_sandbox.lib")
base.delete_file(root_dir + "/libcef.lib")
@ -226,6 +262,7 @@ def make():
base.cmd_exe(root_dir + "/converter/allthemesgen", ["--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\""] + themes_params)
base.delete_file(root_dir + "/converter/AllFonts.js")
base.delete_file(root_dir + "/converter/font_selection.bin")
base.delete_file(root_dir + "/converter/fonts.log")
base.delete_exe(root_dir + "/converter/allfontsgen")
base.delete_exe(root_dir + "/converter/allthemesgen")

View File

@ -42,8 +42,7 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel_network")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "UnicodeConverter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "graphics")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfWriter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfReader")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DjVuFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "XpsFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "HtmlFile2")
@ -52,18 +51,13 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "Fb2File")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "EpubFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "DocxRenderer")
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", root_dir + "/cmap.bin")
if (0 == platform.find("win") or 0 == platform.find("linux") or 0 == platform.find("mac")):
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "x2t")
else:
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "x2t")
if ("ios" == platform) and config.check_option("config", "bundle_dylibs") and config.check_option("config", "simulator"):
exclude_arch(root_dir, ["kernel", "kernel_network", "UnicodeConverter", "graphics", "PdfWriter",
"PdfReader", "DjVuFile", "XpsFile", "HtmlFile2", "HtmlRenderer", "doctrenderer",
"Fb2File", "EpubFile", "x2t"])
# icu
if (0 == platform.find("win")):
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/icudt58.dll", root_dir + "/icudt58.dll")

View File

@ -75,8 +75,7 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "kernel_network")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "UnicodeConverter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "graphics")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "PdfWriter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "PdfReader")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "PdfFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "DjVuFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "XpsFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "HtmlFile2")
@ -85,8 +84,12 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "Fb2File")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "EpubFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "DocxRenderer")
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)
base.generate_doctrenderer_config(converter_dir + "/DoctRenderer.config", "../../../", "server")
# icu
@ -101,20 +104,20 @@ def make():
if (0 == platform.find("mac")):
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicudata.58.dylib", converter_dir + "/libicudata.58.dylib")
base.copy_file(core_dir + "/Common/3dParty/icu/" + platform + "/build/libicuuc.58.dylib", converter_dir + "/libicuuc.58.dylib")
if (0 == platform.find("win")):
base.copy_files(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/release/icudt*.dat", converter_dir + "/")
elif (-1 == config.option("config").find("use_javascript_core")):
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", converter_dir + "/icudtl.dat")
base.copy_v8_files(core_dir, converter_dir, platform)
# builder
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, converter_dir, "docbuilder")
base.copy_dir(git_dir + "/DocumentBuilder/empty", converter_dir + "/empty")
base.copy_dir(git_dir + "/document-templates/new/en-US", converter_dir + "/empty")
# js
js_dir = root_dir
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", js_dir + "/sdkjs")
base.copy_dir(base_dir + "/js/" + branding + "/builder/web-apps", js_dir + "/web-apps")
# add embed worker code
base.cmd_in_dir(git_dir + "/sdkjs/common/embed", "python", ["make.py", js_dir + "/web-apps/apps/api/documents/api.js"])
# plugins
base.create_dir(js_dir + "/sdkjs-plugins")
@ -125,6 +128,8 @@ def make():
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", js_dir + "/sdkjs-plugins/v1/plugins-ui.js")
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", js_dir + "/sdkjs-plugins/v1/plugins.css")
base.support_old_versions_plugins(js_dir + "/sdkjs-plugins")
base.clone_marketplace_plugin(root_dir + "/sdkjs-plugins")
# tools
tools_dir = root_dir + "/server/tools"
@ -162,8 +167,8 @@ def make():
#document-templates
document_templates_files = server_dir + '/../document-templates'
document_templates = build_server_dir + '/../document-templates'
base.create_dir(document_templates)
base.copy_dir(document_templates_files, document_templates)
base.copy_dir(document_templates_files + '/new', document_templates + '/new')
base.copy_dir(document_templates_files + '/sample', document_templates + '/sample')
#license
license_file1 = server_dir + '/LICENSE.txt'

View File

@ -62,7 +62,12 @@ def make():
print("-----------------------------------------------------------")
base.generate_doctrenderer_config("./DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/")
if not base.is_dir(git_dir + "/sdkjs-plugins"):
base.create_dir(git_dir + "/sdkjs-plugins")
base.support_old_versions_plugins(git_dir + "/sdkjs-plugins")
base.clone_marketplace_plugin(git_dir + "/sdkjs-plugins")
if not base.is_dir(git_dir + "/fonts"):
base.create_dir(git_dir + "/fonts")
@ -132,12 +137,17 @@ def make():
#site url
example_config = {}
example_config["port"] = 80
if (base.host_platform() == "linux"):
example_config["port"] = 3000
else:
example_config["port"] = 80
example_config["siteUrl"] = "http://" + config.option("siteUrl") + ":8000/"
example_config["apiUrl"] = "web-apps/apps/api/documents/api.js"
example_config["preloaderUrl"] = "web-apps/apps/api/documents/cache-scripts.html"
json_file = git_dir + "/document-server-integration/web/documentserver-example/nodejs/config/local-development-" + base.host_platform() + ".json"
base.writeFile(json_file, json.dumps({"server": example_config}, indent=2))
json_dir = git_dir + "/document-server-integration/web/documentserver-example/nodejs/config/"
json_file = json_dir + "/local-development-" + base.host_platform() + ".json"
if base.is_exist(json_dir):
base.writeFile(json_file, json.dumps({"server": example_config}, indent=2))
os.chdir(old_cur)
return

View File

@ -66,6 +66,28 @@ class CDependencies:
res += ['--remove-path', item]
return res
def check__docker_dependencies():
if (host_platform == 'windows' and not check_vc_components()):
return False
if (host_platform == 'mac'):
return True
checksResult = CDependencies()
checksResult.append(check_nodejs())
checksResult.append(check_7z())
if (len(checksResult.install) > 0):
install_args = ['install.py']
install_args += checksResult.get_uninstall()
install_args += checksResult.get_removepath()
install_args += checksResult.get_install()
base_dir = base.get_script_dir(__file__)
install_args[0] = './scripts/develop/' + install_args[0]
if (host_platform == 'windows'):
code = libwindows.sudo(unicode(sys.executable), install_args)
elif (host_platform == 'linux'):
get_updates()
base.cmd_in_dir(base_dir + "/../../", 'python', install_args, False)
def check_dependencies():
if (host_platform == 'windows' and not check_vc_components()):
return False
@ -88,7 +110,6 @@ def check_dependencies():
if (host_platform == 'windows'):
checksResult.append(check_nodejs())
checksResult.append(check_buildTools())
if (config.option("sql-type") == 'mysql' and host_platform == 'windows'):
checksResult.append(check_mysqlServer())
@ -169,7 +190,7 @@ def check_nodejs():
nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:])
nodejs_cur_version_minor = int(nodejs_version.split('.')[1])
print('Installed Node.js version: ' + nodejs_version[1:])
nodejs_min_version = '10.20'
nodejs_min_version = '14.14'
nodejs_min_version_minor = 0
major_minor_min_version = nodejs_min_version.split('.')
nodejs_min_version_major = int(major_minor_min_version[0])
@ -183,7 +204,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 10.20 to 14.x')
print('Installed Node.js version must be 14.14 to 14.x')
isNeedReinstall = True
elif (nodejs_min_version_major == nodejs_cur_version_major):
if (nodejs_min_version_minor > nodejs_cur_version_minor):
@ -193,7 +214,7 @@ def check_nodejs():
isNeedReinstall = True
if (True == isNeedReinstall):
print('Installed Node.js version must be 10.20 to 14.x')
print('Installed Node.js version must be 14.14 to 14.x')
if (host_platform == 'windows'):
dependence.append_uninstall('Node.js')
dependence.append_install('Node.js')
@ -372,10 +393,11 @@ def check_npm():
def check_vc_components():
base.print_info('Check Visual C++ components')
result = True
if (len(get_programUninstalls('Microsoft Visual C++ 2015-2019 Redistributable (x64)')) == 0):
print('Microsoft Visual C++ 2015-2019 Redistributable (x64) not found')
if (len(get_programUninstalls('Microsoft Visual C++ 2015-')) == 0):
print('Microsoft Visual C++ 2015-20** Redistributable (x64) not found')
result = installProgram('VC2019x64') and result
print('Installed Visual C++ components is valid')
return result
@ -908,11 +930,11 @@ def install_nodejs():
downloads_list = {
'Windows': {
'Git': 'https://github.com/git-for-windows/git/releases/download/v2.29.0.windows.1/Git-2.29.0-64-bit.exe',
'Node.js': 'https://nodejs.org/download/release/v14.15.1/node-v14.15.1-x64.msi',
'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',
'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/16/release/vc_redist.x64.exe',
'VC2019x64': 'https://aka.ms/vs/17/release/vc_redist.x64.exe',
'MySQLInstaller': 'https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-8.0.21.0.msi',
'BuildTools': 'https://download.visualstudio.microsoft.com/download/pr/11503713/e64d79b40219aea618ce2fe10ebd5f0d/vs_BuildTools.exe',
'Redis': 'https://github.com/tporadowski/redis/releases/download/v5.0.9/Redis-x64-5.0.9.msi',

View File

@ -10,11 +10,15 @@ import config_server as develop_config_server
base_dir = base.get_script_dir(__file__)
def make():
if ("1" != config.option("develop")):
return
if not dependence.check_dependencies():
exit(1)
def build_docker_server():
dependence.check__docker_dependencies()
build_develop_server()
def build_docker_sdk_web_apps(dir):
dependence.check__docker_dependencies()
build_js.build_js_develop(dir)
def build_develop_server():
build_server.build_server_develop()
build_js.build_js_develop(base_dir + "/../../..")
develop_config_server.make()
@ -22,5 +26,12 @@ def make():
branding_develop_script_dir = base_dir + "/../../../" + config.option("branding") + "/build_tools/scripts"
if base.is_file(branding_develop_script_dir + "/develop.py"):
base.cmd_in_dir(branding_develop_script_dir, "python", ["develop.py"], True)
def make():
if ("1" != config.option("develop")):
return
if not dependence.check_dependencies():
exit(1)
build_develop_server()
exit(0)

View File

@ -3,25 +3,30 @@
import sys
sys.path.append('../')
import optparse
import argparse
import config
import base
import os
arguments = sys.argv[1:]
parser = argparse.ArgumentParser(description="Print repositories list.")
parser.add_argument('-P', '--platform', type=str, dest='platform',
action='store', default="native", help="Defines platform")
parser.add_argument('-M', '--module', type=str, dest='module',
action='store', default="core desktop builder server",
help="Defines modules")
parser.add_argument('-B', '--branding', type=str, dest='branding',
action='store', help="Defines branding path")
args = parser.parse_args()
parser = optparse.OptionParser()
parser.add_option("--module", action="store", type="string", dest="module", default="core desktop builder server", help="defines modules")
parser.add_option("--platform", action="store", type="string", dest="platform", default="native", help="defines platform")
parser.add_option("--branding", action="store", type="string", dest="branding", default="onlyoffice", help="provides branding path")
config_args = [
'configure.py',
'--platform', args.platform,
'--module', args.module
]
if args.branding != None:
config_args += ['--branding', args.branding]
(options, args) = parser.parse_args(arguments)
configOptions = vars(options)
base.cmd_in_dir('../../', 'python',['configure.py',
'--module', configOptions["module"],
'--platform', configOptions["platform"],
'--branding', configOptions["branding"]])
base.cmd_in_dir('../../', 'python', config_args)
# parse configuration
config.parse()
@ -29,9 +34,6 @@ config.parse_defaults()
repositories = base.get_repositories()
# Add other plugins
repositories.update(base.get_plugins('autocomplete, easybib, wordpress'))
# Add other repositories
if config.check_option("module", "builder"):
repositories['document-builder-package'] = [False, False]

View File

@ -39,8 +39,6 @@ config.parse_defaults()
repositories = base.get_repositories()
# Add other plugins
repositories.update(base.get_plugins('autocomplete, easybib, glavred, wordpress'))
# Add other repositories
repositories['core-ext'] = [True, False]

View File

@ -6,6 +6,9 @@ import os
import base
import dependence
import traceback
import develop
base_dir = base.get_script_dir(__file__)
def install_module(path):
base.print_info('Install: ' + path)
@ -41,56 +44,94 @@ def start_linux_services():
os.system('sudo service rabbitmq-server restart')
def run_integration_example():
base.cmd_in_dir('../../../document-server-integration/web/documentserver-example/nodejs', 'python', ['run-develop.py'])
if base.is_exist(base_dir + '/../../../document-server-integration/web/documentserver-example/nodejs'):
base.cmd_in_dir(base_dir + '/../../../document-server-integration/web/documentserver-example/nodejs', 'python', ['run-develop.py'])
def start_linux_services():
base.print_info('Restart MySQL Server')
def make_start():
base.configure_common_apps()
platform = base.host_platform()
if ("windows" == platform):
dependence.check_pythonPath()
dependence.check_gitPath()
restart_win_rabbit()
elif ("mac" == platform):
start_mac_services()
elif ("linux" == platform):
start_linux_services()
def make_configure(args):
platform = base.host_platform()
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']
base.print_info('Build modules')
if ("linux" == platform):
base.cmd_in_dir(base_dir + '/../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0'] + args)
else:
base.cmd_in_dir(base_dir + '/../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0', '--sql-type', 'mysql', '--db-port', '3306', '--db-user', 'root', '--db-pass', 'onlyoffice'] + args)
base.cmd_in_dir(base_dir + '/../../', 'python', ['make.py'])
def make_install():
platform = base.host_platform()
run_integration_example()
base.create_dir(base_dir + '/../../../server/App_Data')
install_module(base_dir + '/../../../server/DocService')
install_module(base_dir + '/../../../server/Common')
install_module(base_dir + '/../../../server/FileConverter')
def make_run():
platform = base.host_platform()
base.set_env('NODE_ENV', 'development-' + platform)
base.set_env('NODE_CONFIG_DIR', '../Common/config')
if ("mac" == platform):
base.set_env('DYLD_LIBRARY_PATH', '../FileConverter/bin/')
elif ("linux" == platform):
base.set_env('LD_LIBRARY_PATH', '../FileConverter/bin/')
run_module(base_dir + '/../../../server/DocService', ['sources/server.js'])
#run_module(base_dir + '/../../../server/DocService', ['sources/gc.js'])
run_module(base_dir + '/../../../server/FileConverter', ['sources/convertermaster.js'])
#run_module(base_dir + '/../../../server/SpellChecker', ['sources/server.js'])
def run_docker_server(args = []):
try:
make_start()
develop.build_docker_server()
make_install()
except SystemExit:
input("Ignoring SystemExit. Press Enter to continue...")
exit(0)
except KeyboardInterrupt:
pass
except:
input("Unexpected error. " + traceback.format_exc() + "Press Enter to continue...")
def run_docker_sdk_web_apps(dir):
try:
develop.build_docker_sdk_web_apps(dir)
except SystemExit:
input("Ignoring SystemExit. Press Enter to continue...")
exit(0)
except KeyboardInterrupt:
pass
except:
input("Unexpected error. " + traceback.format_exc() + "Press Enter to continue...")
def make(args = []):
try:
base.configure_common_apps()
platform = base.host_platform()
if ("windows" == platform):
dependence.check_pythonPath()
dependence.check_gitPath()
restart_win_rabbit()
elif ("mac" == platform):
start_mac_services()
elif ("linux" == platform):
start_linux_services()
make_start()
make_configure(args)
make_install()
make_run()
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']
base.print_info('Build modules')
if ("linux" == platform):
base.cmd_in_dir('../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0'] + args)
else:
base.cmd_in_dir('../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0', '--sql-type', 'mysql', '--db-port', '3306', '--db-user', 'root', '--db-pass', 'onlyoffice'] + args)
base.cmd_in_dir('../../', 'python', ['make.py'])
run_integration_example()
base.create_dir('../../../server/App_Data')
install_module('../../../server/DocService')
install_module('../../../server/Common')
install_module('../../../server/FileConverter')
base.set_env('NODE_ENV', 'development-' + platform)
base.set_env('NODE_CONFIG_DIR', '../Common/config')
if ("mac" == platform):
base.set_env('DYLD_LIBRARY_PATH', '../FileConverter/bin/')
elif ("linux" == platform):
base.set_env('LD_LIBRARY_PATH', '../FileConverter/bin/')
run_module('../../../server/DocService', ['sources/server.js'])
# run_module('../../../server/DocService', ['sources/gc.js'])
run_module('../../../server/FileConverter', ['sources/convertermaster.js'])
# run_module('../../../server/SpellChecker', ['sources/server.js'])
except SystemExit:
input("Ignoring SystemExit. Press Enter to continue...")
exit(0)

View File

@ -0,0 +1,38 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import package_utils as utils
onlyoffice = True
company_name = "ONLYOFFICE"
company_name_l = company_name.lower()
publisher_name = "Ascensio System SIA"
cert_name = "Ascensio System SIA"
s3_bucket = "repo-doc-onlyoffice-com"
s3_region = "eu-west-1"
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_vcredist_list = ["2022"]
desktop_update_changes_list = {
"en": "changes",
"ru": "changes_ru"
}
if utils.is_macos():
desktop_package_name = "ONLYOFFICE"
desktop_build_dir = "desktop-apps/macos"
desktop_branding_dir = "desktop-apps/macos"
desktop_updates_dir = "build/update"
desktop_changes_dir = "ONLYOFFICE/update/updates/ONLYOFFICE/changes"
sparkle_base_url = "https://download.onlyoffice.com/install/desktop/editors/mac"
builder_product_name = "Document Builder"
if utils.is_linux():
desktop_make_targets = ["deb", "rpm", "suse-rpm", "tar"]
builder_make_targets = ["deb", "rpm"] # tar
server_make_targets = ["deb", "rpm", "tar"]

172
scripts/package_builder.py Normal file
View File

@ -0,0 +1,172 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import package_utils as utils
import package_common as common
import package_branding as branding
def make():
utils.log_h1("BUILDER")
if utils.is_windows():
make_windows()
elif utils.is_linux():
make_linux()
else:
utils.log("Unsupported host OS")
return
def aws_s3_upload(files, key, ptype=None):
if not files:
return False
ret = True
key = "builder/" + key
for file in files:
args = ["aws"]
if hasattr(branding, "s3_endpoint_url"):
args += ["--endpoint-url=" + branding.s3_endpoint_url]
args += [
"s3", "cp", "--no-progress", "--acl", "public-read",
file, "s3://" + branding.s3_bucket + "/" + key
]
if common.os_family == "windows":
upload = utils.cmd(*args, verbose=True)
else:
upload = utils.sh(" ".join(args), verbose=True)
ret &= upload
if upload and ptype is not None:
full_key = key
if full_key.endswith("/"): full_key += utils.get_basename(file)
utils.add_deploy_data(
"builder", ptype, file, full_key,
branding.s3_bucket, branding.s3_region
)
return ret
def make_windows():
global inno_file, zip_file, suffix, key_prefix
utils.set_cwd("document-builder-package")
prefix = common.platforms[common.platform]["prefix"]
company = branding.company_name.lower()
product = branding.builder_product_name.replace(" ","").lower()
source_dir = "..\\build_tools\\out\\%s\\%s\\%s" % (prefix, 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"
}[common.platform]
zip_file = "%s_%s_%s.zip" % (package_name, package_version, suffix)
inno_file = "%s_%s_%s.exe" % (package_name, package_version, suffix)
if common.clean:
utils.log_h2("builder clean")
utils.delete_dir("build")
utils.log_h2("copy arifacts")
utils.create_dir("build\\app")
utils.copy_dir_content(source_dir, "build\\app\\")
make_zip()
make_inno()
utils.set_cwd(common.workspace_dir)
return
def make_zip():
utils.log_h2("builder zip build")
utils.log_h3(zip_file)
ret = utils.cmd("7z", "a", "-y", zip_file, ".\\app\\*",
chdir="build", creates="build\\" + zip_file, verbose=True)
utils.set_summary("builder zip build", ret)
if common.deploy and ret:
utils.log_h2("builder zip deploy")
ret = aws_s3_upload(
["build\\" + zip_file], "win/generic/%s/" % common.channel, "Portable"
)
utils.set_summary("builder zip deploy", ret)
return
def make_inno():
utils.log_h2("builder inno build")
utils.log_h3(inno_file)
args = [
"-Arch " + suffix,
"-Version " + common.version,
"-Build " + common.build
]
if not branding.onlyoffice:
args.append("-Branding '..\\..\\%s\\document-builder-package\\exe'" % common.branding)
if common.sign:
args.append("-Sign")
args.append("-CertName '%s'" % branding.cert_name)
ret = utils.ps1(
".\\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"
)
utils.set_summary("builder inno deploy", ret)
return
def make_linux():
utils.set_cwd("document-builder-package")
utils.log_h2("builder build")
make_args = branding.builder_make_targets
if common.platform == "linux_aarch64":
make_args += ["-e", "UNAME_M=aarch64"]
if not branding.onlyoffice:
make_args += ["-e", "BRANDING_DIR=../" + common.branding + "/document-builder-package"]
ret = utils.sh("make clean && make " + " ".join(make_args), verbose=True)
utils.set_summary("builder build", ret)
rpm_arch = "x86_64"
if common.platform == "linux_aarch64": rpm_arch = "aarch64"
if common.deploy:
utils.log_h2("builder deploy")
if ret:
if "tar" in branding.builder_make_targets:
utils.log_h2("builder tar deploy")
ret = aws_s3_upload(
utils.glob_path("tar/*.tar.gz"),
"linux/generic/%s/" % common.channel,
"Portable"
)
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"
)
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"
)
utils.set_summary("builder rpm deploy", ret)
else:
if "tar" in branding.builder_make_targets:
utils.set_summary("builder tar deploy", False)
if "deb" in branding.builder_make_targets:
utils.set_summary("builder deb deploy", False)
if "rpm" in branding.builder_make_targets:
utils.set_summary("builder rpm deploy", False)
utils.set_cwd(common.workspace_dir)
return

49
scripts/package_common.py Normal file
View File

@ -0,0 +1,49 @@
#!/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" }
}
out_dir = "build_tools/out"
tsa_server = "http://timestamp.digicert.com"
vcredist_links = {
"2022": {
"x64": {
"url": "https://aka.ms/vs/17/release/vc_redist.x64.exe",
"md5": "703bd677778f2a1ba1eb4338bac3b868"
},
"x86": {
"url": "https://aka.ms/vs/17/release/vc_redist.x86.exe",
"md5": "732d0ac9cd31b8136f1c8e72efec1636"
}
},
"2015": {
"x64": {
"url": "https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe",
"md5": "27b141aacc2777a82bb3fa9f6e5e5c1c"
},
"x86": {
"url": "https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe",
"md5": "1a15e6606bac9647e7ad3caa543377cf"
}
},
"2013": {
"x64": {
"url": "https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe",
"md5": "96b61b8e069832e6b809f24ea74567ba"
},
"x86": {
"url": "https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe",
"md5": "0fc525b6b7b96a87523daa7a0013c69d"
}
}
}

59
scripts/package_core.py Normal file
View File

@ -0,0 +1,59 @@
#!/usr/bin/env python
import package_utils as utils
import package_common as common
import package_branding as branding
def make():
utils.log_h1("CORE")
if not (utils.is_windows() or utils.is_macos() or utils.is_linux()):
utils.log("Unsupported host OS")
return
if common.deploy:
make_core()
return
def make_core():
prefix = common.platforms[common.platform]["prefix"]
company = branding.company_name.lower()
repos = {
"windows_x64": { "repo": "windows", "arch": "x64", "version": common.version + "." + common.build },
"windows_x86": { "repo": "windows", "arch": "x86", "version": common.version + "." + common.build },
"darwin_x86_64": { "repo": "mac", "arch": "x64", "version": common.version + "-" + common.build },
"darwin_arm64": { "repo": "mac", "arch": "arm", "version": common.version + "-" + common.build },
"linux_x86_64": { "repo": "linux", "arch": "x64", "version": common.version + "-" + common.build },
}
repo = repos[common.platform]
branch = utils.get_env("BRANCH_NAME")
core_7z = utils.get_path("build_tools/out/%s/%s/core.7z" % (prefix, company))
dest_version = "%s/core/%s/%s/%s/" % (repo["repo"], branch, repo["version"], repo["arch"])
dest_latest = "%s/core/%s/%s/%s/" % (repo["repo"], branch, "latest", repo["arch"])
if branch is None:
utils.log_err("BRANCH_NAME variable is undefined")
utils.set_summary("core deploy", False)
return
if not utils.is_file(core_7z):
utils.log_err("core.7z does not exist")
utils.set_summary("core deploy", False)
return
utils.log_h2("core deploy")
args = ["aws", "s3", "cp", "--acl", "public-read", "--no-progress",
core_7z, "s3://" + branding.s3_bucket + "/" + dest_version + "core.7z"]
if common.os_family == "windows":
ret = utils.cmd(*args, verbose=True)
else:
ret = utils.sh(" ".join(args), verbose=True)
if ret:
utils.add_deploy_data("core", "Archive", core_7z, dest_version + "core.7z", branding.s3_bucket, branding.s3_region)
args = ["aws", "s3", "sync", "--delete",
"--acl", "public-read", "--no-progress",
"s3://" + branding.s3_bucket + "/" + dest_version,
"s3://" + branding.s3_bucket + "/" + dest_latest]
if common.os_family == "windows":
ret &= utils.cmd(*args, verbose=True)
else:
ret &= utils.sh(" ".join(args), verbose=True)
utils.set_summary("core deploy", ret)
return

662
scripts/package_desktop.py Normal file
View File

@ -0,0 +1,662 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import package_utils as utils
import package_common as common
import package_branding as branding
def make():
utils.log_h1("DESKTOP")
if utils.is_windows():
make_windows()
elif utils.is_macos():
make_macos()
elif utils.is_linux():
make_linux()
else:
utils.log("Unsupported host OS")
return
def aws_s3_upload(files, key, ptype=None):
if not files:
return False
ret = True
key = "desktop/" + key
for file in files:
args = ["aws"]
if hasattr(branding, "s3_endpoint_url"):
args += ["--endpoint-url=" + branding.s3_endpoint_url]
args += [
"s3", "cp", "--no-progress", "--acl", "public-read",
file, "s3://" + branding.s3_bucket + "/" + key
]
if common.os_family == "windows":
upload = utils.cmd(*args, verbose=True)
else:
upload = utils.sh(" ".join(args), verbose=True)
ret &= upload
if upload and ptype is not None:
full_key = key
if full_key.endswith("/"): full_key += utils.get_basename(file)
utils.add_deploy_data(
"desktop", ptype, file, full_key,
branding.s3_bucket, branding.s3_region
)
return ret
#
# Windows
#
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
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.clean:
utils.log_h2("desktop clean")
# utils.delete_dir("data\\vcredist")
utils.delete_dir("DesktopEditors-cache")
utils.delete_files("*.exe")
utils.delete_files("*.msi")
utils.delete_files("*.aic")
utils.delete_files("*.tmp")
utils.delete_files("*.zip")
utils.delete_files("update\\*.exe")
utils.delete_files("update\\*.xml")
utils.delete_files("update\\*.html")
make_zip()
vcdl = True
vcdl &= download_vcredist("2013")
vcdl &= download_vcredist("2022")
if not vcdl:
utils.set_summary("desktop inno build", False)
# utils.set_summary("desktop inno help 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()
if common.platform in ["windows_x64", "windows_x86"]:
make_advinst()
utils.set_cwd(common.workspace_dir)
return
def make_zip():
utils.log_h2("desktop zip build")
ret = utils.cmd(
"7z", "a", "-y", zip_file, source_dir + "\\*",
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"
)
utils.set_summary("desktop zip deploy", ret)
return
def download_vcredist(year):
utils.log_h2("vcredist " + year + " download")
arch = arch_list[common.platform]
link = common.vcredist_links[year][arch]["url"]
md5 = common.vcredist_links[year][arch]["md5"]
vcredist_file = "data\\vcredist\\vcredist_%s_%s.exe" % (year, arch)
utils.log_h2(vcredist_file)
utils.create_dir(utils.get_dirname(vcredist_file))
ret = utils.download_file(link, vcredist_file, md5, verbose=True)
utils.set_summary("vcredist " + year + " download", ret)
return ret
def make_inno():
global iscc_args
utils.log_h2("desktop inno build")
utils.log_h3(inno_file)
iscc_args = [
"/Qp",
"/DsAppVersion=" + package_version,
"/DDEPLOY_PATH=" + source_dir,
"/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"]:
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" + \
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:
utils.log_h2("desktop inno deploy")
ret = aws_s3_upload(
[inno_file],
"win/inno/%s/%s/" % (common.version, common.build),
"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)
args = [
"iscc",
"/Qp",
"/DsAppVersion=" + package_version,
"/DDEPLOY_PATH=" + source_help_dir,
"/D_ARCH=" + inno_arch_list[common.platform]
]
if branding.onlyoffice:
args.append("/D_ONLYOFFICE=1")
else:
args.append("/DsBrandingFolder=" + \
utils.get_abspath(common.workspace_dir + "\\" + common.branding + "\\desktop-apps"))
if common.sign:
args.append("/DENABLE_SIGNING=1")
args.append("/Sbyparam=signtool.exe sign /v /n $q" + \
branding.cert_name + "$q /t " + common.tsa_server + " $f")
args.append("help.iss")
ret = utils.cmd(*args, creates=inno_help_file, verbose=True)
utils.set_summary("desktop inno help build", ret)
if common.deploy and ret:
utils.log_h2("desktop inno help deploy")
ret = aws_s3_upload(
[inno_help_file],
"win/inno/%s/%s/" % (common.version, common.build),
"Installer"
)
utils.set_summary("desktop inno help deploy", ret)
return
def make_inno_update():
utils.log_h2("desktop inno update build")
utils.log_h2(inno_update_file)
args = ["iscc"] + iscc_args + ["/DTARGET_NAME=" + inno_file, "update_common.iss"]
ret = utils.cmd(*args, creates=inno_update_file, verbose=True)
utils.set_summary("desktop inno update build", ret)
if common.deploy and ret:
utils.log_h2("desktop inno update deploy")
ret = aws_s3_upload(
[inno_update_file],
"win/inno/%s/%s/" % (common.version, common.build),
"WinSparkle"
)
utils.set_summary("desktop inno update deploy", ret)
return
def make_winsparkle_files():
utils.log_h2("desktop winsparkle 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
]
appcast = "update/appcast.xml"
utils.log_h3(appcast)
args = ["env", "LANG=en_US.UTF-8", "awk", "-v", "Prod=1"] + \
awk_args + ["-f", "update/appcast.xml.awk"]
appcast_result = utils.cmd_output(*args, verbose=True)
utils.write_file(appcast, appcast_result)
appcast_test = "update/appcast-test.xml"
utils.log_h3(appcast_test)
args = ["env", "LANG=en_US.UTF-8", "awk"] + \
awk_args + ["-f", "update/appcast.xml.awk"]
appcast_result = utils.cmd_output(*args, verbose=True)
utils.write_file(appcast_test, appcast_result)
if branding.onlyoffice:
changes_dir = "update/changes/" + common.version
else:
changes_dir = "../../../../" + common.branding + \
"/desktop-apps/win-linux/package/windows/update/changes/" + common.version
for lang, base in branding.desktop_update_changes_list.items():
changes = "update/%s.html" % base
if lang == "en": encoding = "en_US.UTF-8"
elif lang == "ru": encoding = "ru_RU.UTF-8"
utils.log_h3(changes)
changes_file = "%s/%s.html" % (changes_dir, lang)
args = ["env", "LANG=" + encoding, "awk"] + awk_args + \
["-f", "update/changes.html.awk", changes_file]
if utils.is_exist(changes_file):
changes_result = utils.cmd_output(*args, verbose=True)
utils.write_file(changes, changes_result)
else:
utils.log("! file not exist: " + changes_file)
if common.deploy:
utils.log_h2("desktop winsparkle files deploy")
ret = aws_s3_upload(
utils.glob_path("update/*.xml") + utils.glob_path("update/*.html"),
"win/inno/%s/%s/" % (common.version, common.build),
"WinSparkle"
)
utils.set_summary("desktop winsparkle files deploy", ret)
return
def make_advinst():
utils.log_h2("desktop advinst build")
utils.log_h3(advinst_file)
arch = arch_list[common.platform]
if not branding.onlyoffice:
branding_path = common.workspace_dir + "\\" + common.branding
utils.copy_dir_content(
branding_path + "\\desktop-apps\\win-linux\\package\\windows\\data", "data", ".bmp")
utils.copy_dir_content(
branding_path + "\\desktop-apps\\win-linux\\package\\windows\\data", "data", ".png")
utils.copy_dir_content(
branding_path + "\\desktop-apps\\win-linux\\extras\\projicons\\res",
"..\\..\\extras\\projicons\\res", ".ico")
utils.copy_file(
branding_path + "\\desktop-apps\\win-linux\\package\\windows\\dictionary.ail",
"dictionary.ail")
utils.copy_file(
branding_path + "\\desktop-apps\\common\\package\\license\\eula_" + common.branding + ".rtf",
"..\\..\\..\\common\\package\\license\\agpl-3.0.rtf")
utils.copy_file(
branding_path + "\\multimedia\\videoplayer\\icons\\" + common.branding + ".ico",
"..\\..\\extras\\projicons\\res\\media.ico")
utils.copy_file(
branding_path + "\\multimedia\\imageviewer\\icons\\ico\\" + common.branding + ".ico",
"..\\..\\extras\\projicons\\res\\gallery.ico")
aic_content = [";aic"]
if not common.sign:
aic_content += [
"ResetSig"
]
if arch == "x86":
aic_content += [
"SetPackageType x86",
"SetAppdir -buildname DefaultBuild -path [ProgramFilesFolder][MANUFACTURER_INSTALL_FOLDER]\\[PRODUCT_INSTALL_FOLDER]",
'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x64)"',
'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x64)"'
]
if arch == "x64":
aic_content += [
'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x86)"',
'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x86)"'
]
if branding.onlyoffice:
aic_content += [
"DelFolder CUSTOM_PATH"
]
else:
utils.replace_in_file('DesktopEditors.aip','(<ROW Property="UpgradeCode" Value=")(.*)("/>)', r'\1%s\3' % (branding.desktop_upgrade_code))
aic_content += [
"AddUpgradeCode {47EEF706-B0E4-4C43-944B-E5F914B92B79} \
-min_ver 7.1.1 -include_min_ver \
-max_ver 7.2.2 -include_max_ver \
-include_lang 1049 \
-property_name UPGRADE_2 -enable_migrate",
"DelLanguage 1029 -buildname DefaultBuild",
"DelLanguage 1031 -buildname DefaultBuild",
"DelLanguage 1041 -buildname DefaultBuild",
"DelLanguage 1046 -buildname DefaultBuild",
"DelLanguage 2070 -buildname DefaultBuild",
"DelLanguage 1060 -buildname DefaultBuild",
"DelLanguage 1036 -buildname DefaultBuild",
"DelLanguage 3082 -buildname DefaultBuild",
"DelLanguage 1033 -buildname DefaultBuild",
"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",
"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",
"SetVersion " + package_version,
"SetPackageName " + advinst_file + " -buildname DefaultBuild",
"Rebuild -buildslist DefaultBuild"
]
utils.write_file("DesktopEditors.aic", "\r\n".join(aic_content), "utf-8-sig")
ret = utils.cmd("AdvancedInstaller.com", "/execute", \
"DesktopEditors.aip", "DesktopEditors.aic", verbose=True)
utils.set_summary("desktop advinst build", ret)
if common.deploy and ret:
utils.log_h2("desktop advinst deploy")
ret = aws_s3_upload(
[advinst_file],
"win/advinst/%s/" % common.channel,
"Installer"
)
utils.set_summary("desktop advinst deploy", ret)
return
#
# macOS
#
def make_macos():
global package_name, build_dir, branding_dir, updates_dir, changes_dir, \
suffix, lane, scheme, app_version
package_name = branding.desktop_package_name
build_dir = branding.desktop_build_dir
branding_dir = branding.desktop_branding_dir
updates_dir = branding.desktop_updates_dir
changes_dir = branding.desktop_changes_dir
suffix = {
"darwin_x86_64": "x86_64",
"darwin_x86_64_v8": "v8",
"darwin_arm64": "arm"
}[common.platform]
lane = "release_" + suffix
scheme = package_name + "-" + suffix
utils.set_cwd(branding_dir)
if common.clean:
utils.log("\n=== Clean\n")
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
appcast_url = branding.sparkle_base_url + "/" + suffix + "/" + branding.desktop_package_name.lower() + ".xml"
release_version = utils.sh_output(
'curl -Ls ' + appcast_url + ' 2> /dev/null' \
+ ' | xmllint --xpath "/rss/channel/item[1]/enclosure/@*[name()=\'sparkle:shortVersionString\']" -' \
+ ' | cut -f2 -d\\\"',
verbose=True).rstrip()
release_build = utils.sh_output(
'curl -Ls ' + appcast_url + ' 2> /dev/null' \
+ ' | xmllint --xpath "/rss/channel/item[1]/enclosure/@*[name()=\'sparkle:version\']" -' \
+ ' | cut -f2 -d\\\"',
verbose=True).rstrip()
utils.log("CURRENT=" + current_version + "(" + current_build + ")" \
+ "\nRELEASE=" + release_version + "(" + release_build + ")")
dmg = make_dmg()
if dmg:
if int(current_build) > int(release_build):
make_sparkle_updates()
else:
utils.log(release_build + " <= " + current_build)
utils.set_cwd(common.workspace_dir)
return
def make_dmg():
utils.log_h2("desktop dmg build")
utils.log_h3(scheme)
utils.log_h3("build/" + package_name + ".app")
dmg = utils.sh(
"bundler exec fastlane " + lane + " skip_git_bump:true",
verbose=True
)
utils.set_summary("desktop dmg build", dmg)
if common.deploy and dmg:
utils.log_h2("desktop dmg deploy")
ret = aws_s3_upload(
utils.glob_path("build/*.dmg"),
"mac/%s/%s/%s/" % (suffix, common.version, common.build),
"Disk Image"
)
utils.set_summary("desktop dmg deploy", ret)
utils.log_h2("desktop zip deploy")
ret = aws_s3_upload(
["build/%s-%s.zip" % (scheme, app_version)],
"mac/%s/%s/%s/" % (suffix, common.version, common.build),
"Archive"
)
utils.set_summary("desktop zip deploy", ret)
return dmg
def make_sparkle_updates():
utils.log_h2("desktop sparkle files build")
zip_filename = scheme + '-' + app_version
macos_zip = "build/" + zip_filename + ".zip"
updates_storage_dir = "%s/%s/_updates" % (utils.get_env('ARCHIVES_DIR'), scheme)
utils.create_dir(updates_dir)
utils.copy_file(macos_zip, updates_dir)
utils.copy_dir_content(updates_storage_dir, updates_dir, ".zip")
utils.copy_file(
changes_dir + "/" + app_version + "/ReleaseNotes.html",
updates_dir + "/" + zip_filename + ".html"
)
utils.copy_file(
changes_dir + "/" + app_version + "/ReleaseNotesRU.html",
updates_dir + "/" + zip_filename + ".ru.html"
)
sparkle_base_url = "%s/%s/updates/" % (branding.sparkle_base_url, suffix)
ret = utils.sh(
common.workspace_dir \
+ "/desktop-apps/macos/Vendor/Sparkle/bin/generate_appcast " \
+ updates_dir \
+ " --download-url-prefix " + sparkle_base_url \
+ " --release-notes-url-prefix " + sparkle_base_url,
verbose=True
)
utils.set_summary("desktop sparkle files build", ret)
# utils.log_h3("edit sparkle appcast links")
# appcast_url = branding.sparkle_base_url + "/" + suffix
# appcast = "%s/%s.xml" % (updates_dir, package_name.lower())
# for lang, base in update_changes_list.items():
# if base == "ReleaseNotes":
# utils.replace_in_file(appcast,
# r'(<sparkle:releaseNotesLink>.+/).+(\.html</sparkle:releaseNotesLink>)',
# "\\1" + base + "\\2")
# else:
# utils.replace_in_file(appcast,
# r'(<sparkle:releaseNotesLink xml:lang="' + lang + r'">).+(\.html</sparkle:releaseNotesLink>)',
# "\\1" + base + "\\2")
utils.log("")
utils.log_h3("generate checksums")
utils.sh(
"md5 *.zip *.delta > md5sums.txt",
chdir="build/update", verbose=True
)
utils.sh(
"shasum -a 256 *.zip *.delta > sha256sums.txt",
chdir="build/update", verbose=True
)
if common.deploy:
utils.log_h2("desktop sparkle files deploy")
ret = aws_s3_upload(
utils.glob_path("build/update/*.delta") \
+ utils.glob_path("build/update/*.xml") \
+ utils.glob_path("build/update/*.html"),
"mac/%s/%s/%s/" % (suffix, common.version, common.build),
"Sparkle"
)
utils.set_summary("desktop sparkle files deploy", ret)
utils.log_h2("desktop checksums deploy")
ret = aws_s3_upload(
utils.glob_path("build/update/*.txt"),
"mac/%s/%s/%s/" % (suffix, common.version, common.build),
"Checksums"
)
utils.set_summary("desktop checksums deploy", ret)
return
#
# Linux
#
def make_linux():
utils.set_cwd("desktop-apps/win-linux/package/linux")
utils.log_h2("desktop build")
make_args = branding.desktop_make_targets
if common.platform == "linux_aarch64":
make_args += ["-e", "UNAME_M=aarch64"]
if not branding.onlyoffice:
make_args += ["-e", "BRANDING_DIR=../../../../" + common.branding + "/desktop-apps/win-linux/package/linux"]
ret = utils.sh("make clean && make " + " ".join(make_args), verbose=True)
utils.set_summary("desktop build", ret)
rpm_arch = "x86_64"
if common.platform == "linux_aarch64": rpm_arch = "aarch64"
if common.deploy:
utils.log_h2("desktop deploy")
if ret:
utils.log_h2("desktop tar deploy")
if "tar" in branding.desktop_make_targets:
ret = aws_s3_upload(
utils.glob_path("tar/*.tar.gz") + utils.glob_path("tar/*.tar.xz"),
"linux/generic/%s/" % common.channel,
"Portable"
)
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"
)
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"
)
utils.set_summary("desktop deb-astra deploy", ret)
if "rpm" in branding.desktop_make_targets:
utils.log_h2("desktop rpm deploy")
ret = aws_s3_upload(
utils.glob_path("rpm/builddir/RPMS/" + rpm_arch + "/*.rpm") \
+ utils.glob_path("rpm/builddir/RPMS/noarch/*.rpm"),
"linux/rhel/%s/" % common.channel,
"CentOS"
)
utils.set_summary("desktop rpm deploy", ret)
if "suse-rpm" in branding.desktop_make_targets:
utils.log_h2("desktop suse-rpm deploy")
ret = aws_s3_upload(
utils.glob_path("suse-rpm/builddir/RPMS/" + rpm_arch + "/*.rpm") \
+ utils.glob_path("suse-rpm/builddir/RPMS/noarch/*.rpm"),
"linux/suse/%s/" % common.channel,
"SUSE Linux"
)
utils.set_summary("desktop suse-rpm deploy", ret)
if "apt-rpm" in branding.desktop_make_targets:
utils.log_h2("desktop apt-rpm deploy")
ret = aws_s3_upload(
utils.glob_path("apt-rpm/builddir/RPMS/" + rpm_arch + "/*.rpm") \
+ utils.glob_path("apt-rpm/builddir/RPMS/noarch/*.rpm"),
"linux/altlinux/%s/" % common.channel,
"ALT Linux"
)
utils.set_summary("desktop apt-rpm deploy", ret)
if "urpmi" in branding.desktop_make_targets:
utils.log_h2("desktop urpmi deploy")
ret = aws_s3_upload(
utils.glob_path("urpmi/builddir/RPMS/" + rpm_arch + "/*.rpm") \
+ utils.glob_path("urpmi/builddir/RPMS/noarch/*.rpm"),
"linux/rosa/%s/" % common.channel,
"ROSA"
)
utils.set_summary("desktop urpmi deploy", ret)
else:
if "tar" in branding.desktop_make_targets:
utils.set_summary("desktop tar deploy", False)
if "deb" in branding.desktop_make_targets:
utils.set_summary("desktop deb deploy", False)
if "deb-astra" in branding.desktop_make_targets:
utils.set_summary("desktop deb-astra deploy", False)
if "rpm" in branding.desktop_make_targets:
utils.set_summary("desktop rpm deploy", False)
if "suse-rpm" in branding.desktop_make_targets:
utils.set_summary("desktop suse-rpm deploy", False)
if "apt-rpm" in branding.desktop_make_targets:
utils.set_summary("desktop apt-rpm deploy", False)
if "urpmi" in branding.desktop_make_targets:
utils.set_summary("desktop urpmi deploy", False)
utils.set_cwd(common.workspace_dir)
return

45
scripts/package_mobile.py Normal file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env python
import package_utils as utils
import package_common as common
import package_branding as branding
def make():
utils.log_h1("MOBILE")
if not utils.is_linux():
utils.log("Unsupported host OS")
return
make_mobile()
return
def make_mobile():
utils.set_cwd("build_tools/out")
if common.clean:
utils.log_h2("mobile clean")
utils.sh("rm -rfv *.zip", verbose=True)
zip_file = "build-" + common.version + "-" + common.build + ".zip"
s3_key = "mobile/android/%s/%s" % (common.channel, zip_file)
utils.log_h2("mobile build")
ret = utils.sh("zip -r " + zip_file + " ./android* ./js", verbose=True)
utils.set_summary("mobile build", ret)
if common.deploy:
utils.log_h2("mobile deploy")
if ret:
ret = utils.sh(
"aws s3 cp --acl public-read --no-progress " \
+ zip_file + " s3://" + branding.s3_bucket + "/" + s3_key,
verbose=True
)
if ret:
utils.add_deploy_data(
"mobile", "Android", zip_file, s3_key,
branding.s3_bucket, branding.s3_region
)
utils.set_summary("mobile deploy", ret)
utils.set_cwd(common.workspace_dir)
return

145
scripts/package_server.py Normal file
View File

@ -0,0 +1,145 @@
#!/usr/bin/env python
import package_utils as utils
import package_common as common
import package_branding as branding
def make(edition):
utils.log_h1("SERVER (" + edition.upper() + ")")
if utils.is_windows():
make_windows(edition)
elif utils.is_linux():
make_linux(edition)
else:
utils.log("Unsupported host OS")
return
def aws_s3_upload(files, key, edition, ptype=None):
if not files:
return False
ret = True
key = "server/" + key
for file in files:
args = ["aws"]
if hasattr(branding, "s3_endpoint_url"):
args += ["--endpoint-url=" + branding.s3_endpoint_url]
args += [
"s3", "cp", "--no-progress", "--acl", "public-read",
file, "s3://" + branding.s3_bucket + "/" + key
]
if common.os_family == "windows":
upload = utils.cmd(*args, verbose=True)
else:
upload = utils.sh(" ".join(args), verbose=True)
ret &= upload
if upload and ptype is not None:
full_key = key
if full_key.endswith("/"): full_key += utils.get_basename(file)
utils.add_deploy_data(
"server_" + edition, ptype, file, full_key,
branding.s3_bucket, branding.s3_region
)
return ret
def make_windows(edition):
if edition == "enterprise":
product_name = "DocumentServer-EE"
elif edition == "developer":
product_name = "DocumentServer-DE"
else:
product_name = "DocumentServer"
utils.set_cwd("document-server-package")
utils.log_h2("server " + edition + " build")
ret = utils.cmd("make", "clean", verbose=True)
args = ["-e", "PRODUCT_NAME=" + product_name]
if not branding.onlyoffice:
args += ["-e", "BRANDING_DIR=../" + common.branding + "/document-server-package"]
ret &= utils.cmd("make", "packages", *args, verbose=True)
utils.set_summary("server " + edition + " build", ret)
if common.deploy and ret:
utils.log_h2("server " + edition + " inno deploy")
ret = aws_s3_upload(
utils.glob_path("exe/*.exe"),
"win/inno/%s/" % common.channel,
edition,
"Installer"
)
utils.set_summary("server " + edition + " inno deploy", ret)
utils.set_cwd(common.workspace_dir)
return
def make_linux(edition):
if edition == "enterprise":
product_name = "documentserver-ee"
elif edition == "developer":
product_name = "documentserver-de"
else:
product_name = "documentserver"
utils.set_cwd("document-server-package")
utils.log_h2("server " + edition + " build")
make_args = branding.server_make_targets + ["-e", "PRODUCT_NAME=" + product_name]
if common.platform == "linux_aarch64":
make_args += ["-e", "UNAME_M=aarch64"]
if not branding.onlyoffice:
make_args += ["-e", "BRANDING_DIR=../" + common.branding + "/document-server-package"]
ret = utils.sh("make clean && make " + " ".join(make_args), verbose=True)
utils.set_summary("server " + edition + " build", ret)
rpm_arch = "x86_64"
if common.platform == "linux_aarch64": rpm_arch = "aarch64"
if common.deploy:
utils.log_h2("server " + edition + " deploy")
if ret:
if "deb" in branding.server_make_targets:
utils.log_h2("server " + edition + " deb deploy")
ret = aws_s3_upload(
utils.glob_path("deb/*.deb"),
"linux/debian/%s/" % common.channel,
edition,
"Debian"
)
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"
)
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"
)
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"
)
utils.set_summary("server " + edition + " snap deploy", ret)
else:
if "deb" in branding.server_make_targets:
utils.set_summary("server " + edition + " deb deploy", False)
if "rpm" in branding.server_make_targets:
utils.set_summary("server " + edition + " rpm deploy", False)
if "apt-rpm" in branding.server_make_targets:
utils.set_summary("server " + edition + " apt-rpm deploy", False)
if "tar" in branding.server_make_targets:
utils.set_summary("server " + edition + " snap deploy", False)
utils.set_cwd(common.workspace_dir)
return

382
scripts/package_utils.py Normal file
View File

@ -0,0 +1,382 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import glob
import hashlib
import json
import os
import platform
import re
import shutil
import subprocess
import sys
import time
import package_common as common
def host_platform():
return platform.system().lower()
def is_windows():
return host_platform() == "windows"
def is_macos():
return host_platform() == "darwin"
def is_linux():
return host_platform() == "linux"
def log(string, end='\n'):
sys.stdout.write(string + end)
sys.stdout.flush()
return
def log_h1(string):
line = "#" * (len(string) + 8)
log("\n" + line + "\n### " + string + " ###\n" + line + "\n")
return
def log_h2(string):
log("\n### " + string + "\n")
return
def log_h3(string):
log("# " + string)
return
def log_err(string):
log("!!! " + string)
return
def get_timestamp():
return "%.f" % time.time()
def get_env(key, default=None):
return os.getenv(key, default)
def set_env(key, value):
os.environ[key] = value
return
def get_cwd():
return os.getcwd()
def set_cwd(path, verbose=True):
if verbose:
log("- change working dir:")
log(" path: " + path)
os.chdir(path)
return
def get_path(path):
if is_windows():
return path.replace("/", "\\")
return path
def get_abspath(path):
return os.path.abspath(get_path(path))
def get_basename(path):
return os.path.basename(path)
def get_dirname(path):
return os.path.dirname(path)
def get_file_size(path):
return os.path.getsize(path)
def get_script_dir(path):
return get_dirname(os.path.realpath(path))
def is_file(path):
return os.path.isfile(path)
def is_dir(path):
return os.path.isdir(path)
def is_exist(path):
if os.path.exists(path):
return True
return False
def glob_path(path):
return glob.glob(path)
def glob_file(path):
if glob.glob(path) and is_file(glob.glob(path)[0]):
return glob.glob(path)[0]
return
def get_md5(path):
if os.path.exists(path):
md5_hash = hashlib.md5()
md5_hash.update(open(path, "rb").read())
return md5_hash.hexdigest()
return
def create_dir(path, verbose=True):
if verbose:
log("- create_dir:")
log(" path: " + path)
if not is_exist(path):
os.makedirs(path)
else:
log_err("dir exist")
return
def write_file(path, data, encoding='utf-8', verbose=True):
if is_file(path):
delete_file(path)
if verbose:
log("- write_file:")
log(" path: " + path)
log(" encoding: " + encoding)
log(" data: |\n" + data)
with codecs.open(path, 'w', encoding) as file:
file.write(data)
return
def replace_in_file(path, pattern, text_replace, encoding='utf-8', verbose=True):
if verbose:
log("- replace_in_file:")
log(" path: " + path)
log(" pattern: " + pattern)
log(" replace: " + text_replace)
log(" encoding: " + encoding)
file_data = ""
with codecs.open(get_path(path), "r", encoding) as file:
file_data = file.read()
file_data = re.sub(pattern, text_replace, file_data)
delete_file(path)
with codecs.open(get_path(path), "w", encoding) as file:
file.write(file_data)
return
def copy_file(src, dst, verbose=True):
if verbose:
log("- copy_file:")
log(" src: " + src)
log(" dst: " + dst)
if is_file(dst):
delete_file(dst)
if not is_file(src):
log_err("file not exist: " + src)
return
return shutil.copy2(get_path(src), get_path(dst))
def copy_files(src, dst, override=True, verbose=True):
if verbose:
log("- copy_files:")
log(" src: " + src)
log(" dst: " + dst)
log(" override: " + str(override))
for file in glob.glob(src):
file_name = os.path.basename(file)
if is_file(file):
if override and is_file(dst + "/" + file_name):
delete_file(dst + "/" + file_name)
if not is_file(dst + "/" + file_name):
if verbose:
log(file + " : " + get_path(dst))
shutil.copy2(file, get_path(dst))
elif is_dir(file):
if not is_dir(dst + "/" + file_name):
create_dir(dst + "/" + file_name)
copy_files(file + "/*", dst + "/" + file_name, override)
return
def copy_dir(src, dst, override=True, verbose=True):
if verbose:
log("- copy_dir:")
log(" src: " + src)
log(" dst: " + dst)
log(" override: " + str(override))
if is_dir(dst):
delete_dir(dst)
try:
shutil.copytree(get_path(src), get_path(dst))
except OSError as e:
log_err('directory not copied. Error: %s' % e)
return
def copy_dir_content(src, dst, filter_include = "", filter_exclude = "", verbose=True):
if verbose:
log("- copy_dir_content:")
log(" src: " + src)
log(" dst: " + dst)
log(" include: " + filter_include)
log(" exclude: " + filter_exclude)
src_folder = src
if ("/" != src[-1:]):
src_folder += "/"
src_folder += "*"
for file in glob.glob(src_folder):
basename = os.path.basename(file)
if ("" != filter_include) and (-1 == basename.find(filter_include)):
continue
if ("" != filter_exclude) and (-1 != basename.find(filter_exclude)):
continue
if is_file(file):
copy_file(file, dst, verbose=False)
elif is_dir(file):
copy_dir(file, dst + "/" + basename)
return
def delete_file(path, verbose=True):
if verbose:
log("- delete_file:")
log(" path: " + path)
if not is_file(path):
log_err("file not exist")
return
return os.remove(path)
def delete_dir(path, verbose=True):
if verbose:
log("- delete_dir:")
log(" path: " + path)
if not is_dir(path):
log_err("dir not exist")
return
shutil.rmtree(path, ignore_errors=True)
return
def delete_files(src, verbose=True):
if verbose:
log("- delete_files:")
log(" pattern: " + src)
for path in glob.glob(src):
if verbose:
log(path)
if is_file(path):
os.remove(path)
elif is_dir(path):
shutil.rmtree(path, ignore_errors=True)
return
def set_summary(target, status):
common.summary.append({target: status})
return
def add_deploy_data(product, ptype, src, dst, bucket, region):
common.deploy_data.append({
"platform": common.platforms[common.platform]["title"],
"product": product,
"type": ptype,
# "local": get_path(src),
"size": get_file_size(get_path(src)),
"bucket": bucket,
"region": region,
"key": dst
})
file = open(get_path(common.workspace_dir + "/deploy.json"), 'w')
file.write(json.dumps(common.deploy_data, sort_keys=True, indent=4))
file.close()
return
def cmd(*args, **kwargs):
if kwargs.get("verbose"):
log("- cmd:")
log(" command: " + " ".join(args))
if kwargs.get("chdir"):
log(" chdir: " + kwargs["chdir"])
if kwargs.get("creates"):
log(" creates: " + kwargs["creates"])
if kwargs.get("creates") and is_exist(kwargs["creates"]):
log_err("creates exist")
return False
if kwargs.get("chdir") and is_dir(kwargs["chdir"]):
oldcwd = get_cwd()
set_cwd(kwargs["chdir"])
ret = subprocess.call(
[i for i in args], stderr=subprocess.STDOUT, shell=True
) == 0
if kwargs.get("chdir") and oldcwd:
set_cwd(oldcwd)
return ret
def cmd_output(*args, **kwargs):
if kwargs.get("verbose"):
log("- cmd_output:")
log(" command: " + " ".join(args))
return subprocess.check_output(
[i for i in args], stderr=subprocess.STDOUT, shell=True
).decode("utf-8")
def powershell(*args, **kwargs):
if kwargs.get("verbose"):
log("- powershell:")
log(" command: " + " ".join(args))
if kwargs.get("chdir"):
log(" chdir: " + kwargs["chdir"])
if kwargs.get("creates"):
log(" creates: " + kwargs["creates"])
if kwargs.get("creates") and is_exist(kwargs["creates"]):
return False
args = ["powershell", "-Command"] + [i for i in args]
ret = subprocess.call(
args, stderr=subprocess.STDOUT, shell=True
) == 0
return ret
def ps1(file, args=[], **kwargs):
if kwargs.get("verbose"):
log_h2("powershell cmdlet: " + 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
) == 0
return ret
def download_file(url, path, md5, verbose=False):
if verbose:
log("- download_file:")
log(" url: " + path)
log(" path: " + url)
log(" md5: " + md5)
if is_file(path):
if get_md5(path) == md5:
log_err("file already exist (match checksum)")
return True
else:
log_err("wrong checksum (%s), delete" % md5)
os.remove(path)
ret = powershell(
"(New-Object System.Net.WebClient).DownloadFile('%s','%s')" % (url, path),
verbose=True
)
md5_new = get_md5(path)
if md5 != md5_new:
log_err("checksum didn't match (%s != %s)" % (md5, md5_new))
return False
return ret
def sh(command, **kwargs):
if kwargs.get("verbose"):
log("- sh:")
log(" command: " + command)
if kwargs.get("chdir"):
log(" chdir: " + kwargs["chdir"])
if kwargs.get("creates"):
log(" creates: " + kwargs["creates"])
if kwargs.get("creates") and is_exist(kwargs["creates"]):
log_err("creates exist")
return False
if kwargs.get("chdir") and is_dir(kwargs["chdir"]):
oldcwd = get_cwd()
set_cwd(kwargs["chdir"])
ret = subprocess.call(
command, stderr=subprocess.STDOUT, shell=True
) == 0
if kwargs.get("chdir") and oldcwd:
set_cwd(oldcwd)
return ret
def sh_output(command, **kwargs):
if kwargs.get("verbose"):
log("- sh_output:")
log(" command: " + command)
return subprocess.check_output(
command, stderr=subprocess.STDOUT, shell=True
).decode("utf-8")

View File

@ -1,14 +0,0 @@
#!/usr/bin/env python3
import packages_desktop
# import packages_server
# import packages_builder
def make(product, package_list):
if ("desktop" == product):
packages_desktop.make(package_list.split())
# if ("server" == product):
# packages_server.make(package_list.split())
# if ("builder" == product):
# packages_builder.make(package_list.split())
return

View File

@ -1,93 +0,0 @@
#!/usr/bin/env python3
import base
import os
import re
def make(packages):
base_dir = base.get_script_dir() + "/../out"
git_dir = base.get_script_dir() + "/../.."
for package in packages:
if -1 != package.find("diskimage"):
macos_dir = os.path.abspath(git_dir + "/desktop-apps/macos")
update_dir = macos_dir + "/build/update"
changes_dir = macos_dir + "/ONLYOFFICE/update/updates/ONLYOFFICE/changes"
if (package == "diskimage-x86_64"):
lane = "release_x86_64"
scheme = "ONLYOFFICE-x86_64"
elif (package == "diskimage-v8-x86_64"):
lane = "release_v8"
scheme = "ONLYOFFICE-v8"
elif (package == "diskimage-arm64"):
lane = "release_arm"
scheme = "ONLYOFFICE-arm"
else:
exit(1)
print("Build package " + scheme)
print("$ bundler exec fastlane " + lane + " skip_git_bump:true")
base.cmd_in_dir(macos_dir, "bundler", ["exec", "fastlane", lane, "skip_git_bump:true"])
print("Build updates")
app_version = base.run_command("/usr/libexec/PlistBuddy -c 'print :CFBundleShortVersionString' " +
macos_dir + "/build/ONLYOFFICE.app/Contents/Info.plist")['stdout']
zip_filename = scheme + "-" + app_version
macos_zip = macos_dir + "/build/" + zip_filename + ".zip"
update_storage_dir = base.get_env("ARCHIVES_DIR") + "/" + scheme + "/_updates"
base.create_dir(update_dir)
base.copy_dir_content(update_storage_dir, update_dir, ".zip")
base.copy_dir_content(update_storage_dir, update_dir, ".html")
base.copy_file(macos_zip, update_dir)
notes_src = changes_dir + "/" + app_version + "/ReleaseNotes.html"
notes_dst = update_dir + "/" + zip_filename + ".html"
cur_date = base.run_command("LC_ALL=en_US.UTF-8 date -u \"+%B %e, %Y\"")['stdout']
if base.is_exist(notes_src):
base.copy_file(notes_src, notes_dst)
base.replaceInFileRE(notes_dst,
r"(<span class=\"releasedate\">).+(</span>)", "\\1 - " + cur_date + "\\2")
else:
base.writeFile(notes_dst, "placeholder\n")
notes_src = changes_dir + "/" + app_version + "/ReleaseNotesRU.html"
notes_dst = update_dir + "/" + zip_filename + ".ru.html"
cur_date = base.run_command("LC_ALL=ru_RU.UTF-8 date -u \"+%e %B %Y\"")['stdout']
if base.is_exist(notes_src):
base.copy_file(notes_src, notes_dst)
base.replaceInFileRE(notes_dst,
r"(<span class=\"releasedate\">).+(</span>)", "\\1 - " + cur_date + "\\2")
else:
base.writeFile(notes_dst, "placeholder\n")
print("$ ./generate_appcast " + update_dir)
base.cmd(macos_dir + "/Vendor/Sparkle/bin/generate_appcast", [update_dir])
print("Edit Sparkle appcast links")
sparkle_base_url = "https://download.onlyoffice.com/install/desktop/editors/mac"
if (package == "diskimage-x86_64"): sparkle_base_url += "/x86_64"
elif (package == "diskimage-v8-x86_64"): sparkle_base_url += "/v8"
elif (package == "diskimage-arm64"): sparkle_base_url += "/arm"
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
r"(<sparkle:releaseNotesLink>)(?:.+ONLYOFFICE-(?:x86|x86_64|v8|arm)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
"\\1" + sparkle_base_url + "/updates/changes/\\2/ReleaseNotes.html\\3")
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
r"(<sparkle:releaseNotesLink xml:lang=\"ru\">)(?:ONLYOFFICE-(?:x86|x86_64|v8|arm)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
"\\1" + sparkle_base_url + "/updates/changes/\\2/ReleaseNotesRU.html\\3")
base.replaceInFileRE(update_dir + "/onlyoffice.xml",
r"(url=\")(?:.+/)(ONLYOFFICE.+\")", "\\1" + sparkle_base_url + "/updates/\\2")
print("Delete unnecessary files")
for file in os.listdir(update_dir):
if (-1 == file.find(app_version)) and (file.endswith(".zip") or file.endswith(".html")):
base.delete_file(update_dir + "/" + file)
return

View File

@ -1,9 +1,9 @@
#!/usr/bin/env python
import os
import shutil
import re
def readFile(path):
with open(path, "r") as file:
with open(path, "r", errors='replace') as file:
filedata = file.read()
return filedata
@ -46,12 +46,12 @@ class EditorApi(object):
if -1 != retParam.find("[]"):
isArray = True
retParam = retParam.replace("[]", "")
retType = retParam.replace("|", " ").split(" ")[0]
retType = retParam.replace("|", " ").replace(".", " ").split(" ")[0]
retTypeLower = retType.lower()
retValue = ""
if -1 != retType.find("\""):
retValue = "\"\""
elif "bool" == retTypeLower:
elif "boolean" == retTypeLower or "bool" == retTypeLower:
retValue = "true"
elif "string" == retTypeLower:
retValue = "\"\""
@ -61,6 +61,12 @@ class EditorApi(object):
retValue = "undefined"
elif "null" == retTypeLower:
retValue = "null"
elif "array" == retTypeLower:
retValue = "[]"
elif "base64img" == retTypeLower:
retValue = "base64img"
elif "error" == retTypeLower:
retValue = "undefined"
else:
retValue = "new " + retType + "()"
if isArray:
@ -72,24 +78,34 @@ class EditorApi(object):
rec = rec.replace("\t", "")
rec = rec.replace('\n ', '\n')
indexEndDecoration = rec.find("*/")
indexOfStartPropName = rec.find('Object.defineProperty(')
if indexOfStartPropName != -1:
propName = re.search(r'"([^\"]*)"', rec[indexOfStartPropName:])[0]
else:
propName = None
decoration = "/**" + rec[0:indexEndDecoration + 2]
decoration = decoration.replace("Api\n", "ApiInterface\n")
decoration = decoration.replace("Api ", "ApiInterface ")
decoration = decoration.replace("{Api}", "{ApiInterface}")
decoration = decoration.replace("@return ", "@returns ")
decoration = decoration.replace("@returns {?", "@returns {")
decoration = decoration.replace("?}", "}")
if -1 != decoration.find("@name ApiInterface"):
self.append_record(decoration, "var ApiInterface = function() {};\nvar Api = new ApiInterface();\n", True)
return
code = rec[indexEndDecoration + 2:]
code = code.strip("\t\n\r ")
code = code.replace("=\n", "= ").strip("\t\n\r ")
lines = code.split("\n")
codeCorrect = ""
sFuncName = ""
sMethodName = re.search(r'.prototype.(.*)=', code)
is_found_function = False
addon_for_func = "{}"
if -1 != decoration.find("@return"):
addon_for_func = "{ return null; }"
for line in lines:
line = line.strip("\t\n\r ")
line = line.replace("{", "")
@ -107,6 +123,20 @@ class EditorApi(object):
codeCorrect += (line + "\n")
codeCorrect = codeCorrect.replace("Api.prototype", "ApiInterface.prototype")
self.append_record(decoration, codeCorrect)
className = codeCorrect[0:codeCorrect.find('.')]
# если свойство определено сразу под методом (без декорации)
if propName is not None and sMethodName is not None:
prop_define = f'{className}.prototype.{propName[1:-1]} = {className}.prototype.{sMethodName.group(1)}();\n'
self.append_record(decoration, prop_define)
#иначе
elif propName is not None:
className = re.search(r'.defineProperty\((.*).prototype', code).group(1).strip()
returnValue = 'undefined' if decoration.find('@return') == -1 else self.getReturnValue(decoration)
if (returnValue != 'undefined'):
returnValue = re.search(r'{ return (.*); }', returnValue).group(1).strip()
prop_define = f'{className}.prototype.{propName[1:-1]} = {returnValue};\n'
self.append_record(decoration, prop_define)
return
def append_record(self, decoration, code, init=False):

26
tools/common/README.md Normal file
View File

@ -0,0 +1,26 @@
## Overview
**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**.
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.
```bash
change_autor.py path_to_input_folder path_to_output_folder new_author_name
```
________________________
**convert_directory.py** is a tool to convert all files in the directory to the specified format.
## How to use
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
```

View File

@ -0,0 +1,86 @@
#!/usr/bin/env python
import sys
sys.path.append('../../scripts')
import base
import os
import glob
import shutil
params = sys.argv[1:]
if (3 > len(params)):
print("use: change_autor.py path_to_input_files_directory path_to_output_files_directory author_name")
exit(0)
cur_path = os.getcwd()
base.configure_common_apps()
directory_input = params[0].replace("\\", "/")
directory_output = params[1].replace("\\", "/")
author_name = params[2]
input_files = []
for file in glob.glob(os.path.join(u"" + directory_input, u'*')):
input_files.append(file.replace("\\", "/"))
temp_dir = os.getcwd().replace("\\", "/") + "/temp"
def change_author_name(file_dist, output_file, author_name):
app = "7za" if ("mac" == base.host_platform()) else "7z"
base.cmd_exe(app, ["x", "-y", file_dist, "-o" + temp_dir, "docProps\\core.xml", "-r"])
with open(temp_dir + "/docProps/core.xml", 'r') as file:
data = file.read()
creator_open = "<dc:creator>"
creator_close = "</dc:creator>"
open_tag_pos = data.find(creator_open)
if open_tag_pos == -1:
creator_close_to_find = "<dc:creator/>"
else:
creator_close_to_find = "</dc:creator>"
close_tag_pos = data.find(creator_close_to_find)
last_tag_pos = data.find("</cp:coreProperties>")
if open_tag_pos != -1 and close_tag_pos != - 1:
data = data[:open_tag_pos + len(creator_open)] + author_name + data[close_tag_pos:]
elif close_tag_pos != - 1:
data = data[:close_tag_pos] + creator_open + author_name + creator_close + data[close_tag_pos + len(creator_close_to_find):]
else:
data = data[:last_tag_pos] + creator_open + author_name + creator_close + data[last_tag_pos:]
lastModified_open = "<cp:lastModifiedBy>"
lastModified_close = "</cp:lastModifiedBy>"
open_tag_pos = data.find(lastModified_open)
if open_tag_pos == -1:
lastModified_close_to_find = "<cp:lastModifiedBy/>"
else:
lastModified_close_to_find = "</cp:lastModifiedBy>"
close_tag_pos = data.find(lastModified_close_to_find)
last_tag_pos = data.find("</cp:coreProperties>")
if open_tag_pos != -1 and close_tag_pos != - 1:
data = data[:open_tag_pos + len(lastModified_open)] + author_name + data[close_tag_pos:]
elif close_tag_pos != - 1:
data = data[:close_tag_pos] + lastModified_open + author_name + lastModified_close + data[close_tag_pos + len(lastModified_close_to_find):]
else:
data = data[:last_tag_pos] + lastModified_open + author_name + lastModified_close + data[last_tag_pos:]
with open(temp_dir + "/docProps/core.xml", 'w') as file:
file.write(data)
shutil.copyfile(file_dist, output_file)
base.cmd_exe(app, ["a", "-r", output_file, temp_dir + "\\docProps"])
output_len = len(input_files)
output_cur = 1
for input_file in input_files:
if base.is_dir(temp_dir):
base.delete_dir(temp_dir)
base.create_dir(temp_dir)
print("process [" + str(output_cur) + " of " + str(output_len) + "]: " + str(input_file.encode("utf-8")))
output_file = os.path.join(directory_output, os.path.splitext(os.path.basename(input_file))[0]) + u"." + input_file.split(".")[-1]
change_author_name(input_file, output_file, author_name)
base.delete_dir(temp_dir)
output_cur += 1

29
tools/common/convert.py Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env python
import sys
sys.path.append('../../scripts')
import base
import os
import glob
import convert_common
params = sys.argv[1:]
if (3 > len(params)):
print("use: convert.py path_to_builder_directory path_to_input_file path_to_output_file [params]")
exit(0)
base.configure_common_apps()
directory_x2t = params[0].replace("\\", "/")
file_input = params[1].replace("\\", "/")
file_output = params[2].replace("\\", "/")
convert_params = ""
if 4 == len(params):
convert_params = params[3]
directory_fonts = directory_x2t + "/sdkjs/common"
if not base.is_file(directory_fonts + "/AllFonts.js"):
base.cmd_in_dir(directory_x2t, "docbuilder", [], True)
convert_common.convertFile(directory_x2t, file_input, file_output, convert_params)

View File

@ -0,0 +1,153 @@
#!/usr/bin/env python
import sys
sys.path.append('../../scripts')
import base
import os
import glob
from xml.sax.saxutils import escape
AVS_OFFICESTUDIO_FILE_DOCUMENT = 0x0040
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0001
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0002
AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0003
AVS_OFFICESTUDIO_FILE_DOCUMENT_RTF = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0004
AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0005
AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0006
AVS_OFFICESTUDIO_FILE_DOCUMENT_MHT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0007
AVS_OFFICESTUDIO_FILE_DOCUMENT_EPUB = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0008
AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2 = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0009
AVS_OFFICESTUDIO_FILE_DOCUMENT_MOBI = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000a
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000b
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000c
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000d
AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT_FLAT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000e
AVS_OFFICESTUDIO_FILE_DOCUMENT_OTT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000f
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC_FLAT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0010
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX_FLAT = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0011
AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML_IN_CONTAINER = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0012
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX_PACKAGE = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0014
AVS_OFFICESTUDIO_FILE_DOCUMENT_OFORM = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0015
AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCXF = AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0016
AVS_OFFICESTUDIO_FILE_PRESENTATION = 0x0080
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0001
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0002
AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0003
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0004
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTM = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0005
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSM = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0006
AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0007
AVS_OFFICESTUDIO_FILE_PRESENTATION_POTM = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0008
AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP_FLAT = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0009
AVS_OFFICESTUDIO_FILE_PRESENTATION_OTP = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x000a
AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX_PACKAGE = AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x000b
AVS_OFFICESTUDIO_FILE_SPREADSHEET = 0x0100
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0001
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0002
AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0003
AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0004
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0005
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0006
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0007
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSB = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0008
AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS_FLAT = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0009
AVS_OFFICESTUDIO_FILE_SPREADSHEET_OTS = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000a
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX_FLAT = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000b
AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX_PACKAGE = AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000c
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM = 0x0200
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0001
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_SWF = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0002
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0003
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_XPS = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0004
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_SVG = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0005
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLR = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0006
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLRMenu = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0007
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLRCanvas = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0008
AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDFA = AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0009
AVS_OFFICESTUDIO_FILE_IMAGE = 0x0400
AVS_OFFICESTUDIO_FILE_IMAGE_JPG = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0001
AVS_OFFICESTUDIO_FILE_IMAGE_TIFF = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0002
AVS_OFFICESTUDIO_FILE_IMAGE_TGA = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0003
AVS_OFFICESTUDIO_FILE_IMAGE_GIF = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0004
AVS_OFFICESTUDIO_FILE_IMAGE_PNG = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0005
AVS_OFFICESTUDIO_FILE_IMAGE_EMF = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0006
AVS_OFFICESTUDIO_FILE_IMAGE_WMF = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0007
AVS_OFFICESTUDIO_FILE_IMAGE_BMP = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0008
AVS_OFFICESTUDIO_FILE_IMAGE_CR2 = AVS_OFFICESTUDIO_FILE_IMAGE + 0x0009
AVS_OFFICESTUDIO_FILE_IMAGE_PCX = AVS_OFFICESTUDIO_FILE_IMAGE + 0x000a
AVS_OFFICESTUDIO_FILE_IMAGE_RAS = AVS_OFFICESTUDIO_FILE_IMAGE + 0x000b
AVS_OFFICESTUDIO_FILE_IMAGE_PSD = AVS_OFFICESTUDIO_FILE_IMAGE + 0x000c
AVS_OFFICESTUDIO_FILE_IMAGE_ICO = AVS_OFFICESTUDIO_FILE_IMAGE + 0x000d
EXT_TO_FORMAT = {
"docx" : AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX,
"docxf" : AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCXF,
"oform" : AVS_OFFICESTUDIO_FILE_DOCUMENT_OFORM,
"dotx" : AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX,
"odt" : AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT,
"ott" : AVS_OFFICESTUDIO_FILE_DOCUMENT_OTT,
"rtf" : AVS_OFFICESTUDIO_FILE_DOCUMENT_RTF,
"txt" : AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT,
"html" : AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML,
"xlsx" : AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX,
"xltx" : AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX,
"ods" : AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS,
"ots" : AVS_OFFICESTUDIO_FILE_SPREADSHEET_OTS,
"csv" : AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV,
"pptx" : AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX,
"potx" : AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX,
"odp" : AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP,
"otp" : AVS_OFFICESTUDIO_FILE_PRESENTATION_OTP,
"pdf" : AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF,
"fb2" : AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2,
"epub" : AVS_OFFICESTUDIO_FILE_DOCUMENT_EPUB,
"png" : AVS_OFFICESTUDIO_FILE_IMAGE_PNG,
"jpg" : AVS_OFFICESTUDIO_FILE_IMAGE_JPG
}
def getFormatByExt(ext):
format = 0
try:
format = EXT_TO_FORMAT[ext]
except KeyError as e:
raise ValueError('Undefined format: {}'.format(e.args[0]))
return format
def getFormatByFile(file_path):
ext = file_path.split(".")[-1]
return getFormatByExt(ext)
def convertFile(directory_x2t, file_input, file_output, convert_params):
cur_path = os.getcwd()
directory_fonts = directory_x2t + "/sdkjs/common"
if not base.is_file(directory_fonts + "/AllFonts.js"):
base.cmd_in_dir(directory_x2t, "docbuilder", [], True)
temp_dir = os.getcwd().replace("\\", "/") + "/temp"
if base.is_dir(temp_dir):
base.delete_dir(temp_dir)
base.create_dir(temp_dir)
xml_convert = u"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
xml_convert += u"<TaskQueueDataConvert>"
xml_convert += (u"<m_sFileFrom>" + escape(file_input) + u"</m_sFileFrom>")
xml_convert += (u"<m_sFileTo>" + escape(file_output) + u"</m_sFileTo>")
xml_convert += u"<m_nFormatTo>" + str(getFormatByFile(file_output)) + u"</m_nFormatTo>"
xml_convert += (u"<m_sAllFontsPath>" + directory_fonts + u"/AllFonts.js</m_sAllFontsPath>")
xml_convert += (u"<m_sFontDir>" + directory_fonts + "</m_sFontDir>")
xml_convert += u"<m_sJsonParams>{&quot;spreadsheetLayout&quot;:{&quot;fitToWidth&quot;:1,&quot;fitToHeight&quot;:1}}</m_sJsonParams>"
xml_convert += u"<m_nDoctParams>1</m_nDoctParams>"
xml_convert += convert_params
xml_convert += (u"<m_sTempDir>" + temp_dir + u"</m_sTempDir>")
xml_convert += u"</TaskQueueDataConvert>"
base.save_as_script(temp_dir + "/to.xml", [xml_convert])
base.cmd_in_dir(directory_x2t, "x2t", [temp_dir + "/to.xml"], True)
base.delete_dir(temp_dir)
os.chdir(cur_path)

View File

@ -0,0 +1,41 @@
#!/usr/bin/env python
import sys
sys.path.append('../../scripts')
import base
import os
import glob
import convert_common
params = sys.argv[1:]
if (4 > len(params)):
print("use: convert_directory.py path_to_builder_directory path_to_input_files_directory path_to_output_files_directory format_ext [convert_params]")
exit(0)
cur_path = os.getcwd()
base.configure_common_apps()
directory_x2t = params[0].replace("\\", "/")
directory_input = params[1].replace("\\", "/")
directory_output = params[2].replace("\\", "/")
format_ext = params[3]
convert_params = ""
if (5 == len(params)):
convert_params = params[4]
input_files = []
for file in glob.glob(os.path.join(u"" + directory_input, u'*')):
input_files.append(file.replace("\\", "/"))
directory_fonts = directory_x2t + "/sdkjs/common"
if not base.is_file(directory_fonts + "/AllFonts.js"):
base.cmd_in_dir(directory_x2t, "docbuilder", [], True)
output_len = len(input_files)
output_cur = 1
for input_file in input_files:
print("process [" + str(output_cur) + " of " + str(output_len) + "]: " + str(input_file.encode("utf-8")))
output_file = os.path.join(directory_output, os.path.splitext(os.path.basename(input_file))[0]) + u"." + format_ext
convert_common.convertFile(directory_x2t, input_file, output_file, convert_params)
output_cur += 1

View File

@ -0,0 +1,80 @@
#!/usr/bin/env python
import sys
sys.path.append('../../scripts')
import base
import os
import glob
params = sys.argv[1:]
if (5 != len(params)):
print("use: thumbnails.py path_to_builder_directory path_to_input_files_directory path_to_output_files_directory width height")
exit(0)
cur_path = os.getcwd()
base.configure_common_apps()
directory_x2t = params[0].replace("\\", "/")
directory_input = params[1].replace("\\", "/")
directory_output = params[2].replace("\\", "/")
th_width = params[3]
th_height = params[4]
output_dir = directory_output + "/[" + str(th_width) + "x" + str(th_height) + "]"
if base.is_dir(output_dir):
base.delete_dir(output_dir)
base.create_dir(output_dir)
input_files = []
for file in glob.glob(os.path.join(u"" + directory_input, u'*')):
input_files.append(file.replace("\\", "/"))
#print(input_files)
temp_dir = os.getcwd().replace("\\", "/") + "/temp"
if base.is_dir(temp_dir):
base.delete_dir(temp_dir)
base.create_dir(temp_dir)
directory_fonts = directory_x2t + "/sdkjs/common"
if not base.is_file(directory_fonts + "/AllFonts.js"):
base.cmd_in_dir(directory_x2t, "docbuilder", [], True)
json_params = "{'spreadsheetLayout':{'fitToWidth':1,'fitToHeight':1},"
json_params += "'documentLayout':{'drawPlaceHolders':true,'drawFormHighlight':true,'isPrint':true}}"
json_params = json_params.replace("'", "&quot;")
output_len = len(input_files)
output_cur = 1
for input_file in input_files:
print("process [" + str(output_cur) + " of " + str(output_len) + "]: " + str(input_file.encode("utf-8")))
output_file = os.path.join(output_dir, os.path.splitext(os.path.basename(input_file))[0])
xml_convert = u"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
xml_convert += u"<TaskQueueDataConvert>"
xml_convert += (u"<m_sFileFrom>" + input_file + u"</m_sFileFrom>")
xml_convert += (u"<m_sFileTo>" + output_file + u".zip</m_sFileTo>")
xml_convert += u"<m_nFormatTo>1029</m_nFormatTo>"
xml_convert += (u"<m_sAllFontsPath>" + directory_fonts + u"/AllFonts.js</m_sAllFontsPath>")
xml_convert += (u"<m_sFontDir>" + directory_fonts + u"</m_sFontDir>")
xml_convert += (u"<m_sJsonParams>" + json_params + u"</m_sJsonParams>")
xml_convert += u"<m_nDoctParams>1</m_nDoctParams>"
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"<width>" + str(th_width) + u"</width>")
xml_convert += (u"<height>" + str(th_height) + u"</height>")
xml_convert += u"</m_oThumbnail>"
xml_convert += u"<m_nDoctParams>1</m_nDoctParams>"
xml_convert += (u"<m_sTempDir>" + temp_dir + u"</m_sTempDir>")
xml_convert += u"</TaskQueueDataConvert>"
base.save_as_script(temp_dir + "/to.xml", [xml_convert])
base.cmd_in_dir(directory_x2t, "x2t", [temp_dir + "/to.xml"], True)
base.delete_dir(temp_dir)
base.create_dir(temp_dir)
base.extract_unicode(output_file + u".zip", output_file)
base.delete_file(output_dir + "/" + os.path.splitext(os.path.basename(input_file))[0] + ".zip")
output_cur += 1
base.delete_dir(temp_dir)
os.chdir(cur_path)

View File

@ -5,6 +5,7 @@ sys.path.append('../../scripts')
import base
import os
import subprocess
import deps
def get_branch_name(directory):
cur_dir = os.getcwd()
@ -16,86 +17,6 @@ def get_branch_name(directory):
os.chdir(cur_dir)
return current_branch
def install_deps():
if base.is_file("./packages_complete"):
return
# dependencies
packages = ["apt-transport-https",
"autoconf2.13",
"build-essential",
"ca-certificates",
"cmake",
"curl",
"git",
"glib-2.0-dev",
"libglu1-mesa-dev",
"libgtk-3-dev",
"libpulse-dev",
"libtool",
"p7zip-full",
"subversion",
"gzip",
"libasound2-dev",
"libatspi2.0-dev",
"libcups2-dev",
"libdbus-1-dev",
"libicu-dev",
"libglu1-mesa-dev",
"libgstreamer1.0-dev",
"libgstreamer-plugins-base1.0-dev",
"libx11-xcb-dev",
"libxcb*",
"libxi-dev",
"libxrender-dev",
"libxss1",
"libncurses5"]
base.cmd("sudo", ["apt-get", "install", "-y"] + packages)
# nodejs
base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"])
nodejs_cur = 0
try:
nodejs_version = base.run_command('node -v')['stdout']
nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:])
nodejs_cur_version_minor = int(nodejs_version.split('.')[1])
nodejs_cur = nodejs_cur_version_major * 1000 + nodejs_cur_version_minor
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")
print("Reinstall")
if (base.is_dir("./node_js_setup_10.x")):
base.delete_dir("./node_js_setup_10.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.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", ["apt-get", "install", "-y", "nodejs"])
base.cmd("sudo", ["npm", "install", "-g", "npm@6"])
else:
print("OK")
base.cmd("sudo", ["apt-get", "-y", "install", "npm", "yarn"], True)
base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"])
base.cmd("sudo", ["npm", "install", "-g", "pkg"])
# 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", ["update-alternatives", "--config", "java"])
base.cmd("sudo", ["update-alternatives", "--config", "javac"])
base.writeFile("./packages_complete", "complete")
return
def install_qt():
# qt
if not base.is_file("./qt_source_5.9.9.tar.xz"):
@ -137,7 +58,7 @@ def install_qt():
if not base.is_file("./node_js_setup_10.x"):
print("install dependencies...")
install_deps()
deps.install_deps()
if not base.is_dir("./qt_build"):
print("install qt...")

View File

@ -0,0 +1,9 @@
#!/bin/bash
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
DIR_X2T=$SCRIPTPATH/..
$("$DIR_X2T/x2t" &>/dev/null)
status=$?
[ $status -ne 88 ] && $(cp "$SCRIPTPATH/libstdc++.so.6" "$DIR_X2T/libstdc++.so.6")

Binary file not shown.

91
tools/linux/deps.py Executable file
View File

@ -0,0 +1,91 @@
#!/usr/bin/env python
import sys
sys.path.append('../../scripts')
import base
import os
import subprocess
def install_deps():
if base.is_file("./packages_complete"):
return
# dependencies
packages = ["apt-transport-https",
"autoconf2.13",
"build-essential",
"ca-certificates",
"cmake",
"curl",
"git",
"glib-2.0-dev",
"libglu1-mesa-dev",
"libgtk-3-dev",
"libpulse-dev",
"libtool",
"p7zip-full",
"subversion",
"gzip",
"libasound2-dev",
"libatspi2.0-dev",
"libcups2-dev",
"libdbus-1-dev",
"libicu-dev",
"libglu1-mesa-dev",
"libgstreamer1.0-dev",
"libgstreamer-plugins-base1.0-dev",
"libx11-xcb-dev",
"libxcb*",
"libxi-dev",
"libxrender-dev",
"libxss1",
"libncurses5"]
base.cmd("sudo", ["apt-get", "install", "-y"] + packages)
# nodejs
base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"])
nodejs_cur = 0
try:
nodejs_version = base.run_command('node -v')['stdout']
nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:])
nodejs_cur_version_minor = int(nodejs_version.split('.')[1])
nodejs_cur = nodejs_cur_version_major * 1000 + nodejs_cur_version_minor
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")
print("Reinstall")
if (base.is_dir("./node_js_setup_10.x")):
base.delete_dir("./node_js_setup_10.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.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", ["apt-get", "install", "-y", "nodejs"])
base.cmd("sudo", ["npm", "install", "-g", "npm@6"])
else:
print("OK")
base.cmd("sudo", ["apt-get", "-y", "install", "npm", "yarn"], True)
base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"])
base.cmd("sudo", ["npm", "install", "-g", "pkg"])
# 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", ["update-alternatives", "--config", "java"])
base.cmd("sudo", ["update-alternatives", "--config", "javac"])
base.writeFile("./packages_complete", "complete")
return
if __name__ == "__main__":
install_deps()

View File

@ -1 +1 @@
7.0.0
7.3.0