From f904d409a5ba3da2c218d60fc1b1d685ae594dee Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 22 May 2024 17:56:51 -0600 Subject: [PATCH] generalize project config --- android/app/build.gradle | 3 +-- android/app/src/debug/AndroidManifest.xml | 2 +- android/app/src/main/AndroidManifest.xml | 6 +++--- .../cypherstack/stackwallet/MainActivity.kt | 2 +- .../app/src/main/profile/AndroidManifest.xml | 2 +- android/app/src/profile/AndroidManifest.xml | 2 +- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- ios/Runner/Info.plist | 2 +- .../startup_preferences_view.dart | 3 ++- .../wallet_backup_view.dart | 3 ++- .../delete_wallet_recovery_phrase_view.dart | 3 ++- .../forgot_password_desktop_view.dart | 5 +++-- linux/CMakeLists.txt | 4 ++-- linux/my_application.cc | 4 ++-- macos/Runner.xcodeproj/project.pbxproj | 18 +++++++++--------- .../xcshareddata/xcschemes/Runner.xcscheme | 8 ++++---- macos/Runner/Configs/AppInfo.xcconfig | 4 ++-- scripts/android/build_all_duo.sh | 7 ------- scripts/app_config/configure_stack_duo.sh | 17 ++++++++--------- scripts/app_config/configure_stack_wallet.sh | 19 ++++++++++--------- .../platforms/android/platform_config.sh | 11 +++++++++++ .../platforms/ios/platform_config.sh | 7 +++++++ .../platforms/linux/platform_config.sh | 7 +++++++ .../platforms/macos/platform_config.sh | 10 ++++++++++ .../platforms/windows/platform_config.sh | 8 ++++++++ scripts/app_config/shared/link_assets.sh | 3 --- scripts/build_app.sh | 12 ++++++++---- scripts/env.sh | 8 +++++++- scripts/ios/build_all_duo.sh | 4 ---- scripts/linux/build_all_duo.sh | 4 ---- scripts/macos/build_all_duo.sh | 3 --- scripts/windows/build_all_duo.sh | 3 --- windows/CMakeLists.txt | 4 ++-- windows/runner/Runner.rc | 8 ++++---- windows/runner/main.cpp | 2 +- 35 files changed, 123 insertions(+), 91 deletions(-) create mode 100755 scripts/app_config/platforms/android/platform_config.sh create mode 100755 scripts/app_config/platforms/ios/platform_config.sh create mode 100755 scripts/app_config/platforms/linux/platform_config.sh create mode 100755 scripts/app_config/platforms/macos/platform_config.sh create mode 100755 scripts/app_config/platforms/windows/platform_config.sh diff --git a/android/app/build.gradle b/android/app/build.gradle index ae9570217..4d134796a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -47,8 +47,7 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.cypherstack.stackwallet" + applicationId "com.place.holder" minSdkVersion 23 targetSdkVersion 33 // ndkVersion = "21.1.6352462" diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index e461d6136..9aa98e2e8 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.place.holder"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 3f1a56aa8..bfcdf171f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.place.holder"> diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index e461d6136..9aa98e2e8 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.place.holder"> diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 7a1d5f01e..c793dd2fe 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -525,7 +525,7 @@ ); MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)"; ONLY_ACTIVE_ARCH = NO; - PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet; + PRODUCT_BUNDLE_IDENTIFIER = com.place.holder; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; STRIP_INSTALLED_PRODUCT = NO; @@ -716,7 +716,7 @@ ); MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)"; ONLY_ACTIVE_ARCH = NO; - PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet; + PRODUCT_BUNDLE_IDENTIFIER = com.place.holder; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; STRIP_INSTALLED_PRODUCT = NO; @@ -799,7 +799,7 @@ ); MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)"; ONLY_ACTIVE_ARCH = NO; - PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet; + PRODUCT_BUNDLE_IDENTIFIER = com.place.holder; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; STRIP_INSTALLED_PRODUCT = NO; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 6b8be59a8..ea8af9f9f 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -15,7 +15,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - Stack Wallet + PlaceHolderName CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart index 835d156df..687fe7eb4 100644 --- a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart +++ b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart @@ -13,6 +13,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:stackwallet/app_config.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; @@ -158,7 +159,7 @@ class _StartupPreferencesViewState textAlign: TextAlign.left, ), Text( - "Stack Wallet home screen", + "${AppConfig.appName} home screen", style: STextStyles.itemSubtitle( context), diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart index ab6baf455..71e7d980e 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart @@ -15,6 +15,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:qr_flutter/qr_flutter.dart'; +import 'package:stackwallet/app_config.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; @@ -126,7 +127,7 @@ class WalletBackupView extends ConsumerWidget { "Your backup data is the only way you can access your " "funds if you forget your PIN, lose your phone, etc." "\n\n" - "Stack Wallet does not keep nor is able to restore " + "${AppConfig.appName} does not keep nor is able to restore " "your backup data. " "Only you have access to your wallet.", style: STextStyles.label(context), diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart index 8c7d94fe9..36510c490 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart @@ -14,6 +14,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:stackwallet/app_config.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart'; import 'package:stackwallet/pages/home_view/home_view.dart'; @@ -202,7 +203,7 @@ class _DeleteWalletRecoveryPhraseViewState "Your backup data is the only way you can access your " "funds if you forget your PIN, lose your phone, etc." "\n\n" - "Stack Wallet does not keep nor is able to restore " + "${AppConfig.appName} does not keep nor is able to restore " "your backup data. " "Only you have access to your wallet.", style: STextStyles.label(context), diff --git a/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart b/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart index 0de5069e8..0f1077983 100644 --- a/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart +++ b/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart @@ -13,6 +13,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:stackwallet/app_config.dart'; import 'package:stackwallet/pages_desktop_specific/password/delete_password_warning_view.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/theme_providers.dart'; @@ -73,7 +74,7 @@ class _ForgotPasswordDesktopViewState height: 42, ), Text( - "Stack Wallet", + AppConfig.appName, style: STextStyles.desktopH1(context), ), const SizedBox( @@ -82,7 +83,7 @@ class _ForgotPasswordDesktopViewState SizedBox( width: 400, child: Text( - "Stack Wallet does not store your password. Create new wallet or use a Stack backup file to restore your wallet.", + "${AppConfig.appName} does not store your password. Create new wallet or use a Stack backup file to restore your wallet.", textAlign: TextAlign.center, style: STextStyles.desktopTextSmall(context).copyWith( color: Theme.of(context) diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 53391e7ad..bd1d1690b 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -4,10 +4,10 @@ project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "stack_wallet") +set(BINARY_NAME "place_holder") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.cypherstack.stackwallet") +set(APPLICATION_ID "com.place.holder") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/linux/my_application.cc b/linux/my_application.cc index d342c1506..a6eec3956 100644 --- a/linux/my_application.cc +++ b/linux/my_application.cc @@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "Stack Wallet"); + gtk_header_bar_set_title(header_bar, "PlaceHolderName"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "Stack Wallet"); + gtk_window_set_title(window, "PlaceHolderName"); } gtk_window_set_default_size(window, 1220, 500); diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index eccafe6ba..3e8ffdabb 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -77,7 +77,7 @@ 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* Stack Wallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Stack Wallet.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* PlaceHolderName.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PlaceHolderName.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -160,7 +160,7 @@ 33CC10EE2044A3C60003C045 /* Products */ = { isa = PBXGroup; children = ( - 33CC10ED2044A3C60003C045 /* Stack Wallet.app */, + 33CC10ED2044A3C60003C045 /* PlaceHolderName.app */, 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, ); name = Products; @@ -267,7 +267,7 @@ ); name = Runner; productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* Stack Wallet.app */; + productReference = 33CC10ED2044A3C60003C045 /* PlaceHolderName.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -497,10 +497,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackWallet.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.place.holderCamel.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stack Wallet.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PlaceHolderName.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet"; }; name = Debug; }; @@ -512,10 +512,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackWallet.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.place.holderCamel.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stack Wallet.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PlaceHolderName.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet"; }; name = Release; }; @@ -527,10 +527,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackWallet.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.place.holderCamel.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stack Wallet.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PlaceHolderName.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/stack_wallet"; }; name = Profile; }; diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 73f65e0e3..4baf48207 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -65,7 +65,7 @@ @@ -82,7 +82,7 @@ diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig index 391513c54..1a3350d22 100644 --- a/macos/Runner/Configs/AppInfo.xcconfig +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = Stack Wallet +PRODUCT_NAME = PlaceHolderName // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stack_wallet +PRODUCT_BUNDLE_IDENTIFIER = com.place.holder_snake // The copyright displayed in application information PRODUCT_COPYRIGHT = Copyright © 2023 com.cypherstack. All rights reserved. diff --git a/scripts/android/build_all_duo.sh b/scripts/android/build_all_duo.sh index e636ce29e..bca175541 100755 --- a/scripts/android/build_all_duo.sh +++ b/scripts/android/build_all_duo.sh @@ -2,13 +2,6 @@ set -x -e -sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../android/app/build.gradle -sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../android/app/src/debug/AndroidManifest.xml -sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../android/app/src/main/AndroidManifest.xml -sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../android/app/src/main/kotlin/com/cypherstack/stackwallet/MainActivity.kt -sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../android/app/src/main/profile/AndroidManifest.xml -sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../android/app/src/profile/AndroidManifest.xml - # todo: revisit following at some point # libepiccash requires old rust diff --git a/scripts/app_config/configure_stack_duo.sh b/scripts/app_config/configure_stack_duo.sh index c910deef8..99e60e4cd 100755 --- a/scripts/app_config/configure_stack_duo.sh +++ b/scripts/app_config/configure_stack_duo.sh @@ -4,24 +4,23 @@ set -x -e # Configure files for Duo. -export ORIGINAL_NAME="Stack Wallet" -export ORIGINAL_APP_ID="com.cypherstack.stackwallet" - export NEW_NAME="Stack Duo" export NEW_APP_ID="com.cypherstack.stackduo" +export NEW_APP_ID_CAMEL="com.cypherstack.stackDuo" +export NEW_APP_ID_SNAKE="com.cypherstack.stack_duo" +export NEW_BASIC_NAME="stack_duo" +NEW_PUBSPEC_NAME="stackduo" PUBSPEC_FILE="${APP_PROJECT_ROOT_DIR}/pubspec.yaml" -PUBSPEC_NAME="stackduo" -PUBSPEC_DESC="Stack Duo" # String replacements. if [[ "$(uname)" == 'Darwin' ]]; then # macos specific sed - sed -i '' "s/name: PLACEHOLDER/name: ${PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" - sed -i '' "s/description: PLACEHOLDER/description: ${PUBSPEC_DESC}/g" "${PUBSPEC_FILE}" + sed -i '' "s/name: PLACEHOLDER/name: ${NEW_PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" + sed -i '' "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}" else - sed -i "s/name: PLACEHOLDER/name: ${PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" - sed -i "s/description: PLACEHOLDER/description: ${PUBSPEC_DESC}/g" "${PUBSPEC_FILE}" + sed -i "s/name: PLACEHOLDER/name: ${NEW_PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" + sed -i "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}" fi APP_CONFIG_DART_FILE="${APP_PROJECT_ROOT_DIR}/lib/app_config.g.dart" diff --git a/scripts/app_config/configure_stack_wallet.sh b/scripts/app_config/configure_stack_wallet.sh index 2f698ba6c..acd13fb22 100755 --- a/scripts/app_config/configure_stack_wallet.sh +++ b/scripts/app_config/configure_stack_wallet.sh @@ -4,22 +4,23 @@ set -x -e # Configure files for Stack Wallet. -# currently unused -#export APP_NAME="Stack Wallet" -#export APP_ID="com.cypherstack.stackwallet" +export NEW_NAME="Stack Wallet" +export NEW_APP_ID="com.cypherstack.stackwallet" +export NEW_APP_ID_CAMEL="com.cypherstack.stackWallet" +export NEW_APP_ID_SNAKE="com.cypherstack.stack_wallet" +export NEW_BASIC_NAME="stack_wallet" +NEW_PUBSPEC_NAME="stackwallet" PUBSPEC_FILE="${APP_PROJECT_ROOT_DIR}/pubspec.yaml" -PUBSPEC_NAME="stackwallet" -PUBSPEC_DESC="Stack Wallet" # String replacements. if [[ "$(uname)" == 'Darwin' ]]; then # macos specific sed - sed -i '' "s/name: PLACEHOLDER/name: ${PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" - sed -i '' "s/description: PLACEHOLDER/description: ${PUBSPEC_DESC}/g" "${PUBSPEC_FILE}" + sed -i '' "s/name: PLACEHOLDER/name: ${NEW_PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" + sed -i '' "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}" else - sed -i "s/name: PLACEHOLDER/name: ${PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" - sed -i "s/description: PLACEHOLDER/description: ${PUBSPEC_DESC}/g" "${PUBSPEC_FILE}" + sed -i "s/name: PLACEHOLDER/name: ${NEW_PUBSPEC_NAME}/g" "${PUBSPEC_FILE}" + sed -i "s/description: PLACEHOLDER/description: ${NEW_NAME}/g" "${PUBSPEC_FILE}" fi diff --git a/scripts/app_config/platforms/android/platform_config.sh b/scripts/app_config/platforms/android/platform_config.sh new file mode 100755 index 000000000..5002c11d5 --- /dev/null +++ b/scripts/app_config/platforms/android/platform_config.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -x -e + +sed -i "s/${APP_ID_PLACEHOLDER}/${NEW_APP_ID}/g" "${APP_PROJECT_ROOT_DIR}/android/app/build.gradle" +sed -i "s/${APP_ID_PLACEHOLDER}/${NEW_APP_ID}/g" "${APP_PROJECT_ROOT_DIR}/android/app/src/debug/AndroidManifest.xml" +sed -i "s/${APP_ID_PLACEHOLDER}/${NEW_APP_ID}/g" "${APP_PROJECT_ROOT_DIR}/android/app/src/profile/AndroidManifest.xml" +sed -i "s/${APP_ID_PLACEHOLDER}/${NEW_APP_ID}/g" "${APP_PROJECT_ROOT_DIR}/android/app/src/main/AndroidManifest.xml" +sed -i "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/android/app/src/main/AndroidManifest.xml" +sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" "${APP_PROJECT_ROOT_DIR}/android/app/src/main/profile/AndroidManifest.xml" +sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" "${APP_PROJECT_ROOT_DIR}/android/app/src/main/kotlin/com/cypherstack/stackwallet/MainActivity.kt" diff --git a/scripts/app_config/platforms/ios/platform_config.sh b/scripts/app_config/platforms/ios/platform_config.sh new file mode 100755 index 000000000..2dad97e5f --- /dev/null +++ b/scripts/app_config/platforms/ios/platform_config.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -x -e + +# Configure ios for Duo. +sed -i '' "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/ios/Runner/Info.plist" +sed -i '' "s/${APP_ID_PLACEHOLDER}/${NEW_APP_ID}/g" "${APP_PROJECT_ROOT_DIR}/ios/Runner.xcodeproj/project.pbxproj" diff --git a/scripts/app_config/platforms/linux/platform_config.sh b/scripts/app_config/platforms/linux/platform_config.sh new file mode 100755 index 000000000..6219ae3da --- /dev/null +++ b/scripts/app_config/platforms/linux/platform_config.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -x -e + +# Configure Linux for Duo. +sed -i "s/${APP_BASIC_NAME_PLACEHOLDER}/${NEW_BASIC_NAME}/g" "${APP_PROJECT_ROOT_DIR}/linux/CMakeLists.txt" +sed -i "s/${APP_NAME_PLACEHOLDER}/${NEW_NAME}/g" "${APP_PROJECT_ROOT_DIR}/linux/my_application.cc" diff --git a/scripts/app_config/platforms/macos/platform_config.sh b/scripts/app_config/platforms/macos/platform_config.sh new file mode 100755 index 000000000..88becec76 --- /dev/null +++ b/scripts/app_config/platforms/macos/platform_config.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -x -e + +# 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" diff --git a/scripts/app_config/platforms/windows/platform_config.sh b/scripts/app_config/platforms/windows/platform_config.sh new file mode 100755 index 000000000..ea9309a9c --- /dev/null +++ b/scripts/app_config/platforms/windows/platform_config.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -x -e + +# 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" diff --git a/scripts/app_config/shared/link_assets.sh b/scripts/app_config/shared/link_assets.sh index e9873ac88..e718f0783 100755 --- a/scripts/app_config/shared/link_assets.sh +++ b/scripts/app_config/shared/link_assets.sh @@ -24,6 +24,3 @@ ln -s "${ASSET_SOURCES_DIR}/icon/${SELECT_ASSETS_DIR}" "${ASSETS_DIR}/icon" rm -f "${ASSETS_DIR}/lottie" ln -s "${ASSET_SOURCES_DIR}/lottie/${SELECT_ASSETS_DIR}" "${ASSETS_DIR}/lottie" - -# run icon and image generators -"${APP_PROJECT_ROOT_DIR}/scripts/app_config/shared/asset_generators.sh" \ No newline at end of file diff --git a/scripts/build_app.sh b/scripts/build_app.sh index d038cfa3c..795adfdbf 100755 --- a/scripts/build_app.sh +++ b/scripts/build_app.sh @@ -54,8 +54,7 @@ if [ -z "$APP_NAMED_ID" ]; then usage fi - - +# checks for the correct platform dir and pushes it for later if printf '%s\0' "${APP_PLATFORMS[@]}" | grep -Fxqz -- "${APP_BUILD_PLATFORM}"; then pushd "${APP_PROJECT_ROOT_DIR}/scripts/${APP_BUILD_PLATFORM}" else @@ -63,16 +62,21 @@ else usage fi +# apply config project wide change changes if printf '%s\0' "${APP_NAMED_IDS[@]}" | grep -Fxqz -- "${APP_NAMED_ID}"; then - # shellcheck disable=SC1090 - source "${APP_PROJECT_ROOT_DIR}/scripts/app_config/configure_${APP_NAMED_ID}.sh" "${APP_PROJECT_ROOT_DIR}/scripts/app_config/shared/update_version.sh" -v "${APP_VERSION_STRING}" -b "${APP_BUILD_NUMBER}" "${APP_PROJECT_ROOT_DIR}/scripts/app_config/shared/link_assets.sh" "${APP_NAMED_ID}" + # shellcheck disable=SC1090 + source "${APP_PROJECT_ROOT_DIR}/scripts/app_config/configure_${APP_NAMED_ID}.sh" + "${APP_PROJECT_ROOT_DIR}/scripts/app_config/shared/platforms/${APP_BUILD_PLATFORM}/platform_config.sh" else echo "Invalid app id: ${APP_NAMED_ID}" exit 1 fi +# run icon and image generators after project config has completed +"${APP_PROJECT_ROOT_DIR}/scripts/app_config/shared/asset_generators.sh" + if [ "$BUILD_CRYPTO_PLUGINS" -eq 0 ]; then if [[ "$APP_NAMED_ID" = "stack_wallet" ]]; then ./build_all.sh diff --git a/scripts/env.sh b/scripts/env.sh index 174a6d879..d47b6f2f4 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -6,4 +6,10 @@ set -x -e THIS_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) pushd "${THIS_SCRIPT_DIR}/../" export APP_PROJECT_ROOT_DIR="$(pwd)" -popd \ No newline at end of file +popd + +export APP_NAME_PLACEHOLDER="PlaceHolderName" +export APP_ID_PLACEHOLDER="com.place.holder" +export APP_ID_PLACEHOLDER_CAMEL="com.place.holderCamel" +export APP_ID_PLACEHOLDER_SNAKE="com.place.holder_snake" +export APP_BASIC_NAME_PLACEHOLDER="place_holder" diff --git a/scripts/ios/build_all_duo.sh b/scripts/ios/build_all_duo.sh index 1dabc0834..c16884680 100755 --- a/scripts/ios/build_all_duo.sh +++ b/scripts/ios/build_all_duo.sh @@ -2,10 +2,6 @@ set -x -e -# Configure ios for Duo. -sed -i '' "s/${ORIGINAL_NAME}/${NEW_NAME}/g" ../../ios/Runner/Info.plist -sed -i '' "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../ios/Runner.xcodeproj/project.pbxproj - # todo: revisit following at some point # libepiccash requires old rust diff --git a/scripts/linux/build_all_duo.sh b/scripts/linux/build_all_duo.sh index 7f0cd0286..77ccdf592 100755 --- a/scripts/linux/build_all_duo.sh +++ b/scripts/linux/build_all_duo.sh @@ -2,10 +2,6 @@ set -x -e -# Configure Linux for Duo. -sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../linux/CMakeLists.txt -sed -i "s/${ORIGINAL_NAME}/${NEW_NAME}/g" ../../linux/my_application.cc - # todo: revisit following at some point # libepiccash requires old rust diff --git a/scripts/macos/build_all_duo.sh b/scripts/macos/build_all_duo.sh index f4910ecae..f5cfbeeb1 100755 --- a/scripts/macos/build_all_duo.sh +++ b/scripts/macos/build_all_duo.sh @@ -2,9 +2,6 @@ set -x -e -# Configure macOS for Duo. -sed -i '' 's/com.cypherstack.stackWallet/com.cypherstack.stackDuo/g' ../../macos/Runner.xcodeproj/project.pbxproj - # todo: revisit following at some point # libepiccash requires old rust diff --git a/scripts/windows/build_all_duo.sh b/scripts/windows/build_all_duo.sh index b66e59d4f..6262793dd 100755 --- a/scripts/windows/build_all_duo.sh +++ b/scripts/windows/build_all_duo.sh @@ -2,9 +2,6 @@ set -x -e -# Configure Windows for Duo. -sed -i 's/Stack Wallet/Stack Duo/g' ../../windows/runner/Runner.rc - # todo: revisit following at some point # libepiccash requires old rust diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index eddd46e4d..b9add856d 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -1,10 +1,10 @@ # Project-level configuration. cmake_minimum_required(VERSION 3.14) -project(stack_wallet LANGUAGES CXX) +project(place_holder LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "stack_wallet") +set(BINARY_NAME "place_holder") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc index d23cd8ce6..ac822d092 100644 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -90,12 +90,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.cypherstack" "\0" - VALUE "FileDescription", "Stack Wallet" "\0" + VALUE "FileDescription", "PlaceHolderName" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "Stack Wallet" "\0" + VALUE "InternalName", "PlaceHolderName" "\0" VALUE "LegalCopyright", "Copyright (C) 2022 com.cypherstack. All rights reserved." "\0" - VALUE "OriginalFilename", "Stack Wallet.exe" "\0" - VALUE "ProductName", "Stack Wallet" "\0" + VALUE "OriginalFilename", "PlaceHolderName.exe" "\0" + VALUE "ProductName", "PlaceHolderName" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp index 7369685a2..a960708f3 100644 --- a/windows/runner/main.cpp +++ b/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"Stack Wallet", origin, size)) { + if (!window.CreateAndShow(L"PlaceHolderName", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true);