Skip to content

Commit

Permalink
Merge pull request #141 from bugsnag/releases/v2.1.0
Browse files Browse the repository at this point in the history
v2.1.0
  • Loading branch information
lemnik committed Jun 14, 2022
2 parents 9314bf8 + f283b3d commit c276b67
Show file tree
Hide file tree
Showing 43 changed files with 959 additions and 115 deletions.
155 changes: 137 additions & 18 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,54 @@
agents:
queue: opensource-arm-mac-cocoa-12
queue: macos-12-arm

steps:

- label: ":test_tube:"
- label: ":test_tube: 2.5.0"
timeout_in_minutes: 10
env:
FLUTTER_BIN: "/opt/flutter/2.5.0/bin/flutter"
commands:
- make test

- label: ":lint-roller:"
- label: ":test_tube: 3.0.1"
timeout_in_minutes: 10
env:
FLUTTER_BIN: "/opt/flutter/3.0.1/bin/flutter"
commands:
- make test

- label: ":lint-roller: 2.5.0"
timeout_in_minutes: 10
env:
FLUTTER_BIN: "/opt/flutter/2.5.0/bin/flutter"
commands:
- make lint

- label: Build Example App
- label: ":lint-roller: 3.0.1"
timeout_in_minutes: 10
env:
FLUTTER_BIN: "/opt/flutter/3.0.1/bin/flutter"
commands:
- make lint

- label: Build Example App 2.5.0
timeout_in_minutes: 10
env:
FLUTTER_BIN: "/opt/flutter/2.5.0/bin/flutter"
commands:
- pod repo update
- make example
# Verify that App.framework's UUID (and therefore our `codeIdentifier`) changes when Dart code is touched
- dwarfdump --arch=arm64 --uuid example/build/ios/iphoneos/Runner.app/Frameworks/App.framework/App | tee uuid_before
- sed -i '' -e 's/add_your_api_key_here/my_api_key/' example/lib/main.dart
- make example
- dwarfdump --arch=arm64 --uuid example/build/ios/iphoneos/Runner.app/Frameworks/App.framework/App | tee uuid_after
- test "$(cat uuid_before)" != "$(cat uuid_after)"

- label: Build Example App 3.0.1
timeout_in_minutes: 10
env:
FLUTTER_BIN: "/opt/flutter/3.0.1/bin/flutter"
commands:
- pod repo update
- make example
Expand All @@ -28,30 +62,73 @@ steps:
#
# iOS
#
- label: Build iOS Test Fixture
key: ios-fixture
- label: Build iOS Test Fixture 2.5.0
key: "ios-fixture-2-8-1"
timeout_in_minutes: 20
env:
FLUTTER_BIN: "/opt/flutter/2.5.0/bin/flutter"
commands:
- pod repo update trunk
- features/scripts/build_ios_app.sh
plugins:
artifacts#v1.5.0:
upload:
from: "features/fixtures/app/build/ios/ipa/app.ipa"
to: "features/fixtures/app/build/ios/ipa/app-2.5.0.ipa"

- label: Build iOS Test Fixture 3.0.1
key: "ios-fixture-3-0-1"
timeout_in_minutes: 20
env:
FLUTTER_BIN: "/opt/flutter/3.0.1/bin/flutter"
commands:
- pod repo update trunk
- features/scripts/build_ios_app.sh
plugins:
artifacts#v1.5.0:
upload: "features/fixtures/app/build/ios/ipa/app.ipa"
upload:
from: "features/fixtures/app/build/ios/ipa/app.ipa"
to: "features/fixtures/app/build/ios/ipa/app-3.0.1.ipa"

- label: 'iOS 14 end-to-end tests 2.5.0'
depends_on: "ios-fixture-2-8-1"
timeout_in_minutes: 10
env:
FLUTTER_BIN: "/opt/flutter/2.5.0/bin/flutter"
agents:
queue: opensource
plugins:
artifacts#v1.5.0:
download: "features/fixtures/app/build/ios/ipa/app-2.5.0.ipa"
upload: "maze_output/failed/**/*"
docker-compose#v3.7.0:
pull: maze-runner
run: maze-runner
command:
- "--app=/app/features/fixtures/app/build/ios/ipa/app-2.5.0.ipa"
- "--farm=bs"
- "--device=IOS_14"
- "--fail-fast"
concurrency: 24
concurrency_group: 'browserstack-app'
concurrency_method: eager

