@@ -6,11 +6,6 @@ set -euo pipefail
66# Or try out the Alpha version of the Sentry Dart Plugin that does it automatically for you, feedback is welcomed.
77# https://github.com/getsentry/sentry-dart-plugin
88
9- export SENTRY_PROJECT=sentry-flutter
10- export SENTRY_ORG=sentry-sdks
11- export SENTRY_LOG_LEVEL=info
12- export OUTPUT_FOLDER_WEB=./build/web/
13-
149export SENTRY_RELEASE=$( date +%Y-%m-%d_%H-%M-%S)
1510
1611echo -e " [\033[92mrun\033[0m] $1 "
@@ -28,10 +23,12 @@ elif [ "$1" == "android" ]; then
2823 launchCmd=' adb shell am start -n io.sentry.samples.flutter/io.sentry.samples.flutter.MainActivity'
2924 echo -e " [\033[92mrun\033[0m] Android app installed"
3025elif [ " $1 " == " web" ]; then
31- # Uses dart2js
3226 flutter build web --dart-define=SENTRY_RELEASE=$SENTRY_RELEASE --source-maps
33- ls -lah $OUTPUT_FOLDER_WEB
34- echo -e " [\033[92mrun\033[0m] Built: $OUTPUT_FOLDER_WEB "
27+ buildDir=' ./build/web/'
28+ port=' 8132'
29+ ls -lah $buildDir
30+ echo -e " [\033[92mrun\033[0m] Built: $buildDir "
31+ launchCmd=" bash -c '( sleep 3 ; open http://127.0.0.1:$port ) & python3 -m http.server --directory $buildDir $port '"
3532elif [ " $1 " == " macos" ]; then
3633 flutter build macos --split-debug-info=$symbolsDir --obfuscate
3734 launchCmd=' ./build/macos/Build/Products/Release/sentry_flutter_example.app/Contents/MacOS/sentry_flutter_example'
4138 else
4239 echo -e " [\033[92mrun\033[0m] $1 isn't supported"
4340 fi
44- exit
41+ exit 1
4542fi
4643
47- if [ " $1 " == " web" ]; then
48- echo -e " [\033[92mrun\033[0m] Uploading sourcemaps for $SENTRY_RELEASE "
49- sentry-cli releases new $SENTRY_RELEASE
50-
51- sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps . \
52- --ext dart
53-
54- pushd $OUTPUT_FOLDER_WEB
55- sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps . \
56- --ext map \
57- --ext js
58-
59- sentry-cli releases finalize $SENTRY_RELEASE
44+ dart run sentry_dart_plugin
6045
61- python3 -m http.server 8132
62- popd
63- else
64- # 'symbols' directory contains the Dart debug info files but to include platform-specific ones, use the whole build dir instead.
65- echo -e " [\033[92mrun\033[0m] Uploading debug information files"
66- sentry-cli upload-dif --wait --org $SENTRY_ORG --project $SENTRY_PROJECT build
67-
68- echo " Starting the built app: $( $launchCmd ) "
69- $launchCmd
70- fi
46+ echo " Starting the built app: $launchCmd "
47+ eval $launchCmd
0 commit comments