mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
Compare commits
110 Commits
fix/docs-g
...
v8.2.2.26
| Author | SHA1 | Date | |
|---|---|---|---|
| 12c3310451 | |||
| d525d8f603 | |||
| 80fb376132 | |||
| 1d557f1065 | |||
| 30df3df8cf | |||
| 0f730c1948 | |||
| fa7e324fe0 | |||
| e2313e6a3d | |||
| 2ce8c42323 | |||
| 684e65adaa | |||
| 68bcdb2f88 | |||
| af3627bccb | |||
| 5e4b3cf0d2 | |||
| 593af1048b | |||
| ae00ecb773 | |||
| da83e42172 | |||
| 2895d53f8e | |||
| e01e5c145a | |||
| 56f6d82c8f | |||
| 3e79cf0c12 | |||
| efc09657a8 | |||
| 64390c3e01 | |||
| 52c35b8e3c | |||
| cf1c25031c | |||
| 7b9f18867a | |||
| 0985b4dbe8 | |||
| 772fb721ae | |||
| 1ef1c795c1 | |||
| 6d956566c5 | |||
| edec5bb25f | |||
| 3534f65f0e | |||
| 6fbea9c8a4 | |||
| 18bba5da3d | |||
| 952270e1ba | |||
| 0c180e6ee5 | |||
| fdd9c329b1 | |||
| 5b80459b37 | |||
| 1b646a6e00 | |||
| cf970efbec | |||
| 4020cdac69 | |||
| d41502ea19 | |||
| f5d0ef4005 | |||
| c4a89ecf61 | |||
| 71eb25e561 | |||
| 486a6683fd | |||
| 2175d8d87c | |||
| f463bff49e | |||
| a817e2b046 | |||
| 3539e36bde | |||
| 6930a9ffe1 | |||
| e0a44502b1 | |||
| 19e1bd5586 | |||
| ea65ba02f1 | |||
| 8406e48009 | |||
| a8f1d11cbc | |||
| f245a4a9c6 | |||
| 597529a16d | |||
| 9b9dba05c2 | |||
| 2d0bbc824f | |||
| fa523c673f | |||
| da1a4ba393 | |||
| e9c9712e52 | |||
| 78561ca659 | |||
| 1ad87383e3 | |||
| c29ac1549f | |||
| f09eeb19e5 | |||
| 4b7b2c78a2 | |||
| 414af6bdb0 | |||
| df7288b275 | |||
| ce80953086 | |||
| d1344dab71 | |||
| 4f2ba4ae76 | |||
| 6bd525c3b4 | |||
| 341671a612 | |||
| 9161aa1556 | |||
| 70e9fbabce | |||
| a2c00deba2 | |||
| 3baee0c14e | |||
| bd279d1ad7 | |||
| 4d55a66307 | |||
| 9481e01581 | |||
| fe91bf9620 | |||
| d812ba379b | |||
| e1cc7f3c83 | |||
| f50d5d2cd1 | |||
| b3987b0ad5 | |||
| 63fbbc5603 | |||
| dabbc31c09 | |||
| 997bfa3dd5 | |||
| 50eca8aab5 | |||
| 6e4a2e4d5e | |||
| 40e9938885 | |||
| 5bc8ca2266 | |||
| 4cdbfbfb86 | |||
| 01575d1f2e | |||
| 8f75c75b80 | |||
| ebc084f9ea | |||
| 626efaf5cf | |||
| 096ce99588 | |||
| 9ce103b31b | |||
| 13cbd84b58 | |||
| a8912dff41 | |||
| 8b773614ba | |||
| d04f04f382 | |||
| 9a44dae4f9 | |||
| 07665dd93e | |||
| eeca17e78b | |||
| f91264bc94 | |||
| f2dff2d173 | |||
| aa49605ac4 |
@ -27,7 +27,7 @@ parser.add_option("--db-pass", action="store", type="string", dest="db-pass", de
|
||||
parser.add_option("--compiler", action="store", type="string", dest="compiler", default="", help="defines compiler name. It is not recommended to use it as it's defined automatically (msvc2015, msvc2015_64, gcc, gcc_64, clang, clang_64, etc)")
|
||||
parser.add_option("--no-apps", action="store", type="string", dest="no-apps", default="0", help="disables building desktop apps that use qt")
|
||||
parser.add_option("--themesparams", action="store", type="string", dest="themesparams", default="", help="provides settings for generating presentation themes thumbnails")
|
||||
parser.add_option("--git-protocol", action="store", type="string", dest="git-protocol", default="https", help="can be used only if update is set to true - 'https', 'ssh'")
|
||||
parser.add_option("--git-protocol", action="store", type="string", dest="git-protocol", default="auto", help="can be used only if update is set to true - 'https', 'ssh'")
|
||||
parser.add_option("--branding", action="store", type="string", dest="branding", default="", help="provides branding path")
|
||||
parser.add_option("--branding-name", action="store", type="string", dest="branding-name", default="", help="provides branding name")
|
||||
parser.add_option("--branding-url", action="store", type="string", dest="branding-url", default="", help="provides branding url")
|
||||
|
||||
@ -10,15 +10,17 @@ import package_utils as utils
|
||||
# parse
|
||||
parser = argparse.ArgumentParser(description="Build packages.")
|
||||
parser.add_argument("-P", "--platform", dest="platform", type=str,
|
||||
action="store", help="Defines platform", required=True)
|
||||
parser.add_argument("-T", "--targets", dest="targets", type=str, nargs="+",
|
||||
action="store", help="Defines targets", required=True)
|
||||
parser.add_argument("-R", "--branding", dest="branding", type=str,
|
||||
action="store", help="Provides branding path")
|
||||
action="store", help="Defines platform", required=True)
|
||||
parser.add_argument("-T", "--targets", dest="targets", type=str, nargs="+",
|
||||
action="store", help="Defines targets", required=True)
|
||||
parser.add_argument("-V", "--version", dest="version", type=str,
|
||||
action="store", help="Defines version")
|
||||
action="store", help="Defines version")
|
||||
parser.add_argument("-B", "--build", dest="build", type=str,
|
||||
action="store", help="Defines build")
|
||||
action="store", help="Defines build")
|
||||
parser.add_argument("-H", "--branch", dest="branch", type=str,
|
||||
action="store", help="Defines branch")
|
||||
parser.add_argument("-R", "--branding", dest="branding", type=str,
|
||||
action="store", help="Provides branding path")
|
||||
args = parser.parse_args()
|
||||
|
||||
# vars
|
||||
@ -29,13 +31,20 @@ common.targets = args.targets
|
||||
common.clean = "clean" in args.targets
|
||||
common.sign = "sign" in args.targets
|
||||
common.deploy = "deploy" in args.targets
|
||||
common.version = args.version if args.version else utils.get_env("BUILD_VERSION", "0.0.0")
|
||||
common.build = args.build if args.build else utils.get_env("BUILD_NUMBER", "0")
|
||||
if args.version: common.version = args.version
|
||||
else: common.version = utils.get_env("PRODUCT_VERSION", "0.0.0")
|
||||
utils.set_env("PRODUCT_VERSION", common.version)
|
||||
utils.set_env("BUILD_VERSION", common.version)
|
||||
if args.build: common.build = args.build
|
||||
else: common.build = utils.get_env("BUILD_NUMBER", "0")
|
||||
utils.set_env("BUILD_NUMBER", common.build)
|
||||
if args.branch: common.branch = args.branch
|
||||
else: common.branch = utils.get_env("BRANCH_NAME", "null")
|
||||
utils.set_env("BRANCH_NAME", common.branch)
|
||||
common.branding = args.branding
|
||||
common.timestamp = utils.get_timestamp()
|
||||
common.workspace_dir = utils.get_abspath(utils.get_script_dir(__file__) + "/..")
|
||||
common.branding_dir = utils.get_abspath(common.workspace_dir + "/" + args.branding) if args.branding else common.workspace_dir
|
||||
common.deploy_data = utils.get_path(common.workspace_dir + "/deploy.txt")
|
||||
common.summary = []
|
||||
utils.log("os_family: " + common.os_family)
|
||||
utils.log("platform: " + str(common.platform))
|
||||
@ -64,15 +73,14 @@ import package_mobile
|
||||
|
||||
# build
|
||||
utils.set_cwd(common.workspace_dir, verbose=True)
|
||||
utils.delete_file(common.deploy_data)
|
||||
if "core" in common.targets:
|
||||
package_core.make()
|
||||
if "closuremaps_opensource" in common.targets:
|
||||
if "closuremaps_sdkjs_opensource" in common.targets:
|
||||
package_core.deploy_closuremaps_sdkjs("opensource")
|
||||
package_core.deploy_closuremaps_webapps("opensource")
|
||||
if "closuremaps_commercial" in common.targets:
|
||||
if "closuremaps_sdkjs_commercial" in common.targets:
|
||||
package_core.deploy_closuremaps_sdkjs("commercial")
|
||||
package_core.deploy_closuremaps_webapps("commercial")
|
||||
if "closuremaps_webapps" in common.targets:
|
||||
package_core.deploy_closuremaps_webapps("opensource")
|
||||
if "desktop" in common.targets:
|
||||
package_desktop.make()
|
||||
if "builder" in common.targets:
|
||||
|
||||
111
scripts/base.py
111
scripts/base.py
@ -39,6 +39,9 @@ def is_os_arm():
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_platform():
|
||||
return platform.machine().lower()
|
||||
|
||||
def is_python_64bit():
|
||||
return (struct.calcsize("P") == 8)
|
||||
|
||||
@ -426,12 +429,13 @@ def cmd_and_return_cwd(prog, args=[], is_no_errors=False):
|
||||
|
||||
def run_command(sCommand):
|
||||
popen = subprocess.Popen(sCommand, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
result = {'stdout' : '', 'stderr' : ''}
|
||||
result = {'stdout' : '', 'stderr' : '', 'returncode' : 0}
|
||||
try:
|
||||
stdout, stderr = popen.communicate()
|
||||
popen.wait()
|
||||
result['stdout'] = stdout.strip().decode('utf-8', errors='ignore')
|
||||
result['stderr'] = stderr.strip().decode('utf-8', errors='ignore')
|
||||
result['returncode'] = popen.returncode
|
||||
finally:
|
||||
popen.stdout.close()
|
||||
popen.stderr.close()
|
||||
@ -496,12 +500,37 @@ def set_cwd(dir):
|
||||
return
|
||||
|
||||
# git ---------------------------------------------------
|
||||
def git_get_origin():
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(get_script_dir() + "/../")
|
||||
ret = run_command("git config --get remote.origin.url")["stdout"]
|
||||
os.chdir(cur_dir)
|
||||
return ret
|
||||
|
||||
def git_is_ssh():
|
||||
git_protocol = config.option("git-protocol")
|
||||
if (git_protocol == "https"):
|
||||
return False
|
||||
if (git_protocol == "ssh"):
|
||||
return True
|
||||
origin = git_get_origin()
|
||||
if (git_protocol == "auto") and (origin.find(":ONLYOFFICE/") != -1):
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_ssh_base_url():
|
||||
cur_origin = git_get_origin()
|
||||
ind = cur_origin.find(":ONLYOFFICE/")
|
||||
if (ind == -1):
|
||||
return "git@github.com:ONLYOFFICE/"
|
||||
return cur_origin[:ind+12]
|
||||
|
||||
def git_update(repo, is_no_errors=False, is_current_dir=False, git_owner=""):
|
||||
print("[git] update: " + repo)
|
||||
owner = git_owner if git_owner else "ONLYOFFICE"
|
||||
url = "https://github.com/" + owner + "/" + repo + ".git"
|
||||
if config.option("git-protocol") == "ssh":
|
||||
url = "git@github.com:ONLYOFFICE/" + repo + ".git"
|
||||
if git_is_ssh():
|
||||
url = get_ssh_base_url() + repo + ".git"
|
||||
folder = get_script_dir() + "/../../" + repo
|
||||
if is_current_dir:
|
||||
folder = repo
|
||||
@ -534,10 +563,12 @@ def get_repositories():
|
||||
result.update(get_sdkjs_addons())
|
||||
result["onlyoffice.github.io"] = [False, False]
|
||||
result["web-apps"] = [False, False]
|
||||
result.update(get_web_apps_addons())
|
||||
result["dictionaries"] = [False, False]
|
||||
result["core-fonts"] = [False, False]
|
||||
|
||||
if config.check_option("module", "server"):
|
||||
result.update(get_web_apps_addons())
|
||||
|
||||
if config.check_option("module", "builder"):
|
||||
result["document-templates"] = [False, False]
|
||||
|
||||
@ -570,8 +601,8 @@ def get_branding_repositories(checker):
|
||||
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"
|
||||
if config.option("git-protocol") == "ssh":
|
||||
url = "git@github.com:ONLYOFFICE/" + repo + ".git"
|
||||
if git_is_ssh():
|
||||
url = get_ssh_base_url() + repo + ".git"
|
||||
folder = get_script_dir() + "/../../" + repo
|
||||
if is_current_dir:
|
||||
folder = repo
|
||||
@ -738,8 +769,9 @@ def qt_config(platform):
|
||||
if (-1 != platform.find("xp")):
|
||||
config_param += " build_xp"
|
||||
if ("ios" == platform):
|
||||
set_env("BITCODE_GENERATION_MODE", "bitcode")
|
||||
set_env("ENABLE_BITCODE", "YES")
|
||||
if (config.check_option("bitcode", "yes")):
|
||||
set_env("BITCODE_GENERATION_MODE", "bitcode")
|
||||
set_env("ENABLE_BITCODE", "YES")
|
||||
config_param = config_param.replace("desktop", "")
|
||||
config_param += " iphoneos device"
|
||||
if (-1 == config_param_lower.find("debug")):
|
||||
@ -1187,7 +1219,7 @@ def mac_correct_rpath_x2t(dir):
|
||||
mac_correct_rpath_library("kernel", ["UnicodeConverter"])
|
||||
mac_correct_rpath_library("kernel_network", ["UnicodeConverter", "kernel"])
|
||||
mac_correct_rpath_library("graphics", ["UnicodeConverter", "kernel"])
|
||||
mac_correct_rpath_library("doctrenderer", ["UnicodeConverter", "kernel", "kernel_network", "graphics"])
|
||||
mac_correct_rpath_library("doctrenderer", ["UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "XpsFile", "DjVuFile", "DocxRenderer"])
|
||||
mac_correct_rpath_library("HtmlFile2", ["UnicodeConverter", "kernel", "kernel_network", "graphics"])
|
||||
mac_correct_rpath_library("EpubFile", ["UnicodeConverter", "kernel", "HtmlFile2", "graphics"])
|
||||
mac_correct_rpath_library("Fb2File", ["UnicodeConverter", "kernel", "graphics"])
|
||||
@ -1206,7 +1238,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", "kernel_network", "doctrenderer"])
|
||||
mac_correct_rpath_binary("./allthemesgen", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "graphics", "kernel_network", "doctrenderer", "PdfFile", "XpsFile", "DjVuFile", "DocxRenderer"])
|
||||
if is_file("./pluginsmanager"):
|
||||
cmd("chmod", ["-v", "+x", "./pluginsmanager"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./pluginsmanager"], True)
|
||||
@ -1224,8 +1256,13 @@ def mac_correct_rpath_docbuilder(dir):
|
||||
cmd("chmod", ["-v", "+x", "./docbuilder"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@executable_path", "./docbuilder"], True)
|
||||
mac_correct_rpath_binary("./docbuilder", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "HtmlRenderer", "XpsFile", "DjVuFile", "HtmlFile2", "Fb2File", "EpubFile", "doctrenderer", "DocxRenderer"])
|
||||
mac_correct_rpath_library("docbuilder.c", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "doctrenderer"])
|
||||
cmd("install_name_tool", ["-add_rpath", "@loader_path", "libdocbuilder.c.dylib"], True)
|
||||
mac_correct_rpath_library("docbuilder.c", ["icudata.58", "icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "doctrenderer", "PdfFile", "XpsFile", "DjVuFile", "DocxRenderer"])
|
||||
|
||||
def add_loader_path_to_rpath(libs):
|
||||
for lib in libs:
|
||||
cmd("install_name_tool", ["-add_rpath", "@loader_path", "lib" + lib + ".dylib"], True)
|
||||
|
||||
add_loader_path_to_rpath(["icuuc.58", "UnicodeConverter", "kernel", "kernel_network", "graphics", "doctrenderer", "PdfFile", "XpsFile", "DjVuFile", "DocxRenderer", "docbuilder.c"])
|
||||
os.chdir(cur_dir)
|
||||
return
|
||||
|
||||
@ -1271,7 +1308,7 @@ def linux_set_origin_rpath_libraries(dir, libs):
|
||||
return
|
||||
|
||||
def linux_correct_rpath_docbuilder(dir):
|
||||
linux_set_origin_rpath_libraries(dir, ["docbuilder.c.so", "icuuc.so.58", "doctrenderer.so", "graphics.so", "kernel.so", "kernel_network.so", "UnicodeConverter.so"])
|
||||
linux_set_origin_rpath_libraries(dir, ["docbuilder.jni.so", "docbuilder.c.so", "icuuc.so.58", "doctrenderer.so", "graphics.so", "kernel.so", "kernel_network.so", "UnicodeConverter.so", "PdfFile.so", "XpsFile.so", "DjVuFile.so", "DocxRenderer.so"])
|
||||
return
|
||||
|
||||
def common_check_version(name, good_version, clean_func):
|
||||
@ -1327,7 +1364,7 @@ def copy_marketplace_plugin(dst_dir, is_name_as_guid=False, is_desktop_local=Fal
|
||||
git_dir = __file__script__path__ + "/../.."
|
||||
if False:
|
||||
# old version
|
||||
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", dst_dir, "manager", is_name_as_guid, is_desktop_local)
|
||||
copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", dst_dir, "manager", is_name_as_guid, is_desktop_local)
|
||||
return
|
||||
src_dir_path = git_dir + "/onlyoffice.github.io/store/plugin"
|
||||
name = "marketplace"
|
||||
@ -1393,6 +1430,7 @@ def support_old_versions_plugins(out_dir):
|
||||
def generate_sdkjs_plugin_list(dst):
|
||||
plugins_list = config.option("sdkjs-plugin").rsplit(", ") \
|
||||
+ config.option("sdkjs-plugin-server").rsplit(", ")
|
||||
plugins_list = list(filter(None, plugins_list))
|
||||
with open(get_path(dst), 'w') as file:
|
||||
dump = json.dumps(sorted(plugins_list), indent=4)
|
||||
file.write(re.sub(r"^(\s{4})", '\t', dump, 0, re.MULTILINE))
|
||||
@ -1754,3 +1792,48 @@ def apply_patch(file, patch):
|
||||
#file_content_new = "\n#if 0" + file_content_old + "#else" + file_content_new + "#endif\n"
|
||||
replaceInFile(file, file_content_old, file_content_new)
|
||||
return
|
||||
|
||||
def get_autobuild_version(product, platform="", branch="", build=""):
|
||||
download_platform = platform
|
||||
if ("" == download_platform):
|
||||
osType = get_platform()
|
||||
isArm = True if (-1 != osType.find("arm")) else False
|
||||
is64 = True if (osType.endswith("64")) else False
|
||||
|
||||
if ("windows" == host_platform()):
|
||||
download_platform = "win-"
|
||||
elif ("linux" == host_platform()):
|
||||
download_platform = "linux-"
|
||||
else:
|
||||
download_platform = "mac-"
|
||||
|
||||
download_platform += ("arm" if isArm else "")
|
||||
download_platform += ("64" if is64 else "32")
|
||||
else:
|
||||
download_platform = download_platform.replace("_", "-")
|
||||
|
||||
download_build = build
|
||||
if ("" == download_build):
|
||||
download_build = "latest"
|
||||
|
||||
download_branch = branch
|
||||
if ("" == download_branch):
|
||||
download_branch = "develop"
|
||||
|
||||
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):
|
||||
if is_file(dir + "/libdoctrenderer.dylib") and (os.path.getsize(dir + "/libdoctrenderer.dylib") < 5*1024*1024):
|
||||
return
|
||||
|
||||
if (product in ["builder", "server"]):
|
||||
cmd_in_dir(dir, "./x2t", ["-create-js-cache"], True)
|
||||
cmd_in_dir(dir, "./x2t", ["-create-js-snapshots"], True)
|
||||
return
|
||||
|
||||
def setup_local_qmake(dir_qmake):
|
||||
dir_base = os.path.dirname(dir_qmake)
|
||||
writeFile(dir_base + "/onlyoffice_qt.conf", "Prefix = " + dir_base)
|
||||
return
|
||||
|
||||
@ -46,4 +46,16 @@ def make(solution=""):
|
||||
else:
|
||||
base.make_sln_project("../core/DesktopEditor/doctrenderer/docbuilder.com/src", "docbuilder.com.sln")
|
||||
base.restorePathForBuilder(new_replace_path)
|
||||
|
||||
# build Java docbuilder wrapper
|
||||
if config.check_option("module", "builder") and "onlyoffice" == config.branding():
|
||||
for platform in platforms:
|
||||
if not platform in config.platforms:
|
||||
continue
|
||||
|
||||
# build JNI library
|
||||
qmake.make(platform, base.get_script_dir() + "/../../core/DesktopEditor/doctrenderer/docbuilder.java/src/jni/docbuilder_jni.pro", "", True)
|
||||
# build Java code to JAR
|
||||
base.cmd_in_dir(base.get_script_dir() + "/../../core/DesktopEditor/doctrenderer/docbuilder.java", "python", ["make.py"])
|
||||
|
||||
return
|
||||
|
||||
@ -3,6 +3,11 @@ sys.path.append('../../../scripts')
|
||||
import base
|
||||
import os
|
||||
|
||||
def clean():
|
||||
if base.is_dir("hunspell"):
|
||||
base.delete_dir_with_access_error("hunspell")
|
||||
return
|
||||
|
||||
def make(build_js = True):
|
||||
|
||||
old_cur_dir = os.getcwd()
|
||||
@ -11,6 +16,8 @@ def make(build_js = True):
|
||||
core_common_dir = base.get_script_dir() + "/../../core/Common"
|
||||
|
||||
os.chdir(core_common_dir + "/3dParty/hunspell")
|
||||
|
||||
base.common_check_version("hunspell", "1", clean)
|
||||
base.cmd("python", ["./before.py"])
|
||||
|
||||
if (build_js):
|
||||
|
||||
@ -119,7 +119,7 @@ def make():
|
||||
# windows hack (delete later) ----------------------
|
||||
if ("windows" == base.host_platform()):
|
||||
base.delete_dir_with_access_error("v8/buildtools/win")
|
||||
base.cmd("git", ["config", "--system", "core.longpaths", "true"])
|
||||
base.cmd("git", ["config", "--system", "core.longpaths", "true"], True)
|
||||
base.cmd("gclient", ["sync", "--force"], True)
|
||||
else:
|
||||
base.cmd("gclient", ["sync"], True)
|
||||
@ -246,7 +246,7 @@ def make_xp():
|
||||
base.cmd("./depot_tools/fetch", ["v8"], True)
|
||||
base.cmd("./depot_tools/gclient", ["sync", "-r", "4.10.253"], True)
|
||||
base.delete_dir_with_access_error("v8/buildtools/win")
|
||||
base.cmd("git", ["config", "--system", "core.longpaths", "true"])
|
||||
base.cmd("git", ["config", "--system", "core.longpaths", "true"], True)
|
||||
base.cmd("gclient", ["sync", "--force"], True)
|
||||
|
||||
# save common py script
|
||||
|
||||
@ -21,6 +21,9 @@ def change_bootstrap():
|
||||
content += "@Subdir git\n"
|
||||
content += "infra/3pp/tools/git/${platform} version:2@2.41.0.chromium.11\n"
|
||||
|
||||
base.replaceInFile("./depot_tools/bootstrap/bootstrap.py",
|
||||
"raise subprocess.CalledProcessError(proc.returncode, argv, None)", "return")
|
||||
|
||||
base.writeFile("./depot_tools/bootstrap/manifest.txt", content)
|
||||
return
|
||||
|
||||
@ -105,6 +108,9 @@ def make():
|
||||
if not base.is_dir(base_dir):
|
||||
base.create_dir(base_dir)
|
||||
|
||||
if ("mac" == base.host_platform()):
|
||||
base.cmd("git", ["config", "--global", "http.postBuffer", "157286400"], True)
|
||||
|
||||
os.chdir(base_dir)
|
||||
if not base.is_dir("depot_tools"):
|
||||
base.cmd("git", ["clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"])
|
||||
@ -121,7 +127,7 @@ def make():
|
||||
base.copy_dir("./v8/third_party", "./v8/third_party_new")
|
||||
if ("windows" == base.host_platform()):
|
||||
os.chdir("v8")
|
||||
base.cmd("git", ["config", "--system", "core.longpaths", "true"])
|
||||
base.cmd("git", ["config", "--system", "core.longpaths", "true"], True)
|
||||
os.chdir("../")
|
||||
v8_branch_version = "remotes/branch-heads/8.9"
|
||||
if ("mac" == base.host_platform()):
|
||||
@ -137,6 +143,11 @@ def make():
|
||||
else:
|
||||
base.replaceInFile("depot_tools/gclient_paths.py", "@functools.lru_cache", "")
|
||||
|
||||
if ("mac" == base.host_platform()):
|
||||
if not base.is_file("v8/build/config/compiler/BUILD.gn.bak"):
|
||||
base.copy_file("v8/build/config/compiler/BUILD.gn", "v8/build/config/compiler/BUILD.gn.bak")
|
||||
base.replaceInFile("v8/build/config/compiler/BUILD.gn", "\"-Wloop-analysis\",", "\"-Wloop-analysis\", \"-D_Float16=short\",")
|
||||
|
||||
if not base.is_file("v8/third_party/jinja2/tests.py.bak"):
|
||||
base.copy_file("v8/third_party/jinja2/tests.py", "v8/third_party/jinja2/tests.py.bak")
|
||||
base.replaceInFile("v8/third_party/jinja2/tests.py", "from collections import Mapping", "try:\n from collections.abc import Mapping\nexcept ImportError:\n from collections import Mapping")
|
||||
|
||||
@ -76,9 +76,12 @@ def make():
|
||||
if (0 == platform.find("win")):
|
||||
base.copy_file(core_build_dir + "/lib/" + platform_postfix + "/doctrenderer.lib", root_dir + "/doctrenderer.lib")
|
||||
base.copy_v8_files(core_dir, root_dir, platform, isWindowsXP)
|
||||
# python wrapper
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "docbuilder.c")
|
||||
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.python/src/docbuilder.py", root_dir + "/docbuilder.py")
|
||||
# java wrapper
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, root_dir, "docbuilder.jni")
|
||||
base.copy_file(core_dir + "/DesktopEditor/doctrenderer/docbuilder.java/build/libs/docbuilder.jar", root_dir + "/docbuilder.jar")
|
||||
|
||||
# app
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, root_dir, "docbuilder")
|
||||
@ -120,6 +123,8 @@ def make():
|
||||
if (0 == platform.find("mac")):
|
||||
base.mac_correct_rpath_x2t(root_dir)
|
||||
base.mac_correct_rpath_docbuilder(root_dir)
|
||||
|
||||
base.create_x2t_js_cache(root_dir, "builder")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ def make():
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "Fb2File")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "EpubFile")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "DocxRenderer")
|
||||
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "hunspell")
|
||||
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", archive_dir + "/cmap.bin")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "x2t")
|
||||
|
||||
@ -61,13 +62,14 @@ def make():
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "ooxml_crypt")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "vboxtester")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "metafiletester")
|
||||
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "dictionariestester")
|
||||
|
||||
# js cache
|
||||
base.generate_doctrenderer_config(archive_dir + "/DoctRenderer.config", "./", "builder", "", "./dictionaries")
|
||||
base.create_x2t_js_cache(archive_dir, "core")
|
||||
base.delete_file(archive_dir + "/DoctRenderer.config")
|
||||
|
||||
# dictionaries
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", archive_dir + "/dictionaries", True, False)
|
||||
|
||||
if base.is_file(archive_dir + ".7z"):
|
||||
base.delete_file(archive_dir + ".7z")
|
||||
base.archive_folder(archive_dir + "/*", archive_dir + ".7z")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@ -102,6 +102,7 @@ def make():
|
||||
|
||||
base.generate_doctrenderer_config(root_dir + "/converter/DoctRenderer.config", "../editors/", "desktop", "", "../dictionaries")
|
||||
base.copy_dir(git_dir + "/document-templates/new", root_dir + "/converter/empty")
|
||||
base.copy_dir(git_dir + "/desktop-apps/common/templates", root_dir + "/converter/templates")
|
||||
|
||||
# dictionaries
|
||||
base.copy_dictionaries(git_dir + "/dictionaries", root_dir + "/dictionaries")
|
||||
@ -260,6 +261,8 @@ def make():
|
||||
if isUseJSC:
|
||||
base.delete_file(root_dir + "/converter/icudtl.dat")
|
||||
|
||||
base.create_x2t_js_cache(root_dir + "/converter", "desktop")
|
||||
|
||||
if (0 == platform.find("win")):
|
||||
base.delete_file(root_dir + "/cef_sandbox.lib")
|
||||
base.delete_file(root_dir + "/libcef.lib")
|
||||
|
||||
@ -118,6 +118,8 @@ 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")
|
||||
|
||||
# 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"])
|
||||
|
||||
|
||||
@ -5,9 +5,6 @@ import base
|
||||
import os
|
||||
import json
|
||||
|
||||
def get_core_url(arch, branch):
|
||||
return "http://repo-doc-onlyoffice-com.s3.amazonaws.com/" + base.host_platform() + "/core/" + branch + "/latest/" + arch + "/core.7z"
|
||||
|
||||
def make():
|
||||
git_dir = base.get_script_dir() + "/../.."
|
||||
old_cur = os.getcwd()
|
||||
@ -18,16 +15,10 @@ def make():
|
||||
|
||||
os.chdir(work_dir)
|
||||
|
||||
arch = "x64"
|
||||
arch2 = "_64"
|
||||
if ("windows" == base.host_platform()) and not base.host_platform_is64():
|
||||
arch = "x86"
|
||||
arch2 = "_32"
|
||||
|
||||
url = get_core_url(arch, config.option("branch"))
|
||||
url = base.get_autobuild_version("core", "", config.option("branch"))
|
||||
data_url = base.get_file_last_modified_url(url)
|
||||
if (data_url == "" and config.option("branch") != "develop"):
|
||||
url = get_core_url(arch, "develop")
|
||||
url = base.get_autobuild_version("core", "", "develop")
|
||||
data_url = base.get_file_last_modified_url(url)
|
||||
|
||||
old_data_url = base.readFile("./core.7z.data")
|
||||
@ -49,12 +40,6 @@ def make():
|
||||
base.extract("./core.7z", "./")
|
||||
base.writeFile("./core.7z.data", data_url)
|
||||
|
||||
platform = ""
|
||||
if ("windows" == base.host_platform()):
|
||||
platform = "win" + arch2
|
||||
else:
|
||||
platform = base.host_platform() + arch2
|
||||
|
||||
base.copy_files("./core/*", "./")
|
||||
else:
|
||||
print("-----------------------------------------------------------")
|
||||
|
||||
@ -43,7 +43,7 @@ if utils.is_linux():
|
||||
},
|
||||
{
|
||||
"make": "rpm",
|
||||
"src": "rpm/builddir/RPMS/*/*.rpm",
|
||||
"src": "rpm/build/RPMS/*/*.rpm",
|
||||
"dst": "builder/linux/rhel/"
|
||||
}
|
||||
]
|
||||
|
||||
@ -7,14 +7,17 @@ import package_branding as branding
|
||||
|
||||
def make():
|
||||
utils.log_h1("BUILDER")
|
||||
if not (utils.is_windows() or utils.is_macos() or utils.is_linux()):
|
||||
utils.log("Unsupported host OS")
|
||||
return
|
||||
if common.deploy:
|
||||
make_archive()
|
||||
if utils.is_windows():
|
||||
make_windows()
|
||||
elif utils.is_macos():
|
||||
make_macos()
|
||||
elif utils.is_linux():
|
||||
make_linux()
|
||||
else:
|
||||
utils.log("Unsupported host OS")
|
||||
return
|
||||
|
||||
def s3_upload(files, dst):
|
||||
@ -24,11 +27,40 @@ def s3_upload(files, dst):
|
||||
key = dst + utils.get_basename(f) if dst.endswith("/") else dst
|
||||
upload = utils.s3_upload(f, "s3://" + branding.s3_bucket + "/" + key)
|
||||
if upload:
|
||||
utils.add_deploy_data(key)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
ret &= upload
|
||||
return ret
|
||||
|
||||
def make_archive():
|
||||
utils.set_cwd(utils.get_path(
|
||||
"build_tools/out/" + common.prefix + "/" + branding.company_name.lower()))
|
||||
|
||||
utils.log_h2("builder archive build")
|
||||
utils.delete_file("builder.7z")
|
||||
args = ["7z", "a", "-y", "builder.7z", "./documentbuilder/*"]
|
||||
if utils.is_windows():
|
||||
ret = utils.cmd(*args, verbose=True)
|
||||
else:
|
||||
ret = utils.sh(" ".join(args), verbose=True)
|
||||
utils.set_summary("builder archive build", ret)
|
||||
|
||||
utils.log_h2("builder archive deploy")
|
||||
dest = "builder-" + common.prefix.replace("_","-") + ".7z"
|
||||
dest_latest = "archive/%s/latest/%s" % (common.branch, dest)
|
||||
dest_version = "archive/%s/%s/%s" % (common.branch, common.build, dest)
|
||||
ret = utils.s3_upload(
|
||||
"builder.7z", "s3://" + branding.s3_bucket + "/" + dest_version)
|
||||
utils.set_summary("builder archive deploy", ret)
|
||||
if ret:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_version)
|
||||
utils.s3_copy(
|
||||
"s3://" + branding.s3_bucket + "/" + dest_version,
|
||||
"s3://" + branding.s3_bucket + "/" + dest_latest)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_latest)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
def make_windows():
|
||||
global inno_file, zip_file, suffix, key_prefix
|
||||
utils.set_cwd("document-builder-package")
|
||||
|
||||
@ -10,47 +10,37 @@ def make():
|
||||
utils.log("Unsupported host OS")
|
||||
return
|
||||
if common.deploy:
|
||||
make_core()
|
||||
make_archive()
|
||||
return
|
||||
|
||||
def make_core():
|
||||
prefix = common.platformPrefixes[common.platform]
|
||||
company = branding.company_name.lower()
|
||||
repos = {
|
||||
"windows_x64": { "repo": "windows", "arch": "x64", "version": common.version + "." + common.build },
|
||||
"windows_x86": { "repo": "windows", "arch": "x86", "version": common.version + "." + common.build },
|
||||
"darwin_x86_64": { "repo": "mac", "arch": "x64", "version": common.version + "-" + common.build },
|
||||
"darwin_arm64": { "repo": "mac", "arch": "arm", "version": common.version + "-" + common.build },
|
||||
"linux_x86_64": { "repo": "linux", "arch": "x64", "version": common.version + "-" + common.build },
|
||||
}
|
||||
repo = repos[common.platform]
|
||||
branch = utils.get_env("BRANCH_NAME")
|
||||
core_7z = utils.get_path("build_tools/out/%s/%s/core.7z" % (prefix, company))
|
||||
dest_version = "%s/core/%s/%s/%s" % (repo["repo"], branch, repo["version"], repo["arch"])
|
||||
dest_latest = "%s/core/%s/%s/%s" % (repo["repo"], branch, "latest", repo["arch"])
|
||||
def make_archive():
|
||||
utils.set_cwd(utils.get_path(
|
||||
"build_tools/out/" + common.prefix + "/" + branding.company_name.lower()))
|
||||
|
||||
if branch is None:
|
||||
utils.log_err("BRANCH_NAME variable is undefined")
|
||||
utils.set_summary("core deploy", False)
|
||||
return
|
||||
if not utils.is_file(core_7z):
|
||||
utils.log_err("file not exist: " + core_7z)
|
||||
utils.set_summary("core deploy", False)
|
||||
return
|
||||
utils.log_h2("core archive build")
|
||||
utils.delete_file("core.7z")
|
||||
args = ["7z", "a", "-y", "core.7z", "./core/*"]
|
||||
if utils.is_windows():
|
||||
ret = utils.cmd(*args, verbose=True)
|
||||
else:
|
||||
ret = utils.sh(" ".join(args), verbose=True)
|
||||
utils.set_summary("core archive build", ret)
|
||||
|
||||
utils.log_h2("core deploy")
|
||||
utils.log_h2("core archive deploy")
|
||||
dest = "core-" + common.prefix.replace("_","-") + ".7z"
|
||||
dest_latest = "archive/%s/latest/%s" % (common.branch, dest)
|
||||
dest_version = "archive/%s/%s/%s" % (common.branch, common.build, dest)
|
||||
ret = utils.s3_upload(
|
||||
core_7z,
|
||||
"s3://" + branding.s3_bucket + "/" + dest_version + "/core.7z")
|
||||
"core.7z", "s3://" + branding.s3_bucket + "/" + dest_version)
|
||||
utils.set_summary("core archive deploy", ret)
|
||||
if ret:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_version + "/core.7z")
|
||||
utils.add_deploy_data(dest_version + "/core.7z")
|
||||
ret = utils.s3_sync(
|
||||
"s3://" + branding.s3_bucket + "/" + dest_version + "/",
|
||||
"s3://" + branding.s3_bucket + "/" + dest_latest + "/",
|
||||
delete=True)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_latest + "/core.7z")
|
||||
utils.set_summary("core deploy", ret)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_version)
|
||||
utils.s3_copy(
|
||||
"s3://" + branding.s3_bucket + "/" + dest_version,
|
||||
"s3://" + branding.s3_bucket + "/" + dest_latest)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + dest_latest)
|
||||
|
||||
utils.set_cwd(common.workspace_dir)
|
||||
return
|
||||
|
||||
def deploy_closuremaps_sdkjs(license):
|
||||
@ -74,7 +64,6 @@ def deploy_closuremaps_sdkjs(license):
|
||||
ret &= upload
|
||||
if upload:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
utils.add_deploy_data(key)
|
||||
utils.set_summary("sdkjs closure maps %s deploy" % license, ret)
|
||||
return
|
||||
|
||||
@ -100,6 +89,5 @@ def deploy_closuremaps_webapps(license):
|
||||
ret &= upload
|
||||
if upload:
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
utils.add_deploy_data(key)
|
||||
utils.set_summary("web-apps closure maps %s deploy" % license, ret)
|
||||
return
|
||||
|
||||
@ -26,7 +26,6 @@ def s3_upload(files, dst):
|
||||
key = dst + utils.get_basename(f) if dst.endswith("/") else dst
|
||||
upload = utils.s3_upload(f, "s3://" + branding.s3_bucket + "/" + key)
|
||||
if upload:
|
||||
utils.add_deploy_data(key)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
ret &= upload
|
||||
return ret
|
||||
@ -154,17 +153,6 @@ def make_inno():
|
||||
else:
|
||||
ret = False
|
||||
utils.set_summary("desktop inno update deploy", ret)
|
||||
|
||||
changes_dir = common.workspace_dir + "\\" \
|
||||
+ utils.get_path(branding.desktop_changes_dir) + "\\" + common.version
|
||||
if common.platform == "windows_x64" and \
|
||||
common.deploy and \
|
||||
utils.glob_path(changes_dir + "\\*.html"):
|
||||
utils.log_h2("desktop changelog deploy")
|
||||
ret = s3_upload(
|
||||
utils.glob_path(changes_dir + "\\*.html"),
|
||||
"desktop/win/update/%s/%s/" % (common.version, common.build))
|
||||
utils.set_summary("desktop changelog deploy", ret)
|
||||
return
|
||||
|
||||
def make_advinst():
|
||||
@ -294,11 +282,17 @@ def make_sparkle_updates():
|
||||
macos_zip = "build/" + zip_filename + ".zip"
|
||||
utils.create_dir(updates_dir)
|
||||
utils.copy_file(macos_zip, updates_dir)
|
||||
utils.copy_dir_content(released_updates_dir, updates_dir, ".zip")
|
||||
utils.sh(
|
||||
"ls -1t " + released_updates_dir + "/*.zip" \
|
||||
+ " | head -n 3" \
|
||||
+ " | while read f; do cp -fv \"$f\" " + updates_dir + "/; done",
|
||||
verbose=True)
|
||||
|
||||
for file in utils.glob_path(changes_dir + "/" + common.version + "/*.html"):
|
||||
filename = utils.get_basename(file).replace("changes", zip_filename)
|
||||
utils.copy_file(file, updates_dir + "/" + filename)
|
||||
for ext in [".html", ".ru.html"]:
|
||||
changes_src = changes_dir + "/" + common.version + "/changes" + ext
|
||||
changes_dst = updates_dir + "/" + zip_filename + ext
|
||||
if not utils.copy_file(changes_src, changes_dst):
|
||||
utils.write_file(changes_dst, "<!DOCTYPE html>placeholder")
|
||||
|
||||
sparkle_base_url = "%s/%s/updates/" % (branding.sparkle_base_url, suffix)
|
||||
ret = utils.sh(
|
||||
|
||||
@ -31,7 +31,6 @@ def make_mobile():
|
||||
key = "mobile/android/" + zip_file
|
||||
ret = utils.s3_upload(zip_file, "s3://" + branding.s3_bucket + "/" + key)
|
||||
if ret:
|
||||
utils.add_deploy_data(key)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
utils.set_summary("mobile deploy", ret)
|
||||
|
||||
|
||||
@ -21,7 +21,6 @@ def s3_upload(files, dst):
|
||||
key = dst + utils.get_basename(f) if dst.endswith("/") else dst
|
||||
upload = utils.s3_upload(f, "s3://" + branding.s3_bucket + "/" + key)
|
||||
if upload:
|
||||
utils.add_deploy_data(key)
|
||||
utils.log("URL: " + branding.s3_base_url + "/" + key)
|
||||
ret &= upload
|
||||
return ret
|
||||
|
||||
@ -266,11 +266,6 @@ def set_summary(target, status):
|
||||
common.summary.append({target: status})
|
||||
return
|
||||
|
||||
def add_deploy_data(key):
|
||||
with open(common.deploy_data, 'a+') as f:
|
||||
f.write(key + "\n")
|
||||
return
|
||||
|
||||
def cmd(*args, **kwargs):
|
||||
if kwargs.get("verbose"):
|
||||
log("- cmd:")
|
||||
@ -385,15 +380,13 @@ def s3_upload(src, dst, **kwargs):
|
||||
ret = sh(" ".join(args), verbose=True)
|
||||
return ret
|
||||
|
||||
def s3_sync(src, dst, **kwargs):
|
||||
def s3_copy(src, dst, **kwargs):
|
||||
args = ["aws"]
|
||||
if kwargs.get("endpoint_url"):
|
||||
args += ["--endpoint-url", kwargs["endpoint_url"]]
|
||||
args += ["s3", "sync", "--no-progress"]
|
||||
args += ["s3", "cp", "--no-progress"]
|
||||
if kwargs.get("acl"):
|
||||
args += ["--acl", kwargs["acl"]]
|
||||
if kwargs.get("delete") and kwargs["delete"]:
|
||||
args += ["--delete"]
|
||||
args += [src, dst]
|
||||
if is_windows():
|
||||
ret = cmd(*args, verbose=True)
|
||||
|
||||
@ -29,7 +29,7 @@ def check_support_platform(platform):
|
||||
return False
|
||||
return True
|
||||
|
||||
def make(platform, project, qmake_config_addon=""):
|
||||
def make(platform, project, qmake_config_addon="", is_no_errors=False):
|
||||
# check platform
|
||||
if not check_support_platform(platform):
|
||||
print("THIS PLATFORM IS NOT SUPPORTED")
|
||||
@ -93,6 +93,9 @@ def make(platform, project, qmake_config_addon=""):
|
||||
qmake_app = qt_dir + "/bin/qmake"
|
||||
# non windows platform
|
||||
if not base.is_windows():
|
||||
if base.is_file(qt_dir + "/onlyoffice_qt.conf"):
|
||||
build_params.append("-qtconf")
|
||||
build_params.append(qt_dir + "/onlyoffice_qt.conf")
|
||||
base.cmd(qmake_app, build_params)
|
||||
base.correct_makefile_after_qmake(platform, makefile)
|
||||
if ("1" == config.option("clean")):
|
||||
@ -100,7 +103,7 @@ def make(platform, project, qmake_config_addon=""):
|
||||
base.cmd_and_return_cwd("make", distclean_params, True)
|
||||
base.cmd(qmake_app, build_params)
|
||||
base.correct_makefile_after_qmake(platform, makefile)
|
||||
base.cmd_and_return_cwd("make", ["-f", makefile] + get_j_num())
|
||||
base.cmd_and_return_cwd("make", ["-f", makefile] + get_j_num(), is_no_errors)
|
||||
else:
|
||||
config_params_array = base.qt_config_as_param(config_param)
|
||||
config_params_string = ""
|
||||
@ -123,7 +126,7 @@ def make(platform, project, qmake_config_addon=""):
|
||||
if ("0" != config.option("multiprocess")):
|
||||
qmake_bat.append("set CL=/MP")
|
||||
qmake_bat.append("call nmake -f " + makefile)
|
||||
base.run_as_bat(qmake_bat)
|
||||
base.run_as_bat(qmake_bat, is_no_errors)
|
||||
|
||||
if (base.is_file(stash_file)):
|
||||
base.delete_file(stash_file)
|
||||
|
||||
@ -1,16 +1,22 @@
|
||||
|
||||
# Documentation Generation Guide
|
||||
|
||||
This guide explains how to generate documentation for Onlyoffice API using the provided Python scripts, `generate_docs_json.py` and `generate_docs_md.py`. These scripts are used to create JSON and Markdown documentation for the `apiBuilder.js` files from the word, cell, and slide editors.
|
||||
This guide explains how to generate documentation for Onlyoffice Builder/Plugins API using the provided Python scripts: `generate_docs_json.py`, `generate_docs_plugins_json.py`, `generate_docs_md.py`. These scripts are used to create JSON and Markdown documentation for the `apiBuilder.js` files from the word, cell, and slide editors.
|
||||
|
||||
## Prerequisites
|
||||
## Requirements
|
||||
|
||||
1. **Node.js and npm**: Ensure you have Node.js and npm installed on your machine. You can download them from [Node.js official website](https://nodejs.org/).
|
||||
```bash
|
||||
Node.js v20 and above
|
||||
Python v3.10 and above
|
||||
```
|
||||
|
||||
2. **jsdoc**: The scripts use `jsdoc` to generate documentation. Install it using npm:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
git clone https://github.com/ONLYOFFICE/build_tools.git
|
||||
cd build_tools/scripts/sdkjs_common/jsdoc
|
||||
npm install
|
||||
```
|
||||
|
||||
## Scripts Overview
|
||||
|
||||
@ -24,7 +30,19 @@ This script generates JSON documentation based on the `apiBuilder.js` files.
|
||||
```
|
||||
|
||||
- **Parameters**:
|
||||
- `output_path` (optional): The directory where the JSON documentation will be saved. If not specified, the default path is `Onlyoffice/sdkjs/deploy/api_builder/json`.
|
||||
- `output_path` (optional): The directory where the JSON documentation will be saved. If not specified, the default path is `../../../../office-js-api-declarations/office-js-api`.
|
||||
|
||||
### `generate_docs_plugins_json.py`
|
||||
|
||||
This script generates JSON documentation based on the `api_plugins.js` files.
|
||||
|
||||
- **Usage**:
|
||||
```bash
|
||||
python generate_docs_plugins_json.py output_path
|
||||
```
|
||||
|
||||
- **Parameters**:
|
||||
- `output_path` (optional): The directory where the JSON documentation will be saved. If not specified, the default path is `../../../../office-js-api-declarations/office-js-api-plugins`.
|
||||
|
||||
### `generate_docs_md.py`
|
||||
|
||||
@ -36,7 +54,7 @@ This script generates Markdown documentation from the `apiBuilder.js` files.
|
||||
```
|
||||
|
||||
- **Parameters**:
|
||||
- `output_path` (optional): The directory where the Markdown documentation will be saved. If not specified, the default path is `Onlyoffice/office-js-api`.
|
||||
- `output_path` (optional): The directory where the Markdown documentation will be saved. If not specified, the default path is `../../../../office-js-api/`.
|
||||
|
||||
## Example
|
||||
|
||||
@ -45,6 +63,11 @@ To generate JSON documentation with the default output path:
|
||||
python generate_docs_json.py /path/to/save/json
|
||||
```
|
||||
|
||||
To generate JSON documentation with the default output path:
|
||||
```bash
|
||||
python generate_docs_plugins_json.py /path/to/save/json
|
||||
```
|
||||
|
||||
To generate Markdown documentation and specify a custom output path:
|
||||
```bash
|
||||
python generate_docs_md.py /path/to/save/markdown
|
||||
|
||||
16
scripts/sdkjs_common/jsdoc/config/plugins/cell.json
Normal file
16
scripts/sdkjs_common/jsdoc/config/plugins/cell.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"source": {
|
||||
"include": ["../../../../sdkjs/cell/api_plugins.js"]
|
||||
},
|
||||
"plugins": ["./correct_doclets.js"],
|
||||
"opts": {
|
||||
"destination": "./out",
|
||||
"recurse": true,
|
||||
"encoding": "utf8"
|
||||
},
|
||||
"templates": {
|
||||
"json": {
|
||||
"pretty": true
|
||||
}
|
||||
}
|
||||
}
|
||||
16
scripts/sdkjs_common/jsdoc/config/plugins/common.json
Normal file
16
scripts/sdkjs_common/jsdoc/config/plugins/common.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"source": {
|
||||
"include": ["../../../../sdkjs/common/plugins/plugin_base_api.js" ,"../../../../sdkjs/common/apiBase_plugins.js"]
|
||||
},
|
||||
"plugins": ["./correct_doclets.js"],
|
||||
"opts": {
|
||||
"destination": "./out",
|
||||
"recurse": true,
|
||||
"encoding": "utf8"
|
||||
},
|
||||
"templates": {
|
||||
"json": {
|
||||
"pretty": true
|
||||
}
|
||||
}
|
||||
}
|
||||
85
scripts/sdkjs_common/jsdoc/config/plugins/correct_doclets.js
Normal file
85
scripts/sdkjs_common/jsdoc/config/plugins/correct_doclets.js
Normal file
@ -0,0 +1,85 @@
|
||||
exports.handlers = {
|
||||
processingComplete: function(e) {
|
||||
const filteredDoclets = [];
|
||||
|
||||
function checkNullProps(oDoclet) {
|
||||
for (let key of Object.keys(oDoclet)) {
|
||||
if (oDoclet[key] == null) {
|
||||
delete oDoclet[key];
|
||||
}
|
||||
if (typeof(oDoclet[key]) == "object") {
|
||||
checkNullProps(oDoclet[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < e.doclets.length; i++) {
|
||||
const doclet = e.doclets[i];
|
||||
if (true == doclet.undocumented || doclet.kind == 'package') {
|
||||
continue;
|
||||
}
|
||||
|
||||
const filteredDoclet = {
|
||||
comment: doclet.comment,
|
||||
|
||||
meta: doclet.meta ? {
|
||||
lineno: doclet.meta.lineno,
|
||||
columnno: doclet.meta.columnno
|
||||
} : doclet.meta,
|
||||
|
||||
kind: doclet.kind,
|
||||
since: doclet.since,
|
||||
name: doclet.name,
|
||||
type: doclet.type ? {
|
||||
names: doclet.type.names,
|
||||
parsedType: doclet.type.parsedType
|
||||
} : doclet.type,
|
||||
|
||||
description: doclet.description,
|
||||
memberof: doclet.memberof,
|
||||
|
||||
properties: doclet.properties ? doclet.properties.map(property => ({
|
||||
type: property.type ? {
|
||||
names: property.type.names,
|
||||
parsedType: property.type.parsedType
|
||||
} : property.type,
|
||||
|
||||
name: property.name,
|
||||
description: property.description,
|
||||
optional: property.optional,
|
||||
defaultvalue: property.defaultvalue
|
||||
})) : doclet.properties,
|
||||
|
||||
longname: doclet.longname,
|
||||
scope: doclet.scope,
|
||||
alias: doclet.alias,
|
||||
|
||||
params: doclet.params ? doclet.params.map(param => ({
|
||||
type: param.type ? {
|
||||
names: param.type.names,
|
||||
parsedType: param.type.parsedType
|
||||
} : param.type,
|
||||
|
||||
name: param.name,
|
||||
description: param.description,
|
||||
optional: param.optional,
|
||||
defaultvalue: param.defaultvalue
|
||||
})) : doclet.params,
|
||||
|
||||
returns: doclet.returns ? doclet.returns.map(returnObj => ({
|
||||
type: {
|
||||
names: returnObj.type.names,
|
||||
parsedType: returnObj.type.parsedType
|
||||
}
|
||||
})) : doclet.returns,
|
||||
see: doclet.see
|
||||
};
|
||||
|
||||
checkNullProps(filteredDoclet)
|
||||
|
||||
filteredDoclets.push(filteredDoclet);
|
||||
}
|
||||
|
||||
e.doclets.splice(0, e.doclets.length, ...filteredDoclets);
|
||||
}
|
||||
};
|
||||
16
scripts/sdkjs_common/jsdoc/config/plugins/forms.json
Normal file
16
scripts/sdkjs_common/jsdoc/config/plugins/forms.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"source": {
|
||||
"include": ["../../../../sdkjs-forms/apiPlugins.js"]
|
||||
},
|
||||
"plugins": ["./correct_doclets.js"],
|
||||
"opts": {
|
||||
"destination": "./out",
|
||||
"recurse": true,
|
||||
"encoding": "utf8"
|
||||
},
|
||||
"templates": {
|
||||
"json": {
|
||||
"pretty": true
|
||||
}
|
||||
}
|
||||
}
|
||||
16
scripts/sdkjs_common/jsdoc/config/plugins/slide.json
Normal file
16
scripts/sdkjs_common/jsdoc/config/plugins/slide.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"source": {
|
||||
"include": ["../../../../sdkjs/slide/api_plugins.js"]
|
||||
},
|
||||
"plugins": ["./correct_doclets.js"],
|
||||
"opts": {
|
||||
"destination": "./out",
|
||||
"recurse": true,
|
||||
"encoding": "utf8"
|
||||
},
|
||||
"templates": {
|
||||
"json": {
|
||||
"pretty": true
|
||||
}
|
||||
}
|
||||
}
|
||||
16
scripts/sdkjs_common/jsdoc/config/plugins/word.json
Normal file
16
scripts/sdkjs_common/jsdoc/config/plugins/word.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"source": {
|
||||
"include": ["../../../../sdkjs/word/api_plugins.js", "../../../../sdkjs-forms/apiPlugins.js"]
|
||||
},
|
||||
"plugins": ["./correct_doclets.js"],
|
||||
"opts": {
|
||||
"destination": "./out",
|
||||
"recurse": true,
|
||||
"encoding": "utf8"
|
||||
},
|
||||
"templates": {
|
||||
"json": {
|
||||
"pretty": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,13 +3,16 @@ import subprocess
|
||||
import json
|
||||
import argparse
|
||||
import re
|
||||
import platform
|
||||
|
||||
root = '../../../..'
|
||||
|
||||
# Configuration files
|
||||
configs = [
|
||||
"./config/word.json",
|
||||
"./config/cell.json",
|
||||
"./config/slide.json",
|
||||
"./config/forms.json"
|
||||
"./config/builder/word.json",
|
||||
"./config/builder/cell.json",
|
||||
"./config/builder/slide.json",
|
||||
"./config/builder/forms.json"
|
||||
]
|
||||
|
||||
editors_maps = {
|
||||
@ -20,20 +23,17 @@ editors_maps = {
|
||||
}
|
||||
|
||||
def generate(output_dir, md=False):
|
||||
missing_examples_file = f'{output_dir}/missing_examples.txt'
|
||||
|
||||
if not os.path.exists(output_dir):
|
||||
os.makedirs(output_dir)
|
||||
|
||||
# Recreate missing_examples.txt file
|
||||
with open(missing_examples_file, 'w', encoding='utf-8') as f:
|
||||
f.write('')
|
||||
|
||||
# Generate JSON documentation
|
||||
for config in configs:
|
||||
editor_name = config.split('/')[-1].replace('.json', '')
|
||||
output_file = os.path.join(output_dir, editor_name + ".json")
|
||||
command = f"set EDITOR={editors_maps[editor_name]} && npx jsdoc -c {config} -X > {output_file}"
|
||||
command_set_env = "export"
|
||||
if (platform.system().lower() == "windows"):
|
||||
command_set_env = "set"
|
||||
command = f"{command_set_env} EDITOR={editors_maps[editor_name]} && npx jsdoc -c {config} -X > {output_file}"
|
||||
print(f"Generating {editor_name}.json: {command}")
|
||||
subprocess.run(command, shell=True)
|
||||
|
||||
@ -55,7 +55,7 @@ def generate(output_dir, md=False):
|
||||
else:
|
||||
doclet['see'][0] = doclet['see'][0].replace('{Editor}', editor_name.title())
|
||||
|
||||
file_path = '../../../../' + doclet['see'][0]
|
||||
file_path = f'{root}/' + doclet['see'][0]
|
||||
|
||||
if os.path.exists(file_path):
|
||||
with open(file_path, 'r', encoding='utf-8') as see_file:
|
||||
@ -70,22 +70,20 @@ def generate(output_dir, md=False):
|
||||
comment = ''
|
||||
code_content = example_content
|
||||
|
||||
# Format content for doclet['example']
|
||||
doclet['example'] = remove_js_comments(comment) + "```js\n" + code_content + "\n```"
|
||||
if md == True:
|
||||
doclet['example'] = remove_js_comments(comment) + "```js\n" + code_content + "\n```"
|
||||
|
||||
if md == False:
|
||||
doclet['description'] = doclet['description'] + f'\n\n## Try it\n\n ```js document-builder={{"documentType": "{editor_name.title()}"}}\n{code_content}\n```'
|
||||
|
||||
else:
|
||||
# Record missing examples in missing_examples.txt
|
||||
with open(missing_examples_file, 'a', encoding='utf-8') as missing_file:
|
||||
missing_file.write(f"{file_path}\n")
|
||||
document_type = editor_name
|
||||
if "forms" == document_type:
|
||||
document_type = "pdf"
|
||||
doclet['description'] = doclet['description'] + f'\n\n## Try it\n\n ```js document-builder={{"documentType": "{document_type}"}}\n{code_content}\n```'
|
||||
|
||||
# Write the modified JSON file back
|
||||
with open(output_file, 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=4)
|
||||
|
||||
print("Documentation generation completed.")
|
||||
print("Documentation generation for builder completed.")
|
||||
|
||||
def remove_builder_lines(text):
|
||||
lines = text.splitlines() # Split text into lines
|
||||
@ -98,25 +96,6 @@ def remove_js_comments(text):
|
||||
# Remove multi-line comments, leaving text after /*
|
||||
text = re.sub(r'/\*\s*|\s*\*/', '', text, flags=re.DOTALL)
|
||||
return text.strip()
|
||||
|
||||
def get_current_branch(path):
|
||||
try:
|
||||
# Navigate to the specified directory and get the current branch name
|
||||
result = subprocess.run(
|
||||
["git", "rev-parse", "--abbrev-ref", "HEAD"],
|
||||
cwd=path,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True
|
||||
)
|
||||
if result.returncode == 0:
|
||||
return result.stdout.strip()
|
||||
else:
|
||||
print(f"Error: {result.stderr}")
|
||||
return None
|
||||
except Exception as e:
|
||||
print(f"Exception: {e}")
|
||||
return None
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Generate documentation")
|
||||
@ -125,12 +104,7 @@ if __name__ == "__main__":
|
||||
type=str,
|
||||
help="Destination directory for the generated documentation",
|
||||
nargs='?', # Indicates the argument is optional
|
||||
default="../../../../document-builder-declarations/document-builder" # Default value
|
||||
default=f"{root}/office-js-api-declarations/office-js-api"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
branch_name = get_current_branch("../../../../sdkjs")
|
||||
if branch_name:
|
||||
args.destination = f"{args.destination}/{branch_name}"
|
||||
|
||||
generate(args.destination)
|
||||
|
||||
@ -13,6 +13,8 @@ editors = [
|
||||
"forms"
|
||||
]
|
||||
|
||||
missing_examples = []
|
||||
|
||||
def load_json(file_path):
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
return json.load(f)
|
||||
@ -53,10 +55,10 @@ def correct_default_value(value, enumerations, classes):
|
||||
return generate_data_types_markdown([value], enumerations, classes)
|
||||
|
||||
def remove_line_breaks(string):
|
||||
return re.sub(r'[\r\n]', '', string)
|
||||
return re.sub(r'[\r\n]', ' ', string)
|
||||
|
||||
def generate_data_types_markdown(types, enumerations, classes, root='../../'):
|
||||
param_types_md = ' |'.join(types)
|
||||
param_types_md = ' | '.join(types)
|
||||
|
||||
for enum in enumerations:
|
||||
if enum['name'] in types:
|
||||
@ -69,10 +71,10 @@ def generate_data_types_markdown(types, enumerations, classes, root='../../'):
|
||||
element = match.group(1).strip()
|
||||
base_type = element.split('.')[0] # Take only the first part before the dot, if any
|
||||
if any(enum['name'] == base_type for enum in enumerations):
|
||||
return f"<[{element}](../../Enumeration/{base_type}.md)>"
|
||||
return f"<[{element}]({root}Enumeration/{base_type}.md)>"
|
||||
elif base_type in classes:
|
||||
return f"<[{element}](../../{base_type}/{base_type}.md)>"
|
||||
return f"<{element}>"
|
||||
return f"<[{element}]({root}{base_type}/{base_type}.md)>"
|
||||
return f"<{element}>"
|
||||
|
||||
return re.sub(r'<([^<>]+)>', replace_with_links, param_types_md)
|
||||
|
||||
@ -196,10 +198,11 @@ def generate_enumeration_markdown(enumeration, enumerations, classes):
|
||||
|
||||
return content
|
||||
|
||||
def process_doclets(data, output_dir):
|
||||
def process_doclets(data, output_dir, editor_name):
|
||||
classes = {}
|
||||
classes_props = {}
|
||||
enumerations = []
|
||||
editor_dir = os.path.join(output_dir, editor_name)
|
||||
|
||||
for doclet in data:
|
||||
if doclet['kind'] == 'class':
|
||||
@ -217,7 +220,7 @@ def process_doclets(data, output_dir):
|
||||
|
||||
# Process classes
|
||||
for class_name, methods in classes.items():
|
||||
class_dir = os.path.join(output_dir, class_name)
|
||||
class_dir = os.path.join(editor_dir, class_name)
|
||||
methods_dir = os.path.join(class_dir, 'Methods')
|
||||
os.makedirs(methods_dir, exist_ok=True)
|
||||
|
||||
@ -227,16 +230,22 @@ def process_doclets(data, output_dir):
|
||||
|
||||
# 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)
|
||||
write_markdown_file(os.path.join(methods_dir, f"{method['name']}.md"), method_content)
|
||||
write_markdown_file(method_file_path, method_content)
|
||||
if not method.get('example', ''):
|
||||
missing_examples.append(os.path.relpath(method_file_path, output_dir))
|
||||
|
||||
# Process enumerations
|
||||
enum_dir = os.path.join(output_dir, 'Enumeration')
|
||||
enum_dir = os.path.join(editor_dir, 'Enumeration')
|
||||
os.makedirs(enum_dir, exist_ok=True)
|
||||
|
||||
for enum in enumerations:
|
||||
enum_file_path = os.path.join(enum_dir, f"{enum['name']}.md")
|
||||
enum_content = generate_enumeration_markdown(enum, enumerations, classes)
|
||||
write_markdown_file(os.path.join(enum_dir, f"{enum['name']}.md"), enum_content)
|
||||
write_markdown_file(enum_file_path, enum_content)
|
||||
if not enum.get('example', ''):
|
||||
missing_examples.append(os.path.relpath(enum_file_path, output_dir))
|
||||
|
||||
def generate(output_dir):
|
||||
print('Generating Markdown documentation...')
|
||||
@ -247,7 +256,7 @@ def generate(output_dir):
|
||||
os.makedirs(output_dir + f'/{editor_name.title()}', exist_ok=True)
|
||||
|
||||
data = load_json(input_file)
|
||||
process_doclets(data, output_dir + f'/{editor_name}')
|
||||
process_doclets(data, output_dir, editor_name.title())
|
||||
|
||||
shutil.rmtree(output_dir + 'tmp_json')
|
||||
print('Done')
|
||||
@ -262,5 +271,7 @@ if __name__ == "__main__":
|
||||
default="../../../../office-js-api/" # Default value
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
generate(args.destination)
|
||||
print("START_MISSING_EXAMPLES")
|
||||
print(",".join(missing_examples))
|
||||
print("END_MISSING_EXAMPLES")
|
||||
|
||||
99
scripts/sdkjs_common/jsdoc/generate_docs_plugins_json.py
Normal file
99
scripts/sdkjs_common/jsdoc/generate_docs_plugins_json.py
Normal file
@ -0,0 +1,99 @@
|
||||
import os
|
||||
import subprocess
|
||||
import json
|
||||
import argparse
|
||||
import re
|
||||
|
||||
# Configuration files
|
||||
configs = [
|
||||
"./config/plugins/common.json",
|
||||
"./config/plugins/word.json",
|
||||
"./config/plugins/cell.json",
|
||||
"./config/plugins/slide.json",
|
||||
"./config/plugins/forms.json"
|
||||
]
|
||||
|
||||
root = '../../../..'
|
||||
|
||||
def generate(output_dir, md=False):
|
||||
if not os.path.exists(output_dir):
|
||||
os.makedirs(output_dir)
|
||||
|
||||
# Generate JSON documentation
|
||||
for config in configs:
|
||||
editor_name = config.split('/')[-1].replace('.json', '')
|
||||
output_file = os.path.join(output_dir, editor_name + ".json")
|
||||
command = f"npx jsdoc -c {config} -X > {output_file}"
|
||||
print(f"Generating {editor_name}.json: {command}")
|
||||
subprocess.run(command, shell=True)
|
||||
|
||||
# Append examples to JSON documentation
|
||||
for config in configs:
|
||||
editor_name = config.split('/')[-1].replace('.json', '')
|
||||
output_file = os.path.join(output_dir, editor_name + ".json")
|
||||
|
||||
# Read the JSON file
|
||||
with open(output_file, 'r', encoding='utf-8') as f:
|
||||
data = json.load(f)
|
||||
|
||||
# Modify JSON data
|
||||
for doclet in data:
|
||||
if 'see' in doclet:
|
||||
if doclet['see'] is not None:
|
||||
if editor_name == 'forms':
|
||||
doclet['see'][0] = doclet['see'][0].replace('{Editor}', 'Word')
|
||||
else:
|
||||
doclet['see'][0] = doclet['see'][0].replace('{Editor}', editor_name.title())
|
||||
|
||||
file_path = f'{root}/' + doclet['see'][0]
|
||||
|
||||
if os.path.exists(file_path):
|
||||
with open(file_path, 'r', encoding='utf-8') as see_file:
|
||||
example_content = see_file.read()
|
||||
|
||||
# Extract the first line as a comment if it exists
|
||||
lines = example_content.split('\n')
|
||||
if lines[0].startswith('//'):
|
||||
comment = lines[0] + '\n'
|
||||
code_content = '\n'.join(lines[1:])
|
||||
else:
|
||||
comment = ''
|
||||
code_content = example_content
|
||||
|
||||
doclet['examples'] = [remove_js_comments(comment) + code_content]
|
||||
|
||||
if md == False:
|
||||
document_type = editor_name
|
||||
if "forms" == document_type:
|
||||
document_type = "pdf"
|
||||
doclet['description'] = doclet['description'] + f'\n\n## Try it\n\n ```js document-builder={{"documentType": "{document_type}"}}\n{code_content}\n```'
|
||||
|
||||
# Write the modified JSON file back
|
||||
with open(output_file, 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=4)
|
||||
|
||||
print("Documentation generation for builder completed.")
|
||||
|
||||
def remove_builder_lines(text):
|
||||
lines = text.splitlines() # Split text into lines
|
||||
filtered_lines = [line for line in lines if not line.strip().startswith("builder.")]
|
||||
return "\n".join(filtered_lines)
|
||||
|
||||
def remove_js_comments(text):
|
||||
# Remove single-line comments, leaving text after //
|
||||
text = re.sub(r'^\s*//\s?', '', text, flags=re.MULTILINE)
|
||||
# Remove multi-line comments, leaving text after /*
|
||||
text = re.sub(r'/\*\s*|\s*\*/', '', text, flags=re.DOTALL)
|
||||
return text.strip()
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Generate documentation")
|
||||
parser.add_argument(
|
||||
"destination",
|
||||
type=str,
|
||||
help="Destination directory for the generated documentation",
|
||||
nargs='?', # Indicates the argument is optional
|
||||
default=f"{root}/office-js-api-declarations/office-js-api-plugins"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
generate(args.destination)
|
||||
39
scripts/sdkjs_common/jsdoc/get_latest_branch.py
Normal file
39
scripts/sdkjs_common/jsdoc/get_latest_branch.py
Normal file
@ -0,0 +1,39 @@
|
||||
import subprocess
|
||||
|
||||
def fetch_branches():
|
||||
#Fetch all branches without tags from the remote.
|
||||
subprocess.run(['git', 'fetch', '--no-tags', 'origin', '+refs/heads/*:refs/remotes/origin/*'], check=True)
|
||||
|
||||
def get_branches():
|
||||
#Get list of branches in the repository."""
|
||||
result = subprocess.run(['git', 'branch', '-r'], capture_output=True, text=True)
|
||||
return [line.strip() for line in result.stdout.splitlines()]
|
||||
|
||||
def parse_version(version_str):
|
||||
#Parse version string and return a tuple of integers (major, minor, patch).
|
||||
try:
|
||||
return tuple(map(int, version_str.lstrip('v').split('.')))
|
||||
except ValueError:
|
||||
return (0, 0, 0) # Default for non-parsable versions
|
||||
|
||||
def get_max_version_branch(branches):
|
||||
#Find the branch with the highest version.
|
||||
max_branch = None
|
||||
max_version = (0, 0, 0)
|
||||
|
||||
for branch in branches:
|
||||
parts = branch.split('/')
|
||||
if len(parts) >= 2 and (parts[1] == 'hotfix' or parts[1] == 'release'):
|
||||
version = parse_version(parts[2])
|
||||
if version > max_version:
|
||||
max_version = version
|
||||
max_branch = parts
|
||||
|
||||
return max_branch
|
||||
|
||||
if __name__ == "__main__":
|
||||
fetch_branches() # Fetch branches without tags
|
||||
branches = get_branches()
|
||||
max_version_branch = get_max_version_branch(branches)
|
||||
if max_version_branch:
|
||||
print('/'.join(max_version_branch[1:])) # Print only the branch name without origin
|
||||
@ -14,6 +14,15 @@ def is_exist_in_array(projects, proj):
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_full_projects_list(json_data, list):
|
||||
result = []
|
||||
for rec in list:
|
||||
if rec in json_data:
|
||||
result += get_full_projects_list(json_data, json_data[rec])
|
||||
else:
|
||||
result.append(rec)
|
||||
return result
|
||||
|
||||
def adjust_project_params(params):
|
||||
ret_params = params
|
||||
|
||||
@ -86,13 +95,9 @@ def get_projects(pro_json_path, platform):
|
||||
|
||||
# check aliases to modules
|
||||
records_src = data[module]
|
||||
records = []
|
||||
records = get_full_projects_list(data, records_src)
|
||||
|
||||
for rec in records_src:
|
||||
if rec in data:
|
||||
records += data[rec]
|
||||
else:
|
||||
records.append(rec)
|
||||
print(records)
|
||||
|
||||
for rec in records:
|
||||
params = []
|
||||
|
||||
18
sln.json
18
sln.json
@ -1,6 +1,10 @@
|
||||
{
|
||||
"root" : "../",
|
||||
|
||||
"spell" : [
|
||||
"[win,linux,mac]core/Common/3dParty/hunspell/qt/hunspell.pro"
|
||||
],
|
||||
|
||||
"core" : [
|
||||
|
||||
"core/Common/3dParty/cryptopp/project/cryptopp.pro",
|
||||
@ -23,7 +27,6 @@
|
||||
"core/DocxRenderer/DocxRenderer.pro",
|
||||
|
||||
"core/DesktopEditor/doctrenderer/doctrenderer.pro",
|
||||
"core/DesktopEditor/doctrenderer/docbuilder.python/src/docbuilder_func_lib.pro",
|
||||
|
||||
"[!no_x2t]core/OOXML/Projects/Linux/DocxFormatLib/DocxFormatLib.pro",
|
||||
"[!no_x2t]core/OOXML/Projects/Linux/PPTXFormatLib/PPTXFormatLib.pro",
|
||||
@ -51,15 +54,19 @@
|
||||
|
||||
"[win,linux,mac,!linux_arm64]core/OfficeCryptReader/ooxml_crypt/ooxml_crypt.pro",
|
||||
|
||||
"spell",
|
||||
|
||||
"[win,linux,mac,!no_tests]core/DesktopEditor/vboxtester/vboxtester.pro",
|
||||
"[win,linux,mac,!no_tests]core/Test/Applications/StandardTester/standardtester.pro",
|
||||
"[win,linux,mac,!no_tests]core/Test/Applications/x2tTester/x2ttester.pro",
|
||||
"[win,linux,mac,!no_tests]core/Test/Applications/MetafileTester/MetafileTester.pro"
|
||||
"[win,linux,mac,!no_tests]core/Test/Applications/MetafileTester/MetafileTester.pro",
|
||||
"[win,linux,mac,!no_tests]core/Common/3dParty/hunspell/test/test.pro"
|
||||
|
||||
],
|
||||
|
||||
"builder" : [
|
||||
"core"
|
||||
"core",
|
||||
"core/DesktopEditor/doctrenderer/docbuilder.python/src/docbuilder_func_lib.pro"
|
||||
],
|
||||
|
||||
"server" : [
|
||||
@ -70,13 +77,8 @@
|
||||
"[win,linux]desktop-sdk/ChromiumBasedEditors/videoplayerlib/videoplayerlib.pro"
|
||||
],
|
||||
|
||||
"spell" : [
|
||||
"[win,linux,mac]core/Common/3dParty/hunspell/qt/hunspell.pro"
|
||||
],
|
||||
|
||||
"desktop" : [
|
||||
"core",
|
||||
"spell",
|
||||
"multimedia",
|
||||
|
||||
"core/DesktopEditor/xmlsec/src/ooxmlsignature.pro",
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
{
|
||||
"browser" : "chrome",
|
||||
"browserUrl" : "C:/Program Files/Google/Chrome/Application/chrome.exe"
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
{
|
||||
"browser" : "firefox",
|
||||
"browserUrl" : "C:/Program Files/Mozilla Firefox/firefox.exe"
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
|
||||
os.environ["PUPPETEER_SKIP_CHROMIUM_DOWNLOAD"] = "true"
|
||||
base.cmd("npm", ["i", "puppeteer"])
|
||||
@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
import json
|
||||
|
||||
def get_tests_in_dir(directory):
|
||||
files = []
|
||||
for file in glob.glob(directory + "/*.js"):
|
||||
if base.is_file(file):
|
||||
files.append(file)
|
||||
elif is_dir(file):
|
||||
files += get_tests_in_dir(file)
|
||||
return files
|
||||
|
||||
params = sys.argv[1:]
|
||||
if (0 == len(params)):
|
||||
print("use: run.py path_to_config [path_to_test]")
|
||||
exit(0)
|
||||
|
||||
config_path = params[0]
|
||||
test_file = "./tests"
|
||||
|
||||
if (1 < len(params)):
|
||||
test_file = params[1]
|
||||
|
||||
tests_array = [test_file]
|
||||
if base.is_dir(test_file):
|
||||
tests_array = get_tests_in_dir(test_file)
|
||||
|
||||
config_content = "{}"
|
||||
with open(config_path, "r") as config_path_loader:
|
||||
config_content = config_path_loader.read()
|
||||
|
||||
print(config_content)
|
||||
|
||||
config = json.loads(config_content)
|
||||
os.environ["PUPPETEER_SKIP_CHROMIUM_DOWNLOAD"] = "true"
|
||||
if "browser" in config:
|
||||
print("browser: " + config["browser"])
|
||||
os.environ["PUPPETEER_PRODUCT"] = config["browser"]
|
||||
|
||||
if "browserUrl" in config:
|
||||
print("browserUrl: " + config["browserUrl"])
|
||||
os.environ["PUPPETEER_EXECUTABLE_PATH"] = config["browserUrl"]
|
||||
|
||||
if not base.is_dir("./work_directory"):
|
||||
base.create_dir("./work_directory")
|
||||
base.create_dir("./work_directory/cache")
|
||||
base.create_dir("./work_directory/downloads")
|
||||
|
||||
for test in tests_array:
|
||||
print("run test: " + test)
|
||||
run_file = test + ".runned.js"
|
||||
base.copy_file("./tester.js", run_file)
|
||||
test_content = base.readFile(test)
|
||||
test_content = test_content.replace("await Tester.", "Tester.")
|
||||
test_content = test_content.replace("Tester.", "await Tester.")
|
||||
base.replaceInFile(run_file, "\"%%CODE%%\"", test_content)
|
||||
base.cmd("node", [run_file])
|
||||
base.delete_file(run_file)
|
||||
@ -1,171 +0,0 @@
|
||||
const puppeteer = require('puppeteer')
|
||||
const pathfs = require('path')
|
||||
const fs = require('fs');
|
||||
|
||||
function TesterImpl()
|
||||
{
|
||||
this.browser = null;
|
||||
this.page = null;
|
||||
this.width = 1500;
|
||||
this.height = 800;
|
||||
this.pixelRatio = 1;
|
||||
|
||||
this.cacheDir = pathfs.resolve("./work_directory/cache");
|
||||
this.downloadsDir = pathfs.resolve("./work_directory/downloads");
|
||||
this.downloadCounter = 0;
|
||||
|
||||
this.load = async function(url)
|
||||
{
|
||||
const head = { x: 100, y: 200 };
|
||||
this.browser = await puppeteer.launch({
|
||||
headless: false,
|
||||
product: process.env["PUPPETEER_PRODUCT"],
|
||||
args: [
|
||||
"--disable-infobars",
|
||||
`--window-size=${this.width+head.x},${this.height+head.y}`,
|
||||
"--disk-cache-dir=" + this.cacheDir
|
||||
],
|
||||
defaultViewport : {width: this.width, height: this.height, deviceScaleFactor : this.pixelRatio }
|
||||
});
|
||||
|
||||
this.page = await this.browser.newPage();
|
||||
await this.page.setViewport({ width: this.width, height: this.height });
|
||||
let waitObject = (process.env["PUPPETEER_PRODUCT"] === "firefox") ? { waitUntil: "networkidle0", timeout: 15000 } : {};
|
||||
await this.page.goto(url + "&autotest=enabled", waitObject);
|
||||
console.log("[tester] pageLoaded");
|
||||
return this.page;
|
||||
};
|
||||
|
||||
this.close = async function(nosleep)
|
||||
{
|
||||
if (true !== nosleep)
|
||||
await this.waitAutosave();
|
||||
await this.browser.close();
|
||||
};
|
||||
|
||||
this.sleep = async function(ms)
|
||||
{
|
||||
return await new Promise(resolve => setTimeout(resolve, ms));
|
||||
};
|
||||
|
||||
this.waitEditor = async function()
|
||||
{
|
||||
// TODO: wait first onEndRecalculate
|
||||
await this.sleep(5000);
|
||||
console.log("[tester] editorReady");
|
||||
};
|
||||
|
||||
this.waitAutosave = async function()
|
||||
{
|
||||
await this.sleep(5000);
|
||||
};
|
||||
|
||||
this.evaluateInMainFrame = async function(code)
|
||||
{
|
||||
return await this.page.evaluate(code);
|
||||
};
|
||||
this.evaluateInEditorFrame = async function(code)
|
||||
{
|
||||
const frame = await this.page.frames().find(frame => frame.name() === 'frameEditor');
|
||||
if (!frame)
|
||||
return;
|
||||
return await frame.evaluate(code);
|
||||
};
|
||||
|
||||
this.click = async function(id)
|
||||
{
|
||||
let res = await this.evaluateInEditorFrame("document.getElementById(\"" + id + "\").click(); \"[tester] clicked: " + id + "\"");
|
||||
//console.log(res);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.mouseClick = async function(x, y, options)
|
||||
{
|
||||
let res = await this.page.mouse.click(x, y, options);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.eval = async function(code)
|
||||
{
|
||||
let res = await this.evaluateInEditorFrame(code);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.keyDown = async function(key)
|
||||
{
|
||||
// https://pptr.dev/api/puppeteer.keyinput
|
||||
let res = await this.page.keyboard.down(key);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.keyUp = async function(key)
|
||||
{
|
||||
// https://pptr.dev/api/puppeteer.keyinput
|
||||
let res = await this.page.keyboard.up(key);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.keyClick = async function(key)
|
||||
{
|
||||
// https://pptr.dev/api/puppeteer.keyinput
|
||||
let res = await this.page.keyboard.down(key);
|
||||
res = await this.page.keyboard.up(key);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.keyPress = async function(key)
|
||||
{
|
||||
// https://pptr.dev/api/puppeteer.keyinput
|
||||
let res = await this.page.keyboard.press(key);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.input = async function(text)
|
||||
{
|
||||
let res = await this.page.keyboard.type(text);
|
||||
await this.sleep(200);
|
||||
return res;
|
||||
};
|
||||
|
||||
this.downloadFile = async function(format, path)
|
||||
{
|
||||
const tmpDir = pathfs.resolve(this.downloadsDir, "./tmp" + this.downloadCounter++);
|
||||
fs.mkdirSync(tmpDir);
|
||||
|
||||
// emulate download
|
||||
const client = await this.page.target().createCDPSession();
|
||||
await client.send("Page.setDownloadBehavior", {
|
||||
behavior: "allow",
|
||||
downloadPath: tmpDir
|
||||
});
|
||||
|
||||
await this.evaluateInEditorFrame("document.querySelectorAll('[data-layout-name=\"toolbar-file\"]')[0].click();");
|
||||
await this.sleep(200);
|
||||
await this.evaluateInEditorFrame("document.getElementsByClassName(\"svg-format-" + format + "\")[0].click();");
|
||||
await this.sleep(200);
|
||||
await this.evaluateInEditorFrame("document.getElementById(\"fm-btn-return\").click();");
|
||||
|
||||
await this.sleep(2000);
|
||||
|
||||
const files = fs.readdirSync(tmpDir);
|
||||
fs.copyFileSync(pathfs.resolve(tmpDir, "./" + files[0]), pathfs.resolve(path));
|
||||
fs.rmSync(tmpDir, { recursive: true, force: true });
|
||||
};
|
||||
}
|
||||
|
||||
const Tester = new TesterImpl;
|
||||
|
||||
try {
|
||||
(async () => {
|
||||
"%%CODE%%"
|
||||
})();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
Tester.load("path_to_file");
|
||||
Tester.waitEditor();
|
||||
|
||||
// down Enter
|
||||
Tester.keyClick("Enter");
|
||||
|
||||
// type text
|
||||
Tester.input("Hello World!");
|
||||
|
||||
Tester.keyPress("ArrowLeft");
|
||||
Tester.keyDown("Shift");
|
||||
for (let i = 0; i < 5; i++)
|
||||
Tester.keyPress("ArrowLeft");
|
||||
Tester.keyUp("Shift");
|
||||
|
||||
// bold
|
||||
Tester.click("id-toolbar-btn-bold");
|
||||
// italic
|
||||
Tester.mouseClick(115, 105);
|
||||
|
||||
// if needed
|
||||
Tester.waitAutosave();
|
||||
|
||||
Tester.downloadFile("docx", "./work_directory/new.docx")
|
||||
Tester.downloadFile("odt", "./work_directory/new.odt")
|
||||
|
||||
Tester.close(true);
|
||||
114
tools/common/desktop_templates.py
Normal file
114
tools/common/desktop_templates.py
Normal file
@ -0,0 +1,114 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../scripts')
|
||||
import base
|
||||
import os
|
||||
import glob
|
||||
import base64
|
||||
|
||||
sys.stdin.reconfigure(encoding='utf-8')
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
base.configure_common_apps()
|
||||
|
||||
def change_property(data_src, name, value):
|
||||
data = data_src
|
||||
creator_open = "<dc:" + name + ">"
|
||||
creator_close = "</dc:" + name + ">"
|
||||
open_tag_pos = data.find(creator_open)
|
||||
if open_tag_pos == -1:
|
||||
creator_close_to_find = "<dc:" + name + "/>"
|
||||
else:
|
||||
creator_close_to_find = "</dc:" + name + ">"
|
||||
close_tag_pos = data.find(creator_close_to_find)
|
||||
last_tag_pos = data.find("</cp:coreProperties>")
|
||||
|
||||
if open_tag_pos != -1 and close_tag_pos != - 1:
|
||||
data = data[:open_tag_pos + len(creator_open)] + value + data[close_tag_pos:]
|
||||
elif close_tag_pos != - 1:
|
||||
data = data[:close_tag_pos] + creator_open + value + creator_close + data[close_tag_pos + len(creator_close_to_find):]
|
||||
else:
|
||||
data = data[:last_tag_pos] + creator_open + value + creator_close + data[last_tag_pos:]
|
||||
return data
|
||||
|
||||
def change_author_name(file_input):
|
||||
temp_dir = os.getcwd().replace("\\", "/") + "/temp"
|
||||
base.create_dir(temp_dir)
|
||||
|
||||
app = "7za" if ("mac" == base.host_platform()) else "7z"
|
||||
base.cmd_exe(app, ["x", "-y", file_input, "-o" + temp_dir, "docProps/core.xml", "-r"])
|
||||
|
||||
with open(temp_dir + "/docProps/core.xml", 'r', encoding='utf-8') as file:
|
||||
data = file.read()
|
||||
|
||||
data = change_property(data, "creator", "")
|
||||
data = change_property(data, "lastModifiedBy", "")
|
||||
|
||||
with open(temp_dir + "/docProps/core.xml", 'w', encoding='utf-8') as file:
|
||||
file.write(data)
|
||||
|
||||
base.cmd_exe(app, ["a", "-r", file_input, temp_dir + "/docProps"])
|
||||
base.delete_dir(temp_dir)
|
||||
|
||||
def get_files(dir):
|
||||
arr_files = []
|
||||
for file in glob.glob(dir + "/*"):
|
||||
if base.is_file(file):
|
||||
arr_files.append(file)
|
||||
elif base.is_dir(file):
|
||||
arr_files += get_files(file)
|
||||
return arr_files
|
||||
|
||||
def get_local_path(base, src_dir):
|
||||
test1 = base.replace("\\", "/")
|
||||
test2 = src_dir.replace("\\", "/")
|
||||
return test2[len(test1)+1:]
|
||||
|
||||
params = sys.argv[1:]
|
||||
|
||||
if (3 > len(params)):
|
||||
print("use: convert.py path_to_x2t_directory path_to_input_directory path_to_output_directory")
|
||||
exit(0)
|
||||
|
||||
base.configure_common_apps()
|
||||
|
||||
x2t_directory = params[0]
|
||||
src_directory = params[1]
|
||||
dst_directory = params[2]
|
||||
|
||||
if base.is_dir(dst_directory):
|
||||
base.delete_dir(dst_directory)
|
||||
base.create_dir(dst_directory)
|
||||
|
||||
src_files = get_files(src_directory)
|
||||
|
||||
for file in src_files:
|
||||
directory = os.path.dirname(file)
|
||||
name = os.path.basename(file)
|
||||
directory_out_file = dst_directory + "/" + get_local_path(src_directory, directory)
|
||||
if not base.is_dir(directory_out_file):
|
||||
os.makedirs(directory_out_file, exist_ok=True)
|
||||
name_without_ext = os.path.splitext(name)[0]
|
||||
name_ext = os.path.splitext(name)[1][1:]
|
||||
|
||||
dst_ext = name_ext
|
||||
if ("docx" == name_ext) or ("dotx" == name_ext):
|
||||
dst_ext = "dotx"
|
||||
elif ("pptx" == name_ext) or ("potx" == name_ext):
|
||||
dst_ext = "potx"
|
||||
elif ("xlsx" == name_ext) or ("xltx" == name_ext):
|
||||
dst_ext = "xltx"
|
||||
|
||||
dst_name = name_without_ext
|
||||
if (len(dst_name) < 4) or (dst_name[0:4] != "[32]"):
|
||||
dst_name = "[32]" + base64.b32encode(name_without_ext.encode("utf-8")).decode("utf-8")
|
||||
|
||||
dst_file = directory_out_file + "/" + dst_name + "." + dst_ext
|
||||
|
||||
os.makedirs(directory_out_file, exist_ok=True)
|
||||
base.cmd_in_dir(x2t_directory, "x2t", [file, dst_file])
|
||||
|
||||
change_author_name(dst_file)
|
||||
|
||||
print(name_without_ext + " => " + dst_name)
|
||||
@ -55,14 +55,23 @@ def install_qt():
|
||||
base.cmd_in_dir("./qt-everywhere-opensource-src-5.9.9", "make", ["-j", "4"])
|
||||
base.cmd_in_dir("./qt-everywhere-opensource-src-5.9.9", "make", ["install"])
|
||||
return
|
||||
|
||||
def install_qt_prebuild():
|
||||
url_amd64 = "https://s3.eu-west-1.amazonaws.com/static-doc.teamlab.eu.com/qt/5.9.9/linux_amd64/qt_binary.7z"
|
||||
base.download(url_amd64, "./qt_amd64.7z")
|
||||
base.extract("./qt_amd64.7z", "./qt_build")
|
||||
base.create_dir("./qt_build/Qt-5.9.9")
|
||||
base.cmd("mv", ["./qt_build/qt_amd64", "./qt_build/Qt-5.9.9/gcc_64"])
|
||||
base.setup_local_qmake("./qt_build/Qt-5.9.9/gcc_64/bin")
|
||||
return
|
||||
|
||||
if not base.is_file("./node_js_setup_14.x"):
|
||||
print("install dependencies...")
|
||||
deps.install_deps()
|
||||
|
||||
if not base.is_dir("./qt_build"):
|
||||
if not base.is_dir("./qt_build"):
|
||||
print("install qt...")
|
||||
install_qt()
|
||||
install_qt_prebuild()
|
||||
|
||||
branch = get_branch_name("../..")
|
||||
|
||||
@ -103,6 +112,3 @@ build_tools_params = ["--branch", branch,
|
||||
|
||||
base.cmd_in_dir("../..", "./configure.py", build_tools_params)
|
||||
base.cmd_in_dir("../..", "./make.py")
|
||||
|
||||
|
||||
|
||||
|
||||
@ -39,9 +39,14 @@ def install_deps():
|
||||
"libxi-dev",
|
||||
"libxrender-dev",
|
||||
"libxss1",
|
||||
"libncurses5"]
|
||||
"libncurses5",
|
||||
"libncurses6",
|
||||
"curl",
|
||||
"libxkbcommon0",
|
||||
"libxkbcommon-x11-0"]
|
||||
|
||||
base.cmd("sudo", ["apt-get", "install", "-y"] + packages)
|
||||
for package in packages:
|
||||
base.cmd("sudo", ["apt-get", "install", "-y", package], True)
|
||||
|
||||
# nodejs
|
||||
base.cmd("sudo", ["apt-get", "install", "-y", "nodejs"])
|
||||
@ -79,4 +84,3 @@ def install_deps():
|
||||
|
||||
if __name__ == "__main__":
|
||||
install_deps()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user