- label: 'iOS 14 end-to-end tests'
depends_on: "ios-fixture"
- label: 'iOS 14 end-to-end tests 3.0.1'
depends_on: "ios-fixture-3-0-1"
timeout_in_minutes: 10
env:
FLUTTER_BIN: "/opt/flutter/3.0.1/bin/flutter"
agents:
queue: opensource
plugins:
artifacts#v1.5.0:
download: "features/fixtures/app/build/ios/ipa/app.ipa"
download: "features/fixtures/app/build/ios/ipa/app-3.0.1.ipa"
upload: "maze_output/failed/**/*"
docker-compose#v3.7.0:
pull: maze-runner
run: maze-runner
command:
- "--app=/app/features/fixtures/app/build/ios/ipa/app.ipa"
- "--app=/app/features/fixtures/app/build/ios/ipa/app-3.0.1.ipa"
- "--farm=bs"
- "--device=IOS_14"
- "--fail-fast"
Expand All @@ -62,29 +139,71 @@ steps:
#
# Android
#
- label: Build Android Test Fixture
key: android-fixture
- label: Build Android Test Fixture 2.5.0
key: "android-fixture-2-8-1"
timeout_in_minutes: 20
env:
FLUTTER_BIN: "/opt/flutter/2.5.0/bin/flutter"
commands:
- features/scripts/build_android_app.sh
plugins:
artifacts#v1.5.0:
upload:
from: "features/fixtures/app/build/app/outputs/flutter-apk/app-release.apk"
to: "features/fixtures/app/build/app/outputs/flutter-apk/app-release-2.5.0.apk"

- label: Build Android Test Fixture 3.0.1
key: "android-fixture-3-0-1"
timeout_in_minutes: 20
env:
FLUTTER_BIN: "/opt/flutter/3.0.1/bin/flutter"
commands:
- features/scripts/build_android_app.sh
plugins:
artifacts#v1.5.0:
upload: "features/fixtures/app/build/app/outputs/flutter-apk/app-release.apk"
upload:
from: "features/fixtures/app/build/app/outputs/flutter-apk/app-release.apk"
to: "features/fixtures/app/build/app/outputs/flutter-apk/app-release-3.0.1.apk"

- label: 'Android 12 end-to-end tests 2.5.0'
depends_on: "android-fixture-2-8-1"
timeout_in_minutes: 10
env:
FLUTTER_BIN: "/opt/flutter/2.5.0/bin/flutter"
agents:
queue: opensource
plugins:
artifacts#v1.5.0:
download: "features/fixtures/app/build/app/outputs/flutter-apk/app-release-2.5.0.apk"
upload: "maze_output/failed/**/*"
docker-compose#v3.7.0:
pull: maze-runner
run: maze-runner
command:
- "--app=/app/features/fixtures/app/build/app/outputs/flutter-apk/app-release-2.5.0.apk"
- "--farm=bs"
- "--device=ANDROID_12_0"
- "--fail-fast"
concurrency: 24
concurrency_group: 'browserstack-app'
concurrency_method: eager

- label: 'Android 12 end-to-end tests'
depends_on: "android-fixture"
- label: 'Android 12 end-to-end tests 3.0.1'
depends_on: "android-fixture-3-0-1"
timeout_in_minutes: 10
env:
FLUTTER_BIN: "/opt/flutter/3.0.1/bin/flutter"
agents:
queue: opensource
plugins:
artifacts#v1.5.0:
download: "features/fixtures/app/build/app/outputs/flutter-apk/app-release.apk"
download: "features/fixtures/app/build/app/outputs/flutter-apk/app-release-3.0.1.apk"
upload: "maze_output/failed/**/*"
docker-compose#v3.7.0:
pull: maze-runner
run: maze-runner
command:
- "--app=/app/features/fixtures/app/build/app/outputs/flutter-apk/app-release.apk"
- "--app=/app/features/fixtures/app/build/app/outputs/flutter-apk/app-release-3.0.1.apk"
- "--farm=bs"
- "--device=ANDROID_12_0"
- "--fail-fast"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2.1.0 (2022-06-14)

