Rewrite deploying

This commit is contained in:
Alexey Nagaev
2025-10-17 17:40:35 +03:00
parent b6b09d17f4
commit 30e3202fd5
8 changed files with 60 additions and 37 deletions

View File

@ -43,7 +43,7 @@ parser.add_option("--vs-path", action="store", type="string", dest="vs-path", de
parser.add_option("--siteUrl", action="store", type="string", dest="siteUrl", default="127.0.0.1", help="site url")
parser.add_option("--multiprocess", action="store", type="string", dest="multiprocess", default="1", help="provides ability to specify single process for make")
parser.add_option("--sysroot", action="store", type="string", dest="sysroot", default="0", help="provides ability to use sysroot (ubuntu 16.04) to build c++ code. If value is \"1\", then the sysroot from tools/linux/sysroot will be used, and if it is not there, it will download it and unpack it. You can also set value as the path to the your own sysroot (rarely used). Only for linux")
parser.add_option("--use-qemu", action="store", type="string", dest="use-qemu", default="0", help="Use qemu for win_arm64 cross build.")
parser.add_option("--qemu-win-arm64-dir", action="store", type="string", dest="qemu-win-arm64-dir", default="", help="dir to qemu virtual machine for win_arm64 cross build. It should contains start.bat. More info in tools/win/qemu.")
(options, args) = parser.parse_args(arguments)
configOptions = vars(options)

View File

@ -1972,39 +1972,18 @@ def get_autobuild_version(product, platform="", branch="", build=""):
download_addon = download_branch + "/" + download_build + "/" + product + "-" + download_platform + ".7z"
return "http://repo-doc-onlyoffice-com.s3.amazonaws.com/archive/" + download_addon
def create_artifacts_qemu_win_arm(git_dir, branding, product, only_snapshots=False, themes_params=""):
qemu_git_dir = f"\\\\10.0.2.2\\{os.path.basename(os.path.abspath(git_dir))}"
qemu_root_dir = qemu_git_dir + "\\build_tools\\out\\win_arm64\\" + branding + "\\" + product
automate_bat_data = ""
automate_bat_data = f"call {qemu_root_dir}\\converter\\x2t -create-js-snapshots\n"
if not only_snapshots:
automate_bat_data += f"call {qemu_root_dir}\\converter\\allfontsgen "
automate_bat_data += f"--use-system=\"1\" "
automate_bat_data += f"--input=\"{qemu_root_dir}\\fonts\" "
automate_bat_data += f"--input=\"{qemu_git_dir}\\core-fonts\" "
automate_bat_data += f"--allfonts=\"{qemu_root_dir}\\converter\\AllFonts.js\" "
automate_bat_data += f"--selection=\"{qemu_root_dir}\\converter\\font_selection.bin\"\n"
automate_bat_data += f"call {qemu_root_dir}\\converter\\allthemesgen "
automate_bat_data += f"--converter-dir=\"{qemu_root_dir}\\converter\" "
automate_bat_data += f"--src=\"{qemu_root_dir}\\editors\\sdkjs\\slide\\themes\" "
automate_bat_data += f"--allfonts=\"AllFonts.js\" "
automate_bat_data += f"--output=\"{qemu_root_dir}\\editors\\sdkjs\\common\\Images\" "
automate_bat_data += f"--params=\"{themes_params}\"\n"
automate_bat_data += f"shutdown /s /f /t 10\n"
writeFile(git_dir + "/automate.bat", automate_bat_data)
def create_artifacts_qemu_win_arm():
old_curr_dir = os.path.abspath(os.curdir)
os.chdir(git_dir + "/win-arm-tools")
qemu_dir = os.path.abspath(config.option("qemu-win-arm64-dir"))
if qemu_dir == "":
print("For deploying win_arm64 on non arm host you should provide qemu-win-arm64-dir. More info in tools/win/qemu/README.md")
return
os.chdir(qemu_dir)
start_qemu_bat_path = f"start.bat"
cmd(start_qemu_bat_path, [])
os.chdir(old_curr_dir)
delete_file(git_dir + "/automate.bat")
def create_x2t_js_cache(dir, product, platform):
# mac
if is_file(dir + "/libdoctrenderer.dylib") or is_dir(dir + "/doctrenderer.framework"):

View File

@ -22,4 +22,6 @@ def make():
deploy_mobile.make()
if config.check_option("module", "osign"):
deploy_osign.make()
if config.option("platform").find("win_arm64") != -1 and not base.is_os_arm():
base.create_artifacts_qemu_win_arm()
return

View File

@ -119,8 +119,6 @@ def make():
base.mac_correct_rpath_docbuilder(root_dir)
base.create_x2t_js_cache(root_dir, "builder", platform)
if platform == "win_arm64" and not base.is_os_arm() and config.option("use-qemu") == "1":
base.create_artifacts_qemu_win_arm(git_dir, "builder", branding, True)
base.create_dir(root_dir + "/fonts")
base.copy_dir(git_dir + "/core-fonts/asana", root_dir + "/fonts/asana")

View File

@ -75,8 +75,6 @@ def make():
# js cache
base.generate_doctrenderer_config(archive_dir + "/DoctRenderer.config", "./", "builder", "", "./dictionaries")
base.create_x2t_js_cache(archive_dir, "core", platform)
if platform == "win_arm64" and not base.is_os_arm() and config.option("use-qemu") == "1":
base.create_artifacts_qemu_win_arm(git_dir, "core", branding, True)
base.delete_file(archive_dir + "/DoctRenderer.config")
# dictionaries

View File

@ -315,8 +315,6 @@ def make():
sdkjs_dir_64 = sdkjs_dir[0:end_find_platform] + "/" + host_platform + "/" + sdkjs_dir[end_find_platform+11:]
base.delete_dir(sdkjs_dir)
base.copy_dir(sdkjs_dir_64, sdkjs_dir)
if platform == "win_arm64" and config.option("use-qemu") == "1": # create bat file and start qemu to execute win arm binaries
base.create_artifacts_qemu_win_arm(git_dir, branding, "DesktopEditors", False, themes_params)
else:
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\""], True)
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], True)

