mirror of https://github.com/axmolengine/axmol.git
Build simulator project when generating prebuilt libs for android.
This commit is contained in:
parent
bb77101f0b
commit
78c5f2e77e
|
@ -90,8 +90,7 @@ class CocosLibsCompiler(object):
|
||||||
if self.build_mac:
|
if self.build_mac:
|
||||||
self.compile_mac_ios()
|
self.compile_mac_ios()
|
||||||
if self.build_android:
|
if self.build_android:
|
||||||
self.compile_android("js")
|
self.compile_android()
|
||||||
self.compile_android("lua")
|
|
||||||
|
|
||||||
# generate prebuilt mk files
|
# generate prebuilt mk files
|
||||||
self.modify_binary_mk()
|
self.modify_binary_mk()
|
||||||
|
@ -281,7 +280,7 @@ class CocosLibsCompiler(object):
|
||||||
mac_strip_cmd = "xcrun strip -S %s/*.a" % mac_out_dir
|
mac_strip_cmd = "xcrun strip -S %s/*.a" % mac_out_dir
|
||||||
utils_cocos.execute_command(mac_strip_cmd)
|
utils_cocos.execute_command(mac_strip_cmd)
|
||||||
|
|
||||||
def compile_android(self, language):
|
def compile_android(self):
|
||||||
print("compile android")
|
print("compile android")
|
||||||
# build .so for android
|
# build .so for android
|
||||||
CONSOLE_PATH = "tools/cocos2d-console/bin"
|
CONSOLE_PATH = "tools/cocos2d-console/bin"
|
||||||
|
@ -295,17 +294,9 @@ class CocosLibsCompiler(object):
|
||||||
else:
|
else:
|
||||||
cmd_path = os.path.join(console_dir, "cocos")
|
cmd_path = os.path.join(console_dir, "cocos")
|
||||||
|
|
||||||
proj_name = "My%sGame" % language
|
# build the simulator project
|
||||||
proj_dir = engine_dir
|
proj_path = os.path.join(engine_dir, 'tools/simulator')
|
||||||
proj_path = os.path.join(proj_dir, proj_name)
|
build_cmd = "%s compile -s %s -p android --ndk-mode release --app-abi %s" % (cmd_path, proj_path, self.app_abi)
|
||||||
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)
|
|
||||||
utils_cocos.execute_command(build_cmd)
|
utils_cocos.execute_command(build_cmd)
|
||||||
|
|
||||||
# copy .a to prebuilt dir
|
# 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")):
|
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'))
|
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):
|
def trip_libs(self, strip_cmd, folder):
|
||||||
if not os.path.isdir(folder):
|
if not os.path.isdir(folder):
|
||||||
return
|
return
|
||||||
|
|
|
@ -105,6 +105,13 @@
|
||||||
"SimulatorWin.h"
|
"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",
|
"from": "tools/simulator/frameworks/runtime-src/Classes/ide-support",
|
||||||
"to": "js-template-binary/frameworks/runtime-src/Classes/ide-support/",
|
"to": "js-template-binary/frameworks/runtime-src/Classes/ide-support/",
|
||||||
|
|
Loading…
Reference in New Issue