Compare commits

...

14 Commits

Author SHA1 Message Date
1125676522 [build] added ignorecase for plugins rebranding 2023-11-25 21:51:01 +03:00
adefce2542 Merge pull request #768 from ONLYOFFICE/release/v7.6.0
Release/v7.6.0
2023-11-25 19:23:17 +03:00
ac33113083 [build] added branding in deploy 2023-11-25 19:12:00 +03:00
d1e0a8b582 [build] added branding check for plugins 2023-11-25 19:11:34 +03:00
bbae50fd6b [build] returned websocket 2023-11-23 19:24:05 +03:00
91bf2b0cda [build] changed encoding in base
Co-authored-by: Alexey Nagaev <aleksei.nagaev@onlyoffice.com>
2023-11-19 20:54:17 +03:00
ad85cf6c6d [build] delete print 2023-11-17 15:06:41 +03:00
7f2092bd73 Merge branch 'fix/bug-59392' of https://github.com/onlyoffice/build_tools into fix/bug-59392 2023-11-16 19:17:45 +03:00
8eff8d64cd [build] small fixes for build python3 2023-11-16 19:17:35 +03:00
1583babd52 Merge pull request #766 from ONLYOFFICE/develop
Develop
2023-11-16 19:03:58 +03:00
fa15db70c9 Merge branch release/v7.6.0 into develop (#765)
* Update hard-coded version to v7.6.0

* Fix vcredist [2] (#763)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-16 17:32:35 +03:00
3d884963a7 Merge pull request #762 from ONLYOFFICE/release/v7.6.0
Merge branch release/v7.6.0 into develop
2023-11-15 17:08:32 +03:00
8eb2d689fd Merge branch hotfix/v7.5.1 into develop 2023-11-15 12:46:10 +00:00
f93f45216b Merge pull request #754 from ONLYOFFICE/develop
Develop
2023-11-06 10:16:38 +03:00
4 changed files with 71 additions and 12 deletions

View File

@ -25,7 +25,6 @@ base.set_env("BUILD_PLATFORM", config.option("platform"))
# branding
if ("1" != base.get_env("OO_RUNNING_BRANDING")) and ("" != config.option("branding")):
branding_dir = base_dir + "/../" + config.option("branding")
if ("1" == config.option("update")):
is_exist = True
if not base.is_dir(branding_dir):
@ -39,6 +38,7 @@ if ("1" != base.get_env("OO_RUNNING_BRANDING")) and ("" != config.option("brandi
base.cmd_in_dir(branding_dir, "git", ["pull"], True)
if base.is_file(branding_dir + "/build_tools/make.py"):
base.check_build_version(branding_dir + "/build_tools")
base.set_env("OO_RUNNING_BRANDING", "1")
@ -59,7 +59,7 @@ if ("1" == config.option("update")):
base.configure_common_apps()
# developing...
develop.make();
develop.make()
# check only js builds
if ("1" == base.get_env("OO_ONLY_BUILD_JS")):

View File

@ -297,11 +297,11 @@ def replaceInFile(path, text, textReplace):
print("[replaceInFile] file not exist: " + path)
return
filedata = ""
with open(get_path(path), "r") as file:
with open(get_path(path), "r", encoding="utf-8") as file:
filedata = file.read()
filedata = filedata.replace(text, textReplace)
delete_file(path)
with open(get_path(path), "w") as file:
with open(get_path(path), "w", encoding="utf-8") as file:
file.write(filedata)
return
def replaceInFileUtf8(path, text, textReplace):
@ -316,16 +316,16 @@ def replaceInFileUtf8(path, text, textReplace):
with open(get_path(path), "wb") as file:
file.write(filedata.encode("UTF-8"))
return
def replaceInFileRE(path, pattern, textReplace):
def replaceInFileRE(path, pattern, textReplace, flags=0):
if not is_file(path):
print("[replaceInFile] file not exist: " + path)
return
filedata = ""
with open(get_path(path), "r") as file:
with open(get_path(path), "r", encoding='utf-8') as file:
filedata = file.read()
filedata = re.sub(pattern, textReplace, filedata)
filedata = re.sub(pattern, textReplace, filedata, flags=flags)
delete_file(path)
with open(get_path(path), "w") as file:
with open(get_path(path), "w", encoding='utf-8') as file:
file.write(filedata)
return
@ -333,14 +333,14 @@ def readFile(path):
if not is_file(path):
return ""
filedata = ""
with open(get_path(path), "r") as file:
with open(get_path(path), "r", encoding='utf-8') as file:
filedata = file.read()
return filedata
def writeFile(path, data):
if is_file(path):
delete_file(path)
with open(get_path(path), "w") as file:
with open(get_path(path), "w", encoding='utf-8') as file:
file.write(data)
return
@ -928,7 +928,7 @@ def generate_plist(path):
return
def correct_bundle_identifier(bundle_identifier):
return re.sub("[^a-zA-Z0-9\.\-]", "-", bundle_identifier)
return re.sub(r"[^a-zA-Z0-9\.\-]", "-", bundle_identifier)
def get_sdkjs_addons():
result = {}
@ -1264,6 +1264,61 @@ def copy_sdkjs_plugin(src_dir, dst_dir, name, is_name_as_guid=False, is_desktop_
delete_dir(dst_deploy_dir)
return
def change_plugin_license(path, license, start, end, encoding='utf8'):
with open(path, 'r', encoding=encoding) as file:
content = file.read()
start_index = content.find(start)
end_index = content.find(end)
if start_index >= 0 and end_index >= 0:
old_license = content[start_index:end_index+len(end)]
if (re.search(r'ascensio', old_license, re.IGNORECASE)):
file.close()
replaceInFile(path, old_license, license)
def check_correct_plugins(dir, license = '', branding=''):
js_license = license
html_license = license.replace('/*', '<!--')
html_license = html_license.replace('*/', '-->')
extensions = ['.js', '.html', '.md', '.txt', '.json']
ignoreNameDirs = ['vendor', 'thirdparty']
for address, dirs, files in os.walk(dir):
for i in ignoreNameDirs:
if (re.search(re.escape(i), address)):
break
else:
for i in files:
path = os.path.join(address, i)
filename, file_extension = os.path.splitext(i)
if file_extension in extensions:
if (file_extension == '.js'):
change_plugin_license(path, js_license, start='/*', end='*/')
replaceInFileRE(path, 'onlyoffice', branding.lower())
replaceInFileRE(path, 'ONLYOFFICE', branding.upper())
elif (file_extension == '.html'):
change_plugin_license(path, html_license, start='<!--', end='-->')
replaceInFile(path, "https://onlyoffice.github.io/sdkjs-plugins/", "../")
replaceInFileRE(path, 'onlyoffice', branding.lower(), re.IGNORECASE)
elif (file_extension == '.md' or file_extension == '.txt'):
check = readFile(path)
if (re.search(r'onlyoffice', check, re.IGNORECASE) or re.search(r'ascensio', check, re.IGNORECASE)):
delete_file(path)
elif (file_extension == '.json'):
replaceInFileRE(path, 'onlyoffice', branding.lower())
replaceInFileRE(path, 'ONLYOFFICE', branding.upper())
# ATTENTION sdkjs-plugins\wordpress\scripts\wordpress.js -- changed proxy | https://onlyoffice-proxy.herokuapp.com/https://public-api.wordpress.com/oauth2/token | (Can kill the plugin)
# ATTENTION sdkjs-plugins\wordpress\index.html -- changed link to Learn More | https://github.com/ONLYOFFICE/plugin-wordpress/tree/develop#configuration |
# ATTENTION sdkjs-plugins\easybib\index.html -- changed link to Learn More | https://github.com/ONLYOFFICE/plugin-mendeley/tree/master#configuration |
# ATTENTION sdkjs-plugins\easybib\scripts\easybibhelper.js -- changed proxy | https://onlyoffice-proxy.herokuapp.com/ | (Can kill the plugin)
# ATTENTION sdkjs-plugins\deepl\index.html -- changed link to Learn More | https://github.com/ONLYOFFICE/plugin-deepl/tree/develop#configuration |
# ATTENTION sdkjs-plugins\chess\index_about.html -- changed link to Source Code | https://github.com/ONLYOFFICE/onlyoffice.github.io/tree/master/sdkjs-plugins/content/chess |
# ATTENTION sdkjs-plugins\macros\config.json -- changed link to API at "help" | https://api.onlyoffice.com/plugin/macros |
# ATTENTION sdkjs-plugins\marketplace\index.html -- changed link | https://onlyoffice.github.io/store/index.html |
def correct_plugins_branding(out_dir, license):
branding = config.option("branding")
if not "" == branding and not "onlyoffice" == branding:
check_correct_plugins(out_dir, license, branding)
def copy_marketplace_plugin(dst_dir, is_name_as_guid=False, is_desktop_local=False, is_store_copy=False):
git_dir = __file__script__path__ + "/../.."
if False:
@ -1367,7 +1422,7 @@ def hack_xcode_ios():
def find_mac_sdk_version():
sdk_dir = run_command("xcode-select -print-path")['stdout']
sdk_dir = os.path.join(sdk_dir, "Platforms/MacOSX.platform/Developer/SDKs")
sdks = [re.findall('^MacOSX(1\d\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
sdks = [re.findall(r"^MacOSX(1\d\.\d+)\.sdk$", s) for s in os.listdir(sdk_dir)]
sdks = [s[0] for s in sdks if s]
return sdks[0]

View File

@ -229,6 +229,8 @@ def make():
#base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt/ui/common/{14A8FC87-8E26-4216-B34E-F27F053B2EC4}", root_dir + "/editors/sdkjs-plugins/{14A8FC87-8E26-4216-B34E-F27F053B2EC4}")
#base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt/ui/engine/database/{9AB4BBA8-A7E5-48D5-B683-ECE76A020BB1}", root_dir + "/editors/sdkjs-plugins/{9AB4BBA8-A7E5-48D5-B683-ECE76A020BB1}")
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "sendto", True)
license = base.readFileLicence(root_dir + "/editors/sdkjs/word/sdk-all-min.js")
base.correct_plugins_branding(root_dir + "/editors/sdkjs-plugins", license)
base.copy_file(base_dir + "/js/" + branding + "/desktop/index.html", root_dir + "/index.html")

View File

@ -130,6 +130,8 @@ def make():
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js", js_dir + "/sdkjs-plugins/v1/plugins-ui.js")
base.download("https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css", js_dir + "/sdkjs-plugins/v1/plugins.css")
base.support_old_versions_plugins(js_dir + "/sdkjs-plugins")
license = base.readFileLicence(js_dir + "/sdkjs/word/sdk-all-min.js")
base.correct_plugins_branding(js_dir + "/sdkjs-plugins", license)
# tools
tools_dir = root_dir + "/server/tools"