diff --git a/.gitignore b/.gitignore index badbe17..c3a75e3 100644 --- a/.gitignore +++ b/.gitignore @@ -49,4 +49,5 @@ app.*.map.json android/app/google-services.json ios/Runner/GoogleService-Info.plist ios/firebase_app_id_file.json -lib/firebase_options.dart \ No newline at end of file +lib/firebase_options.dart +scripts/*.plist \ No newline at end of file diff --git a/README.md b/README.md index 5cfc859..3d4a0b9 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,10 @@ The Silent Shard mobile app is an MPC-based Threshold Signer app as a usable, se - Navigate to the project directory - Install dependencies: `flutter pub get` - Run the app: `flutter run` + +### Build +- Build the app: + - Android: `./build_android.sh [stg|prod]` + - iOS: `./build_ios.sh [stg|prod]` + +- Before building the app using the scripts, make sure to update the version in `pubspec.yaml` and copy `GoogleService-Info_.plist` into `scripts` (iOS only), you could find the file in the [Firebase console](https://console.firebase.google.com/u/0/project/mobile-wallet-mm-snap-staging/settings/general/ios:com.silencelaboratories.silentshard). \ No newline at end of file diff --git a/scripts/build_android.sh b/scripts/build_android.sh new file mode 100755 index 0000000..90dac4b --- /dev/null +++ b/scripts/build_android.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e +DIR=$(dirname $0) + +if [ -z "$1" ] || [ "$1" = "--help" ]; then + echo "Usage: ./build_android.sh [stg|prod]" + exit 1 +fi + +if [ "$1" = "stg" ]; then + echo "Building for staging" + + flutter build apk --release +elif [ "$1" = "prod" ]; then + echo "Building for prod" + + flutter build appbundle +else + echo "Invalid argument. Please use 'stg' or 'prod'" + exit 1 +fi diff --git a/scripts/build_ios.sh b/scripts/build_ios.sh new file mode 100755 index 0000000..192e102 --- /dev/null +++ b/scripts/build_ios.sh @@ -0,0 +1,35 @@ +#!/bin/sh +set -e +DIR=$(dirname $0) + +if [ -z "$1" ] || [ "$1" = "--help" ]; then + echo "Usage: ./build_ios.sh [stg|prod]" + exit 1 +fi + +if [ "$1" = "stg" ]; then + echo "Building for staging" + + if [ ! -f "$DIR/GoogleService-Info_stg.plist" ]; then + echo "GoogleService-Info_stg.plist not found! Please add it to the scripts folder" + exit 1 + fi + + cp $DIR/GoogleService-Info_stg.plist ios/Runner/GoogleService-Info.plist + + flutter build ipa +elif [ "$1" = "prod" ]; then + echo "Building for prod" + + if [ ! -f "$DIR/GoogleService-Info_prod.plist" ]; then + echo "GoogleService-Info-prod.plist not found! Please add it to the scripts folder" + exit 1 + fi + + cp $DIR/GoogleService-Info_prod.plist ios/Runner/GoogleService-Info.plist + + flutter build ipa +else + echo "Invalid argument. Please use 'stg' or 'prod'" + exit 1 +fi