-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_distributable.sh
More file actions
executable file
·56 lines (39 loc) · 1.27 KB
/
build_distributable.sh
File metadata and controls
executable file
·56 lines (39 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# The windows side of this does not work for git bash
# Detect OS
OS="$(uname)"
echo "Detected OS: $OS"
if [[ "$OS" == "Darwin" ]]; then
echo "Running macOS build steps..."
echo "Cleaning..."
flutter clean
echo "Building Android APK..."
flutter build apk --target-platform android-arm64
echo "Building Web..."
flutter build web --base-href=/freemans-score-card/
echo "Building iOS IPA..."
# Note: This requires a valid provisioning profile and code signing identity.
flutter build ipa --release
echo "Building macOS..."
flutter build macos --release
elif [[ "$OSTYPE" == "linux-gnu" || "$OS" =~ MINGW.* || "$OS" =~ CYGWIN.* || "$OS" =~ MSYS.* ]]; then
# this worked for gitbash on windows 11 at 2026-02-11
# this may fail with fvm
echo "Running Windows build steps..."
echo "Cleaning..."
flutter clean
echo "Building Android APK..."
flutter build apk --target-platform android-arm64
echo "Building Web..."
flutter build web --base-href=/freemans-score-card/
echo "Building Windows..."
flutter build windows
echo "Installing MSIX creator tool (Flutter Pub)..."
flutter pub run msix:create
echo "Creating MSIX (Dart Run)..."
dart run msix:create
else
echo "Unsupported OS: $OS"
exit 1
fi
echo "Build script completed."