Build simulator project when generating prebuilt libs for android.

This commit is contained in:
Bin Zhang 2015-06-30 16:45:55 +08:00
parent bb77101f0b
commit 78c5f2e77e
2 changed files with 12 additions and 17 deletions

View File

@ -90,8 +90,7 @@ class CocosLibsCompiler(object):
if self.build_mac:
self.compile_mac_ios()
if self.build_android:
self.compile_android("js")
self.compile_android("lua")
self.compile_android()
# generate prebuilt mk files
self.modify_binary_mk()
@ -281,7 +280,7 @@ class CocosLibsCompiler(object):
mac_strip_cmd = "xcrun strip -S %s/*.a" % mac_out_dir
utils_cocos.execute_command(mac_strip_cmd)
def compile_android(self, language):
def compile_android(self):
print("compile android")
# build .so for android
CONSOLE_PATH = "tools/cocos2d-console/bin"
@ -295,17 +294,9 @@ class CocosLibsCompiler(object):
else:
cmd_path = os.path.join(console_dir, "cocos")
proj_name = "My%sGame" % language
proj_dir = engine_dir
proj_path = os.path.join(proj_dir, proj_name)
utils_cocos.rmdir(proj_path)
# create a runtime project
create_cmd = "%s new -l %s -t runtime -d %s %s" % (cmd_path, language, proj_dir, proj_name)
utils_cocos.execute_command(create_cmd)
# build it
build_cmd = "%s compile -s %s -p android --ndk-mode release -j 4 --app-abi %s" % (cmd_path, proj_path, self.app_abi)
# build the simulator project
proj_path = os.path.join(engine_dir, 'tools/simulator')
build_cmd = "%s compile -s %s -p android --ndk-mode release --app-abi %s" % (cmd_path, proj_path, self.app_abi)
utils_cocos.execute_command(build_cmd)
# copy .a to prebuilt dir
@ -353,9 +344,6 @@ class CocosLibsCompiler(object):
if os.path.exists(strip_cmd_path) and os.path.exists(os.path.join(android_out_dir, "x86")):
self.trip_libs(strip_cmd_path, os.path.join(android_out_dir, 'x86'))
# remove the project
utils_cocos.rmdir(proj_path)
def trip_libs(self, strip_cmd, folder):
if not os.path.isdir(folder):
return

View File

@ -105,6 +105,13 @@
"SimulatorWin.h"
]
},
{
"from": "tools/simulator/frameworks/runtime-src/Classes",
"to": "js-template-binary/frameworks/runtime-src/Classes",
"include": [
"js_module_register.h"
]
},
{
"from": "tools/simulator/frameworks/runtime-src/Classes/ide-support",
"to": "js-template-binary/frameworks/runtime-src/Classes/ide-support/",