mirror of https://github.com/axmolengine/axmol.git
Also replace so name for proj.android when new project
This commit is contained in:
parent
ee3bd4cfd9
commit
546ebfc4d4
|
@ -71,8 +71,7 @@ list(APPEND GAME_HEADER
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
# change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml
|
# the APP_NAME should match on AndroidManifest.xml
|
||||||
set(APP_NAME MyGame)
|
|
||||||
list(APPEND GAME_SOURCE
|
list(APPEND GAME_SOURCE
|
||||||
proj.android/app/jni/hellocpp/main.cpp
|
proj.android/app/jni/hellocpp/main.cpp
|
||||||
)
|
)
|
||||||
|
|
|
@ -24,6 +24,12 @@
|
||||||
"proj.android/app/AndroidManifest.xml"
|
"proj.android/app/AndroidManifest.xml"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"project_replace_so_name": {
|
||||||
|
"src_so_name": "HelloCpp",
|
||||||
|
"files": [
|
||||||
|
"proj.android/app/AndroidManifest.xml"
|
||||||
|
]
|
||||||
|
},
|
||||||
"project_replace_mac_bundleid": {
|
"project_replace_mac_bundleid": {
|
||||||
"src_bundle_id": "org.cocos2dx.hellocpp",
|
"src_bundle_id": "org.cocos2dx.hellocpp",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
<!-- Tell Cocos2dxActivity the name of our .so -->
|
<!-- Tell Cocos2dxActivity the name of our .so -->
|
||||||
<meta-data android:name="android.app.lib_name"
|
<meta-data android:name="android.app.lib_name"
|
||||||
android:value="MyGame" />
|
android:value="HelloCpp" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.cocos2dx.cpp.AppActivity"
|
android:name="org.cocos2dx.cpp.AppActivity"
|
||||||
|
|
|
@ -68,8 +68,7 @@ set(GAME_SOURCE ${RUNTIME_SRC_ROOT}/Classes/AppDelegate.cpp)
|
||||||
# sources need to compile info, include dirs and source files
|
# sources need to compile info, include dirs and source files
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
# change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml
|
# the APP_NAME should match on AndroidManifest.xml
|
||||||
set(APP_NAME cocos2dlua)
|
|
||||||
list(APPEND GAME_SOURCE ${RUNTIME_SRC_ROOT}/proj.android/app/jni/hellolua/main.cpp)
|
list(APPEND GAME_SOURCE ${RUNTIME_SRC_ROOT}/proj.android/app/jni/hellolua/main.cpp)
|
||||||
elseif(LINUX)
|
elseif(LINUX)
|
||||||
list(APPEND GAME_SOURCE ${RUNTIME_SRC_ROOT}/proj.linux/main.cpp)
|
list(APPEND GAME_SOURCE ${RUNTIME_SRC_ROOT}/proj.linux/main.cpp)
|
||||||
|
|
|
@ -115,6 +115,12 @@
|
||||||
"frameworks/runtime-src/proj.android/app/build.gradle",
|
"frameworks/runtime-src/proj.android/app/build.gradle",
|
||||||
"frameworks/runtime-src/proj.android/app/AndroidManifest.xml" ]
|
"frameworks/runtime-src/proj.android/app/AndroidManifest.xml" ]
|
||||||
},
|
},
|
||||||
|
"project_replace_so_name": {
|
||||||
|
"src_so_name": "HelloLua",
|
||||||
|
"files": [
|
||||||
|
"frameworks/runtime-src/proj.android/app/AndroidManifest.xml"
|
||||||
|
]
|
||||||
|
},
|
||||||
"project_replace_mac_bundleid": {
|
"project_replace_mac_bundleid": {
|
||||||
"src_bundle_id": "org.cocos2dx.hellolua",
|
"src_bundle_id": "org.cocos2dx.hellolua",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
<!-- Tell Cocos2dxActivity the name of our .so -->
|
<!-- Tell Cocos2dxActivity the name of our .so -->
|
||||||
<meta-data android:name="android.app.lib_name"
|
<meta-data android:name="android.app.lib_name"
|
||||||
android:value="cocos2dlua" />
|
android:value="HelloLua" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.cocos2dx.lua.AppActivity"
|
android:name="org.cocos2dx.lua.AppActivity"
|
||||||
|
|
|
@ -47,6 +47,12 @@
|
||||||
"proj.android/AndroidManifest.xml"
|
"proj.android/AndroidManifest.xml"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"project_replace_so_name": {
|
||||||
|
"src_so_name": "HelloCpp",
|
||||||
|
"files": [
|
||||||
|
"proj.android/app/AndroidManifest.xml"
|
||||||
|
]
|
||||||
|
},
|
||||||
"project_replace_mac_bundleid": {
|
"project_replace_mac_bundleid": {
|
||||||
"src_bundle_id": "org.cocos2dx.hellocpp",
|
"src_bundle_id": "org.cocos2dx.hellocpp",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -80,6 +80,12 @@
|
||||||
"frameworks/runtime-src/proj.android/AndroidManifest.xml"
|
"frameworks/runtime-src/proj.android/AndroidManifest.xml"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"project_replace_so_name": {
|
||||||
|
"src_so_name": "HelloLua",
|
||||||
|
"files": [
|
||||||
|
"frameworks/runtime-src/proj.android/app/AndroidManifest.xml"
|
||||||
|
]
|
||||||
|
},
|
||||||
"project_replace_mac_bundleid": {
|
"project_replace_mac_bundleid": {
|
||||||
"src_bundle_id": "org.cocos2dx.hellolua",
|
"src_bundle_id": "org.cocos2dx.hellolua",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -643,6 +643,29 @@ class TPCreator(object):
|
||||||
cocos.Logging.warning(MultiLanguage.get_string('NEW_WARNING_FILE_NOT_FOUND_FMT',
|
cocos.Logging.warning(MultiLanguage.get_string('NEW_WARNING_FILE_NOT_FOUND_FMT',
|
||||||
os.path.join(dst_project_dir, dst)))
|
os.path.join(dst_project_dir, dst)))
|
||||||
|
|
||||||
|
def project_replace_so_name(self, v):
|
||||||
|
""" will modify the content of the file
|
||||||
|
"""
|
||||||
|
src_so_name = v['src_so_name']
|
||||||
|
dst_so_name = self.project_name
|
||||||
|
if src_so_name == dst_so_name:
|
||||||
|
return
|
||||||
|
|
||||||
|
cocos.Logging.info(MultiLanguage.get_string('NEW_INFO_STEP_REPLACE_SO_FMT',
|
||||||
|
(src_so_name, dst_so_name)))
|
||||||
|
files = v['files']
|
||||||
|
if not dst_so_name:
|
||||||
|
raise cocos.CCPluginError(MultiLanguage.get_string('NEW_ERROR_PKG_NAME_NOT_SPECIFIED'),
|
||||||
|
cocos.CCPluginError.ERROR_WRONG_ARGS)
|
||||||
|
for f in files:
|
||||||
|
dst = f.replace("PROJECT_NAME", self.project_name)
|
||||||
|
dstpath = os.path.join(self.project_dir, dst)
|
||||||
|
if os.path.exists(dstpath):
|
||||||
|
replace_string(dstpath, src_so_name, dst_so_name)
|
||||||
|
else:
|
||||||
|
cocos.Logging.warning(MultiLanguage.get_string('NEW_WARNING_FILE_NOT_FOUND_FMT',
|
||||||
|
dstpath))
|
||||||
|
|
||||||
def project_replace_mac_bundleid(self, v):
|
def project_replace_mac_bundleid(self, v):
|
||||||
""" will modify the content of the file
|
""" will modify the content of the file
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue