From a49594a2366317ecfbf3078f2573c410cc51ad0b Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Tue, 15 Nov 2022 13:24:09 +0100 Subject: [PATCH] chore: example run script updates (#1128) Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> --- flutter/example/.gitignore | 3 --- flutter/example/pubspec.yaml | 5 +++-- flutter/example/run.sh | 41 ++++++++-------------------------- flutter/example/web/index.html | 6 +++-- 4 files changed, 16 insertions(+), 39 deletions(-) diff --git a/flutter/example/.gitignore b/flutter/example/.gitignore index f3c205341e..955a348605 100644 --- a/flutter/example/.gitignore +++ b/flutter/example/.gitignore @@ -31,9 +31,6 @@ .pub/ /build/ -# Web related -lib/generated_plugin_registrant.dart - # Symbolication related app.*.symbols diff --git a/flutter/example/pubspec.yaml b/flutter/example/pubspec.yaml index b12abf7fee..51fbf7d6b5 100644 --- a/flutter/example/pubspec.yaml +++ b/flutter/example/pubspec.yaml @@ -33,9 +33,10 @@ flutter: - assets/sentry-wordmark.png sentry: - upload_native_symbols: false + upload_native_symbols: true upload_source_maps: true + include_native_sources: true project: sentry-flutter org: sentry-sdks - log_level: error wait_for_processing: true + commits: true diff --git a/flutter/example/run.sh b/flutter/example/run.sh index 1d87c5570f..d40bc89df2 100755 --- a/flutter/example/run.sh +++ b/flutter/example/run.sh @@ -6,11 +6,6 @@ set -euo pipefail # Or try out the Alpha version of the Sentry Dart Plugin that does it automatically for you, feedback is welcomed. # https://github.com/getsentry/sentry-dart-plugin -export SENTRY_PROJECT=sentry-flutter -export SENTRY_ORG=sentry-sdks -export SENTRY_LOG_LEVEL=info -export OUTPUT_FOLDER_WEB=./build/web/ - export SENTRY_RELEASE=$(date +%Y-%m-%d_%H-%M-%S) echo -e "[\033[92mrun\033[0m] $1" @@ -28,10 +23,12 @@ elif [ "$1" == "android" ]; then launchCmd='adb shell am start -n io.sentry.samples.flutter/io.sentry.samples.flutter.MainActivity' echo -e "[\033[92mrun\033[0m] Android app installed" elif [ "$1" == "web" ]; then - # Uses dart2js flutter build web --dart-define=SENTRY_RELEASE=$SENTRY_RELEASE --source-maps - ls -lah $OUTPUT_FOLDER_WEB - echo -e "[\033[92mrun\033[0m] Built: $OUTPUT_FOLDER_WEB" + buildDir='./build/web/' + port='8132' + ls -lah $buildDir + echo -e "[\033[92mrun\033[0m] Built: $buildDir" + launchCmd="bash -c '( sleep 3 ; open http://127.0.0.1:$port ) & python3 -m http.server --directory $buildDir $port'" elif [ "$1" == "macos" ]; then flutter build macos --split-debug-info=$symbolsDir --obfuscate launchCmd='./build/macos/Build/Products/Release/sentry_flutter_example.app/Contents/MacOS/sentry_flutter_example' @@ -41,30 +38,10 @@ else else echo -e "[\033[92mrun\033[0m] $1 isn't supported" fi - exit + exit 1 fi -if [ "$1" == "web" ]; then - echo -e "[\033[92mrun\033[0m] Uploading sourcemaps for $SENTRY_RELEASE" - sentry-cli releases new $SENTRY_RELEASE - - sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps . \ - --ext dart - - pushd $OUTPUT_FOLDER_WEB - sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps . \ - --ext map \ - --ext js - - sentry-cli releases finalize $SENTRY_RELEASE +dart run sentry_dart_plugin - python3 -m http.server 8132 - popd -else - # 'symbols' directory contains the Dart debug info files but to include platform-specific ones, use the whole build dir instead. - echo -e "[\033[92mrun\033[0m] Uploading debug information files" - sentry-cli upload-dif --wait --org $SENTRY_ORG --project $SENTRY_PROJECT build - - echo "Starting the built app: $($launchCmd)" - $launchCmd -fi +echo "Starting the built app: $launchCmd" +eval $launchCmd diff --git a/flutter/example/web/index.html b/flutter/example/web/index.html index 8b90121e83..bb05091b9c 100644 --- a/flutter/example/web/index.html +++ b/flutter/example/web/index.html @@ -1,5 +1,6 @@ +
@@ -12,12 +13,12 @@ - +