diff --git a/.github/workflows/native-compile-linux.yml b/.github/workflows/native-compile-linux.yml index 4d0dbffd35..868e915f54 100644 --- a/.github/workflows/native-compile-linux.yml +++ b/.github/workflows/native-compile-linux.yml @@ -29,7 +29,7 @@ jobs: run: | COCOS2DX_ROOT=$GITHUB_WORKSPACE/native echo "Compiling Linux ... " - cd $COCOS2DX_ROOT/templates/linux + cd $GITHUB_WORKSPACE/templates/linux mkdir -p build-linux/proj touch build-linux/proj/cfg.cmake echo "set(CC_USE_VULKAN OFF)" >> build-linux/proj/cfg.cmake @@ -41,7 +41,7 @@ jobs: echo "set(USE_PHYSICS_PHYSX OFF)" >> build-linux/proj/cfg.cmake mkdir build-linux/assets - RES_DIR=$COCOS2DX_ROOT/templates/linux/build-linux + RES_DIR=$GITHUB_WORKSPACE/templates/linux/build-linux cd build-linux cmake ../ -GNinja -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS2DX_ROOT set +e diff --git a/.github/workflows/native-compile-platforms.yml b/.github/workflows/native-compile-platforms.yml index 4606075b78..806c0ef1bf 100644 --- a/.github/workflows/native-compile-platforms.yml +++ b/.github/workflows/native-compile-platforms.yml @@ -31,7 +31,7 @@ jobs: env: COCOS_ENGINE_DEV: 1 run: | - cd $GITHUB_WORKSPACE/native/templates/windows + cd $GITHUB_WORKSPACE/templates/windows mkdir -p build-win64/proj touch build-win64/proj/cfg.cmake echo "set(CC_USE_GLES3 ON)" >> build-win64/proj/cfg.cmake @@ -43,7 +43,7 @@ jobs: echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-win64/proj/cfg.cmake mkdir build-win64/assets cd build-win64 - RES_DIR=${GITHUB_WORKSPACE//\\//}/native/templates/windows/build-win64 + RES_DIR=${GITHUB_WORKSPACE//\\//}/templates/windows/build-win64 COCOS_X_PATH=${GITHUB_WORKSPACE//\\//}/native cmake ../ -G"Visual Studio 16 2019" -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS_X_PATH -Ax64 cmake --build . --config Release @@ -70,13 +70,13 @@ jobs: run: | COCOS2DX_ROOT=$GITHUB_WORKSPACE/native ANDORID_NDK=$ANDROID_NDK_LATEST_HOME - NATIVE_DIR=$COCOS2DX_ROOT/templates/android-template + NATIVE_DIR=$GITHUB_WORKSPACE/templates/android-template echo "Compiling Android ... " - cd $COCOS2DX_ROOT/templates/ + cd $GITHUB_WORKSPACE/templates/ if [ ! -d android-template ]; then cp -r android/template android-template fi - cd $COCOS2DX_ROOT/templates/android/build + cd $GITHUB_WORKSPACE/templates/android/build mkdir -p build-android/proj touch build-android/proj/cfg.cmake echo "set(CC_USE_GLES3 ON)" >> build-android/proj/cfg.cmake @@ -87,7 +87,7 @@ jobs: mkdir -p build-android/assets - ASSET_DIR=$COCOS2DX_ROOT/templates/android/build/build-android/ + ASSET_DIR=$GITHUB_WORKSPACE/templates/android/build/build-android/ sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDORID_NDK@g" gradle.properties sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties @@ -129,7 +129,7 @@ jobs: NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` COCOS2DX_ROOT=$GITHUB_WORKSPACE/native echo "Compiling MacOSX ... " - cd $COCOS2DX_ROOT/templates/mac + cd $GITHUB_WORKSPACE/templates/mac mkdir -p build-mac/proj touch build-mac/proj/cfg.cmake echo "set(CC_USE_VULKAN OFF)" >> build-mac/proj/cfg.cmake @@ -140,7 +140,7 @@ jobs: echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-mac/proj/cfg.cmake mkdir build-mac/assets - RES_DIR=$COCOS2DX_ROOT/templates/mac/build-mac + RES_DIR=$GITHUB_WORKSPACE/templates/mac/build-mac cd build-mac cmake ../ -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64 -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS2DX_ROOT set +e @@ -180,7 +180,7 @@ jobs: NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` COCOS2DX_ROOT=$GITHUB_WORKSPACE/native echo "Compiling MacOSX ... " - cd $COCOS2DX_ROOT/templates/mac + cd $GITHUB_WORKSPACE/templates/mac mkdir -p build-mac/proj touch build-mac/proj/cfg.cmake echo "set(CC_USE_VULKAN OFF)" >> build-mac/proj/cfg.cmake @@ -191,7 +191,7 @@ jobs: echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-mac/proj/cfg.cmake mkdir build-mac/assets - RES_DIR=$COCOS2DX_ROOT/templates/mac/build-mac + RES_DIR=$GITHUB_WORKSPACE/templates/mac/build-mac cd build-mac cmake ../ -GXcode -DCMAKE_OSX_ARCHITECTURES=arm64 -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS2DX_ROOT set +e @@ -235,7 +235,7 @@ jobs: NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` COCOS2DX_ROOT=$GITHUB_WORKSPACE/native echo "Compiling iOS ... " - cd $COCOS2DX_ROOT/templates/ios + cd $GITHUB_WORKSPACE/templates/ios mkdir -p build-ios/proj touch build-ios/proj/cfg.cmake echo "set(CC_USE_GLES3 OFF)" >> build-ios/proj/cfg.cmake @@ -249,7 +249,7 @@ jobs: echo "set(MACOSX_BUNDLE_GUI_IDENTIFIER com.cocos.demo.ios)" >> build-ios/proj/cfg.cmake mkdir build-ios/assets cd build-ios - RES_DIR=$COCOS2DX_ROOT/templates/ios/build-ios + RES_DIR=$GITHUB_WORKSPACE/templates/ios/build-ios cmake ../ -GXcode -DCMAKE_SYSTEM_NAME=iOS \ -DCMAKE_OSX_SYSROOT=iphoneos \ -DCMAKE_OSX_ARCHITECTURES=arm64 \ diff --git a/.github/workflows/native_compile_self.yml b/.github/workflows/native_compile_self.yml index 0f4c2d1111..92bba69961 100644 --- a/.github/workflows/native_compile_self.yml +++ b/.github/workflows/native_compile_self.yml @@ -35,13 +35,13 @@ jobs: ANDROID_NDK_HOME='/home/tools/android-sdk-linux/ndk-bundle' ANDROID_SDK_ROOT='/home/tools/android-sdk-linux' export ANDORID_NDK ANDROID_SDK_ROOT ANDROID_NDK_HOME - NATIVE_DIR=$COCOS2DX_ROOT/templates/android-template + NATIVE_DIR=$GITHUB_WORKSPACE/templates/android-template echo "Compiling Android ... " - cd $COCOS2DX_ROOT/templates/ + cd $GITHUB_WORKSPACE/templates/ if [ ! -d android-template ]; then cp -r android/template android-template fi - cd $COCOS2DX_ROOT/templates/android/build + cd $GITHUB_WORKSPACE/templates/android/build mkdir -p build-android/proj touch build-android/proj/cfg.cmake echo "set(CC_USE_GLES3 ON)" >> build-android/proj/cfg.cmake @@ -50,7 +50,7 @@ jobs: echo "set(USE_WEBSOCKET_SERVER ON)" >> build-android/proj/cfg.cmake echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-android/proj/cfg.cmake mkdir -p build-android/assets - ASSET_DIR=$COCOS2DX_ROOT/templates/android/build/build-android/ + ASSET_DIR=$GITHUB_WORKSPACE/templates/android/build/build-android/ sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDORID_NDK@g" gradle.properties sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties sed -i "s@^RES_PATH.*@RES_PATH=$ASSET_DIR@g" gradle.properties @@ -90,7 +90,7 @@ jobs: env: COCOS_ENGINE_DEV: 1 run: | - cd $GITHUB_WORKSPACE/native/templates/windows + cd $GITHUB_WORKSPACE/templates/windows mkdir -p build-win64/proj touch build-win64/proj/cfg.cmake echo "set(CC_USE_GLES3 ON)" >> build-win64/proj/cfg.cmake @@ -100,7 +100,7 @@ jobs: echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-win64/proj/cfg.cmake mkdir build-win64/assets cd build-win64 - RES_DIR=${GITHUB_WORKSPACE//\\//}/native/templates/windows/build-win64 + RES_DIR=${GITHUB_WORKSPACE//\\//}/templates/windows/build-win64 COCOS_X_PATH=${GITHUB_WORKSPACE//\\//}/native cmake ../ -G"Visual Studio 15 2017" -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS_X_PATH -Ax64 cmake --build . --config Release diff --git a/.gitignore b/.gitignore index 55142568c0..5f971afebb 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ scripts/runtime-web-adapter native/external/ scripts/typedoc-plugin/lib/ +!templates/**/* diff --git a/native/.gitignore b/native/.gitignore index fdf94cab7c..db197c62f0 100644 --- a/native/.gitignore +++ b/native/.gitignore @@ -134,7 +134,6 @@ project.properties # Ignore prebuilt libraries folder /external/* !/external/config.json -/templates/lua-template-runtime/runtime /v*-deps-*.zip /new-renderer-*.zip /v*-lua-runtime-*.zip diff --git a/native/cmake/predefine.cmake b/native/cmake/predefine.cmake index b67925261f..533074faa8 100644 --- a/native/cmake/predefine.cmake +++ b/native/cmake/predefine.cmake @@ -214,17 +214,17 @@ find_program(NODE_EXECUTABLE NAMES node) find_program(TSC_EXECUTABLE NAMES tsc) ## predefined configurations for game applications -include(${CMAKE_CURRENT_LIST_DIR}/../templates/cmake/common.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../../templates/cmake/common.cmake) if(APPLE) - include(${CMAKE_CURRENT_LIST_DIR}/../templates/cmake/apple.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/../../templates/cmake/apple.cmake) elseif(WINDOWS) - include(${CMAKE_CURRENT_LIST_DIR}/../templates/cmake/windows.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/../../templates/cmake/windows.cmake) elseif(LINUX) - include(${CMAKE_CURRENT_LIST_DIR}/../templates/cmake/linux.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/../../templates/cmake/linux.cmake) elseif(ANDROID) - include(${CMAKE_CURRENT_LIST_DIR}/../templates/cmake/android.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/../../templates/cmake/android.cmake) elseif(OHOS) - include(${CMAKE_CURRENT_LIST_DIR}/../templates/cmake/ohos.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/../../templates/cmake/ohos.cmake) else() message(FATAL_ERROR "Unhandled platform specified cmake utils!") endif() diff --git a/native/templates/ohos/entry/src/main/resources/rawfile/.keep b/native/templates/ohos/entry/src/main/resources/rawfile/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/native/tools/coding-style/tailing-spaces.py b/native/tools/coding-style/tailing-spaces.py index 00f9fb5777..a27d1e8108 100644 --- a/native/tools/coding-style/tailing-spaces.py +++ b/native/tools/coding-style/tailing-spaces.py @@ -43,7 +43,7 @@ def lint(root): dirs = [ os.path.join(root, 'cocos'), os.path.join(root, 'extensions'), - os.path.join(root, 'templates') + os.path.join(root, '..', 'templates') ] files = scan(*dirs, extensions=['.c', '.cpp', '.h', '.hpp', '.m', '.mm', '.java']) diff --git a/native/tools/travis-scripts/config.gitingore b/native/tools/travis-scripts/config.gitingore index 1d5a638cfc..227c33f44c 100644 --- a/native/tools/travis-scripts/config.gitingore +++ b/native/tools/travis-scripts/config.gitingore @@ -15,12 +15,10 @@ Thumbs.db /lib /linux-build /samples -/templates /tests /plugin/samples /tools /utils -/licenses /simulator /build/build /cocos/bindings/proj.ios_mac/build/cocos2d_js_bindings.build diff --git a/native/tools/travis-scripts/run-script.sh b/native/tools/travis-scripts/run-script.sh index 9c4d624e4c..227daac7d4 100755 --- a/native/tools/travis-scripts/run-script.sh +++ b/native/tools/travis-scripts/run-script.sh @@ -76,8 +76,8 @@ generate_bindings_glue_codes cd $COCOS2DX_ROOT ## revert change -git clean -fdx templates -git checkout HEAD templates +git clean -fdx ../templates +git checkout HEAD ../templates set +x cd $COCOS2DX_ROOT/tools/travis-scripts diff --git a/native/templates/android/build/build.gradle b/templates/android/build/build.gradle similarity index 100% rename from native/templates/android/build/build.gradle rename to templates/android/build/build.gradle diff --git a/native/templates/android/build/gradle.properties b/templates/android/build/gradle.properties similarity index 100% rename from native/templates/android/build/gradle.properties rename to templates/android/build/gradle.properties diff --git a/native/templates/android/build/gradle/wrapper/gradle-wrapper.jar b/templates/android/build/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from native/templates/android/build/gradle/wrapper/gradle-wrapper.jar rename to templates/android/build/gradle/wrapper/gradle-wrapper.jar diff --git a/native/templates/android/build/gradle/wrapper/gradle-wrapper.properties b/templates/android/build/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from native/templates/android/build/gradle/wrapper/gradle-wrapper.properties rename to templates/android/build/gradle/wrapper/gradle-wrapper.properties diff --git a/native/templates/android/build/gradlew b/templates/android/build/gradlew similarity index 100% rename from native/templates/android/build/gradlew rename to templates/android/build/gradlew diff --git a/native/templates/android/build/gradlew.bat b/templates/android/build/gradlew.bat similarity index 100% rename from native/templates/android/build/gradlew.bat rename to templates/android/build/gradlew.bat diff --git a/native/templates/android/build/libservice/AndroidManifest.xml b/templates/android/build/libservice/AndroidManifest.xml similarity index 100% rename from native/templates/android/build/libservice/AndroidManifest.xml rename to templates/android/build/libservice/AndroidManifest.xml diff --git a/native/templates/android/build/libservice/build.gradle b/templates/android/build/libservice/build.gradle similarity index 100% rename from native/templates/android/build/libservice/build.gradle rename to templates/android/build/libservice/build.gradle diff --git a/native/templates/android/build/libservice/proguard-rules.pro b/templates/android/build/libservice/proguard-rules.pro similarity index 100% rename from native/templates/android/build/libservice/proguard-rules.pro rename to templates/android/build/libservice/proguard-rules.pro diff --git a/native/templates/android/build/libservice/src/com/cocos/service/SDKWrapper.java b/templates/android/build/libservice/src/com/cocos/service/SDKWrapper.java similarity index 100% rename from native/templates/android/build/libservice/src/com/cocos/service/SDKWrapper.java rename to templates/android/build/libservice/src/com/cocos/service/SDKWrapper.java diff --git a/native/templates/android/build/settings.gradle b/templates/android/build/settings.gradle similarity index 100% rename from native/templates/android/build/settings.gradle rename to templates/android/build/settings.gradle diff --git a/native/templates/android/template/.gitignore b/templates/android/template/.gitignore similarity index 100% rename from native/templates/android/template/.gitignore rename to templates/android/template/.gitignore diff --git a/native/templates/android/template/CMakeLists.txt b/templates/android/template/CMakeLists.txt similarity index 100% rename from native/templates/android/template/CMakeLists.txt rename to templates/android/template/CMakeLists.txt diff --git a/native/templates/android/template/app/.gitignore b/templates/android/template/app/.gitignore similarity index 100% rename from native/templates/android/template/app/.gitignore rename to templates/android/template/app/.gitignore diff --git a/native/templates/android/template/app/AndroidManifest.xml b/templates/android/template/app/AndroidManifest.xml similarity index 100% rename from native/templates/android/template/app/AndroidManifest.xml rename to templates/android/template/app/AndroidManifest.xml diff --git a/native/templates/android/template/app/build.gradle b/templates/android/template/app/build.gradle similarity index 100% rename from native/templates/android/template/app/build.gradle rename to templates/android/template/app/build.gradle diff --git a/native/templates/android/template/app/proguard-rules.pro b/templates/android/template/app/proguard-rules.pro similarity index 100% rename from native/templates/android/template/app/proguard-rules.pro rename to templates/android/template/app/proguard-rules.pro diff --git a/native/templates/android/template/app/src/com/cocos/game/AppActivity.java b/templates/android/template/app/src/com/cocos/game/AppActivity.java similarity index 100% rename from native/templates/android/template/app/src/com/cocos/game/AppActivity.java rename to templates/android/template/app/src/com/cocos/game/AppActivity.java diff --git a/native/templates/android/template/build-cfg.json b/templates/android/template/build-cfg.json similarity index 100% rename from native/templates/android/template/build-cfg.json rename to templates/android/template/build-cfg.json diff --git a/native/templates/android/template/build.gradle b/templates/android/template/build.gradle similarity index 100% rename from native/templates/android/template/build.gradle rename to templates/android/template/build.gradle diff --git a/native/templates/android/template/instantapp/AndroidManifest.xml b/templates/android/template/instantapp/AndroidManifest.xml similarity index 100% rename from native/templates/android/template/instantapp/AndroidManifest.xml rename to templates/android/template/instantapp/AndroidManifest.xml diff --git a/native/templates/android/template/instantapp/build.gradle b/templates/android/template/instantapp/build.gradle similarity index 100% rename from native/templates/android/template/instantapp/build.gradle rename to templates/android/template/instantapp/build.gradle diff --git a/native/templates/android/template/instantapp/proguard-rules.pro b/templates/android/template/instantapp/proguard-rules.pro similarity index 100% rename from native/templates/android/template/instantapp/proguard-rules.pro rename to templates/android/template/instantapp/proguard-rules.pro diff --git a/native/templates/android/template/instantapp/src/com/cocos/game/InstantActivity.java b/templates/android/template/instantapp/src/com/cocos/game/InstantActivity.java similarity index 100% rename from native/templates/android/template/instantapp/src/com/cocos/game/InstantActivity.java rename to templates/android/template/instantapp/src/com/cocos/game/InstantActivity.java diff --git a/native/templates/android/template/res/mipmap-hdpi/ic_launcher.png b/templates/android/template/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from native/templates/android/template/res/mipmap-hdpi/ic_launcher.png rename to templates/android/template/res/mipmap-hdpi/ic_launcher.png diff --git a/native/templates/android/template/res/mipmap-mdpi/ic_launcher.png b/templates/android/template/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from native/templates/android/template/res/mipmap-mdpi/ic_launcher.png rename to templates/android/template/res/mipmap-mdpi/ic_launcher.png diff --git a/native/templates/android/template/res/mipmap-xhdpi/ic_launcher.png b/templates/android/template/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from native/templates/android/template/res/mipmap-xhdpi/ic_launcher.png rename to templates/android/template/res/mipmap-xhdpi/ic_launcher.png diff --git a/native/templates/android/template/res/mipmap-xxhdpi/ic_launcher.png b/templates/android/template/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from native/templates/android/template/res/mipmap-xxhdpi/ic_launcher.png rename to templates/android/template/res/mipmap-xxhdpi/ic_launcher.png diff --git a/native/templates/android/template/res/mipmap-xxxhdpi/ic_launcher.png b/templates/android/template/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from native/templates/android/template/res/mipmap-xxxhdpi/ic_launcher.png rename to templates/android/template/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/native/templates/android/template/res/values/strings.xml b/templates/android/template/res/values/strings.xml similarity index 100% rename from native/templates/android/template/res/values/strings.xml rename to templates/android/template/res/values/strings.xml diff --git a/native/templates/cmake/android.cmake b/templates/cmake/android.cmake similarity index 100% rename from native/templates/cmake/android.cmake rename to templates/cmake/android.cmake diff --git a/native/templates/cmake/apple.cmake b/templates/cmake/apple.cmake similarity index 100% rename from native/templates/cmake/apple.cmake rename to templates/cmake/apple.cmake diff --git a/native/templates/cmake/common.cmake b/templates/cmake/common.cmake similarity index 100% rename from native/templates/cmake/common.cmake rename to templates/cmake/common.cmake diff --git a/native/templates/cmake/linux.cmake b/templates/cmake/linux.cmake similarity index 100% rename from native/templates/cmake/linux.cmake rename to templates/cmake/linux.cmake diff --git a/native/templates/cmake/ohos.cmake b/templates/cmake/ohos.cmake similarity index 100% rename from native/templates/cmake/ohos.cmake rename to templates/cmake/ohos.cmake diff --git a/native/templates/cmake/windows.cmake b/templates/cmake/windows.cmake similarity index 100% rename from native/templates/cmake/windows.cmake rename to templates/cmake/windows.cmake diff --git a/native/templates/cocos-project-template.json b/templates/cocos-project-template.json similarity index 100% rename from native/templates/cocos-project-template.json rename to templates/cocos-project-template.json diff --git a/native/templates/common/CMakeLists.txt b/templates/common/CMakeLists.txt similarity index 100% rename from native/templates/common/CMakeLists.txt rename to templates/common/CMakeLists.txt diff --git a/native/templates/common/Classes/Game.cpp b/templates/common/Classes/Game.cpp similarity index 100% rename from native/templates/common/Classes/Game.cpp rename to templates/common/Classes/Game.cpp diff --git a/native/templates/common/Classes/Game.h b/templates/common/Classes/Game.h similarity index 100% rename from native/templates/common/Classes/Game.h rename to templates/common/Classes/Game.h diff --git a/native/templates/ios/AppDelegate.h b/templates/ios/AppDelegate.h similarity index 100% rename from native/templates/ios/AppDelegate.h rename to templates/ios/AppDelegate.h diff --git a/native/templates/ios/AppDelegate.mm b/templates/ios/AppDelegate.mm similarity index 100% rename from native/templates/ios/AppDelegate.mm rename to templates/ios/AppDelegate.mm diff --git a/native/templates/ios/Base.lproj/LaunchScreen.storyboard b/templates/ios/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from native/templates/ios/Base.lproj/LaunchScreen.storyboard rename to templates/ios/Base.lproj/LaunchScreen.storyboard diff --git a/native/templates/ios/Base.lproj/Localizable.strings b/templates/ios/Base.lproj/Localizable.strings similarity index 100% rename from native/templates/ios/Base.lproj/Localizable.strings rename to templates/ios/Base.lproj/Localizable.strings diff --git a/native/templates/ios/CMakeLists.txt b/templates/ios/CMakeLists.txt similarity index 100% rename from native/templates/ios/CMakeLists.txt rename to templates/ios/CMakeLists.txt diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/1024.png b/templates/ios/Images.xcassets/AppIcon.appiconset/1024.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/1024.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/1024.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/114.png b/templates/ios/Images.xcassets/AppIcon.appiconset/114.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/114.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/114.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/120.png b/templates/ios/Images.xcassets/AppIcon.appiconset/120.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/120.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/120.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/180.png b/templates/ios/Images.xcassets/AppIcon.appiconset/180.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/180.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/180.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/29.png b/templates/ios/Images.xcassets/AppIcon.appiconset/29.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/29.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/29.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/40.png b/templates/ios/Images.xcassets/AppIcon.appiconset/40.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/40.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/40.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/57.png b/templates/ios/Images.xcassets/AppIcon.appiconset/57.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/57.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/57.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/58.png b/templates/ios/Images.xcassets/AppIcon.appiconset/58.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/58.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/58.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/60.png b/templates/ios/Images.xcassets/AppIcon.appiconset/60.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/60.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/60.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/80.png b/templates/ios/Images.xcassets/AppIcon.appiconset/80.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/80.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/80.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/87.png b/templates/ios/Images.xcassets/AppIcon.appiconset/87.png similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/87.png rename to templates/ios/Images.xcassets/AppIcon.appiconset/87.png diff --git a/native/templates/ios/Images.xcassets/AppIcon.appiconset/Contents.json b/templates/ios/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from native/templates/ios/Images.xcassets/AppIcon.appiconset/Contents.json rename to templates/ios/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/native/templates/ios/Images.xcassets/Contents.json b/templates/ios/Images.xcassets/Contents.json similarity index 100% rename from native/templates/ios/Images.xcassets/Contents.json rename to templates/ios/Images.xcassets/Contents.json diff --git a/native/templates/ios/Info.plist b/templates/ios/Info.plist similarity index 100% rename from native/templates/ios/Info.plist rename to templates/ios/Info.plist diff --git a/native/templates/ios/LaunchScreenBackgroundLandscape.png b/templates/ios/LaunchScreenBackgroundLandscape.png similarity index 100% rename from native/templates/ios/LaunchScreenBackgroundLandscape.png rename to templates/ios/LaunchScreenBackgroundLandscape.png diff --git a/native/templates/ios/LaunchScreenBackgroundPortrait.png b/templates/ios/LaunchScreenBackgroundPortrait.png similarity index 100% rename from native/templates/ios/LaunchScreenBackgroundPortrait.png rename to templates/ios/LaunchScreenBackgroundPortrait.png diff --git a/native/templates/ios/Prefix.pch b/templates/ios/Prefix.pch similarity index 100% rename from native/templates/ios/Prefix.pch rename to templates/ios/Prefix.pch diff --git a/native/templates/ios/ViewController.h b/templates/ios/ViewController.h similarity index 100% rename from native/templates/ios/ViewController.h rename to templates/ios/ViewController.h diff --git a/native/templates/ios/ViewController.mm b/templates/ios/ViewController.mm similarity index 100% rename from native/templates/ios/ViewController.mm rename to templates/ios/ViewController.mm diff --git a/native/templates/ios/main.mm b/templates/ios/main.mm similarity index 100% rename from native/templates/ios/main.mm rename to templates/ios/main.mm diff --git a/native/templates/ios/service/SDKWrapper.h b/templates/ios/service/SDKWrapper.h similarity index 100% rename from native/templates/ios/service/SDKWrapper.h rename to templates/ios/service/SDKWrapper.h diff --git a/native/templates/ios/service/SDKWrapper.m b/templates/ios/service/SDKWrapper.m similarity index 100% rename from native/templates/ios/service/SDKWrapper.m rename to templates/ios/service/SDKWrapper.m diff --git a/native/templates/ios/zh-Hans.lproj/Localizable.strings b/templates/ios/zh-Hans.lproj/Localizable.strings similarity index 100% rename from native/templates/ios/zh-Hans.lproj/Localizable.strings rename to templates/ios/zh-Hans.lproj/Localizable.strings diff --git a/native/templates/linux/CMakeLists.txt b/templates/linux/CMakeLists.txt similarity index 100% rename from native/templates/linux/CMakeLists.txt rename to templates/linux/CMakeLists.txt diff --git a/native/templates/linux/main.cpp b/templates/linux/main.cpp similarity index 100% rename from native/templates/linux/main.cpp rename to templates/linux/main.cpp diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/1024@2x.png b/templates/mac/Assets.xcassets/AppIcon.appiconset/1024@2x.png similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/1024@2x.png rename to templates/mac/Assets.xcassets/AppIcon.appiconset/1024@2x.png diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/128@1x.png b/templates/mac/Assets.xcassets/AppIcon.appiconset/128@1x.png similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/128@1x.png rename to templates/mac/Assets.xcassets/AppIcon.appiconset/128@1x.png diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/16@1x.png b/templates/mac/Assets.xcassets/AppIcon.appiconset/16@1x.png similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/16@1x.png rename to templates/mac/Assets.xcassets/AppIcon.appiconset/16@1x.png diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/256@1x.png b/templates/mac/Assets.xcassets/AppIcon.appiconset/256@1x.png similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/256@1x.png rename to templates/mac/Assets.xcassets/AppIcon.appiconset/256@1x.png diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/256@2x.png b/templates/mac/Assets.xcassets/AppIcon.appiconset/256@2x.png similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/256@2x.png rename to templates/mac/Assets.xcassets/AppIcon.appiconset/256@2x.png diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/32@1x.png b/templates/mac/Assets.xcassets/AppIcon.appiconset/32@1x.png similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/32@1x.png rename to templates/mac/Assets.xcassets/AppIcon.appiconset/32@1x.png diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/32@2x.png b/templates/mac/Assets.xcassets/AppIcon.appiconset/32@2x.png similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/32@2x.png rename to templates/mac/Assets.xcassets/AppIcon.appiconset/32@2x.png diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/512@1x.png b/templates/mac/Assets.xcassets/AppIcon.appiconset/512@1x.png similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/512@1x.png rename to templates/mac/Assets.xcassets/AppIcon.appiconset/512@1x.png diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/512@2x.png b/templates/mac/Assets.xcassets/AppIcon.appiconset/512@2x.png similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/512@2x.png rename to templates/mac/Assets.xcassets/AppIcon.appiconset/512@2x.png diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/64@2x.png b/templates/mac/Assets.xcassets/AppIcon.appiconset/64@2x.png similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/64@2x.png rename to templates/mac/Assets.xcassets/AppIcon.appiconset/64@2x.png diff --git a/native/templates/mac/Assets.xcassets/AppIcon.appiconset/Contents.json b/templates/mac/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from native/templates/mac/Assets.xcassets/AppIcon.appiconset/Contents.json rename to templates/mac/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/native/templates/mac/Assets.xcassets/Contents.json b/templates/mac/Assets.xcassets/Contents.json similarity index 100% rename from native/templates/mac/Assets.xcassets/Contents.json rename to templates/mac/Assets.xcassets/Contents.json diff --git a/native/templates/mac/CMakeLists.txt b/templates/mac/CMakeLists.txt similarity index 100% rename from native/templates/mac/CMakeLists.txt rename to templates/mac/CMakeLists.txt diff --git a/native/templates/mac/Icon.icns b/templates/mac/Icon.icns similarity index 100% rename from native/templates/mac/Icon.icns rename to templates/mac/Icon.icns diff --git a/native/templates/mac/Info.plist b/templates/mac/Info.plist similarity index 100% rename from native/templates/mac/Info.plist rename to templates/mac/Info.plist diff --git a/native/templates/mac/Prefix.pch b/templates/mac/Prefix.pch similarity index 100% rename from native/templates/mac/Prefix.pch rename to templates/mac/Prefix.pch diff --git a/native/templates/mac/UserConfigMac.debug.xcconfig b/templates/mac/UserConfigMac.debug.xcconfig similarity index 100% rename from native/templates/mac/UserConfigMac.debug.xcconfig rename to templates/mac/UserConfigMac.debug.xcconfig diff --git a/native/templates/mac/UserConfigMac.release.xcconfig b/templates/mac/UserConfigMac.release.xcconfig similarity index 100% rename from native/templates/mac/UserConfigMac.release.xcconfig rename to templates/mac/UserConfigMac.release.xcconfig diff --git a/native/templates/mac/entitlements.plist b/templates/mac/entitlements.plist similarity index 100% rename from native/templates/mac/entitlements.plist rename to templates/mac/entitlements.plist diff --git a/native/templates/mac/gfx_tests.entitlements b/templates/mac/gfx_tests.entitlements similarity index 100% rename from native/templates/mac/gfx_tests.entitlements rename to templates/mac/gfx_tests.entitlements diff --git a/native/templates/mac/main.mm b/templates/mac/main.mm similarity index 100% rename from native/templates/mac/main.mm rename to templates/mac/main.mm diff --git a/native/templates/ohos/.gitignore b/templates/ohos/.gitignore similarity index 100% rename from native/templates/ohos/.gitignore rename to templates/ohos/.gitignore diff --git a/native/templates/ohos/CMakeLists.txt b/templates/ohos/CMakeLists.txt similarity index 100% rename from native/templates/ohos/CMakeLists.txt rename to templates/ohos/CMakeLists.txt diff --git a/native/templates/ohos/build.gradle b/templates/ohos/build.gradle similarity index 100% rename from native/templates/ohos/build.gradle rename to templates/ohos/build.gradle diff --git a/native/templates/ohos/entry/.gitignore b/templates/ohos/entry/.gitignore similarity index 100% rename from native/templates/ohos/entry/.gitignore rename to templates/ohos/entry/.gitignore diff --git a/native/templates/ohos/entry/build.gradle b/templates/ohos/entry/build.gradle similarity index 100% rename from native/templates/ohos/entry/build.gradle rename to templates/ohos/entry/build.gradle diff --git a/native/templates/ohos/entry/libs/.keep b/templates/ohos/entry/libs/.keep similarity index 100% rename from native/templates/ohos/entry/libs/.keep rename to templates/ohos/entry/libs/.keep diff --git a/native/templates/ohos/entry/src/main/config.json b/templates/ohos/entry/src/main/config.json similarity index 100% rename from native/templates/ohos/entry/src/main/config.json rename to templates/ohos/entry/src/main/config.json diff --git a/native/templates/ohos/entry/src/main/java/com/example/cocosdemo/MainAbility.java b/templates/ohos/entry/src/main/java/com/example/cocosdemo/MainAbility.java similarity index 100% rename from native/templates/ohos/entry/src/main/java/com/example/cocosdemo/MainAbility.java rename to templates/ohos/entry/src/main/java/com/example/cocosdemo/MainAbility.java diff --git a/native/templates/ohos/entry/src/main/java/com/example/cocosdemo/MyApplication.java b/templates/ohos/entry/src/main/java/com/example/cocosdemo/MyApplication.java similarity index 100% rename from native/templates/ohos/entry/src/main/java/com/example/cocosdemo/MyApplication.java rename to templates/ohos/entry/src/main/java/com/example/cocosdemo/MyApplication.java diff --git a/native/templates/ohos/entry/src/main/java/com/example/cocosdemo/slice/MainAbilitySlice.java b/templates/ohos/entry/src/main/java/com/example/cocosdemo/slice/MainAbilitySlice.java similarity index 100% rename from native/templates/ohos/entry/src/main/java/com/example/cocosdemo/slice/MainAbilitySlice.java rename to templates/ohos/entry/src/main/java/com/example/cocosdemo/slice/MainAbilitySlice.java diff --git a/native/templates/ohos/entry/src/main/resources/base/element/string.json b/templates/ohos/entry/src/main/resources/base/element/string.json similarity index 100% rename from native/templates/ohos/entry/src/main/resources/base/element/string.json rename to templates/ohos/entry/src/main/resources/base/element/string.json diff --git a/native/templates/ohos/entry/src/main/resources/base/graphic/background_ability_main.xml b/templates/ohos/entry/src/main/resources/base/graphic/background_ability_main.xml similarity index 100% rename from native/templates/ohos/entry/src/main/resources/base/graphic/background_ability_main.xml rename to templates/ohos/entry/src/main/resources/base/graphic/background_ability_main.xml diff --git a/native/templates/ohos/entry/src/main/resources/base/layout/ability_main.xml b/templates/ohos/entry/src/main/resources/base/layout/ability_main.xml similarity index 100% rename from native/templates/ohos/entry/src/main/resources/base/layout/ability_main.xml rename to templates/ohos/entry/src/main/resources/base/layout/ability_main.xml diff --git a/native/templates/ohos/entry/src/main/resources/base/media/icon.png b/templates/ohos/entry/src/main/resources/base/media/icon.png similarity index 100% rename from native/templates/ohos/entry/src/main/resources/base/media/icon.png rename to templates/ohos/entry/src/main/resources/base/media/icon.png diff --git a/native/templates/ohos/entry/src/test/java/com/example/cocosdemo/ExampleTest.java b/templates/ohos/entry/src/test/java/com/example/cocosdemo/ExampleTest.java similarity index 100% rename from native/templates/ohos/entry/src/test/java/com/example/cocosdemo/ExampleTest.java rename to templates/ohos/entry/src/test/java/com/example/cocosdemo/ExampleTest.java diff --git a/native/templates/ohos/gradle.properties b/templates/ohos/gradle.properties similarity index 100% rename from native/templates/ohos/gradle.properties rename to templates/ohos/gradle.properties diff --git a/native/templates/ohos/gradle/wrapper/gradle-wrapper.jar b/templates/ohos/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from native/templates/ohos/gradle/wrapper/gradle-wrapper.jar rename to templates/ohos/gradle/wrapper/gradle-wrapper.jar diff --git a/native/templates/ohos/gradle/wrapper/gradle-wrapper.properties b/templates/ohos/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from native/templates/ohos/gradle/wrapper/gradle-wrapper.properties rename to templates/ohos/gradle/wrapper/gradle-wrapper.properties diff --git a/native/templates/ohos/gradlew b/templates/ohos/gradlew similarity index 100% rename from native/templates/ohos/gradlew rename to templates/ohos/gradlew diff --git a/native/templates/ohos/gradlew.bat b/templates/ohos/gradlew.bat similarity index 100% rename from native/templates/ohos/gradlew.bat rename to templates/ohos/gradlew.bat diff --git a/native/templates/ohos/local.properties b/templates/ohos/local.properties similarity index 100% rename from native/templates/ohos/local.properties rename to templates/ohos/local.properties diff --git a/native/templates/ohos/settings.gradle b/templates/ohos/settings.gradle similarity index 100% rename from native/templates/ohos/settings.gradle rename to templates/ohos/settings.gradle diff --git a/native/templates/project.json b/templates/project.json similarity index 100% rename from native/templates/project.json rename to templates/project.json diff --git a/native/templates/qnx/main.cpp b/templates/qnx/main.cpp similarity index 100% rename from native/templates/qnx/main.cpp rename to templates/qnx/main.cpp diff --git a/native/templates/windows/CMakeLists.txt b/templates/windows/CMakeLists.txt similarity index 100% rename from native/templates/windows/CMakeLists.txt rename to templates/windows/CMakeLists.txt diff --git a/native/templates/windows/build-cfg.json b/templates/windows/build-cfg.json similarity index 100% rename from native/templates/windows/build-cfg.json rename to templates/windows/build-cfg.json diff --git a/native/templates/windows/game.rc b/templates/windows/game.rc similarity index 100% rename from native/templates/windows/game.rc rename to templates/windows/game.rc diff --git a/native/templates/windows/main.cpp b/templates/windows/main.cpp similarity index 100% rename from native/templates/windows/main.cpp rename to templates/windows/main.cpp diff --git a/native/templates/windows/res/game.ico b/templates/windows/res/game.ico similarity index 100% rename from native/templates/windows/res/game.ico rename to templates/windows/res/game.ico diff --git a/native/templates/windows/resource.h b/templates/windows/resource.h similarity index 100% rename from native/templates/windows/resource.h rename to templates/windows/resource.h