diff --git a/.gitignore b/.gitignore index 916be96a3..84d09d3e0 100644 --- a/.gitignore +++ b/.gitignore @@ -82,4 +82,9 @@ secp256k1.dll /ios/Runner/Assets.xcassets/AppIcon.appiconset /linux/CMakeLists.txt -/linux/my_application.cc \ No newline at end of file +/linux/my_application.cc + +/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 diff --git a/scripts/app_config/platforms/macos/platform_config.sh b/scripts/app_config/platforms/macos/platform_config.sh index 88becec76..8e31fa265 100755 --- a/scripts/app_config/platforms/macos/platform_config.sh +++ b/scripts/app_config/platforms/macos/platform_config.sh @@ -2,9 +2,24 @@ set -x -e +F0="macos/Runner.xcodeproj/project.pbxproj" +F1="macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme" +F2="macos/Runner/Configs/AppInfo.xcconfig" + +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 macOS for Duo. -sed -i '' "s/${APP_ID_PLACEHOLDER_CAMEL}/${NEW_APP_ID_CAMEL}/g" "${APP_PROJECT_ROOT_DIR}/macos/Runner.xcodeproj/project.pbxproj" -sed -i '' "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/macos/Runner.xcodeproj/project.pbxproj" -sed -i '' "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme" -sed -i '' "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/macos/Runner/Configs/AppInfo.xcconfig" -sed -i '' "s/${APP_ID_PLACEHOLDER_SNAKE}/${NEW_APP_ID_SNAKE}/g" "${APP_PROJECT_ROOT_DIR}/macos/Runner/Configs/AppInfo.xcconfig" +sed -i '' "s/${APP_ID_PLACEHOLDER_CAMEL}/${NEW_APP_ID_CAMEL}/g" "${APP_PROJECT_ROOT_DIR}/${F0}" +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_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/${F2}" +sed -i '' "s/${APP_ID_PLACEHOLDER_SNAKE}/${NEW_APP_ID_SNAKE}/g" "${APP_PROJECT_ROOT_DIR}/${F2}" diff --git a/macos/Runner.xcodeproj/project.pbxproj b/scripts/app_config/templates/macos/Runner.xcodeproj/project.pbxproj similarity index 100% rename from macos/Runner.xcodeproj/project.pbxproj rename to scripts/app_config/templates/macos/Runner.xcodeproj/project.pbxproj diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/scripts/app_config/templates/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to scripts/app_config/templates/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/scripts/app_config/templates/macos/Runner/Configs/AppInfo.xcconfig similarity index 100% rename from macos/Runner/Configs/AppInfo.xcconfig rename to scripts/app_config/templates/macos/Runner/Configs/AppInfo.xcconfig