diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d4a67bbd4767064e0a8f8db02e8a786e6ab22ede --- /dev/null +++ b/Makefile @@ -0,0 +1,49 @@ +flavor=production +entryPoint=main.dart + +iosBundleName=Vereign +iosScheme=production +iosConfiguration=Release-production + + +ifeq ($(target), development) + flavor=development + entryPoint=main-dev.dart + iosBundleName=Vereign-dev + iosScheme=development + iosConfiguration=Release-development +endif + +.PHONY: all build-ios build-android + +all: build-ios build-android + +run: + flutter run --flavor ${flavor} -t lib/${entryPoint} + +build-ios: flutter-build-ios archive-ios export-ios ## Builds ios bundle and upload to the AppStore + +build-android: ## Builds android bundle + flutter build apk --flavor ${flavor} -t lib/${entryPoint} + +flutter-build-ios: ## Performs flutter build + flutter build ios --flavor $(flavor) -t lib/$(entryPoint) + +archive-ios: ## Creates .xarchive from fullter build + xcodebuild \ + -workspace ios/Runner.xcworkspace \ + -scheme ${iosScheme} \ + -sdk iphoneos \ + -configuration ${iosConfiguration} \ + archive -archivePath \ + build/ios/$(iosBundleName).xcarchive + +export-ios: ## Exports ipa and uploads it to AppStore + xcodebuild \ + -exportArchive \ + -archivePath build/ios/${iosBundleName}.xcarchive \ + -exportOptionsPlist ios/exportOptions-dev.plist \ + -exportPath build/ios/${iosBundleName} + +clean: ## Removes build directory + flutter clean \ No newline at end of file diff --git a/build-android.sh b/build-android.sh deleted file mode 100755 index 2d01da1bfd2c32b4d6d9889b406a7654c3df4136..0000000000000000000000000000000000000000 --- a/build-android.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -flavor='production' -entryPoint='main.dart' - -if [[ $1 == 'development' ]] -then - flavor='development' - entryPoint='main-dev.dart' -fi - -# Build android -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 deleted file mode 100755 index 2109606c7472a22ab9087c02f52876f1f7f8a636..0000000000000000000000000000000000000000 --- a/build-ios.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -flavor='production' -scheme='production' -configuration='Release-production' -entryPoint='main.dart' -bundleName="Vereign" - -if [[ $1 == 'development' ]] -then - flavor='development' - scheme='development' - configuration='Release-development' - entryPoint='main-dev.dart' - bundleName="Vereign-dev" -fi - -# Build ios -flutter build ios --flavor ${flavor} -t lib/${entryPoint} - -# Export xarchive -xcodebuild \ - -workspace ios/Runner.xcworkspace \ - -scheme ${scheme} \ - -sdk iphoneos \ - -configuration ${configuration} \ - archive -archivePath \ - build/ios/${bundleName}.xcarchive - -# Package ipa -xcodebuild \ - -exportArchive \ - -archivePath build/ios/${bundleName}.xcarchive \ - -exportOptionsPlist ios/exportOptions-dev.plist \ - -exportPath build/ios/${bundleName} - -# Cleanup -# flutter clean diff --git a/run.sh b/run.sh deleted file mode 100755 index 6701ad5d79e04f31bf1dede6af3133f2165a9eab..0000000000000000000000000000000000000000 --- a/run.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -flavor='development' -entryPoint='main-dev.dart' - -if [[ $1 == 'production' ]] -then - flavor='production' - entryPoint='main.dart' -fi - -flutter run --flavor ${flavor} -t lib/${entryPoint} \ No newline at end of file