mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-02-10 12:35:23 +08:00
Refactoring
This commit is contained in:
@ -4,7 +4,6 @@
|
||||
import package_utils as utils
|
||||
import package_common as common
|
||||
import package_branding as branding
|
||||
import os
|
||||
|
||||
def make():
|
||||
utils.log_h1("BUILDER")
|
||||
@ -205,14 +204,11 @@ def make_wheel():
|
||||
utils.delete_file("docbuilder.net.dll")
|
||||
utils.delete_file("docbuilder.jni.dll")
|
||||
elif utils.is_macos():
|
||||
utils.delete_file("libdocbuilder.jni.dylib")
|
||||
utils.delete_file("libdocbuilder.jni.framework")
|
||||
# delete all symlinks
|
||||
for root, dirs, files in os.walk('.'):
|
||||
for name in dirs + files:
|
||||
path = os.path.join(root, name)
|
||||
if os.path.islink(path):
|
||||
os.unlink(path)
|
||||
if (utils.is_file("libdocbuilder.jni.dylib")):
|
||||
utils.delete_file("libdocbuilder.jni.dylib")
|
||||
if (utils.is_dir("libdocbuilder.jni.framework")):
|
||||
utils.delete_file("libdocbuilder.jni.framework")
|
||||
utils.remove_all_symlinks(".")
|
||||
elif utils.is_linux():
|
||||
utils.delete_file("libdocbuilder.jni.so")
|
||||
|
||||
|
||||
@ -262,6 +262,20 @@ def delete_files(src, verbose=True):
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
return
|
||||
|
||||
def remove_all_symlinks(dir):
|
||||
for root, dirs, files in os.walk(dir, topdown=True, followlinks=False):
|
||||
for name in files:
|
||||
path = os.path.join(root, name)
|
||||
if os.path.islink(path):
|
||||
os.unlink(path)
|
||||
|
||||
for name in list(dirs):
|
||||
path = os.path.join(root, name)
|
||||
if os.path.islink(path):
|
||||
os.unlink(path)
|
||||
dirs.remove(name)
|
||||
return
|
||||
|
||||
def set_summary(target, status):
|
||||
common.summary.append({target: status})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user