From e182328d5101b934ac2c227c7ac55b1c514b4ff2 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 12 Nov 2013 16:25:39 +0800 Subject: [PATCH] fix incomplete copy resource --- build/android-build.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/build/android-build.py b/build/android-build.py index 4a65c9e6e2..7670e03dd2 100755 --- a/build/android-build.py +++ b/build/android-build.py @@ -109,6 +109,7 @@ def copy_files(src, dst): if os.path.isdir(path): new_dst = os.path.join(dst, item) os.mkdir(new_dst) + print new_dst copy_files(path, new_dst) def copy_resources(target, app_android_root): @@ -133,13 +134,26 @@ def copy_resources(target, app_android_root): resources_dir = os.path.join(app_android_root, "../../Shared/games/CocosDragonJS/Published files Android") if target == "crystalcraze": resources_dir = os.path.join(app_android_root, "../../Shared/games/CrystalCraze/Published-Android") - if target == "moonwarriors": - resources_dir = os.path.join(app_android_root, "../../Shared/games/MoonWarriors/res") if target == "testjavascript": resources_dir = os.path.join(app_android_root, "../../Shared/tests/") if target == "watermelonwithme": resources_dir = os.path.join(app_android_root, "../../Shared/games/WatermelonWithMe") - copy_files(resources_dir, assets_dir) + if target != "moonwarriors": + copy_files(resources_dir, assets_dir) + else: + resources_dir = os.path.join(app_android_root, "../../Shared/games/MoonWarriors/res") + dst_dir = os.path.join(assets_dir, "res") + os.mkdir(dst_dir) + copy_files(resources_dir, dst_dir) + resources_dir = os.path.join(app_android_root, "../../Shared/games/MoonWarriors/src") + dst_dir = os.path.join(assets_dir, "src") + os.mkdir(dst_dir) + copy_files(resources_dir, dst_dir) + resources_dir = os.path.join(app_android_root, "../../Shared/games/MoonWarriors") + for item in os.listdir(resources_dir): + path = os.path.join(resources_dir, item) + if item.endswith('.js') and os.path.isfile(path): + shutil.copy(path, assets_dir) # AssetsManager test should also copy javascript files if target == "assetsmanager":