From d0f11e5283556ea1cc0a2db646096f271e7238e9 Mon Sep 17 00:00:00 2001 From: lixianjing Date: Mon, 5 Jul 2021 16:22:51 +0800 Subject: [PATCH] improve release scripts --- docs/changes.md | 3 +++ scripts/release_common.py | 30 +++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/docs/changes.md b/docs/changes.md index a26b7ebc3..c0a50d900 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -1,5 +1,8 @@ # 最新动态 +2021/07/05 + * 完善release脚本(感谢朝泽提供补丁) + 2021/07/02 * 修复延迟动画刷新的问题(感谢智明提供补丁) * 修复agge的ras初始化的值不正常的问题(感谢智明提供补丁) diff --git a/scripts/release_common.py b/scripts/release_common.py index 6d43f8cdc..4bb95f26f 100644 --- a/scripts/release_common.py +++ b/scripts/release_common.py @@ -98,19 +98,35 @@ def copyFiles(src_root_dir, src, dst_root_dir, dst, ignore_files=[]): print('!!! copyFiles src NOT EXISTS: ' + s) +def copySharedLib(src, dst): + if not os.path.exists(src): + print('copy shared lib: ' + src + ' is not exists.') + else: + files = os.listdir(src) + for file in files: + srcFilename = joinPath(src, file) + dstFilename = joinPath(dst, file) + if os.path.isdir(srcFilename): + if not os.path.exists(dstFilename): + os.makedirs(dstFilename) + copySharedLib(srcFilename, dstFilename) + else: + ext = '.' + getShareLibExt() + if file.endswith(ext): + print('copy shared lib: ' + srcFilename + ' ==> ' + dstFilename) + shutil.copy(srcFilename, dst) + os.chmod(dstFilename, 0o755) + + def copyExe(): output_bin_dir = joinPath(OUTPUT_DIR, 'bin') copyFile(BIN_DIR, EXE_NAME, output_bin_dir, EXE_NAME) + copySharedLib(BIN_DIR, output_bin_dir) + os.chmod(joinPath(output_bin_dir, EXE_NAME), 0o755) - sharelibs = glob.glob(BIN_DIR + "/*."+getShareLibExt()); - for filename in sharelibs: - basename = os.path.basename(filename) - copyFile(BIN_DIR, basename, output_bin_dir, basename) - os.chmod(joinPath(output_bin_dir, basename), 0o755) - def copyAssets(): - copyFiles(ASSETS_DIR, '', OUTPUT_DIR, 'assets/') + copyFiles(ASSETS_DIR, '', OUTPUT_DIR, 'assets/') def cleanFiles(): d = joinPath(OUTPUT_DIR, 'assets/default/inc')