improve release scripts

This commit is contained in:
lixianjing 2021-06-07 11:51:26 +08:00
parent 6928fd5364
commit 4133be42f6
2 changed files with 17 additions and 8 deletions

View File

@ -1,5 +1,9 @@
# 最新动态 # 最新动态
2021/06/07
* 重构和完善文档。
* 完善release脚本拷贝自定义控件的动态库。
2021/06/06 2021/06/06
* 重构widget部分代码。 * 重构widget部分代码。

View File

@ -12,13 +12,14 @@ ASSETS_DIR = 'assets'
OUTPUT_DIR = 'release' OUTPUT_DIR = 'release'
CWD = os.getcwd() CWD = os.getcwd()
OS_NAME = platform.system(); OS_NAME = platform.system();
if OS_NAME == 'Darwin':
AWTK_DLL='libawtk.dylib'
elif OS_NAME == 'Linux':
AWTK_DLL='libawtk.so'
elif OS_NAME == 'Windows':
AWTK_DLL='awtk.dll'
def getShareLibExt():
if OS_NAME == 'Darwin':
return 'dylib'
elif OS_NAME == 'Windows':
return 'dll'
else:
return 'so'
def init(exe, assets_root, bin_root): def init(exe, assets_root, bin_root):
global BIN_DIR global BIN_DIR
@ -100,10 +101,14 @@ def copyFiles(src_root_dir, src, dst_root_dir, dst, ignore_files=[]):
def copyExe(): def copyExe():
output_bin_dir = joinPath(OUTPUT_DIR, 'bin') output_bin_dir = joinPath(OUTPUT_DIR, 'bin')
copyFile(BIN_DIR, EXE_NAME, output_bin_dir, EXE_NAME) copyFile(BIN_DIR, EXE_NAME, output_bin_dir, EXE_NAME)
copyFile(BIN_DIR, AWTK_DLL, output_bin_dir, AWTK_DLL)
os.chmod(joinPath(output_bin_dir, EXE_NAME), 0o755) 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(): def copyAssets():
copyFiles(ASSETS_DIR, '', OUTPUT_DIR, 'assets/') copyFiles(ASSETS_DIR, '', OUTPUT_DIR, 'assets/')