View File

@ -123,8 +123,6 @@ def make():
base.delete_file(file)
base.create_x2t_js_cache(converter_dir, "server", platform)
if platform == "win_arm64" and not base.is_os_arm() and config.option("use-qemu") == "1":
base.create_artifacts_qemu_win_arm(git_dir, "server", branding, True)
# add embed worker code
base.cmd_in_dir(git_dir + "/sdkjs/common/embed", "python", ["make.py", js_dir + "/web-apps/apps/api/documents/api.js"])

View File

@ -0,0 +1,50 @@
setlocal enabledelayedexpansion
set "script_dir=%~dp0"
set "config_file=%script_dir%..\..\..\config"
set "git_dir=%script_dir%..\..\..\..\
set "module_list="
set "branding_value="
set "themesparams="
for /f "delims=" %%a in ('type "%config_file%"') do (
set "line=%%a"
if "!line:~0,7!"=="module=" (
set "module_list=!line:~7!"
set "module_list=!module_list:"=!"
)
if "!line:~0,14!"=="branding-name=" (
set "branding_value=!line:~14!"
set "branding_value=!branding_value:"=!"
)
if "!line:~0,13!"=="themesparams=" (
set "themesparams=!line:~13!"
set "themesparams=!branding_value:"=!"
)
)
if "!branding_value!"=="" (
set "branding_value=onlyoffice"
)
set "base_out_dir=%script_dir%..\..\..\out\win_arm64\%branding_value%"
for %%m in (!module_list!) do (
set "out_module_name=%%m"
if "%%m"=="desktop" (
call %base_out_dir%\DesktopEditors\converter\x2t -create-js-snapshots
call %base_out_dir%\DesktopEditors\converter\allfontsgen --use-system="1" --input="%base_out_dir%\DesktopEditors\fonts" --input="%git_dir%\core-fonts" --allfonts="%base_out_dir%\DesktopEditors\converter\AllFonts.js" --selection="%base_out_dir%\DesktopEditors\converter\font_selection.bin"
call %base_out_dir%\DesktopEditors\converter\allthemesgen --converter-dir="%base_out_dir%\DesktopEditors\converter" --src="%base_out_dir%\DesktopEditors\editors\sdkjs\slide\themes" --allfonts="AllFonts.js" --output="%base_out_dir%\DesktopEditors\editors\sdkjs\common\Images" --params="%themesparams%"
)
if "%%m"=="server" (
call %base_out_dir%\documentserver\server\FileConverter\bin\x2t -create-js-snapshots
)
if "%%m"=="builder" (
call %base_out_dir%\DocumentBuilder\x2t -create-js-snapshots
)
if "%%m"=="core" (
call %base_out_dir%\core\x2t -create-js-snapshots
)
)
pause