From 2519b6feafa9dca3c4a3d796864a990557414bb4 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 23 May 2024 17:32:20 -0600 Subject: [PATCH] windows template files --- .gitignore | 7 ++++++- .../platforms/windows/platform_config.sh | 21 ++++++++++++++++--- .../templates/windows}/CMakeLists.txt | 0 .../templates/windows}/runner/Runner.rc | 0 .../templates/windows}/runner/main.cpp | 0 5 files changed, 24 insertions(+), 4 deletions(-) rename {windows => scripts/app_config/templates/windows}/CMakeLists.txt (100%) rename {windows => scripts/app_config/templates/windows}/runner/Runner.rc (100%) rename {windows => scripts/app_config/templates/windows}/runner/main.cpp (100%) diff --git a/.gitignore b/.gitignore index 84d09d3e0..047468371 100644 --- a/.gitignore +++ b/.gitignore @@ -87,4 +87,9 @@ secp256k1.dll /macos/Runner/Configs/AppInfo.xcconfig /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme /macos/Runner.xcodeproj/project.pbxproj -/macos/Runner/Assets.xcassets/AppIcon.appiconset \ No newline at end of file +/macos/Runner/Assets.xcassets/AppIcon.appiconset + +/windows/runner/Runner.rc +/windows/runner/main.cpp +/windows/CMakeLists.txt +/windows/runner/resources/app_icon.ico \ No newline at end of file diff --git a/scripts/app_config/platforms/windows/platform_config.sh b/scripts/app_config/platforms/windows/platform_config.sh index ea9309a9c..14600ba25 100755 --- a/scripts/app_config/platforms/windows/platform_config.sh +++ b/scripts/app_config/platforms/windows/platform_config.sh @@ -2,7 +2,22 @@ set -x -e +F0="windows/runner/Runner.rc" +F1="windows/runner/main.cpp" +F2="windows/CMakeLists.txt" + +TEMPLATES="${APP_PROJECT_ROOT_DIR}/scripts/app_config/templates" + +for (( i=0; i<=2; i++ )); do + VAR="F${i}" + FILE="${APP_PROJECT_ROOT_DIR}/${!VAR}" + if [ -f "${FILE}" ]; then + rm "${FILE}" + fi + cp "${TEMPLATES}/${!VAR}" "${FILE}" +done + # Configure Windows for Duo. -sed -i "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/windows/runner/Runner.rc" -sed -i "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/windows/runner/main.cpp" -sed -i "s/${APP_BASIC_NAME_PLACEHOLDER}/${NEW_BASIC_NAME}/g" "${APP_PROJECT_ROOT_DIR}/windows/CMakeLists.txt" +sed -i "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/${F0}" +sed -i "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/${F1}" +sed -i "s/${APP_BASIC_NAME_PLACEHOLDER}/${NEW_BASIC_NAME}/g" "${APP_PROJECT_ROOT_DIR}/${F2}" diff --git a/windows/CMakeLists.txt b/scripts/app_config/templates/windows/CMakeLists.txt similarity index 100% rename from windows/CMakeLists.txt rename to scripts/app_config/templates/windows/CMakeLists.txt diff --git a/windows/runner/Runner.rc b/scripts/app_config/templates/windows/runner/Runner.rc similarity index 100% rename from windows/runner/Runner.rc rename to scripts/app_config/templates/windows/runner/Runner.rc diff --git a/windows/runner/main.cpp b/scripts/app_config/templates/windows/runner/main.cpp similarity index 100% rename from windows/runner/main.cpp rename to scripts/app_config/templates/windows/runner/main.cpp