Compare commits

..

138 Commits

Author SHA1 Message Date
a8a3487749 Update hard-coded version to v7.0.2 2022-03-24 07:16:33 +00:00
e31c77d42c Merge branch hotfix/v7.0.1 into master 2022-03-23 09:43:20 +00: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
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
7a115ed3b4 Fix macos branding build (#428) 2022-01-28 17:44:09 +03:00
203fa4a554 Merge branch release/v7.0.0 into master 2022-01-17 14:18:08 +00: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
a06b1a3eae Refactoring run server for develop 2021-12-11 21:17:22 +03:00
1008de5dcf Update branch version to actual one (#411) 2021-12-08 13:18:20 +03:00
7e5a509c32 Fix bug 54408 2021-12-07 19:32:26 +03:00
72ae1f18fd Add script for developing 2021-12-03 10:53:32 +03:00
b5ad4ae8a7 Add support build for android on mac m1 2021-11-26 10:48:40 +03:00
e1132269e5 Disable minimization for mobile module 2021-11-24 17:45:28 +03:00
2c43b6e49a Fix macos packages build (#405)
* Switch to python 3

* Script refactoring
2021-11-18 14:38:28 +03:00
2599806cb1 Set build date for macOS release notes (#404) 2021-11-17 16:21:32 +03:00
00d31b2354 Small fix
(cherry picked from commit 3537d7c05d)
2021-11-16 10:16:29 +03:00
9d1d24811b Update hard-coded version on branch creation
(cherry picked from commit f2022f2607)
2021-11-16 10:16:15 +03:00
cf4cac9482 Merge pull request #402 from ONLYOFFICE/feature/update-version-action
Update hard-coded version on branch creation
2021-11-16 10:07:24 +03:00
3537d7c05d Small fix 2021-11-15 18:54:32 +03:00
f2022f2607 Update hard-coded version on branch creation 2021-11-15 18:52:19 +03:00
23d96dbd4d Fix build for example without sync-rpc
(cherry picked from commit d162d24acd)
2021-11-03 16:33:22 +03:00
a651981b61 Fix bug 53478 2021-11-03 11:07:35 +03:00
6376218441 Fix typo 2021-10-28 13:14:01 +03:00
cff2f7256a Merge branch hotfix/v6.4.2 into master 2021-10-28 07:26:38 +00:00
a7c6f1f81a Fix android build 2021-10-28 09:04:45 +03:00
fa23cb1efe Fix android build 2021-10-27 21:43:45 +03:00
2c6a2e81ec Fix ios build 2021-10-27 10:20:24 +03:00
cf0f2feb29 Fix build ios
(cherry picked from commit 331291010a)
2021-10-23 15:07:06 +03:00
b35ba7f6d5 Fix ios build 2021-10-22 12:03:40 +03:00
659ef4b804 Update make_packages for 6.4.2 (#393)
* Fix build macos packages (#385)

* Add make_packages args

* Fix ReleaseNotes urls

* Small fix

* Small fix 2

* Fix build macos packages 2
2021-10-21 10:55:25 +03:00
610fb0e711 FIx build 2021-10-19 20:54:28 +03:00
d641c85aea Update build_server.py 2021-10-18 14:26:10 +03:00
0a4aaa0583 Update bundled nodejs to 14 (#388)
(cherry picked from commit 1ee486e7e6)
2021-10-18 14:20:41 +03:00
d6e85aa352 Fix build on macos 2021-10-18 13:59:19 +03:00
191c895d6b Merge pull request #386 from ONLYOFFICE/feature/fix-macos-2
Fix build macos packages 2
2021-10-02 10:22:28 +03:00
1acd5bf8bb Fix build macos packages 2 2021-10-02 09:50:57 +03:00
86a3dcedd9 Fix build macos packages (#385)
* Add make_packages args

* Fix ReleaseNotes urls

* Small fix

* Small fix 2
2021-10-01 17:51:40 +03:00
1a4e6aa5ab Update hard-coded version to v6.5.0 (#384) 2021-09-28 16:48:04 +03:00
bdd4b7ee45 Merge branch hotfix/v6.4.1 into master 2021-09-28 08:00:26 +00:00
fd24c14da4 Merge pull request #380 from ONLYOFFICE/hotfix/v6.4.1
Hotfix/v6.4.1
2021-09-23 19:37:07 +03:00
e15a138ff7 Remove outdated data in snap directory (#379) 2021-09-14 12:47:17 +03:00
4389f35509 Add macOS ARM64 package build (#377)
* Fix app_version command

* Fix archives paths

* Fix release notes copying

* Fix files deletion

* Add support arm64 package build

* Small fix
2021-09-03 16:43:43 +03:00
8b2c7cac42 Merge pull request #375 from ONLYOFFICE/fix/mac_arm64
Fix/mac arm64
2021-08-30 19:17:41 +03:00
b2f22ff710 Fix deploy mac_arm64 version 2021-08-30 19:17:00 +03:00
2edf26d70a Support build arm version on intel platform (deploy correction) 2021-08-30 16:59:06 +03:00
e0d2229b16 Fix previous commit 2021-08-30 12:25:12 +03:00
cec0423b14 Support cef mac_arm64 version 2021-08-30 11:34:19 +03:00
c2646afd40 Merge pull request #373 from ONLYOFFICE/release/v6.4.0
Merge branch release/v6.4.0 into develop
2021-08-26 17:59:39 +03:00
03cf7e26b7 Merge branch release/v6.4.0 into master 2021-08-26 11:32:18 +00:00
4649f8b854 Add common method 2021-08-11 11:19:54 +03:00
0d81353be1 Fix build on macos/ios 2021-08-09 20:13:53 +03:00
0fb05dd5e8 Revert base builds (js) for mobile/desktop modules 2021-08-05 21:07:55 +03:00
a38d97c302 Add repositories list script (#362)
* Add repositories list script

* Add command arguments
2021-08-05 13:05:08 +03:00
c0ead7a4c7 Add simple script for update only js (used only module config option) 2021-08-05 09:04:07 +03:00
7a142c714f Merge pull request #361 from ONLYOFFICE/feature/add_hunspell_mobile
Feature/add hunspell mobile
2021-08-04 18:39:20 +03:00
e1f0b3bdcc no double adding of hunspell 2021-08-04 18:23:58 +03:00
c4cf3710a7 added hunspell for mobile 2021-08-04 18:20:51 +03:00
22666b8bba [server] For bug 51620; Add document-templates repository to server deploy 2021-08-03 11:29:20 +03:00
811a82a211 Merge pull request #359 from ONLYOFFICE/release/v6.4.0
Build mobile version in developer mode
2021-07-22 19:19:51 +03:00
84b81d2df0 Build mobile version in developer mode 2021-07-22 19:19:16 +03:00
05fa273558 Merge pull request #358 from ONLYOFFICE/release/v6.4.0
Release/v6.4.0
2021-07-22 17:53:43 +03:00
8b23a074a3 Add support addons for developer mode 2021-07-22 17:53:18 +03:00
c6cc482b92 Fix bug #51440 (#356) 2021-07-22 10:43:56 +03:00
9ccad7a417 Update hard-coded version (#355)
Don't know why this version is left on v6.0.0
2021-07-21 13:40:45 +03:00
71e4b7b2ef Merge pull request #350 from ONLYOFFICE/hotfix/v6.3.1
Merge branch hotfix/v6.3.1 into release/v6.4.0
2021-07-15 18:23:31 +03:00
39dd4e3aa4 Merge pull request #349 from ONLYOFFICE/hotfix/v6.3.1
Merge branch hotfix/v6.3.1 into develop
2021-07-15 18:23:17 +03:00
0d1f975687 Merge pull request #344 from ONLYOFFICE/release/v6.4.0
Release/v6.4.0
2021-07-01 12:55:52 +03:00
418d8f74cf Merge pull request #343 from ONLYOFFICE/fix/chekErlangFunc
Fix checking Erlang
2021-07-01 12:55:24 +03:00
92f7db0a50 Fix checking Erlang 2021-07-01 12:53:32 +03:00
d922e03c95 Remove usage of spellcheker back-end service (#341)
It is no longer needed since v6.3.0
2021-06-28 17:42:39 +03:00
c218aebea6 Merge pull request #340 from ONLYOFFICE/release/v6.4.0
Release/v6.4.0
2021-06-27 11:12:10 +03:00
cedb7af539 Fix clear qmake file 2021-06-27 11:11:52 +03:00
0b0277923f Rename libnetwork => libkernel_network (conflict with system) 2021-06-27 10:54:25 +03:00
6e69de0acc Fix core deploy 2021-06-27 10:16:14 +03:00
54838d542b Add network library to deploy 2021-06-27 09:55:35 +03:00
a3a7289d42 Add network library (developing...) 2021-06-26 22:14:11 +03:00
130933db36 Add windows debug&release version for ixwebsocket 2021-06-26 21:18:57 +03:00
8030ac6beb Merge pull request #339 from ONLYOFFICE/feature/websocket
Feature/websocket
2021-06-25 10:21:45 +03:00
f8091afb69 Remove server version of spell checker (#337)
* Remove server version of spell checker

* Add changes

* Add changes
2021-06-21 11:52:41 +03:00
0a41abdff7 skip development dependencies on build js scripts 2021-06-16 20:30:19 +03:00
880dc8450b Merge pull request #332 from ONLYOFFICE/release/v6.4.0
Release/v6.4.0
2021-06-07 16:35:15 +03:00
8de2dec4e1 [develop] Fix relative path 2021-06-07 16:29:25 +03:00
fc3013a066 Merge pull request #331 from ONLYOFFICE/fix/changeNpmInstallCommand
Changed npm install command to npm ci
2021-06-07 13:54:36 +03:00
dfcde3fef9 Changed npm install command to npm ci 2021-06-07 13:15:21 +03:00
278bcb6136 [develop] Fix after merge 2021-06-06 12:42:18 +03:00
105d69337c [develop] Fix after merge 2021-06-04 14:30:41 +03:00
fc2e7b5382 Merge pull request #330 from ONLYOFFICE/release/v6.4.0
Release/v6.4.0
2021-06-04 11:29:33 +03:00
9a69116d8f Merge branch 'hotfix/v6.3.1' into release/v6.4.0
# Conflicts:
#	scripts/develop/run_server.py
2021-06-04 11:28:57 +03:00
c28c329085 Merge pull request #322 from ONLYOFFICE/fix/checkingNode.js
Fixed script for checking Node.js version
2021-05-28 15:00:06 +03:00
1e933cefcb Fixed script for checking Node.js version 2021-05-28 14:57:30 +03:00
f4d6c67431 [develop] Turn off gc.js module. it works inside server.js 2021-05-21 11:18:30 +03:00
8fe758e14a Merge pull request #315 from ONLYOFFICE/release/v6.3.0
Merge branch release/v6.3.0 into develop
2021-05-21 10:08:41 +03:00
a8b9d2ce3e [scripts][websocket] delete depracated 2021-05-07 18:17:28 +03:00
6e1db8eb00 [scripts][websocket] add 32 and 64 bits build ixwebsocket for win and linux 2021-05-07 17:37:32 +03:00
661041b1df Merge branch hotfix/v6.2.2 into develop 2021-05-07 12:59:21 +00:00
ff1c0c9b41 [scripts][curl] fix build ios/android 2021-05-07 14:42:01 +03:00
0c111433c8 [scripts][websocket] fix build ixwebsocket for windows 2021-05-06 20:55:07 +03:00
e0754402d8 [scripts][websocket] add general build script for all platform 2021-05-06 18:25:39 +03:00
1fd9566702 Merge pull request #302 from ONLYOFFICE/fix/uppedMinNodejsVer
Upped min requiered node.js version to v10.20
2021-05-06 11:53:44 +03:00
dd3f9410cb Upped min requiered node.js version to v10.20 2021-05-06 11:50:48 +03:00
0519981d24 Fix bug 50170 2021-05-04 17:02:59 +03:00
e86f2b3e9f [script][webscoket] add mac support 2021-05-04 16:30:13 +03:00
d9df09ceec Merge pull request #297 from ONLYOFFICE/release/v6.3.0
Release/v6.3.0
2021-05-04 11:35:32 +03:00
d26eee685a Merge pull request #295 from ONLYOFFICE/release/v6.3.0
Release/v6.3.0
2021-05-04 00:09:51 +03:00
a6c4dcaad3 Merge pull request #293 from ONLYOFFICE/release/v6.3.0
Release/v6.3.0
2021-05-03 14:25:17 +03:00
61ac320826 Add support disabling multiprocess mode 2021-05-01 17:57:43 +03:00
64dce5a060 Add multiprocess compilation 2021-05-01 17:48:55 +03:00
71692df973 [scripts][modules] fix build scripts 2021-04-23 15:15:22 +03:00
e1b94bf226 [scripts][modules] add build ixwebsocket for win64 2021-04-23 15:09:14 +03:00
c895e4da83 Rewrite script for build documentation for document builder 2021-04-21 14:33:08 +03:00
98f211bd4b Replace and rename script 2021-04-20 14:44:06 +03:00
b41a1b8a67 apiBuilder.js to apiToInterface.js scripts 2021-04-20 14:36:04 +03:00
83cc90fbbd [websocket] fix build script 2021-04-19 14:12:40 +03:00
5dac0c57cb [scripts][common] fix build scripts 2 2021-04-16 01:26:32 +03:00
4aef611665 Fix get_branding_repositories methods 2021-04-15 11:46:57 +03:00
da28605e63 Merge pull request #288 from ONLYOFFICE/feature/new-document-templates
use common documents templates instead of inner
2021-04-15 00:44:11 +03:00
2a6c42eb1f use common documents templates instead of inner 2021-04-14 22:15:39 +03:00
46fc1d8142 Merge branch 'develop' of https://github.com/ONLYOFFICE/build_tools into feature/websocket 2021-04-14 12:59:07 +03:00
aa2df4f6df [3dParty][websocket] build ixwebsocket for linux64 2021-04-12 23:33:56 +03:00
9ca7fea042 Rename socketRocket.py to socketrocket.py 2021-04-10 13:00:03 +03:00
9661121b38 Merge branch 'feature/websocket' of https://github.com/ONLYOFFICE/build_tools into feature/websocket 2021-04-10 12:56:03 +03:00
e6b8396d2c [3dParty][websocket] add build ixwebsocket for ios 2021-04-09 21:47:06 +03:00
0df4b93182 [3dParty] fix 2021-04-09 20:59:42 +03:00
c20656897d Add support external repos for brandings 2021-04-08 19:26:29 +03:00
1540675db7 Merge branch 'release/v6.3.0' into develop 2021-04-06 14:29:45 +03:00
f4a3c8dc0f Fix typo 2021-04-06 11:12:45 +03:00
c61ba0cb77 [3dParty][lib] add build socketRocket for ios & mac 2021-04-02 19:00:38 +03:00
345af89c97 Merge branch hotfix/v6.2.1 into develop 2021-03-31 11:12:25 +00:00
9cb14b295b Fix build scripts for native mobile version 2021-03-24 17:08:30 +03:00
686b576588 Add glew module for windows support (native-sdk) 2021-03-24 14:52:43 +03:00
00cad780a9 Merge 6.3 into develop 2021-03-22 12:54:06 +03:00
1f4748afc4 Merge remote-tracking branch 'origin/release/v6.3.0' into develop 2021-03-22 12:48:02 +03:00
46202ce1c7 Merge branch release/v6.2.0 into develop 2021-03-18 15:13:49 +00:00
1cf2095e98 Merge pull request #274 from KozhevnikovVA/feature/easy_build_pro
Add function of subproject includation
2021-03-18 10:09:18 +03:00
faf5d1904f Add function of subproject includation
- Добавлена функция addSubProject для подключения подпроекта к проекту,
 которая формирует все необходимые переменные, что
 а) уменьшает объем необходимых работ для добавления/удаления/редактирования
  подпроекта(соответственно уменьшает вероятность опечатки)
 б) увеличивает читаемость, т.к. вся информация о подпроекте(имя, путь,
  зависимости) находится рядом, а не разнесена по всему файлу
 - Файл проекта(build.pro) переделан на применение функции addSubProject
2021-03-17 18:04:17 +03:00
83bdcb6ada [mobile] add build curl, openssl, ixwebsocket for android 2021-02-26 14:54:16 +03:00
38 changed files with 1211 additions and 500 deletions

33
.github/workflows/update-version.yml vendored Normal file
View File

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

View File

@ -167,10 +167,6 @@ LD_LIBRARY_PATH=./ ./DesktopEditors
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
}
location /spellchecker/ {
proxy_pass http://localhost:8080/;
proxy_http_version 1.1;
}
}
```
@ -261,16 +257,7 @@ allow to run foreground processes in background mode.
./converter
```
2. Start the **SpellChecker** service:
```bash
cd out/linux_64/onlyoffice/documentserver/server/SpellChecker
NODE_ENV=development-linux \
NODE_CONFIG_DIR=$PWD/../Common/config \
./spellchecker
```
3. Start the **DocService** service:
2. Start the **DocService** service:
```bash
cd out/linux_64/onlyoffice/documentserver/server/DocService

387
build.pro
View File

@ -4,35 +4,15 @@ ROOT_DIR=$$PWD/..
DEPLOY_DIR=$$PWD/deploy
CORE_ROOT_DIR=$$ROOT_DIR/core
include($$CORE_ROOT_DIR/Common/base.pri)
MAKEFILE=makefiles/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX
PRO_SUFFIX=$$CORE_BUILDS_PLATFORM_PREFIX
core_debug {
MAKEFILE=$$join(MAKEFILE, MAKEFILE, "", "_debug_")
PRO_SUFFIX=$$join(PRO_SUFFIX, PRO_SUFFIX, "", "_debug_")
}
build_xp {
MAKEFILE=$$join(MAKEFILE, MAKEFILE, "", "_xp")
PRO_SUFFIX=$$join(PRO_SUFFIX, PRO_SUFFIX, "", "_xp")
}
OO_BRANDING_SUFFIX = $$(OO_BRANDING)
!isEmpty(OO_BRANDING_SUFFIX) {
PRO_SUFFIX=$$join(PRO_SUFFIX, PRO_SUFFIX, "", "$$OO_BRANDING_SUFFIX")
MAKEFILE=$$join(MAKEFILE, MAKEFILE, "", "$$OO_BRANDING_SUFFIX")
}
message(current_makefile)
message($$MAKEFILE)
include($$PWD/common.pri)
CONFIG += ordered
core_windows {
CONFIG += core_and_multimedia
desktop:CONFIG += core_and_multimedia
}
core_linux {
CONFIG += core_and_multimedia
desktop:CONFIG += core_and_multimedia
}
core_mac {
CONFIG += no_desktop_apps
@ -40,317 +20,96 @@ core_mac {
core_ios {
CONFIG += no_use_common_binary
CONFIG += no_desktop_apps
CONFIG += no_tests
}
core_android {
CONFIG += no_use_common_binary
CONFIG += no_desktop_apps
CONFIG += no_tests
}
SUBDIRS = \
cryptopp \
\
kernel \
unicodeconverter \
graphics \
pdfwriter \
djvufile \
xpsfile \
htmlrenderer \
pdfreader \
htmlfile2 \
doctrenderer \
fb2file \
epubfile
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)
addSubProject(network, $$CORE_ROOT_DIR/Common/Network/network.pro,\
kernel)
addSubProject(graphics, $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/graphics.pro,\
kernel unicodeconverter)
addSubProject(pdfwriter, $$CORE_ROOT_DIR/PdfWriter/PdfWriter.pro,\
kernel unicodeconverter graphics)
addSubProject(djvufile, $$CORE_ROOT_DIR/DjVuFile/DjVuFile.pro,\
kernel unicodeconverter graphics pdfwriter)
addSubProject(xpsfile, $$CORE_ROOT_DIR/XpsFile/XpsFile.pro,\
kernel unicodeconverter graphics pdfwriter)
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)
addSubProject(htmlfile2, $$CORE_ROOT_DIR/HtmlFile2/HtmlFile2.pro,\
kernel unicodeconverter graphics network)
addSubProject(doctrenderer, $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/doctrenderer.pro,\
kernel unicodeconverter graphics)
addSubProject(fb2file, $$CORE_ROOT_DIR/Fb2File/Fb2File.pro,\
kernel unicodeconverter graphics)
addSubProject(epubfile, $$CORE_ROOT_DIR/EpubFile/CEpubFile.pro,\
kernel unicodeconverter graphics htmlfile2)
!no_x2t {
SUBDIRS += \
docxformat \
pptxformat \
docxfile \
txtxmlformat \
rtfformat \
pptformat \
docformat \
odffilereader \
odffilewriter \
xlsformat \
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(x2t, $$CORE_ROOT_DIR/X2tConverter/build/Qt/X2tConverter.pro,\
docxformat pptxformat docxfile txtxmlformat rtfformat pptformat docformat odffilereader odffilewriter xlsformat fb2file epubfile)
}
!no_use_common_binary {
SUBDIRS += \
allfontsgen \
allthemesgen \
docbuilder
addSubProject(allfontsgen, $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/AllFontsGen.pro,\
kernel unicodeconverter graphics)
addSubProject(allthemesgen, $$CORE_ROOT_DIR/DesktopEditor/allthemesgen/allthemesgen.pro,\
kernel unicodeconverter graphics)
addSubProject(docbuilder, $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/docbuilder.pro,\
kernel unicodeconverter graphics doctrenderer)
}
core_ios:CONFIG += no_tests
core_android:CONFIG += no_tests
!no_tests {
SUBDIRS += standardtester
addSubProject(standardtester, $$CORE_ROOT_DIR/Test/Applications/StandardTester/standardtester.pro)
}
core_and_multimedia {
SUBDIRS += \
videoplayer
addSubProject(videoplayer, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/videoplayerlib.pro,\
kernel unicodeconverter graphics)
}
desktop {
message(desktop)
SUBDIRS += \
hunspell \
ooxmlsignature \
documentscore \
documentscore_helper
!core_mac {
SUBDIRS += qtdocumentscore
}
!no_desktop_apps {
core_windows:SUBDIRS += projicons
SUBDIRS += desktopapp
}
}
ordered {
# remove all makefiles
defineTest(removeFile) {
file = $$1
win32:file ~= s,/,\\,g
core_windows {
system(if exist $$shell_quote($$file) $$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
} else {
system($$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
}
}
defineTest(qmakeClear) {
dir = $$1
name = $$2
removeFile($$1/Makefile.$$2$$PRO_SUFFIX)
removeFile($$1/.qmake.stash)
}
qmakeClear($$CORE_ROOT_DIR/Common/3dParty/cryptopp/project, cryptopp)
qmakeClear($$CORE_ROOT_DIR/Common, kernel)
qmakeClear($$CORE_ROOT_DIR/UnicodeConverter, UnicodeConverter)
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/graphics/pro, graphics)
qmakeClear($$CORE_ROOT_DIR/PdfWriter, PdfWriter)
qmakeClear($$CORE_ROOT_DIR/DjVuFile, DjVuFile)
qmakeClear($$CORE_ROOT_DIR/XpsFile, XpsFile)
qmakeClear($$CORE_ROOT_DIR/HtmlRenderer, htmlrenderer)
qmakeClear($$CORE_ROOT_DIR/PdfReader, PdfReader)
qmakeClear($$CORE_ROOT_DIR/HtmlFile2, HtmlFile2)
qmakeClear($$CORE_ROOT_DIR/EpubFile, EpubFile)
qmakeClear($$CORE_ROOT_DIR/Fb2File, Fb2File)
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/doctrenderer, doctrenderer)
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/AllFontsGen, AllFontsGen)
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/allthemesgen, allthemesgen)
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder, docbuilder)
qmakeClear($$CORE_ROOT_DIR/Test/Applications/StandardTester, standardtester)
qmakeClear($$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib, DocxFormatLib)
qmakeClear($$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib, PPTXFormatLib)
qmakeClear($$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux, ASCOfficeDocxFile2Lib)
qmakeClear($$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux, TxtXmlFormatLib)
qmakeClear($$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux, RtfFormatLib)
qmakeClear($$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux, PPTFormatLib)
qmakeClear($$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux, DocFormatLib)
qmakeClear($$CORE_ROOT_DIR/ASCOfficeOdfFile/linux, OdfFileReaderLib)
qmakeClear($$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux, OdfFileWriterLib)
qmakeClear($$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux, XlsFormatLib)
qmakeClear($$CORE_ROOT_DIR/X2tConverter/build/Qt, X2tConverter)
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/hunspell-1.3.3/src/qt, hunspell)
qmakeClear($$CORE_ROOT_DIR/DesktopEditor/xmlsec/src, ooxmlsignature)
qmakeClear($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib, ascdocumentscore)
qmakeClear($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib, ascdocumentscore_helper)
qmakeClear($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper, qtascdocumentscore)
qmakeClear($$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib, videoplayerlib)
qmakeClear($$ROOT_DIR/desktop-apps/win-linux/extras/projicons, ProjIcons)
qmakeClear($$ROOT_DIR/desktop-apps/win-linux, ASCDocumentEditor)
}
# PROJECTS
cryptopp.file = $$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/cryptopp.pro
cryptopp.makefile = $$CORE_ROOT_DIR/Common/3dParty/cryptopp/project/Makefile.cryptopp$$PRO_SUFFIX
kernel.file = $$CORE_ROOT_DIR/Common/kernel.pro
kernel.makefile = $$CORE_ROOT_DIR/Common/Makefile.kernel$$PRO_SUFFIX
unicodeconverter.file = $$CORE_ROOT_DIR/UnicodeConverter/UnicodeConverter.pro
unicodeconverter.makefile = $$CORE_ROOT_DIR/UnicodeConverter/Makefile.UnicodeConverter$$PRO_SUFFIX
graphics.file = $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/graphics.pro
graphics.makefile = $$CORE_ROOT_DIR/DesktopEditor/graphics/pro/Makefile.graphics$$PRO_SUFFIX
pdfwriter.file = $$CORE_ROOT_DIR/PdfWriter/PdfWriter.pro
pdfwriter.makefile = $$CORE_ROOT_DIR/PdfWriter/Makefile.PdfWriter$$PRO_SUFFIX
djvufile.file = $$CORE_ROOT_DIR/DjVuFile/DjVuFile.pro
djvufile.makefile = $$CORE_ROOT_DIR/DjVuFile/Makefile.DjVuFile$$PRO_SUFFIX
xpsfile.file = $$CORE_ROOT_DIR/XpsFile/XpsFile.pro
xpsfile.makefile = $$CORE_ROOT_DIR/XpsFile/Makefile.XpsFile$$PRO_SUFFIX
htmlrenderer.file = $$CORE_ROOT_DIR/HtmlRenderer/htmlrenderer.pro
htmlrenderer.makefile = $$CORE_ROOT_DIR/HtmlRenderer/Makefile.htmlrenderer$$PRO_SUFFIX
pdfreader.file = $$CORE_ROOT_DIR/PdfReader/PdfReader.pro
pdfreader.makefile = $$CORE_ROOT_DIR/PdfReader/Makefile.PdfReader$$PRO_SUFFIX
htmlfile2.file = $$CORE_ROOT_DIR/HtmlFile2/HtmlFile2.pro
htmlfile2.makefile = $$CORE_ROOT_DIR/HtmlFile2/Makefile.HtmlFile2$$PRO_SUFFIX
doctrenderer.file = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/doctrenderer.pro
doctrenderer.makefile = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/Makefile.doctrenderer$$PRO_SUFFIX
fb2file.file = $$CORE_ROOT_DIR/Fb2File/Fb2File.pro
fb2file.makefile = $$CORE_ROOT_DIR/Fb2File/Makefile.Fb2File$$PRO_SUFFIX
epubfile.file = $$CORE_ROOT_DIR/EpubFile/CEpubFile.pro
epubfile.makefile = $$CORE_ROOT_DIR/EpubFile/Makefile.EpubFile$$PRO_SUFFIX
!no_use_common_binary {
allfontsgen.file = $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/AllFontsGen.pro
allfontsgen.makefile = $$CORE_ROOT_DIR/DesktopEditor/AllFontsGen/Makefile.AllFontsGen$$PRO_SUFFIX
allthemesgen.file = $$CORE_ROOT_DIR/DesktopEditor/allthemesgen/allthemesgen.pro
allthemesgen.makefile = $$CORE_ROOT_DIR/DesktopEditor/allthemesgen/Makefile.allthemesgen$$PRO_SUFFIX
docbuilder.file = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/docbuilder.pro
docbuilder.makefile = $$CORE_ROOT_DIR/DesktopEditor/doctrenderer/app_builder/Makefile.docbuilder$$PRO_SUFFIX
}
!no_tests {
standardtester.file = $$CORE_ROOT_DIR/Test/Applications/StandardTester/standardtester.pro
standardtester.makefile = $$CORE_ROOT_DIR/Test/Applications/StandardTester/Makefile.standardtester$$PRO_SUFFIX
}
!no_x2t {
docxformat.file = $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/DocxFormatLib.pro
docxformat.makefile = $$CORE_ROOT_DIR/Common/DocxFormat/DocxFormatLib/Makefile.DocxFormatLib$$PRO_SUFFIX
pptxformat.file = $$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/PPTXFormatLib.pro
pptxformat.makefile = $$CORE_ROOT_DIR/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/Makefile.PPTXFormatLib$$PRO_SUFFIX
docxfile.file = $$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro
docxfile.makefile = $$CORE_ROOT_DIR/ASCOfficeDocxFile2/Linux/Makefile.ASCOfficeDocxFile2Lib$$PRO_SUFFIX
txtxmlformat.file = $$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/TxtXmlFormatLib.pro
txtxmlformat.makefile = $$CORE_ROOT_DIR/ASCOfficeTxtFile/TxtXmlFormatLib/Linux/Makefile.TxtXmlFormatLib$$PRO_SUFFIX
rtfformat.file = $$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/RtfFormatLib.pro
rtfformat.makefile = $$CORE_ROOT_DIR/ASCOfficeRtfFile/RtfFormatLib/Linux/Makefile.RtfFormatLib$$PRO_SUFFIX
pptformat.file = $$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/PPTFormatLib.pro
pptformat.makefile = $$CORE_ROOT_DIR/ASCOfficePPTFile/PPTFormatLib/Linux/Makefile.PPTFormatLib$$PRO_SUFFIX
docformat.file = $$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/DocFormatLib.pro
docformat.makefile = $$CORE_ROOT_DIR/ASCOfficeDocFile/DocFormatLib/Linux/Makefile.DocFormatLib$$PRO_SUFFIX
odffilereader.file = $$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/OdfFileReaderLib.pro
odffilereader.makefile = $$CORE_ROOT_DIR/ASCOfficeOdfFile/linux/Makefile.OdfFileReaderLib$$PRO_SUFFIX
odffilewriter.file = $$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro
odffilewriter.makefile = $$CORE_ROOT_DIR/ASCOfficeOdfFileW/linux/Makefile.OdfFileWriterLib$$PRO_SUFFIX
xlsformat.file = $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro
xlsformat.makefile = $$CORE_ROOT_DIR/ASCOfficeXlsFile2/source/linux/Makefile.XlsFormatLib$$PRO_SUFFIX
x2t.file = $$CORE_ROOT_DIR/X2tConverter/build/Qt/X2tConverter.pro
x2t.makefile = $$CORE_ROOT_DIR/X2tConverter/build/Qt/Makefile.X2tConverter$$PRO_SUFFIX
}
desktop {
hunspell.file = $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro
hunspell.makefile = $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/Makefile.hunspell$$PRO_SUFFIX
ooxmlsignature.file = $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/ooxmlsignature.pro
ooxmlsignature.makefile = $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/Makefile.ooxmlsignature$$PRO_SUFFIX
documentscore.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore.pro
documentscore.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/Makefile.ascdocumentscore$$PRO_SUFFIX
documentscore_helper.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore_helper.pro
documentscore_helper.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/Makefile.ascdocumentscore_helper$$PRO_SUFFIX
message(desktop)
addSubProject(hunspell, $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro)
addSubProject(ooxmlsignature, $$CORE_ROOT_DIR/DesktopEditor/xmlsec/src/ooxmlsignature.pro,\
kernel unicodeconverter graphics)
addSubProject(documentscore, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore.pro,\
kernel unicodeconverter graphics hunspell ooxmlsignature htmlrenderer pdfwriter pdfreader djvufile xpsfile)
addSubProject(documentscore_helper, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/ascdocumentscore_helper.pro,\
documentscore)
!core_mac {
qtdocumentscore.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/qtascdocumentscore.pro
qtdocumentscore.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/Makefile.qtascdocumentscore$$PRO_SUFFIX
addSubProject(qtdocumentscore, $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/lib/qt_wrapper/qtascdocumentscore.pro,\
documentscore)
}
!no_desktop_apps {
core_windows {
projicons.file = $$ROOT_DIR/desktop-apps/win-linux/extras/projicons/ProjIcons.pro
projicons.makefile = $$ROOT_DIR/desktop-apps/win-linux/extras/projicons/Makefile.ProjIcons$$PRO_SUFFIX
}
desktopapp.file = $$ROOT_DIR/desktop-apps/win-linux/ASCDocumentEditor.pro
desktopapp.makefile = $$ROOT_DIR/desktop-apps/win-linux/Makefile.ASCDocumentEditor$$PRO_SUFFIX
core_windows:addSubProject(projicons, $$ROOT_DIR/desktop-apps/win-linux/extras/projicons/ProjIcons.pro,\
documentscore videoplayer)
addSubProject(desktopapp, $$ROOT_DIR/desktop-apps/win-linux/ASCDocumentEditor.pro,\
documentscore videoplayer)
}
}
core_and_multimedia {
videoplayer.file = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/videoplayerlib.pro
videoplayer.makefile = $$ROOT_DIR/desktop-sdk/ChromiumBasedEditors/videoplayerlib/Makefile.videoplayerlib$$PRO_SUFFIX
}
# DEPENDS
kernel.depends = cryptopp
unicodeconverter.depends = kernel
graphics.depends = kernel unicodeconverter
pdfwriter.depends = kernel unicodeconverter graphics
djvufile.depends = kernel unicodeconverter graphics pdfwriter
xpsfile.depends = kernel unicodeconverter graphics pdfwriter
htmlrenderer.depends = kernel unicodeconverter graphics pdfwriter
pdfreader.depends = kernel unicodeconverter graphics pdfwriter htmlrenderer
htmlfile2.depends = kernel unicodeconverter graphics
doctrenderer.depends = kernel unicodeconverter graphics
fb2file.depends = kernel unicodeconverter graphics
epubfile.depends = kernel unicodeconverter graphics htmlfile2
!no_use_common_binary {
allfontsgen.depends = kernel unicodeconverter graphics
allthemesgen.depends = kernel unicodeconverter graphics
docbuilder.depends = kernel unicodeconverter graphics doctrenderer
}
core_and_multimedia {
videoplayer.depends = kernel unicodeconverter graphics
}
desktop {
ooxmlsignature.depends = kernel unicodeconverter graphics
documentscore.depends = kernel unicodeconverter graphics hunspell ooxmlsignature htmlrenderer pdfwriter pdfreader djvufile xpsfile
documentscore_helper.depends = documentscore
!core_mac {
qtdocumentscore.depends = documentscore
mobile {
message(mobile)
!desktop {
addSubProject(hunspell, $$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pro)
}
!no_desktop_apps {
core_windows:projicons.depends = documentscore videoplayer
desktopapp.depends = documentscore videoplayer
}
}
!no_x2t {
x2t.depends = \
docxformat \
pptxformat \
docxfile \
txtxmlformat \
rtfformat \
pptformat \
docformat \
odffilereader \
odffilewriter \
xlsformat \
fb2file \
epubfile
}
}

69
common.pri Normal file
View File

@ -0,0 +1,69 @@
# must setup CORE_ROOT_DIR before including
include($$CORE_ROOT_DIR/Common/base.pri)
MAKEFILE=makefiles/build.makefile_$$CORE_BUILDS_PLATFORM_PREFIX
PRO_SUFFIX=$$CORE_BUILDS_PLATFORM_PREFIX
core_debug {
MAKEFILE=$$join(MAKEFILE, , , "_debug_")
PRO_SUFFIX=$$join(PRO_SUFFIX, , , "_debug_")
}
build_xp {
MAKEFILE=$$join(MAKEFILE, , , "_xp")
PRO_SUFFIX=$$join(PRO_SUFFIX, , , "_xp")
}
OO_BRANDING_SUFFIX = $$(OO_BRANDING)
!isEmpty(OO_BRANDING_SUFFIX) {
PRO_SUFFIX=$$join(PRO_SUFFIX, , , "$$OO_BRANDING_SUFFIX")
MAKEFILE=$$join(MAKEFILE, , , "$$OO_BRANDING_SUFFIX")
}
message(current_makefile)
message($$MAKEFILE)
CONFIG += ordered
defineTest(removeFile) {
file = $$1
win32:file ~= s,/,\\,g
core_windows {
system(if exist $$shell_quote($$file) $$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
} else {
system($$QMAKE_DEL_FILE $$shell_quote($$file) $$escape_expand(\\n\\t))
}
}
defineTest(qmakeClear) {
dir = $$1
name = $$2
removeFile($$1/Makefile.$$2$$PRO_SUFFIX)
removeFile($$1/.qmake.stash)
}
# addSubProject() - adds project to SUBDIRS, creates variables associated with the project(file, makefile, depends)
# Arg1 - Project name
# Arg2 - Qmake file of project
# Arg3(optional) - Project dependencies
defineTest(addSubProject) {
pro_name = $$1
pro_file = $$2
pro_depends = $$3
isEmpty(pro_name):error(Sub-project name is not defined.)
isEmpty(pro_file):error(Qmake file of sub-project \'$$pro_name\' is not defined.)
!exists($$pro_file):error(Sub-project qmake file \'$$pro_file\' is not exists.)
path = $$section(pro_file, /, 0, -2)
ext_name = $$section(pro_file, /, -1, -1)
name = $$section(ext_name, ., 0, 0)
SUBDIRS += $$pro_name
export(SUBDIRS)
$${pro_name}.file = $$pro_file
export($${pro_name}.file)
$${pro_name}.makefile = $$path/Makefile.$$name$$PRO_SUFFIX
export($${pro_name}.makefile)
!isEmpty(pro_depends) {
$${pro_name}.depends = $$pro_depends
export($${pro_name}.depends)
}
# remove makefile
qmakeClear($$path, $$name)
}

View File

@ -1,2 +1,3 @@
sdkjs-plugin="photoeditor, macros, ocr, translator, thesaurus, youtube, highlightcode"
sdkjs-plugin-server="speech, zotero, mendeley"
sdkjs-addons="sdkjs-forms"

View File

@ -1,34 +1,39 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
sys.path.append('scripts')
sys.path.append('scripts/develop')
sys.path.append('scripts/develop/vendor')
sys.path.append('scripts/core_common')
sys.path.append('scripts/core_common/modules')
import optparse
import config
import base
import packages
# parse configuration
config.parse()
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__)
base.set_env("BUILD_PLATFORM", config.option("platform"))
# branding
if ("1" != base.get_env("OO_RUNNING_BRANDING")) and ("" != config.option("branding")):
branding_dir = base_dir + "/../" + config.option("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.set_env("OO_RUNNING_BRANDING", "1")
base.set_env("OO_BRANDING", config.option("branding"))
base.cmd_in_dir(branding_dir + "/build_tools", "python", ["make_packages.py"])
base.cmd_in_dir(branding_dir + "/build_tools",
"python3", ["make_packages.py",
'--product', product,
'--package', package_list
])
exit(0)
base.check_build_version(base_dir)
# build packages
packages.make()
packages.make(product, package_list)

View File

@ -31,6 +31,11 @@ def host_platform():
def is_os_64bit():
return platform.machine().endswith('64')
def is_os_arm():
if -1 == platform.machine().find('arm'):
return False
return True
def is_python_64bit():
return (struct.calcsize("P") == 8)
@ -97,6 +102,14 @@ def copy_file(src, dst):
return
return shutil.copy2(get_path(src), get_path(dst))
def move_file(src, dst):
if is_file(dst):
delete_file(dst)
if not is_file(src):
print("move warning [file not exist]: " + src)
return
return shutil.move(get_path(src), get_path(dst))
def copy_files(src, dst, override=True):
for file in glob.glob(src):
file_name = os.path.basename(file)
@ -111,6 +124,20 @@ def copy_files(src, dst, override=True):
copy_files(file + "/*", dst + "/" + file_name, override)
return
def move_files(src, dst, override=True):
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):
move_file(file, dst)
elif is_dir(file):
if not is_dir(dst + "/" + file_name):
create_dir(dst + "/" + file_name)
move_files(file + "/*", dst + "/" + file_name, override)
return
def copy_dir_content(src, dst, filterInclude = "", filterExclude = ""):
src_folder = src
if ("/" != src[-1:]):
@ -432,16 +459,32 @@ def get_repositories():
if config.check_option("module", "desktop"):
result["desktop-sdk"] = [False, False]
result["desktop-apps"] = [False, False]
result["document-templates"] = [False, False]
if (config.check_option("module", "server")):
result["server"] = [False, False]
result.update(get_server_addons())
result["document-server-integration"] = [False, False]
result["document-templates"] = [False, False]
if (config.check_option("module", "server") or config.check_option("platform", "ios")):
result["core-fonts"] = [False, False]
get_branding_repositories(result)
return result
def get_branding_repositories(checker):
modules = ["core", "server", "mobile", "desktop", "builder"]
for mod in modules:
if not config.check_option("module", mod):
continue
name = "repositories_" + mod
repos = config.option(name).rsplit(", ")
for repo in repos:
if (repo != ""):
checker[repo] = [False, False]
return
def create_pull_request(branches_to, repo, is_no_errors=False, is_current_dir=False):
print("[git] create pull request: " + repo)
url = "https://github.com/ONLYOFFICE/" + repo + ".git"
@ -523,6 +566,8 @@ def qt_config(platform):
config_param += " release"
if ("mac_arm64" == platform):
config_param += " apple_silicon use_javascript_core"
if config.check_option("module", "mobile"):
config_param += " support_web_socket"
return config_param
def qt_major_version():
@ -537,7 +582,16 @@ def qt_copy_lib(lib, dir):
else:
copy_lib(qt_dir, dir, lib + "d")
else:
copy_file(qt_dir + "/../lib/lib" + lib + ".so." + qt_version(), dir + "/lib" + lib + ".so." + qt_major_version())
src_file = qt_dir + "/../lib/lib" + lib + ".so." + qt_version()
if (is_file(src_file)):
copy_file(src_file, dir + "/lib" + lib + ".so." + qt_major_version())
else:
libFramework = lib
libFramework = libFramework.replace("Qt5", "Qt")
libFramework = libFramework.replace("Qt6", "Qt")
libFramework += ".framework"
if (is_dir(qt_dir + "/../lib/" + libFramework)):
copy_dir(qt_dir + "/../lib/" + libFramework, dir + "/" + libFramework)
return
def _check_icu_common(dir, out):
@ -684,7 +738,7 @@ def generate_plist(path):
content += "\t<key>CFBundleGetInfoString</key>\n"
content += "\t<string>Created by " + bundle_creator + "</string>\n"
content += "\t<key>CFBundleIdentifier</key>\n"
content += "\t<string>" + bundle_id_url + name + "</string>\n"
content += "\t<string>" + bundle_id_url + correct_bundle_identifier(name) + "</string>\n"
content += "\t<key>CFBundlePackageType</key>\n"
content += "\t<string>FMWK</string>\n"
content += "\t<key>CFBundleShortVersionString</key>\n"
@ -708,6 +762,9 @@ def generate_plist(path):
return
def correct_bundle_identifier(bundle_identifier):
return re.sub("[^a-zA-Z0-9\.\-]", "-", bundle_identifier)
def get_sdkjs_addons():
result = {}
if ("" == config.option("sdkjs-addons")):
@ -915,9 +972,10 @@ def mac_correct_rpath_x2t(dir):
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("graphics", ["UnicodeConverter", "kernel"])
mac_correct_rpath_library("doctrenderer", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("HtmlFile2", ["UnicodeConverter", "kernel", "graphics"])
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("Fb2File", ["UnicodeConverter", "kernel", "graphics"])
mac_correct_rpath_library("HtmlRenderer", ["UnicodeConverter", "kernel", "graphics"])
@ -927,7 +985,7 @@ def mac_correct_rpath_x2t(dir):
mac_correct_rpath_library("XpsFile", ["kernel", "UnicodeConverter", "graphics", "PdfWriter"])
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", "graphics", "PdfWriter", "HtmlRenderer", "PdfReader", "XpsFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer"])
mac_correct_rpath_binary("./x2t", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfWriter", "HtmlRenderer", "PdfReader", "XpsFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer"])
if is_file("./allfontsgen"):
cmd("chmod", ["-v", "+x", "./allfontsgen"])
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./allfontsgen"], True)
@ -935,7 +993,7 @@ def mac_correct_rpath_x2t(dir):
if is_file("./allthemesgen"):
cmd("chmod", ["-v", "+x", "./allthemesgen"])
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./allthemesgen"], True)
mac_correct_rpath_binary("./allthemesgen", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "graphics", "doctrenderer"])
mac_correct_rpath_binary("./allthemesgen", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "graphics", "kernel_network", "doctrenderer"])
os.chdir(cur_dir)
return
@ -945,9 +1003,9 @@ def mac_correct_rpath_desktop(dir):
os.chdir(dir)
mac_correct_rpath_library("hunspell", [])
mac_correct_rpath_library("ooxmlsignature", ["kernel"])
mac_correct_rpath_library("ascdocumentscore", ["UnicodeConverter", "kernel", "graphics", "PdfWriter", "HtmlRenderer", "PdfReader", "XpsFile", "DjVuFile", "hunspell", "ooxmlsignature"])
mac_correct_rpath_library("ascdocumentscore", ["UnicodeConverter", "kernel", "graphics", "kernel_network", "PdfWriter", "HtmlRenderer", "PdfReader", "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", "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", "PdfWriter", "HtmlRenderer", "PdfReader", "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"])
@ -1101,3 +1159,8 @@ def get_mac_sdk_version_number():
return 1000 * int(ver_arr[0])
return 1000 * int(ver_arr[0]) + int(ver_arr[1])
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 + "/.."

View File

@ -3,6 +3,7 @@
import config
import base
import os
import multiprocessing
def make_pro_file(makefiles_dir, pro_file):
platforms = config.option("platform").split()
@ -66,7 +67,10 @@ def make_pro_file(makefiles_dir, pro_file):
base.cmd_and_return_cwd(base.app_make(), ["clean", "-f", makefiles_dir + "/build.makefile_" + file_suff], True)
base.cmd_and_return_cwd(base.app_make(), ["distclean", "-f", makefiles_dir + "/build.makefile_" + file_suff], True)
base.cmd(qt_dir + "/bin/qmake", ["-nocache", pro_file, "CONFIG+=" + config_param] + qmake_addon)
base.cmd_and_return_cwd(base.app_make(), ["-f", makefiles_dir + "/build.makefile_" + file_suff])
if ("0" != config.option("multiprocess")):
base.cmd_and_return_cwd(base.app_make(), ["-f", makefiles_dir + "/build.makefile_" + file_suff, "-j" + str(multiprocessing.cpu_count())])
else:
base.cmd_and_return_cwd(base.app_make(), ["-f", makefiles_dir + "/build.makefile_" + file_suff])
else:
qmake_bat = []
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + ("x86" if base.platform_is_32(platform) else "x64"))
@ -78,6 +82,8 @@ def make_pro_file(makefiles_dir, pro_file):
if ("1" == config.option("clean")):
qmake_bat.append("call nmake clean -f " + makefiles_dir + "/build.makefile_" + file_suff)
qmake_bat.append("call nmake distclean -f " + makefiles_dir + "/build.makefile_" + file_suff)
if ("0" != config.option("multiprocess")):
qmake_bat.append("set CL=/MP")
qmake_bat.append("call nmake -f " + makefiles_dir + "/build.makefile_" + file_suff)
base.run_as_bat(qmake_bat)

View File

@ -2,12 +2,15 @@
import config
import base
import os
# make build.pro
def make():
if ("1" == base.get_env("OO_NO_BUILD_JS")):
return
base.set_env('NODE_ENV', 'production')
base_dir = base.get_script_dir() + "/.."
out_dir = base_dir + "/out/js/";
branding = config.option("branding-name")
@ -44,26 +47,46 @@ def make():
# mobile
if config.check_option("module", "mobile"):
build_sdk_native(base_dir + "/../sdkjs/build")
build_sdk_native(base_dir + "/../sdkjs/build", False)
base.create_dir(out_dir + "/mobile")
base.create_dir(out_dir + "/mobile/sdkjs")
vendor_dir_src = base_dir + "/../web-apps/vendor/"
sdk_dir_src = base_dir + "/../sdkjs/deploy/sdkjs/"
# banners
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"],
out_dir + "/mobile/sdkjs/banners_word.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",
sdk_dir_src + "common/Native/native.js",
sdk_dir_src + "../../common/Native/Wrappers/common.js",
sdk_dir_src + "common/Native/jquery_native.js"],
out_dir + "/mobile/sdkjs/banners.js")
base_dir + "/../sdkjs/common/Native/native.js",
base_dir + "/../sdkjs/cell/native/common.js",
base_dir + "/../sdkjs/common/Native/jquery_native.js"],
out_dir + "/mobile/sdkjs/banners_cell.js")
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"],
out_dir + "/mobile/sdkjs/banners_slide.js")
base.create_dir(out_dir + "/mobile/sdkjs/word")
base.join_scripts([out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js"], out_dir + "/mobile/sdkjs/word/script.bin")
base.join_scripts([out_dir + "/mobile/sdkjs/banners_word.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js"], out_dir + "/mobile/sdkjs/word/script.bin")
base.create_dir(out_dir + "/mobile/sdkjs/cell")
base.join_scripts([out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js"], out_dir + "/mobile/sdkjs/cell/script.bin")
base.join_scripts([out_dir + "/mobile/sdkjs/banners_cell.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js"], out_dir + "/mobile/sdkjs/cell/script.bin")
base.create_dir(out_dir + "/mobile/sdkjs/slide")
base.join_scripts([out_dir + "/mobile/sdkjs/banners.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js"], out_dir + "/mobile/sdkjs/slide/script.bin")
base.delete_file(out_dir + "/mobile/sdkjs/banners.js")
base.join_scripts([out_dir + "/mobile/sdkjs/banners_slide.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js"], out_dir + "/mobile/sdkjs/slide/script.bin")
base.delete_file(out_dir + "/mobile/sdkjs/banners_word.js")
base.delete_file(out_dir + "/mobile/sdkjs/banners_cell.js")
base.delete_file(out_dir + "/mobile/sdkjs/banners_slide.js")
return
# JS build
@ -82,9 +105,12 @@ def build_interface(directory):
return
def get_build_param(minimize=True):
minimize_scripts = minimize
if config.check_option("jsminimize", "0"):
minimize_scripts = False
beta = "true" if config.check_option("beta", "1") else "false"
params = ["--beta=" + beta]
return params + (["--level=ADVANCED"] if minimize else ["--level=WHITESPACE_ONLY", "--formatting=PRETTY_PRINT"])
return params + (["--level=ADVANCED"] if minimize_scripts else ["--level=WHITESPACE_ONLY", "--formatting=PRETTY_PRINT"])
def build_sdk_desktop(directory):
#_run_npm_cli(directory)
@ -98,10 +124,10 @@ def build_sdk_builder(directory):
_run_grunt(directory, get_build_param() + base.sdkjs_addons_param())
return
def build_sdk_native(directory):
def build_sdk_native(directory, minimize=True):
#_run_npm_cli(directory)
_run_npm(directory)
_run_grunt(directory, get_build_param() + ["--mobile=true"] + base.sdkjs_addons_param())
_run_grunt(directory, get_build_param(minimize) + ["--mobile=true"] + base.sdkjs_addons_param())
return
def build_js_develop(root_dir):
@ -116,4 +142,15 @@ def build_js_develop(root_dir):
_run_npm(root_dir + external_folder + "/web-apps/build")
_run_npm(root_dir + external_folder + "/web-apps/build/sprites")
_run_grunt(root_dir + external_folder + "/web-apps/build/sprites", [])
old_cur = os.getcwd()
old_product_version = base.get_env("PRODUCT_VERSION")
base.set_env("PRODUCT_VERSION", old_product_version + "d")
os.chdir(root_dir + external_folder + "/web-apps/vendor/framework7-react")
base.cmd("npm", ["install"])
base.cmd("npm", ["run", "deploy-word"])
base.cmd("npm", ["run", "deploy-cell"])
base.cmd("npm", ["run", "deploy-slide"])
base.set_env("PRODUCT_VERSION", old_product_version)
os.chdir(old_cur)
return

View File

@ -0,0 +1,58 @@
#!/usr/bin/env python
import config
import base
import os
import build_js
# parse configuration
config.parse()
config.extend_option("jsminimize", "0")
branding = config.option("branding-name")
if ("" == branding):
branding = "onlyoffice"
base_dir = base.get_script_dir() + "/.."
out_dir = base_dir + "/../native-sdk/examples/win-linux-mac/build/sdkjs"
base.create_dir(out_dir)
build_js.build_sdk_native(base_dir + "/../sdkjs/build")
vendor_dir_src = base_dir + "/../web-apps/vendor/"
sdk_dir_src = base_dir + "/../sdkjs/deploy/sdkjs/"
base.join_scripts([vendor_dir_src + "xregexp/xregexp-all-min.js",
vendor_dir_src + "underscore/underscore-min.js",
base_dir + "/../sdkjs/common/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"],
out_dir + "/banners_word.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"],
out_dir + "/banners_cell.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"],
out_dir + "/banners_slide.js")
base.create_dir(out_dir + "/word")
base.join_scripts([out_dir + "/banners_word.js", sdk_dir_src + "word/sdk-all-min.js", sdk_dir_src + "word/sdk-all.js"], out_dir + "/word/script.bin")
base.create_dir(out_dir + "/cell")
base.join_scripts([out_dir + "/banners_cell.js", sdk_dir_src + "cell/sdk-all-min.js", sdk_dir_src + "cell/sdk-all.js"], out_dir + "/cell/script.bin")
base.create_dir(out_dir + "/slide")
base.join_scripts([out_dir + "/banners_slide.js", sdk_dir_src + "slide/sdk-all-min.js", sdk_dir_src + "slide/sdk-all.js"], out_dir + "/slide/script.bin")
base.delete_file(out_dir + "/banners_word.js")
base.delete_file(out_dir + "/banners_cell.js")
base.delete_file(out_dir + "/banners_slide.js")

View File

@ -41,7 +41,7 @@ def make():
if(base.is_exist(custom_public_key)):
base.copy_file(custom_public_key, server_build_dir + '/Common/sources')
pkg_target = "node10"
pkg_target = "node14"
if ("linux" == base.host_platform()):
pkg_target += "-linux"
@ -52,18 +52,10 @@ def make():
base.cmd_in_dir(server_build_dir + "/DocService", "pkg", [".", "-t", pkg_target, "--options", "max_old_space_size=4096", "-o", "docservice"])
base.cmd_in_dir(server_build_dir + "/FileConverter", "pkg", [".", "-t", pkg_target, "-o", "converter"])
base.cmd_in_dir(server_build_dir + "/Metrics", "pkg", [".", "-t", pkg_target, "-o", "metrics"])
base.cmd_in_dir(server_build_dir + "/SpellChecker", "pkg", [".", "-t", pkg_target, "-o", "spellchecker"])
example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs"
base.delete_dir(example_dir + "/node_modules")
base.cmd_in_dir(example_dir, "npm", ["install"])
sync_rpc_lib_dir = example_dir + "/node_modules/sync-rpc/lib"
patch_file = base.get_script_dir() + "/../tools/linux/sync-rpc.patch"
if ("linux" == base.host_platform()):
base.cmd_in_dir(sync_rpc_lib_dir, "patch", ["-N", "-i", patch_file])
if ("windows" == base.host_platform()):
patch_exe_dir = base.git_dir() + "/usr/bin"
base.cmd_in_dir(patch_exe_dir, "patch.exe", ["-N", "-d", sync_rpc_lib_dir, "-i", patch_file])
base.cmd_in_dir(example_dir, "pkg", [".", "-t", pkg_target, "-o", "example"])
def build_server_develop():

View File

@ -53,6 +53,10 @@ def parse():
else:
options["platform"] += (" mac_" + bits)
if ("mac" == host_platform) and check_option("platform", "mac_arm64") and (platform.machine() != "arm64"):
if not check_option("platform", "mac_64"):
options["platform"] = "mac_64 " + options["platform"]
if check_option("platform", "xp") and ("windows" == host_platform):
options["platform"] += " win_64_xp win_32_xp"
@ -99,6 +103,12 @@ def check_compiler(platform):
compiler["compiler"] = platform
compiler["compiler_64"] = platform
if base.host_platform() == "mac":
if not base.is_dir(options["qt-dir"] + "/" + compiler["compiler_64"]):
if base.is_dir(options["qt-dir"] + "/macos"):
compiler["compiler"] = "macos"
compiler["compiler_64"] = "macos"
return compiler
def check_option(name, value):
@ -126,6 +136,14 @@ def branding():
branding = "onlyoffice"
return branding
def is_mobile_platform():
all_platforms = option("platform")
if (-1 != all_platforms.find("android")):
return True
if (-1 != all_platforms.find("ios")):
return True
return False
def parse_defaults():
defaults_path = base.get_script_dir() + "/../defaults"
if ("" != option("branding")):

20
scripts/core_common/make_common.py Normal file → Executable file
View File

@ -6,16 +6,32 @@ sys.path.append('..')
import config
import base
import glob
import boost
import cef
import icu
import openssl
import curl
import websocket
import v8
import html2
import hunspell
import glew
def check_android_ndk_macos_arm(dir):
if base.is_dir(dir + "/darwin-x86_64") and not base.is_dir(dir + "/darwin-arm64"):
print("copy toolchain... [" + dir + "]")
base.copy_dir(dir + "/darwin-x86_64", dir + "/darwin-arm64")
return
def make():
if (config.check_option("platform", "android")) and (base.host_platform() == "mac") and (base.is_os_arm()):
for toolchain in glob.glob(base.get_env("ANDROID_NDK_ROOT") + "/toolchains/*"):
if base.is_dir(toolchain):
check_android_ndk_macos_arm(toolchain + "/prebuilt")
boost.make()
cef.make()
icu.make()
@ -23,4 +39,8 @@ def make():
v8.make()
html2.make()
hunspell.make(False)
glew.make()
if config.check_option("module", "mobile"):
curl.make()
websocket.make()
return

View File

@ -13,7 +13,7 @@ def make():
old_cur = os.getcwd()
os.chdir(base_dir)
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32", "mac_64"]
platforms = ["win_64", "win_32", "win_64_xp", "win_32_xp", "linux_64", "linux_32", "mac_64", "mac_arm64"]
url = "http://d2ettrnqo7v976.cloudfront.net/cef/4280/"
@ -54,14 +54,14 @@ def make():
base.create_dir("./build")
# deploy
if ("mac_64" != platform):
if (0 != platform.find("mac")):
base.copy_files("cef_binary/Release/*", "build/")
base.copy_files("cef_binary/Resources/*", "build/")
if (0 == platform.find("linux")):
base.cmd("chmod", ["a+xr", "build/locales"])
if ("mac_64" == platform):
if (0 == platform.find("mac")):
base.cmd("mv", ["Chromium Embedded Framework.framework", "build/Chromium Embedded Framework.framework"])
os.chdir(base_dir)

View File

@ -0,0 +1,27 @@
#!/usr/bin/env python
import sys
sys.path.append('../..')
import config
import subprocess
import os
import base
def make():
path = base.get_script_dir() + "/../../core/Common/3dParty/curl"
old_cur = os.getcwd()
os.chdir(path)
if (-1 != config.option("platform").find("android")):
if base.is_dir(path + "/build/android"):
os.chdir(old_cur)
return
subprocess.call(["./build-android-curl.sh"])
elif (-1 != config.option("platform").find("ios")):
if base.is_dir(path + "/build/ios"):
os.chdir(old_cur)
return
subprocess.call(["./build-ios-curl.sh"])
os.chdir(old_cur)
return

View File

@ -0,0 +1,34 @@
#!/usr/bin/env python
import sys
sys.path.append('../..')
import config
import base
import os
def clean():
if base.is_dir("glew-2.1.0"):
base.delete_dir("glew-2.1.0");
return
def make():
if ("windows" != base.host_platform()):
return
if not config.check_option("module", "mobile"):
return;
print("[fetch & build]: glew")
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/glew"
old_cur = os.getcwd()
os.chdir(base_dir)
base.common_check_version("glew", "1", clean)
if not base.is_dir("glew-2.1.0"):
base.download("https://deac-ams.dl.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0-win32.zip", "./archive.zip")
base.extract("./archive.zip", "./")
base.delete_file("./archive.zip")
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

@ -0,0 +1,191 @@
#!/usr/bin/env python
import sys
sys.path.append('../..')
import base
import os
import config
from distutils.version import LooseVersion, StrictVersion
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/ixwebsocket"
CMAKE = "cmake"
def find_last_version(arr_input, base_directory):
arr = []
for arr_rec in arr_input:
if base.is_file(base_directory + "/" + arr_rec + "/bin/cmake"):
arr.append(arr_rec)
res = arr[0]
for version in arr:
if(LooseVersion(version) > LooseVersion(res)):
res = version
return res
def build_arch(platform, arch, params, is_debug=False):
print("ixwebsocket build: " + platform + "....." + arch + " ----------------------------------------")
if base.is_dir(current_dir + "/IXWebSocket/build/"+ platform + "/" + arch):
base.delete_dir(current_dir + "/IXWebSocket/build/" + platform + "/" + arch)
base.create_dir(current_dir + "/IXWebSocket/build/" + platform + "/" + arch)
cache_dir = current_dir + "/IXWebSocket/build/" + platform + "/cache"
base.create_dir(cache_dir)
os.chdir(cache_dir)
libext = "a"
prefix = "/"
zlib = "1"
if (0 == platform.find("windows")):
zlib = "0"
libext = "lib"
prefix = cache_dir + "/../" + arch
path = platform
if(platform == "ios" or platform == "android"):
path += "/"
else:
path = ""
base.cmd(CMAKE, ["../../..",
"-DUSE_WS=0", "-DUSE_ZLIB=" + zlib, "-DUSE_TLS=1", "-DUSE_OPEN_SSL=1",
"-DOPENSSL_ROOT_DIR=" + cache_dir + "/../../../../../openssl/build/" + path + arch,
"-DOPENSSL_INCLUDE_DIR=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/include",
"-DOPENSSL_CRYPTO_LIBRARY=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/lib/libcrypto." + libext,
"-DOPENSSL_SSL_LIBRARY=" + cache_dir + "/../../../../../openssl/build/" + path + arch + "/lib/libssl." + libext,
"-DCMAKE_INSTALL_PREFIX:PATH=" + prefix] + params)
if(-1 != platform.find("ios") or -1 != platform.find("mac")):
base.cmd(CMAKE, ["--build", ".", "--config", "Release"])
base.cmd(CMAKE, ["--install", ".", "--config", "Release", "--prefix", cache_dir + "/../" + arch])
elif(-1 != platform.find("android") or -1 != platform.find("linux")):
base.cmd("make", ["-j4"])
base.cmd("make", ["DESTDIR=" + cache_dir + "/../" + arch, "install"])
elif(-1 != platform.find("windows")):
conf = "Debug" if is_debug else "Release"
base.cmd(CMAKE, ["--build", ".", "--target", "install", "--config", conf])
base.delete_dir(cache_dir)
os.chdir(current_dir)
return
def make():
if not base.is_dir(current_dir):
base.create_dir(current_dir)
print("[fetch & build]: ixwebsocket")
current_dir_old = os.getcwd()
os.chdir(current_dir)
if not base.is_dir(current_dir + "/IXWebSocket"):
base.cmd("git", ["clone", "https://github.com/machinezone/IXWebSocket"])
# build for platform
if (-1 != config.option("platform").find("android")):
if base.is_dir(current_dir + "/IXWebSocket/build/android"):
os.chdir(current_dir_old)
return
os.chdir(current_dir + "/IXWebSocket")
global CMAKE
CMAKE_TOOLCHAIN_FILE = base.get_env("ANDROID_NDK_ROOT") + "/build/cmake/android.toolchain.cmake"
CMAKE_DIR = base.get_android_sdk_home() + "/cmake/"
CMAKE = CMAKE_DIR + find_last_version(os.listdir(CMAKE_DIR), CMAKE_DIR) + "/bin/cmake"
def param_android(arch, api):
return ["-G","Unix Makefiles", "-DANDROID_NATIVE_API_LEVEL=" + api, "-DANDROID_ABI=" + arch, "-DANDROID_TOOLCHAIN=clang", "-DANDROID_NDK=" + base.get_env("ANDROID_NDK_ROOT"), "-DCMAKE_TOOLCHAIN_FILE=" + CMAKE_TOOLCHAIN_FILE, "-DCMAKE_MAKE_PROGRAM=make"]
build_arch("android", "arm64-v8a", param_android("arm64-v8a", "21"))
build_arch("android", "armeabi-v7a", param_android("armeabi-v7a", "16"))
build_arch("android", "x86_64", param_android("x86_64", "21"))
build_arch("android", "x86", param_android("x86", "16"))
elif (-1 != config.option("platform").find("ios") or -1 != config.option("platform").find("mac")):
platform = "ios" if -1 != config.option("platform").find("ios") else "mac"
if base.is_dir(current_dir + "/IXWebSocket/build/" + platform):
os.chdir(current_dir_old)
return
if not base.is_dir(current_dir + "/ios-cmake"):
base.cmd("git", ["clone", "https://github.com/leetal/ios-cmake"])
CMAKE_TOOLCHAIN_FILE = current_dir + "/ios-cmake/ios.toolchain.cmake"
os_cmd = 'cmake'
if os.system(os_cmd) != 0:
base.cmd("brew install", ["cmake"])
os.chdir(current_dir + "/IXWebSocket")
def param_apple(platform, arch):
return ["-G","Xcode", "-DDEPLOYMENT_TARGET=10", "-DENABLE_BITCODE=1", "-DPLATFORM=" + platform, "-DARCHS=" + arch, "-DCMAKE_TOOLCHAIN_FILE=" + CMAKE_TOOLCHAIN_FILE]
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"))
else:
build_arch("mac", "mac_arm64", param_apple("MAC_ARM64", "arm64"))
build_arch("mac", "mac_64", param_apple("MAC", "x86_64"))
os.chdir(current_dir)
if(platform == "ios"):
base.create_dir(current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal/include")
base.create_dir(current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal/lib")
#copy include
prefix_dir = current_dir + "/IXWebSocket/build/ios/"
postfix_dir = ""
if base.is_dir(prefix_dir + "armv7/usr"):
postfix_dir = "/usr"
if base.is_dir(prefix_dir + "armv7" + postfix_dir + "/include"):
base.cmd("cp", [ "-r", prefix_dir + "armv7" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
elif base.is_dir(prefix_dir + "armv64" + postfix_dir + "/include"):
base.cmd("cp", [ "-r", prefix_dir + "armv64" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
elif base.is_dir(prefix_dir + "i386" + postfix_dir + "/include"):
base.cmd("cp", [ "-r", prefix_dir + "i386" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
elif base.is_dir(prefix_dir + "x86_64" + postfix_dir + "/include"):
base.cmd("cp", [ "-r", prefix_dir + "x86_64" + postfix_dir + "/include", current_dir + "/IXWebSocket/build/ios/ixwebsocket-universal"])
# Create fat lib
base.cmd("lipo", ["IXWebSocket/build/ios/armv7" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/arm64" + postfix_dir + "/lib/libixwebsocket.a",
"IXWebSocket/build/ios/i386" + postfix_dir + "/lib/libixwebsocket.a", "IXWebSocket/build/ios/x86_64" + postfix_dir + "/lib/libixwebsocket.a",
"-create", "-output",
"IXWebSocket/build/ios/ixwebsocket-universal/lib/libixwebsocket.a"])
elif (-1 != config.option("platform").find("linux")):
if base.is_dir(current_dir + "/IXWebSocket/build/linux"):
os.chdir(current_dir_old)
return
#will support when openssl x86 will support
#if (-1 != config.option("platform").find("linux_32")):
#build_arch("linux", "linux_32", ["-G","Unix Makefiles", "-DCMAKE_MAKE_PROGRAM=make", "-DCMAKE_C_FLAGS=-m32", "-DCMAKE_CXX_FLAGS=-m32"])
if (-1 != config.option("platform").find("linux_64")):
build_arch("linux", "linux_64", ["-G","Unix Makefiles", "-DCMAKE_MAKE_PROGRAM=make"])
elif ("windows" == base.host_platform()):
if base.is_dir(current_dir + "/IXWebSocket/build/windows"):
os.chdir(current_dir_old)
return
if (-1 != config.option("platform").find("win_32")):
build_arch("windows", "win_32", ["-G","Visual Studio 14 2015", "-A", "Win32"])
build_arch("windows_debug", "win_32", ["-G","Visual Studio 14 2015", "-A", "Win32"], True)
if (-1 != config.option("platform").find("win_64")):
build_arch("windows", "win_64", ["-G","Visual Studio 14 2015 Win64"])
build_arch("windows_debug", "win_64", ["-G","Visual Studio 14 2015 Win64"], True)
os.chdir(current_dir_old)
return

View File

@ -5,6 +5,7 @@ sys.path.append('../..')
import config
import base
import os
import openssl_mobile
def clean():
if base.is_dir("openssl"):
@ -14,11 +15,13 @@ def clean():
return
def make():
if ("android" == base.host_platform() or "ios" == config.option("platform")):
return
print("[fetch & build]: openssl")
if (-1 != config.option("platform").find("android") or -1 != config.option("platform").find("ios")):
openssl_mobile.make()
return
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/openssl"
old_cur = os.getcwd()
os.chdir(base_dir)

View File

@ -0,0 +1,21 @@
#!/usr/bin/env python
import base
import config
import os
import subprocess
def make():
path = base.get_script_dir() + "/../../core/Common/3dParty/openssl"
old_cur = os.getcwd()
os.chdir(path)
base.set_env("ANDROID_HOME", base.get_android_sdk_home())
if (-1 != config.option("platform").find("android") and not base.is_dir("./build/android")):
subprocess.call(["./build-android-openssl.sh"])
if (-1 != config.option("platform").find("ios") and not base.is_dir("./build/ios")):
subprocess.call(["./build-ios-openssl.sh"])
os.chdir(old_cur)
return

View File

@ -0,0 +1,62 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append('../..')
import config
import base
import os
import config
current_dir = base.get_script_dir() + "/../../core/Common/3dParty/socketrocket"
def buildIOS():
# Build for iphone
base.cmd("xcodebuild", ["-sdk", "iphoneos", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release"])
# Build for simulator
base.cmd("xcodebuild", ["-sdk", "iphonesimulator", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release"])
# Remove arm64 for simulator for SDK 14
base.cmd("lipo", ["-remove", "arm64", "-output", "build/Release-iphonesimulator/libSocketRocket.a", "build/Release-iphonesimulator/libSocketRocket.a"])
base.create_dir(current_dir + "/build/ios/lib")
# Create fat lib
base.cmd("lipo", ["./build/Release-iphonesimulator/libSocketRocket.a", "./build/Release-iphoneos/libSocketRocket.a", "-create", "-output",
"./build/ios/lib/libSoсketRocket.a"])
return
def buildMacOS():
# Build for iphone
base.cmd("xcodebuild", ["-sdk", "macosx", "BITCODE_GENERATION_MODE = bitcode", "ENABLE_BITCODE = YES", "OTHER_CFLAGS = -fembed-bitcode", "-configuration", "Release"])
base.create_dir(current_dir + "/build/mac_64/lib")
base.create_dir(current_dir + "/build/mac_arm64/lib")
base.cmd("lipo", ["build/Release/libSocketRocket.a", "-thin", "x86_64", "-output", "build/mac_64/lib/libSoсketRocket.a"])
base.cmd("lipo", ["build/Release/libSocketRocket.a", "-thin", "arm64", "-output", "build/mac_arm64/lib/libSoсketRocket.a"])
base.delete_file("build/Release/libSocketRocket.a")
return
def make():
if (-1 == config.option("platform").find("mac") and -1 == config.option("platform").find("ios")):
return
current_dir_old = os.getcwd()
print("[build]: socketrocket")
os.chdir(current_dir)
if (-1 != config.option("platform").find("mac")):
if not base.is_dir(current_dir + "/build/mac_64") or not base.is_dir(current_dir + "/build/mac_arm_64"):
buildMacOS()
elif (-1 != config.option("platform").find("ios")):
if not base.is_dir(current_dir + "/build/ios"):
buildIOS()
os.chdir(current_dir_old)
return

View File

@ -0,0 +1,16 @@
#!/usr/bin/env python
import sys
sys.path.append('../..')
import config
import base
import ixwebsocket
import socketrocket
config_file = base.get_script_dir() + "/../../core/Common/WebSocket/websocket.pri"
def make():
ixwebsocket.make()
socketrocket.make()
return

View File

@ -34,6 +34,7 @@ def make():
# x2t
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "UnicodeConverter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel_network")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "graphics")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfWriter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "PdfReader")

View File

@ -24,20 +24,22 @@ def make():
base.create_dir(archive_dir)
platform = native_platform
platform_postfix = platform + base.qt_dst_postfix()
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "kernel")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "graphics")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "doctrenderer")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "HtmlRenderer")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "DjVuFile")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "XpsFile")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "PdfReader")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "PdfWriter")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "HtmlFile2")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "UnicodeConverter")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "Fb2File")
base.copy_lib(core_build_dir + "/lib/" + platform, archive_dir, "EpubFile")
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "x2t")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "kernel")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "kernel_network")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "graphics")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "doctrenderer")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "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, "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_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "x2t")
base.copy_dir(base_dir + "/js/" + branding + "/builder/sdkjs", archive_dir + "/sdkjs")
base.create_dir(archive_dir + "/sdkjs/vendor")
@ -52,9 +54,9 @@ def make():
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_exe(core_build_dir + "/bin/" + platform, archive_dir, "allfontsgen")
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "allthemesgen")
base.copy_exe(core_build_dir + "/bin/" + platform, archive_dir, "standardtester")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "allfontsgen")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "allthemesgen")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "standardtester")
if base.is_file(archive_dir + "/core.7z"):
base.delete_file(archive_dir + "/core.7z")

View File

@ -3,6 +3,7 @@
import config
import base
import os
import platform
def make():
base_dir = base.get_script_dir() + "/../out"
@ -43,6 +44,7 @@ def make():
# x2t
base.create_dir(root_dir + "/converter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "kernel")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "kernel_network")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "UnicodeConverter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "graphics")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir + "/converter", "PdfWriter")
@ -84,7 +86,7 @@ def make():
base.copy_file(core_dir + "/Common/3dParty/v8/v8/out.gn/" + platform + "/icudtl.dat", root_dir + "/converter/icudtl.dat")
base.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop")
base.copy_dir(git_dir + "/desktop-apps/common/converter/empty", root_dir + "/converter/empty")
base.copy_dir(git_dir + "/document-templates/new", root_dir + "/converter/empty")
# dictionaries
base.create_dir(root_dir + "/dictionaries")
@ -198,6 +200,10 @@ def make():
base.delete_file(root_dir + "/cef_sandbox.lib")
base.delete_file(root_dir + "/libcef.lib")
isMacArmPlaformOnIntel = False
if (platform == "mac_arm64") and not base.is_os_arm():
isMacArmPlaformOnIntel = True
# all themes generate ----
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "allfontsgen")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir + "/converter", "allthemesgen")
@ -205,16 +211,23 @@ def make():
if (0 == platform.find("mac")):
base.mac_correct_rpath_desktop(root_dir)
themes_params = []
if ("" != config.option("themesparams")):
themes_params = ["--params=\"" + config.option("themesparams") + "\""]
base.cmd_exe(root_dir + "/converter/allfontsgen", ["--use-system=\"1\"", "--input=\"" + root_dir + "/fonts\"", "--input=\"" + git_dir + "/core-fonts\"", "--allfonts=\"" + root_dir + "/converter/AllFonts.js\"", "--selection=\"" + root_dir + "/converter/font_selection.bin\""])
base.cmd_exe(root_dir + "/converter/allthemesgen", ["--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\""] + themes_params)
if isMacArmPlaformOnIntel:
sdkjs_dir = root_dir + "/editors/sdkjs"
end_find_platform = sdkjs_dir.rfind("/mac_arm64/")
sdkjs_dir_mac64 = sdkjs_dir[0:end_find_platform] + "/mac_64/" + sdkjs_dir[end_find_platform+11:]
base.delete_dir(sdkjs_dir)
base.copy_dir(sdkjs_dir_mac64, sdkjs_dir)
else:
themes_params = []
if ("" != config.option("themesparams")):
themes_params = ["--params=\"" + config.option("themesparams") + "\""]
base.cmd_exe(root_dir + "/converter/allfontsgen", ["--use-system=\"1\"", "--input=\"" + root_dir + "/fonts\"", "--input=\"" + git_dir + "/core-fonts\"", "--allfonts=\"" + root_dir + "/converter/AllFonts.js\"", "--selection=\"" + root_dir + "/converter/font_selection.bin\""])
base.cmd_exe(root_dir + "/converter/allthemesgen", ["--converter-dir=\"" + root_dir + "/converter\"", "--src=\"" + root_dir + "/editors/sdkjs/slide/themes\"", "--allfonts=\"AllFonts.js\"", "--output=\"" + root_dir + "/editors/sdkjs/common/Images\""] + themes_params)
base.delete_file(root_dir + "/converter/AllFonts.js")
base.delete_file(root_dir + "/converter/font_selection.bin")
base.delete_exe(root_dir + "/converter/allfontsgen")
base.delete_exe(root_dir + "/converter/allthemesgen")
base.delete_file(root_dir + "/converter/AllFonts.js")
base.delete_file(root_dir + "/converter/font_selection.bin")
if not isUseJSC:
base.delete_file(root_dir + "/editors/sdkjs/slide/sdk-all.cache")

View File

@ -3,6 +3,11 @@
import config
import base
def exclude_arch(directory, frameworks):
for lib in frameworks:
base.cmd("lipo", ["-remove", "arm64", directory + "/" + lib + ".framework/" + lib, "-o", directory + "/" + lib + ".framework/" + lib])
return
def make():
base_dir = base.get_script_dir() + "/../out"
git_dir = base.get_script_dir() + "/../.."
@ -34,6 +39,7 @@ def make():
# x2t
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "kernel")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "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")
@ -45,7 +51,17 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "doctrenderer")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "Fb2File")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "EpubFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "x2t")
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")):

View File

@ -32,7 +32,8 @@ def make():
continue
root_dir = base_dir + ("/" + native_platform + "/" + branding + "/documentserver")
root_dir_snap = root_dir + '-snap'
root_dir_snap = root_dir + '-snap/var/www/onlyoffice/documentserver'
root_dir_snap_example = root_dir_snap + '-example'
if (base.is_dir(root_dir)):
base.delete_dir(root_dir)
base.create_dir(root_dir)
@ -57,11 +58,6 @@ def make():
base.create_dir(build_server_dir + '/Metrics/node_modules/modern-syslog/build/Release')
base.copy_file(bin_server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node", build_server_dir + "/Metrics/node_modules/modern-syslog/build/Release/core.node")
base.create_dir(build_server_dir + '/SpellChecker')
base.copy_exe(bin_server_dir + "/SpellChecker", build_server_dir + '/SpellChecker', "spellchecker")
base.create_dir(build_server_dir + '/SpellChecker/node_modules/nodehun/build/Release')
base.copy_file(bin_server_dir + "/SpellChecker/node_modules/nodehun/build/Release/Nodehun.node", build_server_dir + '/SpellChecker/node_modules/nodehun/build/Release/Nodehun.node')
qt_dir = base.qt_setup(native_platform)
platform = native_platform
@ -76,6 +72,7 @@ def make():
base.create_dir(converter_dir)
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "kernel")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "kernel_network")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "UnicodeConverter")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "graphics")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, converter_dir, "PdfWriter")
@ -139,7 +136,7 @@ def make():
branding_dir = git_dir + '/' + config.option("branding") + '/server'
#dictionaries
spellchecker_dictionaries = build_server_dir + '/SpellChecker/dictionaries'
spellchecker_dictionaries = root_dir + '/dictionaries'
spellchecker_dictionaries_files = server_dir + '/../dictionaries/*_*'
base.create_dir(spellchecker_dictionaries)
base.copy_files(spellchecker_dictionaries_files, spellchecker_dictionaries)
@ -161,6 +158,12 @@ def make():
base.create_dir(core_fonts)
base.copy_dir_content(core_fonts_files, core_fonts, "", ".git")
#document-templates
document_templates_files = server_dir + '/../document-templates'
document_templates = build_server_dir + '/../document-templates'
base.create_dir(document_templates)
base.copy_dir(document_templates_files, document_templates)
#license
license_file1 = server_dir + '/LICENSE.txt'
license_file2 = server_dir + '/3rd-Party.txt'
@ -191,6 +194,8 @@ def make():
# snap
if (0 == platform.find("linux")):
if (base.is_dir(root_dir_snap)):
base.delete_dir(root_dir_snap)
base.create_dir(root_dir_snap)
base.copy_dir(root_dir, root_dir_snap)
base.copy_dir(bin_server_dir + '/DocService/node_modules', root_dir_snap + '/server/DocService/node_modules')
@ -200,12 +205,12 @@ def make():
base.copy_dir(bin_server_dir + '/FileConverter/node_modules', root_dir_snap + '/server/FileConverter/node_modules')
base.copy_dir(bin_server_dir + '/FileConverter/sources', root_dir_snap + '/server/FileConverter/sources')
base.delete_file(root_dir_snap + '/server/FileConverter/converter')
base.copy_dir(bin_server_dir + '/SpellChecker/node_modules', root_dir_snap + '/server/SpellChecker/node_modules')
base.copy_dir(bin_server_dir + '/SpellChecker/sources', root_dir_snap + '/server/SpellChecker/sources')
base.delete_file(root_dir_snap + '/server/SpellChecker/spellchecker')
base.copy_dir(bin_server_dir + '/Common/node_modules', root_dir_snap + '/server/Common/node_modules')
base.copy_dir(bin_server_dir + '/Common/sources', root_dir_snap + '/server/Common/sources')
base.copy_dir(bin_example_dir + '/..', root_dir_snap + '/example')
if (base.is_dir(root_dir_snap_example)):
base.delete_dir(root_dir_snap_example)
base.create_dir(root_dir_snap_example)
base.copy_dir(bin_example_dir + '/..', root_dir_snap_example)
base.delete_file(root_dir_snap + '/example/nodejs/example')
return

View File

@ -64,9 +64,8 @@ def make():
base.generate_doctrenderer_config("./DoctRenderer.config", "../../../sdkjs/deploy/", "server", "../../../web-apps/vendor/")
base.support_old_versions_plugins(git_dir + "/sdkjs-plugins")
if base.is_dir(git_dir + "/fonts"):
base.delete_dir(git_dir + "/fonts")
base.create_dir(git_dir + "/fonts")
if not base.is_dir(git_dir + "/fonts"):
base.create_dir(git_dir + "/fonts")
if ("mac" == base.host_platform()):
base.mac_correct_rpath_x2t("./")
@ -89,7 +88,7 @@ def make():
#base.cmd_exe("./allthemesgen", ["--converter-dir=\"" + git_dir + "/server/FileConverter/bin\"", "--src=\"" + git_dir + "/sdkjs/slide/themes\"", "--output=\"" + git_dir + "/sdkjs/common/Images\"", "--postfix=android", "--params=280,224"])
# add directories to open directories
addon_base_path = "../../../"
addon_base_path = "../../"
server_config = {}
static_content = {}
sql = {}

View File

@ -151,6 +151,7 @@ def check_git():
def check_nodejs():
dependence = CDependencies()
isNeedReinstall = False
base.print_info('Check installed Node.js')
nodejs_version = base.run_command('node -v')['stdout']
if (nodejs_version == ''):
@ -158,12 +159,34 @@ def check_nodejs():
dependence.append_install('Node.js')
return dependence
nodejs_cur_version = int(nodejs_version.split('.')[0][1:])
print('Installed Node.js version: ' + str(nodejs_cur_version))
nodejs_min_version = 8
nodejs_max_version = 14
if (nodejs_min_version > nodejs_cur_version or nodejs_cur_version > nodejs_max_version):
print('Installed Node.js version must be 8.x to 14.x')
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_minor = 0
major_minor_min_version = nodejs_min_version.split('.')
nodejs_min_version_major = int(major_minor_min_version[0])
if len(major_minor_min_version) > 1:
nodejs_min_version_minor = int(major_minor_min_version[1])
nodejs_max_version = '14'
nodejs_max_version_minor = float("inf")
major_minor_max_version = nodejs_max_version.split('.')
nodejs_max_version_major = int(major_minor_max_version[0])
if len(major_minor_max_version) > 1:
nodejs_max_version_minor = int(major_minor_max_version[1])
if (nodejs_min_version_major > nodejs_cur_version_major or nodejs_cur_version_major > nodejs_max_version_major):
print('Installed Node.js version must be 10.20 to 14.x')
isNeedReinstall = True
elif (nodejs_min_version_major == nodejs_cur_version_major):
if (nodejs_min_version_minor > nodejs_cur_version_minor):
isNeedReinstall = True
elif (nodejs_cur_version_major == nodejs_max_version_major):
if (nodejs_cur_version_minor > nodejs_max_version_minor):
isNeedReinstall = True
if (True == isNeedReinstall):
print('Installed Node.js version must be 10.20 to 14.x')
if (host_platform == 'windows'):
dependence.append_uninstall('Node.js')
elif (host_platform == 'linux'):
@ -205,6 +228,11 @@ def check_erlang():
erlangBitness = ""
erlang_path_home = get_erlang_path_to_bin()
if base.is_exist(erlang_path_home) == False:
dependence.append_uninstall('Erlang')
dependence.append_uninstall('RabbitMQ')
return dependence
if ("" != erlang_path_home or host_platform != 'windows'):
erlangBitness = base.run_command_in_dir(erlang_path_home, 'erl -eval "erlang:display(erlang:system_info(wordsize)), halt()." -noshell')['stdout']

View File

@ -18,5 +18,9 @@ def make():
build_server.build_server_develop()
build_js.build_js_develop(base_dir + "/../../..")
develop_config_server.make()
if ("" != config.option("branding")):
branding_develop_script_dir = base_dir + "/../../../" + config.option("branding") + "/build_tools/scripts"
if base.is_file(branding_develop_script_dir + "/develop.py"):
base.cmd_in_dir(branding_develop_script_dir, "python", ["develop.py"], True)
exit(0)

View File

@ -0,0 +1,51 @@
#!/usr/bin/env python
import sys
sys.path.append('../')
import optparse
import config
import base
import os
arguments = sys.argv[1:]
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")
(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"]])
# parse configuration
config.parse()
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]
if (config.check_option("module", "server")):
repositories['document-server-package'] = [False, False]
repositories['Docker-DocumentServer'] = [False, False]
for repo in repositories:
line = repo
repo_dir = repositories[repo][1]
if repo_dir != False:
repo_dir = os.path.relpath(repo_dir, base.get_script_dir() + "../../..")
line += " " + repo_dir
print(line)
sys.exit(0)

View File

@ -9,7 +9,7 @@ import traceback
def install_module(path):
base.print_info('Install: ' + path)
base.cmd_in_dir(path, 'npm', ['install'])
base.cmd_in_dir(path, 'npm', ['ci'])
def run_module(directory, args=[]):
base.run_nodejs_in_dir(directory, args)
@ -84,8 +84,9 @@ def make(args = []):
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/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

@ -1,16 +1,14 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import config
import base
import packages_desktop
# import packages_server
# import packages_builder
def make():
if config.check_option("module", "desktop"):
packages_desktop.make()
# if config.check_option("module", "server"):
# packages_server.make()
# if config.check_option("module", "builder"):
# packages_builder.make()
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,67 +1,93 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import config
import base
import os
import re
def make():
def make(packages):
base_dir = base.get_script_dir() + "/../out"
git_dir = base.get_script_dir() + "/../.."
branding = config.branding()
platforms = config.option("platform").split()
for native_platform in platforms:
if not native_platform in config.platforms:
continue
for package in packages:
isWindowsXP = False if (-1 == native_platform.find("_xp")) else True
platform = native_platform[0:-3] if isWindowsXP else native_platform
if (0 == platform.find("mac")):
macos_dir = git_dir + "/desktop-apps/macos"
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"
isX86 = True if ("" != base.get_env("_X86")) else False
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)
target = "release" if not isX86 else "release_x86"
base.cmd_in_dir(macos_dir, "bundler", ["exec", "fastlane", target, "skip_git_bump:true"])
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"
package = "ONLYOFFICE" if not isX86 else "ONLYOFFICE-x86"
app_version = base.run_command("mdls -name kMDItemVersion -raw " +
macos_dir + "/build/ONLYOFFICE.app")['stdout']
macos_zip = macos_dir + "/build/" + package + "-" + app_version + ".zip"
update_storage = base.get_env("ARCHIVES_DIR") + "/" + package + "/_updates"
changes_dir = macos_dir + "/ONLYOFFICE/update/updates/ONLYOFFICE/changes/" + app_version
base.delete_dir(update_dir)
base.delete_dir(os.path.expanduser("~/Library/Caches/Sparkle_generate_appcast"))
base.create_dir(update_dir)
base.copy_dir_content(update_storage, update_dir, ".zip")
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)
for file in os.listdir(update_dir):
if file.endswith(".zip"):
base.copy_file(changes_dir + "/ReleaseNotes.html",
update_dir + "/" + os.path.splitext(file)[0] + ".html")
base.copy_file(changes_dir + "/ReleaseNotesRU.html",
update_dir + "/" + os.path.splitext(file)[0] + ".ru.html")
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])
base_url = "https://download.onlyoffice.com/install/desktop/editors/mac"
changes_url = base_url + "/updates/onlyoffice/changes"
update_url = base_url + ("/updates/onlyoffice" if not isX86 else "/x86")
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)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
"\\1" + changes_url + "/\\2/ReleaseNotes.html\\3")
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)-([0-9.]+)\..+)(</sparkle:releaseNotesLink>)",
"\\1" + changes_url + "/\\2/ReleaseNotesRU.html\\3")
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" + update_url + "/\\2")
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_dir(update_dir + "/" + file)
if (-1 == file.find(app_version)) and (file.endswith(".zip") or file.endswith(".html")):
base.delete_file(update_dir + "/" + file)
return

View File

@ -0,0 +1,176 @@
#!/usr/bin/env python
import os
import shutil
def readFile(path):
with open(path, "r") as file:
filedata = file.read()
return filedata
def writeFile(path, content):
if (os.path.isfile(path)):
os.remove(path)
with open(path, "w") as file:
file.write(content)
return
class EditorApi(object):
def __init__(self):
self.records = []
self.init = False
self.folder = "word"
self.type = "CDE"
self.numfile = 0
self.files = []
return
def initFiles(self, type, files):
self.folder = type
if "word" == self.folder:
self.type = "CDE"
elif "slide" == self.folder:
self.type = "CPE"
else:
self.type = "CSE"
self.files = files
return
def getReturnValue(self, description):
paramStart = description.find("@returns {")
if -1 == paramStart:
return "{}"
paramEnd = description.find("}", paramStart)
retParam = description[paramStart + 10:paramEnd]
isArray = False
if -1 != retParam.find("[]"):
isArray = True
retParam = retParam.replace("[]", "")
retType = retParam.replace("|", " ").split(" ")[0]
retTypeLower = retType.lower()
retValue = ""
if -1 != retType.find("\""):
retValue = "\"\""
elif "bool" == retTypeLower:
retValue = "true"
elif "string" == retTypeLower:
retValue = "\"\""
elif "number" == retTypeLower:
retValue = "0"
elif "undefined" == retTypeLower:
retValue = "undefined"
elif "null" == retTypeLower:
retValue = "null"
else:
retValue = "new " + retType + "()"
if isArray:
retValue = "[" + retValue + "]"
return "{ return " + retValue + "; }"
def check_record(self, recordData):
rec = recordData
rec = rec.replace("\t", "")
rec = rec.replace('\n ', '\n')
indexEndDecoration = rec.find("*/")
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 {")
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 ")
lines = code.split("\n")
codeCorrect = ""
sFuncName = ""
is_found_function = False
addon_for_func = "{}"
if -1 != decoration.find("@return"):
addon_for_func = "{ return null; }"
for line in lines:
line = line.strip("\t\n\r ")
line = line.replace("{", "")
line = line.replace("}", "")
lineWithoutSpaces = line.replace(" ", "")
if not is_found_function and 0 == line.find("function "):
codeCorrect += (line + addon_for_func + "\n")
is_found_function = True
if not is_found_function and -1 != line.find(".prototype."):
codeCorrect += (line + self.getReturnValue(decoration) + ";\n")
is_found_function = True
if -1 != lineWithoutSpaces.find(".prototype="):
codeCorrect += (line + "\n")
if -1 != line.find(".prototype.constructor"):
codeCorrect += (line + "\n")
codeCorrect = codeCorrect.replace("Api.prototype", "ApiInterface.prototype")
self.append_record(decoration, codeCorrect)
return
def append_record(self, decoration, code, init=False):
if init:
if not self.init:
self.init = True
self.records.append(decoration + "\n" + code + "\n\n")
return
# check on private
if -1 != code.find(".prototype.private_"):
return
# add records only for current editor
index_type_editors = decoration.find("@typeofeditors")
if -1 != index_type_editors:
index_type_editors_end = decoration.find("]", index_type_editors)
if -1 != index_type_editors_end:
editors_support = decoration[index_type_editors:index_type_editors_end]
if -1 == editors_support.find(self.type):
return
# optimizations for first file
if 0 == self.numfile:
self.records.append(decoration + "\n" + code + "\n")
return
# check override js classes
if 0 == code.find("function "):
index_end_name = code.find("(")
function_name = code[9:index_end_name].strip(" ")
for rec in range(len(self.records)):
if -1 != self.records[rec].find("function " + function_name + "("):
self.records[rec] = ""
elif -1 != self.records[rec].find("function " + function_name + " ("):
self.records[rec] = ""
elif -1 != self.records[rec].find("\n" + function_name + ".prototype."):
self.records[rec] = ""
self.records.append(decoration + "\n" + code + "\n")
return
def generate(self):
for file in self.files:
file_content = readFile(file)
arrRecords = file_content.split("/**")
arrRecords = arrRecords[1:-1]
for record in arrRecords:
self.check_record(record)
self.numfile += 1
correctContent = ''.join(self.records)
correctContent += "\n"
os.mkdir('deploy/api_builder/' + self.folder)
writeFile("deploy/api_builder/" + self.folder + "/api.js", correctContent)
return
def convert_to_interface(arrFiles, sEditorType):
editor = EditorApi()
editor.initFiles(sEditorType, arrFiles)
editor.generate()
return
old_cur = os.getcwd()
os.chdir("../../../sdkjs")
if True == os.path.isdir('deploy/api_builder'):
shutil.rmtree('deploy/api_builder', ignore_errors=True)
os.mkdir('deploy/api_builder')
convert_to_interface(["word/apiBuilder.js"], "word")
convert_to_interface(["word/apiBuilder.js", "slide/apiBuilder.js"], "slide")
convert_to_interface(["word/apiBuilder.js", "slide/apiBuilder.js", "cell/apiBuilder.js"], "cell")
os.chdir(old_cur)

8
scripts/update_js.py Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env python
import config
import base
import build_js
config.parse()
build_js.make()

View File

@ -1,21 +0,0 @@
--- index.js
+++ index.js
@@ -101,18 +101,11 @@
function nodeNC(port, input) {
const src = nodeNetCatSrc(port, input);
- if (src.length < 1000) {
- return spawnSync(process.execPath, ['-e', src], {
- windowsHide: true,
- maxBuffer: Infinity,
- });
- } else {
return spawnSync(process.execPath, [], {
input: src,
windowsHide: true,
maxBuffer: Infinity,
});
- }
}
function test(fn, port) {

View File

@ -1 +1 @@
6.0.0
7.0.2