From 8e98e366f7de0d8636a387ee857ead7cc8c1b646 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Thu, 7 Sep 2023 17:22:10 +0200 Subject: [PATCH] fix: Allow specifying paths to flutter and dart --- src/flutter/build.sh | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/flutter/build.sh b/src/flutter/build.sh index ff0a6de..0c079b1 100644 --- a/src/flutter/build.sh +++ b/src/flutter/build.sh @@ -86,6 +86,18 @@ while [[ $# -gt 0 ]]; do shift shift ;; + --flutter) + # Specifies the path to the flutter binary + FLUTTER=$2 + shift + shift + ;; + --dart) + # Specifies the path to the dart binary + DART=$2 + shift + shift + ;; *) echo "Unknown argument: $1" shift @@ -107,6 +119,8 @@ CLEAN_BUILD=${CLEAN_BUILD:-y} SKIP_BUILD=${SKIP_BUILD:-n} NOTIFY_SEND=${NOTIFY_SEND:-notify-send} SEND_NOTIFICATION=${SEND_NOTIFICATION:-y} +FLUTTER=${FLUTTER:-flutter} +DART=${DART:-flutter} # Parse version info version=$(grep -E "^version: " pubspec.yaml | cut -b 10-) @@ -118,6 +132,8 @@ release_dir="./release-${version}" echo "===== ${NAME} =====" echo "Building version ${version}" echo "Moving APKs into ${release_dir} after build" +echo "Flutter: ${FLUTTER}" +echo "Dart: ${DART}" echo "Clean build: ${CLEAN_BUILD}" echo "Pigeons to build: ${PIGEON_FILES}" echo "Skipping build: ${SKIP_BUILD}" @@ -153,22 +169,22 @@ else if [[ "${CLEAN_BUILD}" = "y" ]]; then # Clean flutter build - flutter clean + $FLUTTER clean fi # Get dependencies - flutter pub get + $FLUTTER pub get # Build everything again - flutter pub run build_runner build --delete-conflicting-outputs + $FLUTTER pub run build_runner build --delete-conflicting-outputs # Build pigeons for pigeon in $PIGEON_FILES; do - dart run pigeon --input $pigeon + $DART run pigeon --input $pigeon done # Build the release apk - flutter build apk \ + $FLUTTER build apk \ --release \ --split-per-abi \ --split-debug-info="${release_dir}/debug-info"