mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
Developing
This commit is contained in:
@ -312,12 +312,14 @@ def set_cwd(dir):
|
||||
return
|
||||
|
||||
# git ---------------------------------------------------
|
||||
def git_update(repo, is_no_errors=False):
|
||||
def git_update(repo, is_no_errors=False, is_current_dir=False):
|
||||
print("[git] update: " + repo)
|
||||
url = "https://github.com/ONLYOFFICE/" + repo + ".git"
|
||||
if config.option("git-protocol") == "ssh":
|
||||
url = "git@github.com:ONLYOFFICE/" + repo + ".git"
|
||||
folder = get_script_dir() + "/../../" + repo
|
||||
if is_current_dir:
|
||||
folder = repo
|
||||
is_not_exit = False
|
||||
if not is_dir(folder):
|
||||
retClone = cmd("git", ["clone", url, folder], is_no_errors)
|
||||
@ -563,6 +565,28 @@ def web_apps_addons_checkout():
|
||||
git_update(config.web_apps_addons[name], True)
|
||||
return
|
||||
|
||||
def sdkjs_plugins_checkout():
|
||||
plugins_list_config = config.option("sdkjs-plugin")
|
||||
if ("" == plugins_list_config):
|
||||
plugins_list_config = "default"
|
||||
plugins_list_string = plugins_list_config.replace("default", "photoeditor, macros, ocr, translator, speech, thesaurus, youtube, highlightcode")
|
||||
if ("" == plugins_list_config):
|
||||
return
|
||||
plugins_list = plugins_list_string.rsplit(", ")
|
||||
plugins_dir = get_script_dir() + "/../../sdkjs-plugins"
|
||||
if is_dir(plugins_dir + "/.git"):
|
||||
delete_dir_with_access_error(plugins_dir);
|
||||
delete_dir(plugins_dir)
|
||||
if not is_dir(plugins_dir):
|
||||
create_dir(plugins_dir)
|
||||
|
||||
cur_dir = os.getcwd()
|
||||
os.chdir(plugins_dir)
|
||||
for name in plugins_list:
|
||||
git_update("plugin-" + name, True, True)
|
||||
os.chdir(cur_dir)
|
||||
return
|
||||
|
||||
def sdkjs_addons_param():
|
||||
if ("" == config.option("sdkjs-addons")):
|
||||
return []
|
||||
@ -772,4 +796,31 @@ def common_check_version(name, good_version, clean_func):
|
||||
delete_file(version_path)
|
||||
writeFile(version_path, version_good)
|
||||
clean_func()
|
||||
return
|
||||
return
|
||||
|
||||
def copy_sdkjs_plugin(src_dir, dst_dir, name, is_name_as_guid=False):
|
||||
src_dir_path = src_dir + "/plugin-" + name
|
||||
if not is_dir(src_dir_path):
|
||||
src_dir_path = src_dir + "/" + name
|
||||
if not is_name_as_guid:
|
||||
base.copy_dir_content(src_dir_path, dst_dir + "/" + name, "", ".git")
|
||||
return
|
||||
config_content = readFile(src_dir_path + "/config.json")
|
||||
index_start = config_content.find("\"asc.{")
|
||||
index_start += 5
|
||||
index_end = config_content.find(index_start, "}")
|
||||
guid = config_content[index_start:index_end]
|
||||
return
|
||||
|
||||
def copy_sdkjs_plugins(dst_dir, is_name_as_guid=False):
|
||||
plugins_dir = get_script_dir() + "/../../sdkjs-plugins"
|
||||
plugins_list_config = config.option("sdkjs-plugin")
|
||||
if ("" == plugins_list_config):
|
||||
plugins_list_config = "default"
|
||||
plugins_list_string = plugins_list_config.replace("default", "photoeditor, macros, ocr, translator, speech, thesaurus, youtube, highlightcode")
|
||||
if ("" == plugins_list_config):
|
||||
return
|
||||
plugins_list = plugins_list_string.rsplit(", ")
|
||||
for name in plugins_list:
|
||||
copy_sdkjs_plugin(plugins_dir, dst_dir, name, is_name_as_guid)
|
||||
return
|
||||
Reference in New Issue
Block a user