- Networking breadcrumbs can now be easily captured by using the `bugsnag_breadcrumbs_http` or `bugsnag_breadcrumbs_dart_io` packages
[#116](https://github.com/bugsnag/bugsnag-flutter/pull/116)
[#115](https://github.com/bugsnag/bugsnag-flutter/pull/115)
- Added `BugsnagNavigatorObserver` to automatically log navigation breadcrumbs and context
- Column numbers will be captured as `null` instead of `-1` when they're not available
[#139](https://github.com/bugsnag/bugsnag-flutter/pull/139)

## 2.0.2 (2022-05-30)

- Prefixed all class named with 'Bugsnag' to avoid clashing with application code.
Expand Down
59 changes: 41 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FLUTTER_BIN?=flutter

all: format build lint test

.PHONY: clean build bump aar example test format lint e2e_android_local e2e_ios_local

clean:
cd packages/bugsnag_flutter && flutter clean --suppress-analytics
cd example && flutter clean --suppress-analytics && \
cd packages/bugsnag_flutter && $(FLUTTER_BIN) clean --suppress-analytics
cd packages/bugsnag_breadcrumbs_dart_io && $(FLUTTER_BIN) clean --suppress-analytics
cd packages/bugsnag_breadcrumbs_http && $(FLUTTER_BIN) clean --suppress-analytics
cd example && $(FLUTTER_BIN) clean --suppress-analytics && \
rm -rf .idea bugsnag_flutter_example.iml \
ios/{Pods,.symlinks,Podfile.lock} \
ios/{Runner.xcworkspace,Runner.xcodeproj,Runner.xcodeproj/project.xcworkspace}/xcuserdata \
Expand All @@ -19,47 +23,66 @@ ifeq ($(VERSION),)
endif
sed -i '' "s/## TBD/## $(VERSION) ($(shell date '+%Y-%m-%d'))/" CHANGELOG.md
sed -i '' "s/^version: .*/version: $(VERSION)/" packages/bugsnag_flutter/pubspec.yaml
sed -i '' "s/^version: .*/version: $(VERSION)/" packages/bugsnag_breadcrumbs_dart_io/pubspec.yaml
sed -i '' "s/^version: .*/version: $(VERSION)/" packages/bugsnag_breadcrumbs_http/pubspec.yaml
sed -i '' "s/^ 'version': .*/ 'version': '$(VERSION)'/" packages/bugsnag_flutter/lib/src/client.dart

stage: clean
mkdir staging
cd packages/bugsnag_flutter && cp -a . ../../staging/
rm -f staging/pubspec.lock
cp -r example staging/example
cp README.md staging/.
cp LICENSE staging/.
cp CHANGELOG.md staging/.
sed -i '' -e '1,2d' staging/CHANGELOG.md
staging/bugsnag_flutter:
mkdir -p staging/bugsnag_flutter
cd packages/bugsnag_flutter && cp -a . ../../staging/bugsnag_flutter
rm -f staging/bugsnag_flutter/pubspec.lock
cp -r example staging/bugsnag_flutter/example
cp README.md staging/bugsnag_flutter/.
cp LICENSE staging/bugsnag_flutter/.
cp CHANGELOG.md staging/bugsnag_flutter/.
sed -i '' -e '1,2d' staging/bugsnag_flutter/CHANGELOG.md

BSG_FLUTTER_VERSION:=$(shell grep 'version: ' packages/bugsnag_flutter/pubspec.yaml | grep -o '[0-9].*')
staging/%:
mkdir -p staging/$*
cd packages/$* && cp -a . ../../staging/$*
rm -f staging/$*/pubspec.lock
cp LICENSE staging/$*/.
cp CHANGELOG.md staging/$*/.
sed -i '' -e '1,2d' staging/$*/CHANGELOG.md
# Replace the path references to bugsnag_flutter with version-based references, and allow publishing (strip lines with 'publish_to: none')
sed -i '' "s/^ bugsnag_flutter:.*/ bugsnag_flutter: ^$(BSG_FLUTTER_VERSION)/" staging/$*/pubspec.yaml
sed -i '' "s/path:.*/ /;s/publish_to: none/ /" staging/$*/pubspec.yaml

stage: clean staging/bugsnag_flutter staging/bugsnag_breadcrumbs_dart_io staging/bugsnag_breadcrumbs_http

aar:
cd packages/bugsnag_flutter && flutter build aar --suppress-analytics
cd packages/bugsnag_flutter && $(FLUTTER_BIN) build aar --suppress-analytics

example:
cd example && flutter build apk --suppress-analytics && flutter build ios --no-codesign --suppress-analytics
cd example && $(FLUTTER_BIN) build apk --suppress-analytics && $(FLUTTER_BIN) build ios --no-codesign --suppress-analytics

test:
cd packages/bugsnag_flutter && flutter test -r expanded --suppress-analytics
cd packages/bugsnag_flutter && $(FLUTTER_BIN) test -r expanded --suppress-analytics
cd packages/bugsnag_breadcrumbs_http && $(FLUTTER_BIN) test -r expanded --suppress-analytics

test-fixtures: ## Build the end-to-end test fixtures
@./features/scripts/build_ios_app.sh
@./features/scripts/build_android_app.sh

format:
flutter format packages/bugsnag_flutter example features/fixtures/app
$(FLUTTER_BIN) format packages/bugsnag_flutter example features/fixtures/app

lint:
cd packages/bugsnag_flutter && flutter analyze --suppress-analytics
cd packages/bugsnag_flutter && $(FLUTTER_BIN) analyze --suppress-analytics
cd packages/bugsnag_breadcrumbs_dart_io && $(FLUTTER_BIN) analyze --suppress-analytics
cd packages/bugsnag_breadcrumbs_http && $(FLUTTER_BIN) analyze --suppress-analytics

e2e_android_local: features/fixtures/app/build/app/outputs/flutter-apk/app-release.apk
$(HOME)/Library/Android/sdk/platform-tools/adb uninstall com.bugsnag.flutter.test.app || true
bundle exec maze-runner --app=$< --farm=local --os=android --os-version=10 $(FEATURES)

features/fixtures/app/build/app/outputs/flutter-apk/app-release.apk: $(shell find packages/bugsnag_flutter features/fixtures/app/android/app/src features/fixtures/app/lib -type f)
cd features/fixtures/app && flutter build apk
cd features/fixtures/app && $(FLUTTER_BIN) build apk

e2e_ios_local: features/fixtures/app/build/ios/ipa/app.ipa
ideviceinstaller --uninstall com.bugsnag.flutter.test.app
bundle exec maze-runner --app=$< --farm=local --os=ios --os-version=15 --apple-team-id=372ZUL2ZB7 --udid="$(shell idevice_id -l)" $(FEATURES)

features/fixtures/app/build/ios/ipa/app.ipa: $(shell find packages/bugsnag_flutter features/fixtures/app/ios/Runner features/fixtures/app/lib -type f)
cd features/fixtures/app && flutter build ipa --export-options-plist=ios/exportOptions.plist
cd features/fixtures/app && $(FLUTTER_BIN) build ipa --export-options-plist=ios/exportOptions.plist
4 changes: 3 additions & 1 deletion docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Releasing
- Run `git clean -df` to ensure no unexpected files make it into the release
- Creating the staged release: `make stage`
- Publish the new version to pub.dev:
- `cd staging && flutter pub publish`
- `cd staging/bugsnag_flutter && flutter pub publish`
- `cd staging/bugsnag_breadcrumbs_dart_io && flutter pub publish`
- `cd staging/bugsnag_breadcrumbs_http && flutter pub publish`
- Release on GitHub:
- Create a release and tag from `main`
on [GitHub Releases](https://github.com/bugsnag/bugsnag-flutter/releases)
Expand Down
6 changes: 3 additions & 3 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion flutter.hasProperty('compileSdkVersion') ? flutter.compileSdkVersion : 30

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -34,8 +34,8 @@ android {

defaultConfig {
applicationId "com.bugsnag.examples.flutter"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
minSdkVersion flutter.hasProperty('minSdkVersion') ? flutter.minSdkVersion : 16
targetSdkVersion flutter.hasProperty('targetSdkVersion') ? flutter.targetSdkVersion : 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
1 change: 0 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
package="com.bugsnag.examples.flutter">

<application
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:label="Bugsnag Flutter Example">
<activity
Expand Down
Loading

0 comments on commit c276b67

Please sign in to comment.