From 546ebfc4d45d8d26e8d2adaac61a12881c4dc1f4 Mon Sep 17 00:00:00 2001 From: halx99 Date: Tue, 20 Oct 2020 16:26:53 +0800 Subject: [PATCH] Also replace so name for proj.android when new project --- templates/cpp-template-default/CMakeLists.txt | 3 +-- .../cocos-project-template.json | 6 +++++ .../proj.android/app/AndroidManifest.xml | 2 +- templates/lua-template-default/CMakeLists.txt | 3 +-- .../cocos-project-template.json | 6 +++++ .../proj.android/app/AndroidManifest.xml | 2 +- .../cocos-project-template.json | 6 +++++ .../cocos-project-template.json | 6 +++++ .../plugins/plugin_new/project_new.py | 23 +++++++++++++++++++ 9 files changed, 51 insertions(+), 6 deletions(-) diff --git a/templates/cpp-template-default/CMakeLists.txt b/templates/cpp-template-default/CMakeLists.txt index bef3abf9b1..d6e524f8ec 100644 --- a/templates/cpp-template-default/CMakeLists.txt +++ b/templates/cpp-template-default/CMakeLists.txt @@ -71,8 +71,7 @@ list(APPEND GAME_HEADER ) if(ANDROID) - # change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml - set(APP_NAME MyGame) + # the APP_NAME should match on AndroidManifest.xml list(APPEND GAME_SOURCE proj.android/app/jni/hellocpp/main.cpp ) diff --git a/templates/cpp-template-default/cocos-project-template.json b/templates/cpp-template-default/cocos-project-template.json index 26aa6af06d..9f4382b9de 100644 --- a/templates/cpp-template-default/cocos-project-template.json +++ b/templates/cpp-template-default/cocos-project-template.json @@ -24,6 +24,12 @@ "proj.android/app/AndroidManifest.xml" ] }, + "project_replace_so_name": { + "src_so_name": "HelloCpp", + "files": [ + "proj.android/app/AndroidManifest.xml" + ] + }, "project_replace_mac_bundleid": { "src_bundle_id": "org.cocos2dx.hellocpp", "files": [ diff --git a/templates/cpp-template-default/proj.android/app/AndroidManifest.xml b/templates/cpp-template-default/proj.android/app/AndroidManifest.xml index 88d0669f15..3e9a77e159 100644 --- a/templates/cpp-template-default/proj.android/app/AndroidManifest.xml +++ b/templates/cpp-template-default/proj.android/app/AndroidManifest.xml @@ -14,7 +14,7 @@ + android:value="HelloCpp" /> + android:value="HelloLua" />