From 44e5faadd0db52cfd3a89fa708f62828a040ccc1 Mon Sep 17 00:00:00 2001 From: Markin Igor <markin.io210@gmail.com> Date: Wed, 31 Jul 2019 17:48:29 +0500 Subject: [PATCH] Add Android build scripts. --- README.md | 6 +++++- build-android.sh | 21 +++++++++++++++++++++ build-ios.sh | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 build-android.sh diff --git a/README.md b/README.md index df4c819..f62788e 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,14 @@ ## Building process -##### iOS +#### iOS - Production `./build-ios.sh` - Development `./build-ios.sh development` +#### Android +- Production `./build-android.sh` +- Development `./build-android.sh development` + ### Build application in debug mode - With development flavor `flutter run --flavor development -t lib/main-dev.dart` - With production flavor `flutter run --flavor production -t lib/main.dart` diff --git a/build-android.sh b/build-android.sh new file mode 100755 index 0000000..03e594a --- /dev/null +++ b/build-android.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +flavor='production' +entryPoint='main.dart' + +if [[ $1 == 'development' ]] +then + flavor='development' + entryPoint='main-dev.dart' +fi + +# Build ios +flutter build apk --flavor ${flavor} -t lib/${entryPoint} + + +# Move packages wherever we need +# cp build/app/outputs/apk/development/release/app-development-release.apk /path +# cp build/app/outputs/apk/production/release/app-production-release.apk /path + +# Cleanup +# flutter clean diff --git a/build-ios.sh b/build-ios.sh index 49be273..fd31aee 100755 --- a/build-ios.sh +++ b/build-ios.sh @@ -16,7 +16,7 @@ then fi # Build ios -flutter build ios -v --flavor ${flavor} -t lib/${entryPoint} +flutter build ios --flavor ${flavor} -t lib/${entryPoint} # Export xarchive xcodebuild \ -- GitLab