Compare commits

..

17 Commits

Author SHA1 Message Date
9435cdc99b Merge pull request 'Added html 3dParty version control' (#64) from fix/html into hotfix/v8.3.2
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/64
2025-03-12 16:54:41 +00:00
cf90a5ce21 Added html 3dParty version control 2025-03-12 19:50:03 +03:00
de33755900 Remove unused files 2025-03-06 15:06:49 +03:00
6e87116634 Fix typo 2025-03-06 13:56:55 +03:00
029b16ca68 Fix deploy builder 2025-03-06 13:05:25 +03:00
32b47cd21e Merge branch hotfix/v8.3.1 into master 2025-02-27 13:16:17 +00:00
bf75e1c062 Merge pull request 'Up version to 8.3.1' (#50) from fix/version8.3.1 into hotfix/v8.3.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/50
2025-02-27 13:15:05 +00:00
97fccfa34b Up version to 8.3.1 2025-02-27 12:07:55 +05:00
ea43e67fe8 Merge pull request '[jsdoc] Added editor name to examples' (#48) from fix/js-doc into hotfix/v8.3.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/48
2025-02-19 17:34:37 +00:00
dd28a41e17 [jsdoc] Added editor name to examples 2025-02-20 00:30:45 +07:00
a2b7719100 [v8] Disable git configuration on windows 2025-02-11 21:32:05 +03:00
54accd4394 Merge pull request '[jsdoc] Escape "|" in tables md' (#44) from fix/js-doc into hotfix/v8.3.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/44
2025-02-11 07:56:03 +00:00
63557fba56 [jsdoc] Escape "|" in tables md 2025-02-11 14:54:14 +07:00
810e12bd22 Merge release/8.3.0 into master 2025-02-06 07:41:46 +00:00
066f7ad8c1 Version Up 2025-02-06 10:31:28 +03:00
e52a654731 Merge branch release/v8.3.0 into master 2025-02-05 17:13:36 +00:00
a60bc78e23 Merge branch hotfix/v8.2.2 into master 2024-11-28 12:13:38 +00:00
12 changed files with 88 additions and 29 deletions

View File

@ -428,6 +428,13 @@ def cmd_in_dir(directory, prog, args=[], is_no_errors=False):
os.chdir(cur_dir)
return ret
def cmd_in_dir_qemu(platform, directory, prog, args=[], is_no_errors=False):
if (platform == "linux_arm64"):
return cmd_in_dir(directory, "qemu-aarch64", ["-L", "/usr/aarch64-linux-gnu", prog] + args, is_no_errors)
if (platform == "linux_arm32"):
return cmd_in_dir(directory, "qemu-arm", ["-L", "/usr/arm-linux-gnueabi", prog] + args, is_no_errors)
return 0
def cmd_and_return_cwd(prog, args=[], is_no_errors=False):
cur_dir = os.getcwd()
ret = cmd(prog, args, is_no_errors)
@ -1831,10 +1838,14 @@ 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_x2t_js_cache(dir, product):
def create_x2t_js_cache(dir, product, platform):
if is_file(dir + "/libdoctrenderer.dylib") and (os.path.getsize(dir + "/libdoctrenderer.dylib") < 5*1024*1024):
return
if ((platform == "linux_arm64") and not is_os_arm()):
cmd_in_dir_qemu(platform, dir, "./x2t", ["-create-js-snapshots"], True)
return
cmd_in_dir(dir, "./x2t", ["-create-js-snapshots"], True)
return

View File

@ -7,7 +7,27 @@ import base
import os
import subprocess
def clear_module():
directories = ["gumbo-parser", "katana-parser"]
for dir in directories:
if base.is_dir(dir):
base.delete_dir_with_access_error(dir)
def make():
old_cur_dir = os.getcwd()
print("[fetch]: html")
base_dir = base.get_script_dir() + "/../../core/Common/3dParty/html"
os.chdir(base_dir)
base.check_module_version("2", clear_module)
os.chdir(old_cur_dir)
base.cmd_in_dir(base_dir, "python", ["fetch.py"])
return
if __name__ == '__main__':
# manual compile
make()

View File

@ -23,6 +23,9 @@ def change_bootstrap():
base.replaceInFile("./depot_tools/bootstrap/bootstrap.py",
"raise subprocess.CalledProcessError(proc.returncode, argv, None)", "return")
base.replaceInFile("./depot_tools/bootstrap/bootstrap.py",
" _win_git_bootstrap_config()", " #_win_git_bootstrap_config()")
base.writeFile("./depot_tools/bootstrap/manifest.txt", content)
return

View File

@ -125,7 +125,7 @@ def make():
base.mac_correct_rpath_x2t(root_dir)
base.mac_correct_rpath_docbuilder(root_dir)
base.create_x2t_js_cache(root_dir, "builder")
base.create_x2t_js_cache(root_dir, "builder", platform)
# delete unnecessary builder files
def delete_files(files):
@ -138,6 +138,11 @@ def make():
if 0 != platform.find("mac"):
delete_files(base.find_files(root_dir, "sdk-all.js"))
delete_files(base.find_files(root_dir, "sdk-all-min.js"))
base.delete_dir(root_dir + "/sdkjs/slide/themes")
base.delete_dir(root_dir + "/sdkjs/cell/css")
base.delete_file(root_dir + "/sdkjs/pdf/src/engine/viewer.js")
base.delete_file(root_dir + "/sdkjs/common/spell/spell/spell.js.mem")
base.delete_dir(root_dir + "/sdkjs/common/Images")
return

View File

@ -67,7 +67,7 @@ def make():
# js cache
base.generate_doctrenderer_config(archive_dir + "/DoctRenderer.config", "./", "builder", "", "./dictionaries")
base.create_x2t_js_cache(archive_dir, "core")
base.create_x2t_js_cache(archive_dir, "core", platform)
base.delete_file(archive_dir + "/DoctRenderer.config")
# dictionaries

View File

@ -261,7 +261,7 @@ def make():
if isUseJSC:
base.delete_file(root_dir + "/converter/icudtl.dat")
base.create_x2t_js_cache(root_dir + "/converter", "desktop")
base.create_x2t_js_cache(root_dir + "/converter", "desktop", platform)
if (0 == platform.find("win")):
base.delete_file(root_dir + "/cef_sandbox.lib")

View File

@ -119,7 +119,7 @@ def make():
+ glob.glob(js_dir + "/web-apps/apps/*/mobile/dist/js/*.js.map"):
base.delete_file(file)
base.create_x2t_js_cache(converter_dir, "server")
base.create_x2t_js_cache(converter_dir, "server", platform)
# 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

@ -190,7 +190,7 @@ def check_nodejs():
nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:])
nodejs_cur_version_minor = int(nodejs_version.split('.')[1])
print('Installed Node.js version: ' + nodejs_version[1:])
nodejs_min_version = '22'
nodejs_min_version = '18'
nodejs_min_version_minor = 0
major_minor_min_version = nodejs_min_version.split('.')
nodejs_min_version_major = int(major_minor_min_version[0])
@ -214,7 +214,7 @@ def check_nodejs():
isNeedReinstall = True
if (True == isNeedReinstall):
print('Installed Node.js version must be 22 or higher.')
print('Installed Node.js version must be 18 or higher.')
if (host_platform == 'windows'):
dependence.append_uninstall('Node.js')
dependence.append_install('Node.js')
@ -950,7 +950,7 @@ def install_postgresql():
return code
def install_nodejs():
os.system('curl -sSL https://deb.nodesource.com/setup_22.x | sudo -E bash -')
os.system('curl -sSL https://deb.nodesource.com/setup_18.x | sudo -E bash -')
base.print_info("Install node.js...")
install_command = 'yes | sudo apt install nodejs'
print(install_command)
@ -959,7 +959,7 @@ def install_nodejs():
downloads_list = {
'Windows': {
'Git': 'https://github.com/git-for-windows/git/releases/download/v2.29.0.windows.1/Git-2.29.0-64-bit.exe',
'Node.js': 'https://nodejs.org/dist/v22.13.1/node-v22.13.1-x64.msi',
'Node.js': 'https://nodejs.org/dist/v18.17.1/node-v18.17.1-x64.msi',
'Java': 'https://aka.ms/download-jdk/microsoft-jdk-11.0.18-windows-x64.msi',
'RabbitMQ': 'https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.9/rabbitmq-server-3.8.9.exe',
'Erlang': 'http://erlang.org/download/otp_win64_23.1.exe',

View File

@ -153,7 +153,7 @@ def generate_data_types_markdown(types, enumerations, classes, root='../../'):
linked = [link_if_known(ts_t) for ts_t in converted]
# Join them with " | "
param_types_md = ' | '.join(linked)
param_types_md = r' \| '.join(linked)
# If there's still leftover angle brackets for generics, gently escape or link them
# e.g. "Object.<string, number>" => "Object.&lt;string, number&gt;"
@ -178,7 +178,7 @@ def generate_class_markdown(class_name, methods, properties, enumerations, class
# Escape just before returning
return escape_text_outside_code_blocks(content)
def generate_method_markdown(method, enumerations, classes):
def generate_method_markdown(method, enumerations, classes, example_editor_name):
method_name = method['name']
description = method.get('description', 'No description provided.')
description = correct_description(description)
@ -227,11 +227,11 @@ def generate_method_markdown(method, enumerations, classes):
if '```js' in example:
comment, code = example.split('```js', 1)
comment = remove_js_comments(comment)
content += f"\n\n## Example\n\n{comment}\n\n```javascript\n{code.strip()}\n"
content += f"\n\n## Example\n\n{comment}\n\n```javascript {example_editor_name}\n{code.strip()}\n"
else:
# If there's no triple-backtick structure, just show it as code
cleaned_example = remove_js_comments(example)
content += f"\n\n## Example\n\n```javascript\n{cleaned_example}\n```\n"
content += f"\n\n## Example\n\n```javascript {example_editor_name}\n{cleaned_example}\n```\n"
return escape_text_outside_code_blocks(content)
@ -254,7 +254,7 @@ def generate_properties_markdown(properties, enumerations, classes, root='../'):
# Escape outside code blocks
return escape_text_outside_code_blocks(content)
def generate_enumeration_markdown(enumeration, enumerations, classes):
def generate_enumeration_markdown(enumeration, enumerations, classes, example_editor_name):
enum_name = enumeration['name']
description = enumeration.get('description', 'No description provided.')
description = correct_description(description)
@ -300,11 +300,11 @@ def generate_enumeration_markdown(enumeration, enumerations, classes):
if '```js' in example:
comment, code = example.split('```js', 1)
comment = remove_js_comments(comment)
content += f"\n\n## Example\n\n{comment}\n\n```javascript\n{code.strip()}\n"
content += f"\n\n## Example\n\n{comment}\n\n```javascript {example_editor_name}\n{code.strip()}\n"
else:
# If there's no triple-backtick structure
cleaned_example = remove_js_comments(example)
content += f"\n\n## Example\n\n```javascript\n{cleaned_example}\n```\n"
content += f"\n\n## Example\n\n```javascript {example_editor_name}\n{cleaned_example}\n```\n"
return escape_text_outside_code_blocks(content)
@ -313,6 +313,16 @@ def process_doclets(data, output_dir, editor_name):
classes_props = {}
enumerations = []
editor_dir = os.path.join(output_dir, editor_name)
example_editor_name = 'editor-'
if editor_name == 'Word':
example_editor_name += 'docx'
elif editor_name == 'Forms':
example_editor_name += 'pdf'
elif editor_name == 'Slide':
example_editor_name += 'pptx'
elif editor_name == 'Cell':
example_editor_name += 'xlsx'
for doclet in data:
if doclet['kind'] == 'class':
@ -347,7 +357,7 @@ def process_doclets(data, output_dir, editor_name):
# Write method files
for method in methods:
method_file_path = os.path.join(methods_dir, f"{method['name']}.md")
method_content = generate_method_markdown(method, enumerations, classes)
method_content = generate_method_markdown(method, enumerations, classes, example_editor_name)
write_markdown_file(method_file_path, method_content)
if not method.get('example', ''):
@ -359,7 +369,7 @@ def process_doclets(data, output_dir, editor_name):
for enum in enumerations:
enum_file_path = os.path.join(enum_dir, f"{enum['name']}.md")
enum_content = generate_enumeration_markdown(enum, enumerations, classes)
enum_content = generate_enumeration_markdown(enum, enumerations, classes, example_editor_name)
if enum_content is None:
continue

View File

@ -153,7 +153,7 @@ def generate_data_types_markdown(types, enumerations, classes, root='../../'):
linked = [link_if_known(ts_t) for ts_t in converted]
# Join them with " | "
param_types_md = ' | '.join(linked)
param_types_md = r' \| '.join(linked)
# If there's still leftover angle brackets for generics, gently escape or link them
# e.g. "Object.<string, number>" => "Object.&lt;string, number&gt;"
@ -178,7 +178,7 @@ def generate_class_markdown(class_name, methods, properties, enumerations, class
# Escape just before returning
return escape_text_outside_code_blocks(content)
def generate_method_markdown(method, enumerations, classes):
def generate_method_markdown(method, enumerations, classes, example_editor_name):
"""
Generates Markdown for a method doclet, relying only on `method['examples']`
(array of strings). Ignores any single `method['example']` field.
@ -247,12 +247,12 @@ def generate_method_markdown(method, enumerations, classes):
if len(examples) > 1:
content += f"**Example {i}:**\n\n{comment}\n\n"
content += f"```javascript\n{code}\n```\n"
content += f"```javascript {example_editor_name}\n{code}\n```\n"
else:
if len(examples) > 1:
content += f"**Example {i}:**\n\n{comment}\n\n"
# No special fences, just show as code
content += f"```javascript\n{cleaned_example}\n```\n"
content += f"```javascript {example_editor_name}\n{cleaned_example}\n```\n"
return escape_text_outside_code_blocks(content)
@ -275,7 +275,7 @@ def generate_properties_markdown(properties, enumerations, classes, root='../'):
# Escape outside code blocks
return escape_text_outside_code_blocks(content)
def generate_enumeration_markdown(enumeration, enumerations, classes):
def generate_enumeration_markdown(enumeration, enumerations, classes, example_editor_name):
"""
Generates Markdown documentation for a 'typedef' doclet.
This version only works with `enumeration['examples']` (an array of strings),
@ -354,12 +354,12 @@ def generate_enumeration_markdown(enumeration, enumerations, classes):
if len(examples) > 1:
content += f"**Example {i}:**\n\n{comment}\n\n"
content += f"```javascript\n{code}\n```\n"
content += f"```javascript {example_editor_name}\n{code}\n```\n"
else:
if len(examples) > 1:
content += f"**Example {i}:**\n\n{comment}\n\n"
# No special fences, just show as code
content += f"```javascript\n{cleaned_example}\n```\n"
content += f"```javascript {example_editor_name}\n{cleaned_example}\n```\n"
return escape_text_outside_code_blocks(content)
@ -368,6 +368,16 @@ def process_doclets(data, output_dir, editor_name):
classes_props = {}
enumerations = []
editor_dir = os.path.join(output_dir, editor_name)
example_editor_name = 'editor-'
if editor_name == 'Word':
example_editor_name += 'docx'
elif editor_name == 'Forms':
example_editor_name += 'pdf'
elif editor_name == 'Slide':
example_editor_name += 'pptx'
elif editor_name == 'Cell':
example_editor_name += 'xlsx'
for doclet in data:
if doclet['kind'] == 'class':
@ -402,7 +412,7 @@ def process_doclets(data, output_dir, editor_name):
# Write method files
for method in methods:
method_file_path = os.path.join(methods_dir, f"{method['name']}.md")
method_content = generate_method_markdown(method, enumerations, classes)
method_content = generate_method_markdown(method, enumerations, classes, example_editor_name)
write_markdown_file(method_file_path, method_content)
if not method.get('examples', ''):
@ -414,7 +424,7 @@ def process_doclets(data, output_dir, editor_name):
for enum in enumerations:
enum_file_path = os.path.join(enum_dir, f"{enum['name']}.md")
enum_content = generate_enumeration_markdown(enum, enumerations, classes)
enum_content = generate_enumeration_markdown(enum, enumerations, classes, example_editor_name)
if enum_content is None:
continue

View File

@ -67,7 +67,7 @@ def install_deps():
print("OK")
base.cmd("sudo", ["apt-get", "-y", "install", "npm", "yarn"], True)
base.cmd("sudo", ["npm", "install", "-g", "grunt-cli"])
base.cmd("sudo", ["npm", "install", "-g", "@yao-pkg/pkg"])
base.cmd("sudo", ["npm", "install", "-g", "pkg"])
# java
java_error = base.cmd("sudo", ["apt-get", "-y", "install", "openjdk-11-jdk"], True)

View File

@ -1 +1 @@
8.2.2
8.3.1