mirror of https://github.com/axmolengine/axmol.git
Solve the error in framework-compile on Mac.
This commit is contained in:
parent
d508d2ecdd
commit
cc6f02584b
|
@ -117,6 +117,14 @@ class CocosBinTemplateGenerator(object):
|
|||
self.modify_android_build_cfg(lua_build_cfg, "lua")
|
||||
self.modify_android_build_cfg(js_build_cfg, "js")
|
||||
|
||||
# modify the project.properties for templates
|
||||
cpp_prop_file = os.path.join(dst_dir, "cpp-template-binary/proj.android/project.properties")
|
||||
lua_prop_file = os.path.join(dst_dir, "lua-template-binary/frameworks/runtime-src/proj.android/project.properties")
|
||||
js_prop_file = os.path.join(dst_dir, "js-template-binary/frameworks/runtime-src/proj.android/project.properties")
|
||||
self.modify_project_properties(cpp_prop_file)
|
||||
self.modify_project_properties(lua_prop_file)
|
||||
self.modify_project_properties(js_prop_file)
|
||||
|
||||
self.modify_version_json(os.path.join(dst_dir, "lua-template-binary/.settings/version.json"))
|
||||
self.modify_version_json(os.path.join(dst_dir, "js-template-binary/.settings/version.json"))
|
||||
|
||||
|
@ -177,6 +185,22 @@ class CocosBinTemplateGenerator(object):
|
|||
json.dump(cfg_info, f, sort_keys=True, indent=4)
|
||||
f.close()
|
||||
|
||||
def modify_project_properties(self, cfg_path):
|
||||
f = open(cfg_path)
|
||||
lines = f.readlines()
|
||||
f.close()
|
||||
|
||||
new_lines = []
|
||||
pattern = r'android\.library\.reference.*'
|
||||
for line in lines:
|
||||
temp_str = line.strip()
|
||||
if not re.match(pattern, temp_str):
|
||||
new_lines.append(line)
|
||||
|
||||
f = open(cfg_path, 'w')
|
||||
f.writelines(new_lines)
|
||||
f.close()
|
||||
|
||||
def modify_android_build_cfg(self, cfg_path, language):
|
||||
f = open(cfg_path)
|
||||
content = f.read()
|
||||
|
@ -190,7 +214,9 @@ class CocosBinTemplateGenerator(object):
|
|||
replace_str = "../../cocos2d-x"
|
||||
|
||||
if replace_str is not None:
|
||||
content = content.replace(replace_str, self.repo_x)
|
||||
framework_version = self.version.strip()
|
||||
framework_version = framework_version.replace(' ', '-')
|
||||
content = content.replace(replace_str, "${COCOS_FRAMEWORKS}/%s" % framework_version)
|
||||
|
||||
f = open(cfg_path, "w")
|
||||
f.write(content)
|
||||
|
|
|
@ -87,8 +87,8 @@ class CocosLibsCompiler(object):
|
|||
if self.build_mac:
|
||||
self.compile_mac_ios()
|
||||
if self.build_android:
|
||||
self.compile_android("lua")
|
||||
self.compile_android("js")
|
||||
self.compile_android("lua")
|
||||
|
||||
|
||||
def build_win32_proj(self, cmd_path, sln_path, proj_name, mode):
|
||||
|
|
|
@ -64,6 +64,13 @@
|
|||
"RuntimeJsImpl.*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"from": "tools/simulator/frameworks/runtime-src/Classes",
|
||||
"to": "lua-template-binary/frameworks/runtime-src/Classes",
|
||||
"include": [
|
||||
"lua_module_register.h"
|
||||
]
|
||||
},
|
||||
{
|
||||
"from": "tools/simulator/frameworks/runtime-src/proj.ios_mac/ios",
|
||||
"to": "lua-template-binary/frameworks/runtime-src/proj.ios_mac/ios",
|
||||
|
@ -136,24 +143,15 @@
|
|||
},
|
||||
{
|
||||
"from": "cocos/platform/android/java/src",
|
||||
"to": "cpp-template-binary/proj.android/src",
|
||||
"include": [
|
||||
"*.java"
|
||||
]
|
||||
"to": "cpp-template-binary/proj.android/src"
|
||||
},
|
||||
{
|
||||
"from": "cocos/platform/android/java/src",
|
||||
"to": "lua-template-binary/frameworks/runtime-src/proj.android/src",
|
||||
"include": [
|
||||
"*.java"
|
||||
]
|
||||
"to": "lua-template-binary/frameworks/runtime-src/proj.android/src"
|
||||
},
|
||||
{
|
||||
"from": "cocos/platform/android/java/src",
|
||||
"to": "js-template-binary/frameworks/runtime-src/proj.android/src",
|
||||
"include": [
|
||||
"*.java"
|
||||
]
|
||||
"to": "js-template-binary/frameworks/runtime-src/proj.android/src"
|
||||
}
|
||||
],
|
||||
"modify_config": [
|
||||
|
@ -174,6 +172,8 @@
|
|||
"cocos/scripting/js-bindings/proj.android/Android.mk",
|
||||
"cocos/scripting/lua-bindings/proj.android/Android.mk",
|
||||
"cocos/storage/local-storage/Android.mk",
|
||||
"external/bullet/Android.mk",
|
||||
"external/recast/Android.mk",
|
||||
"external/flatbuffers/Android.mk",
|
||||
"external/Box2D/Android.mk",
|
||||
"cocos/editor-support/cocosbuilder/Android.mk",
|
||||
|
|
Loading…
Reference in New Issue