diff --git a/.buildkite/block.yml b/.buildkite/block.yml new file mode 100644 index 00000000..4a5d69e4 --- /dev/null +++ b/.buildkite/block.yml @@ -0,0 +1,11 @@ +agents: + queue: macos + +steps: + - block: 'Trigger a full build' + key: 'trigger-full-build' + + - label: 'Upload the full test pipeline' + depends_on: 'trigger-full-build' + timeout_in_minutes: 2 + command: buildkite-agent pipeline upload .buildkite/pipeline.full.yml diff --git a/.buildkite/pipeline.full.yml b/.buildkite/pipeline.full.yml index 47251e16..b6c0e5b2 100644 --- a/.buildkite/pipeline.full.yml +++ b/.buildkite/pipeline.full.yml @@ -1,303 +1,14 @@ agents: - queue: macos-12-arm + queue: macos steps: - # - # Build Plugins - # - - # Unreal Engine 5.0 - macOS - - label: 'Build Plugin - 5.0 Mac' - env: - UE_VERSION: "5.0" - DEVELOPER_DIR: "/Applications/Xcode13.2.1.app" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - make package - plugins: - artifacts#v1.5.0: - upload: - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - artifact_paths: [ Build/Plugin/*.zip ] - timeout_in_minutes: 60 - key: plugin_5_0 - - - label: 'Build Plugin - 5.1 Mac' - env: - UE_VERSION: "5.1" - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - make package - plugins: - artifacts#v1.5.0: - upload: - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - artifact_paths: [ Build/Plugin/*.zip ] - timeout_in_minutes: 60 - key: plugin_5_1 - - # - # Build Test Fixtures - # - - # Unreal Engine 5.0 - Android - - name: ':android: Build E2E - 5.0 Android' - depends_on: plugin_5_0 - env: - UE_VERSION: "5.0" - DEVELOPER_DIR: "/Applications/Xcode13.2.1.app" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_5.0-macOS.zip - upload: - - build/TestFixture-Android-Shipping-5.0-arm64.apk - - build/TestFixture-Android-Shipping-5.0-armv7.apk - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh Android - timeout_in_minutes: 60 - key: android_fixture_5_0 - - # Unreal Engine 5.0 - iOS - - name: ':ios: Build E2E - 5.0 iOS' - depends_on: plugin_5_0 - env: - UE_VERSION: "5.0" - DEVELOPER_DIR: "/Applications/Xcode13.2.1.app" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_5.0-macOS.zip - upload: - - build/TestFixture-IOS-Shipping-5.0.dSYM - - build/TestFixture-IOS-Shipping-5.0.ipa - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh IOS - timeout_in_minutes: 60 - key: ios_fixture_5_0 - - # Unreal Engine 5.0 - macOS - - name: ':mac: Build E2E - 5.0 macOS' - depends_on: plugin_5_0 - env: - UE_VERSION: "5.0" - DEVELOPER_DIR: "/Applications/Xcode13.2.1.app" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_5.0-macOS.zip - upload: - - TestFixture-macOS-5.0.zip - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh Mac - timeout_in_minutes: 90 - key: mac_fixture_5_0 - - - # Unreal Engine 5.1 - Android - - name: ':android: Build E2E - 5.1 Android' - depends_on: plugin_5_1 - env: - UE_VERSION: "5.1" - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_5.1-macOS.zip - upload: - - build/TestFixture-Android-Shipping-5.1-arm64.apk - - build/TestFixture-Android-Shipping-5.1-armv7.apk - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - label: 'Append Unreal 5.5 Pipeline' + timeout_in_minutes: 2 commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh Android - timeout_in_minutes: 60 - key: android_fixture_5_1 + - buildkite-agent pipeline upload .buildkite/unreal.5.5.yml - # Unreal Engine 5.1 - iOS - - name: ':ios: Build E2E - 5.1 iOS' - depends_on: plugin_5_1 - env: - UE_VERSION: "5.1" - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_5.1-macOS.zip - upload: - - build/TestFixture-IOS-Shipping-5.1.dSYM - - build/TestFixture-IOS-Shipping-5.1.ipa - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - label: 'Append Unreal 5.6 Pipeline' + timeout_in_minutes: 2 commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh IOS - timeout_in_minutes: 60 - key: ios_fixture_5_1 + - buildkite-agent pipeline upload .buildkite/unreal.5.6.yml - # Unreal Engine 5.1 - macOS - - name: ':mac: Build E2E - 5.1 macOS' - depends_on: plugin_5_1 - env: - UE_VERSION: "5.1" - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_5.1-macOS.zip - upload: - - TestFixture-macOS-5.1.zip - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh Mac - timeout_in_minutes: 90 - key: mac_fixture_5_1 - - # - # E2E Tests - # - - # Unreal Engine 5.0 - Android - - label: 'E2E Tests - 5.0 Android 11' - depends_on: android_fixture_5_0 - timeout_in_minutes: 30 - agents: - queue: opensource - plugins: - artifacts#v1.3.0: - download: - - build/TestFixture-Android-Shipping-5.0-arm64.apk - upload: ["maze_output/failed/**/*"] - docker-compose#v3.3.0: - run: maze-runner - command: - - "--app=/app/build/TestFixture-Android-Shipping-5.0-arm64.apk" - - "--device=ANDROID_11" - - "--farm=bs" - - "--order=random" - concurrency: 5 - concurrency_group: browserstack-app - concurrency_method: eager - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - - # Unreal Engine 5.0 - iOS - - label: 'E2E Tests - 5.0 iOS 12' - depends_on: ios_fixture_5_0 - timeout_in_minutes: 30 - agents: - queue: opensource - plugins: - artifacts#v1.3.0: - download: - - build/TestFixture-IOS-Shipping-5.0.ipa - - build/TestFixture-IOS-Shipping-5.0.dSYM - upload: ["maze_output/failed/**/*"] - docker-compose#v3.3.0: - run: maze-runner - command: - - "--app=/app/build/TestFixture-IOS-Shipping-5.0.ipa" - - "--device=IOS_14" - - "--farm=bs" - - "--order=random" - concurrency: 5 - concurrency_group: browserstack-app - concurrency_method: eager - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - - # Unreal Engine 5.0 - macOS - - label: 'E2E Tests - 5.0 macOS 12' - depends_on: mac_fixture_5_0 - timeout_in_minutes: 10 - plugins: - artifacts#v1.5.0: - download: - - TestFixture-macOS-5.0.zip - upload: ["maze_output/failed/**/*"] - commands: - - echo '--- Extracting test fixture' - - unzip TestFixture-macOS-5.0.zip - - echo '--- Installing dependencies' - - bundle install - - echo '--- Running tests' - - bundle exec maze-runner --os=macos - - # Unreal Engine 5.1 - Android - - label: 'E2E Tests - 5.1 Android 11' - depends_on: android_fixture_5_1 - timeout_in_minutes: 30 - agents: - queue: opensource - plugins: - artifacts#v1.3.0: - download: - - build/TestFixture-Android-Shipping-5.1-arm64.apk - upload: ["maze_output/failed/**/*"] - docker-compose#v3.3.0: - run: maze-runner - command: - - "--app=/app/build/TestFixture-Android-Shipping-5.1-arm64.apk" - - "--device=ANDROID_11" - - "--farm=bs" - - "--order=random" - concurrency: 5 - concurrency_group: browserstack-app - concurrency_method: eager - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - - # Unreal Engine 5.1 - iOS - - label: 'E2E Tests - 5.1 iOS 12' - depends_on: ios_fixture_5_1 - timeout_in_minutes: 30 - agents: - queue: opensource - plugins: - artifacts#v1.3.0: - download: - - build/TestFixture-IOS-Shipping-5.1.ipa - - build/TestFixture-IOS-Shipping-5.1.dSYM - upload: ["maze_output/failed/**/*"] - docker-compose#v3.3.0: - run: maze-runner - command: - - "--app=/app/build/TestFixture-IOS-Shipping-5.1.ipa" - - "--device=IOS_16" - - "--farm=bs" - - "--order=random" - concurrency: 5 - concurrency_group: browserstack-app - concurrency_method: eager - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - - # Unreal Engine 5.1 - macOS - - label: 'E2E Tests - 5.1 macOS 12' - depends_on: mac_fixture_5_1 - timeout_in_minutes: 10 - plugins: - artifacts#v1.5.0: - download: - - TestFixture-macOS-5.1.zip - upload: ["maze_output/failed/**/*"] - commands: - - echo '--- Extracting test fixture' - - unzip TestFixture-macOS-5.1.zip - - echo '--- Installing dependencies' - - bundle install - - echo '--- Running tests' - - bundle exec maze-runner --os=macos - - - name: 'Append Unreal 5.3 Pipeline' - commands: - - buildkite-agent pipeline upload .buildkite/unreal.5.3.yml diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 7abc0e77..7f088b8b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,330 +1,12 @@ agents: - queue: macos-12-arm + queue: macos steps: - # - # Build Plugins - # - -# # Unreal Engine 4.27 - macOS - - label: 'Build Plugin - 4.27 macOS' - env: - UE_VERSION: "4.27" - DEVELOPER_DIR: "/Applications/Xcode13.2.1.app" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - make package - plugins: - artifacts#v1.5.0: - upload: - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - artifact_paths: [ Build/Plugin/*.zip ] - timeout_in_minutes: 60 - key: plugin_4_27 - - # Unreal Engine 5.2 - macOS - - label: 'Build Plugin - 5.2 macOS' - env: - UE_VERSION: "5.2" - DEVELOPER_DIR: "/Applications/Xcode14.app" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - make package - plugins: - artifacts#v1.5.0: - upload: - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - artifact_paths: [Build/Plugin/*.zip] - timeout_in_minutes: 60 - key: plugin_5_2 - -# # Unreal Engine 4.27 - Windows - - label: 'Build Plugin - 4.27 Windows' - agents: - queue: windows-general-wsl - env: - UE_VERSION: "4.27" - command: features/scripts/build-plugin-wsl.sh - artifact_paths: [Bugsnag-*.zip] - timeout_in_minutes: 60 - key: plugin_win_4_27 - - # Unreal Engine 5.2 - Windows - - label: 'Build Plugin - 5.2 Windows' - agents: - queue: windows-general-wsl - env: - UE_VERSION: "5.2" - command: features/scripts/build-plugin-wsl.sh - artifact_paths: [Bugsnag-*.zip] - timeout_in_minutes: 60 - key: plugin_win_5_2 - - # - # Build Test Fixtures - # - - # Unreal Engine 4.27 - Android - - name: ':android: Build E2E - 4.27 Android' - depends_on: plugin_4_27 - env: - UE_VERSION: "4.27" - DEVELOPER_DIR: "/Applications/Xcode13.2.1.app" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_4.27-macOS.zip - upload: - - build/TestFixture-Android-Shipping-4.27-arm64.apk - - build/TestFixture-Android-Shipping-4.27-armv7.apk - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh Android - timeout_in_minutes: 60 - key: android_fixture_4_27 - - # Unreal Engine 4.27 - iOS - - name: ':ios: Build E2E - 4.27 iOS' - depends_on: plugin_4_27 - env: - UE_VERSION: "4.27" - DEVELOPER_DIR: "/Applications/Xcode13.2.1.app" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_4.27-macOS.zip - upload: - - build/TestFixture-IOS-Shipping-4.27.dSYM - - build/TestFixture-IOS-Shipping-4.27.ipa - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh IOS - timeout_in_minutes: 60 - key: ios_fixture_4_27 - - # Unreal Engine 4.27 - macOS - - name: ':mac: Build E2E - 4.27 macOS' - depends_on: plugin_4_27 - env: - UE_VERSION: "4.27" - DEVELOPER_DIR: "/Applications/Xcode13.2.1.app" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_4.27-macOS.zip - upload: - - TestFixture-macOS-4.27.zip - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh Mac - timeout_in_minutes: 90 - key: mac_fixture_4_27 - -# # Unreal Engine 5.2 - Android -# - name: ':android: Build E2E - 5.2 Android' -# depends_on: plugin_5_2 -# env: -# UE_VERSION: "5.2" -# DEVELOPER_DIR: "/Applications/Xcode14.app" -# JAVA_VERSION: "17" -# plugins: -# artifacts#v1.5.0: -# download: Build/Plugin/Bugsnag-*-UE_5.2-macOS.zip -# upload: -# - build/TestFixture-Android-Shipping-5.2-arm64.apk -# - build/TestFixture-Android-Shipping-5.2-armv7.apk -# - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" -# commands: -# - env -# - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" -# - features/scripts/build-fixture.sh Android -# timeout_in_minutes: 60 -# key: android_fixture_5_2 - - # Unreal Engine 5.2 - iOS - - name: ':ios: Build E2E - 5.2 iOS' - depends_on: plugin_5_2 - env: - UE_VERSION: "5.2" - DEVELOPER_DIR: "/Applications/Xcode14.app" - JAVA_VERSION: "17" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_5.2-macOS.zip - upload: - - build/TestFixture-IOS-Shipping-5.2.dSYM - - build/TestFixture-IOS-Shipping-5.2.ipa - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh IOS - timeout_in_minutes: 60 - key: ios_fixture_5_2 - - # Unreal Engine 5.2 - macOS - - name: ':mac: Build E2E - 5.2 macOS' - depends_on: plugin_5_2 - env: - UE_VERSION: "5.2" - DEVELOPER_DIR: "/Applications/Xcode14.app" - JAVA_VERSION: "17" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_5.2-macOS.zip - upload: - - TestFixture-macOS-5.2.zip - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh Mac - timeout_in_minutes: 90 - key: mac_fixture_5_2 - - # - # E2E Tests - # - # Unreal Engine 4.27 - Android - - label: 'E2E Tests - 4.27 Android 11' - depends_on: android_fixture_4_27 - timeout_in_minutes: 30 - agents: - queue: opensource - plugins: - artifacts#v1.3.0: - download: - - build/TestFixture-Android-Shipping-4.27-arm64.apk - upload: ["maze_output/failed/**/*"] - docker-compose#v3.3.0: - run: maze-runner - command: - - "--app=/app/build/TestFixture-Android-Shipping-4.27-arm64.apk" - - "--device=ANDROID_11" - - "--farm=bs" - - "--order=random" - concurrency: 5 - concurrency_group: browserstack-app - concurrency_method: eager - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - - # Unreal Engine 4.27 - iOS - - label: 'E2E Tests - 4.27 iOS 12' - depends_on: ios_fixture_4_27 - timeout_in_minutes: 30 - agents: - queue: opensource - plugins: - artifacts#v1.3.0: - download: - - build/TestFixture-IOS-Shipping-4.27.ipa - - build/TestFixture-IOS-Shipping-4.27.dSYM - upload: ["maze_output/failed/**/*"] - docker-compose#v3.3.0: - run: maze-runner - command: - - "--app=/app/build/TestFixture-IOS-Shipping-4.27.ipa" - - "--device=IOS_12" - - "--farm=bs" - - "--order=random" - concurrency: 5 - concurrency_group: browserstack-app - concurrency_method: eager - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - - # Unreal Engine 4.27 - macOS - - label: 'E2E Tests - 4.27 macOS 12' - depends_on: mac_fixture_4_27 - timeout_in_minutes: 10 - plugins: - artifacts#v1.5.0: - download: - - TestFixture-macOS-4.27.zip - upload: ["maze_output/failed/**/*"] - commands: - - echo '--- Extracting test fixture' - - unzip TestFixture-macOS-4.27.zip - - echo '--- Installing dependencies' - - bundle install - - echo '--- Running tests' - - bundle exec maze-runner --os=macos - -# # Unreal Engine 5.2 - Android -# - label: 'E2E Tests - 5.2 Android 11' -# depends_on: android_fixture_5_2 -# timeout_in_minutes: 30 -# agents: -# queue: opensource -# plugins: -# artifacts#v1.3.0: -# download: -# - build/TestFixture-Android-Shipping-5.2-arm64.apk -# upload: ["maze_output/failed/**/*"] -# docker-compose#v3.3.0: -# run: maze-runner -# command: -# - "--app=/app/build/TestFixture-Android-Shipping-5.2-arm64.apk" -# - "--device=ANDROID_13" -# - "--farm=bs" -# - "--order=random" -# concurrency: 5 -# concurrency_group: browserstack-app -# concurrency_method: eager -# retry: -# automatic: -# - exit_status: -1 # Agent was lost -# limit: 2 - - # Unreal Engine 5.2 - iOS - - label: 'E2E Tests - 5.2 iOS 12' - depends_on: ios_fixture_5_2 - timeout_in_minutes: 30 - agents: - queue: opensource - plugins: - artifacts#v1.3.0: - download: - - build/TestFixture-IOS-Shipping-5.2.ipa - - build/TestFixture-IOS-Shipping-5.2.dSYM - upload: ["maze_output/failed/**/*"] - docker-compose#v3.3.0: - run: maze-runner - command: - - "--app=/app/build/TestFixture-IOS-Shipping-5.2.ipa" - - "--device=IOS_16" - - "--farm=bs" - - "--order=random" - concurrency: 5 - concurrency_group: browserstack-app - concurrency_method: eager - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - - # Unreal Engine 5.2 - macOS - - label: 'E2E Tests - 5.2 macOS 12' - depends_on: mac_fixture_5_2 - timeout_in_minutes: 10 - plugins: - artifacts#v1.5.0: - download: - - TestFixture-macOS-5.2.zip - upload: ["maze_output/failed/**/*"] + - label: 'Append Unreal 5.7 Pipeline' + timeout_in_minutes: 2 commands: - - echo '--- Extracting test fixture' - - unzip TestFixture-macOS-5.2.zip - - echo '--- Installing dependencies' - - bundle install - - echo '--- Running tests' - - bundle exec maze-runner --os=macos + - buildkite-agent pipeline upload .buildkite/unreal.5.7.yml - # - # Conditionally trigger full pipeline - # - label: 'Conditionally trigger full set of tests' + timeout_in_minutes: 2 command: sh -c .buildkite/pipeline_trigger.sh diff --git a/.buildkite/pipeline_trigger.sh b/.buildkite/pipeline_trigger.sh index 09b9ca38..053c9b01 100755 --- a/.buildkite/pipeline_trigger.sh +++ b/.buildkite/pipeline_trigger.sh @@ -7,4 +7,8 @@ if [[ "$BUILDKITE_MESSAGE" == *"[full ci]"* || "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" == "main" ]]; then echo "Running full build" buildkite-agent pipeline upload .buildkite/pipeline.full.yml +else + # Basic build, but allow a full build to be triggered + echo "Running basic build" + buildkite-agent pipeline upload .buildkite/block.yml fi diff --git a/.buildkite/unreal.5.3.yml b/.buildkite/unreal.5.3.yml deleted file mode 100644 index b6542a03..00000000 --- a/.buildkite/unreal.5.3.yml +++ /dev/null @@ -1,145 +0,0 @@ -agents: - queue: macos-13-arm - -steps: - - label: 'Build Plugin - 5.3 Mac' - env: - UE_VERSION: "5.3" - DEVELOPER_DIR: "/Applications/Xcode14.1.app" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - make package - plugins: - artifacts#v1.5.0: - upload: - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - artifact_paths: [ Build/Plugin/*.zip ] - timeout_in_minutes: 60 - key: plugin_5_3 - - # Unreal Engine 5.3 - Android - - name: ':android: Build E2E - 5.3 Android' - depends_on: plugin_5_3 - env: - UE_VERSION: "5.3" - DEVELOPER_DIR: "/Applications/Xcode14.1.app" - JAVA_VERSION: 17 - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_5.3-macOS.zip - upload: - - build/TestFixture-Android-Shipping-5.3-arm64.apk - - build/TestFixture-Android-Shipping-5.3-armv7.apk - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh Android - timeout_in_minutes: 60 - key: android_fixture_5_3 - - # Unreal Engine 5.3 - iOS - - name: ':ios: Build E2E - 5.3 iOS' - depends_on: plugin_5_3 - env: - UE_VERSION: "5.3" - DEVELOPER_DIR: "/Applications/Xcode14.1.app" - plugins: - artifacts#v1.5.0: - download: Build/Plugin/Bugsnag-*-UE_5.3-macOS.zip - upload: - - build/TestFixture-IOS-Shipping-5.3.dSYM - - build/TestFixture-IOS-Shipping-5.3.ipa - - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - commands: - - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - - features/scripts/build-fixture.sh IOS - timeout_in_minutes: 60 - key: ios_fixture_5_3 - - # # Unreal Engine 5.3 - macOS - # - name: ':mac: Build E2E - 5.3 macOS' - # depends_on: plugin_5_3 - # env: - # UE_VERSION: "5.3" - # DEVELOPER_DIR: "/Applications/Xcode14.1.app" - # plugins: - # artifacts#v1.5.0: - # download: Build/Plugin/Bugsnag-*-UE_5.3-macOS.zip - # upload: - # - TestFixture-macOS-5.3.zip - # - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - # commands: - # - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" - # - features/scripts/build-fixture.sh Mac - # timeout_in_minutes: 90 - # key: mac_fixture_5_3 - - # Unreal Engine 5.3 - Android - - label: 'E2E Tests - 5.3 Android 11' - depends_on: android_fixture_5_3 - timeout_in_minutes: 30 - agents: - queue: opensource - plugins: - artifacts#v1.3.0: - download: - - build/TestFixture-Android-Shipping-5.3-arm64.apk - upload: ["maze_output/failed/**/*"] - docker-compose#v3.3.0: - run: maze-runner - command: - - "--app=/app/build/TestFixture-Android-Shipping-5.3-arm64.apk" - - "--device=ANDROID_11" - - "--farm=bs" - - "--order=random" - concurrency: 5 - concurrency_group: browserstack-app - concurrency_method: eager - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - - # Unreal Engine 5.3 - iOS - - label: 'E2E Tests - 5.3 iOS 12' - depends_on: ios_fixture_5_3 - timeout_in_minutes: 30 - agents: - queue: opensource - plugins: - artifacts#v1.3.0: - download: - - build/TestFixture-IOS-Shipping-5.3.ipa - - build/TestFixture-IOS-Shipping-5.3.dSYM - upload: ["maze_output/failed/**/*"] - docker-compose#v3.3.0: - run: maze-runner - command: - - "--app=/app/build/TestFixture-IOS-Shipping-5.3.ipa" - - "--device=IOS_16" - - "--farm=bs" - - "--order=random" - concurrency: 5 - concurrency_group: browserstack-app - concurrency_method: eager - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - - # Unreal Engine 5.3 - macOS - # - label: 'E2E Tests - 5.3 macOS 12' - # depends_on: mac_fixture_5_3 - # timeout_in_minutes: 10 - # plugins: - # artifacts#v1.5.0: - # download: - # - TestFixture-macOS-5.3.zip - # upload: ["maze_output/failed/**/*"] - # commands: - # - echo '--- Extracting test fixture' - # - unzip TestFixture-macOS-5.3.zip - # - echo '--- Installing dependencies' - # - bundle install - # - echo '--- Running tests' - # - bundle exec maze-runner --os=macos diff --git a/.buildkite/unreal.5.5.yml b/.buildkite/unreal.5.5.yml new file mode 100644 index 00000000..56bb7ea0 --- /dev/null +++ b/.buildkite/unreal.5.5.yml @@ -0,0 +1,174 @@ +agents: + queue: macos-14 + +steps: + - group: ":hammer: Builds UE 5.5" + steps: + - label: ":macos: Build Plugin - 5.5" + agents: + queue: macos-14-isolated + env: + UE_VERSION: "5.5" + XCODE_VERSION: "15.3.0" + JAVA_VERSION: "11" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - make package + plugins: + artifacts#v1.5.0: + upload: + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + artifact_paths: + - Build/Plugin/*.zip + timeout_in_minutes: 30 + key: plugin_5_5 + + - label: ":android: Build E2E - 5.5" + agents: + queue: macos-14-isolated + depends_on: plugin_5_5 + env: + UE_VERSION: "5.5" + XCODE_VERSION: "15.4.0" + JAVA_VERSION: "17" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - features/scripts/build-fixture.sh Android + plugins: + artifacts#v1.5.0: + download: Build/Plugin/Bugsnag-*-UE_5.5-macOS.zip + upload: + - build/TestFixture-Android-Shipping-5.5-arm64.apk + - build/TestFixture-Android-Shipping-5.5-armv7.apk + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + timeout_in_minutes: 30 + key: android_fixture_5_5 + + - label: ":ios: Build E2E - 5.5" + agents: + queue: macos-14-isolated + depends_on: plugin_5_5 + env: + UE_VERSION: "5.5" + XCODE_VERSION: "15.4.0" + JAVA_VERSION: "17" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - features/scripts/build-fixture.sh IOS + plugins: + artifacts#v1.5.0: + download: Build/Plugin/Bugsnag-*-UE_5.5-macOS.zip + upload: + - build/TestFixture-IOS-Shipping-5.5.ipa + - build/TestFixture-IOS-Shipping-5.5-file.dSYM + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + timeout_in_minutes: 30 + key: ios_fixture_5_5 + + - label: ":mac: Build E2E - 5.5" + agents: + queue: macos-14-isolated + depends_on: plugin_5_5 + env: + UE_VERSION: "5.5" + XCODE_VERSION: "15.4.0" + JAVA_VERSION: "17" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - features/scripts/build-fixture.sh Mac + plugins: + artifacts#v1.5.0: + download: Build/Plugin/Bugsnag-*-UE_5.5-macOS.zip + upload: + - TestFixture-macOS-5.5.zip + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + timeout_in_minutes: 30 + key: mac_fixture_5_5 + + - group: ":test_tube: E2E Tests UE 5.5" + steps: + - label: ":android: E2E Tests - 5.5 Android 11" + depends_on: android_fixture_5_5 + agents: + queue: opensource + timeout_in_minutes: 30 + plugins: + artifacts#v1.3.0: + download: + - build/TestFixture-Android-Shipping-5.5-arm64.apk + upload: + - "maze_output/**/*" + docker-compose#v3.3.0: + run: maze-runner + command: + - "--app=/app/build/TestFixture-Android-Shipping-5.5-arm64.apk" + - "--device=ANDROID_11" + - "--farm=bs" + - "--order=random" + - "--appium-version=1.22.0" + test-collector#v1.10.2: + files: "reports/TEST-*.xml" + format: "junit" + branch: "^main|next$$" + concurrency: 5 + concurrency_group: browserstack-app + concurrency_method: eager + retry: + automatic: + - exit_status: -1 + limit: 2 + + - label: ":ios: E2E Tests - 5.5 iOS 16" + depends_on: ios_fixture_5_5 + agents: + queue: opensource + timeout_in_minutes: 30 + plugins: + artifacts#v1.3.0: + download: + - build/TestFixture-IOS-Shipping-5.5.ipa + - build/TestFixture-IOS-Shipping-5.5-file.dSYM + upload: + - maze_output/failed/**/* + docker-compose#v3.3.0: + run: maze-runner + command: + - "--app=/app/build/TestFixture-IOS-Shipping-5.5.ipa" + - "--device=IOS_16" + - "--farm=bs" + - "--appium-version=1.22.0" + - "--order=random" + test-collector#v1.10.2: + files: "reports/TEST-*.xml" + format: "junit" + branch: "^main|next$$" + concurrency: 5 + concurrency_group: browserstack-app + concurrency_method: eager + retry: + automatic: + - exit_status: -1 + limit: 2 + +# Pending PLAT-12729 +# - label: ":macos: E2E Tests - 5.5 macOS 14" +# depends_on: mac_fixture_5_5 +# agents: +# queue: macos-14 +# env: +# XCODE_VERSION: "15.4.0" +# UE_VERSION: "5.5" +# timeout_in_minutes: 20 +# commands: +# - echo '--- Extracting test fixture' +# - unzip TestFixture-macOS-5.5.zip +# - echo '--- Installing dependencies' +# - bundle install +# - echo '--- Running tests' +# - bundle exec maze-runner --os=macos +# plugins: +# artifacts#v1.5.0: +# download: +# - TestFixture-macOS-5.5.zip +# upload: +# - maze_output/failed/**/* diff --git a/.buildkite/unreal.5.6.yml b/.buildkite/unreal.5.6.yml new file mode 100644 index 00000000..c96f07f9 --- /dev/null +++ b/.buildkite/unreal.5.6.yml @@ -0,0 +1,174 @@ +agents: + queue: macos-14 + +steps: + - group: ":hammer: Builds UE 5.6" + steps: + - label: ":macos: Build Plugin - 5.6" + agents: + queue: macos-14-isolated + env: + UE_VERSION: "5.6" + XCODE_VERSION: "16.1.0" + JAVA_VERSION: "11" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - make package + plugins: + artifacts#v1.5.0: + upload: + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + artifact_paths: + - Build/Plugin/*.zip + timeout_in_minutes: 30 + key: plugin_5_6 + + - label: ":android: Build E2E - 5.6" + agents: + queue: macos-14-isolated + depends_on: plugin_5_6 + env: + UE_VERSION: "5.6" + XCODE_VERSION: "16.1.0" + JAVA_VERSION: "21" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - features/scripts/build-fixture.sh Android + plugins: + artifacts#v1.5.0: + download: Build/Plugin/Bugsnag-*-UE_5.6-macOS.zip + upload: + - build/TestFixture-Android-Shipping-5.6-arm64.apk + - build/TestFixture-Android-Shipping-5.6-armv7.apk + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + timeout_in_minutes: 30 + key: android_fixture_5_6 + + - label: ":ios: Build E2E - 5.6" + agents: + queue: macos-14-isolated + depends_on: plugin_5_6 + env: + UE_VERSION: "5.6" + XCODE_VERSION: "16.1.0" + JAVA_VERSION: "21" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - features/scripts/build-fixture.sh IOS + plugins: + artifacts#v1.5.0: + download: Build/Plugin/Bugsnag-*-UE_5.6-macOS.zip + upload: + - build/TestFixture-IOS-Shipping-5.6.ipa + - build/TestFixture-IOS-Shipping-5.6-file.dSYM + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + timeout_in_minutes: 30 + key: ios_fixture_5_6 + + - label: ":mac: Build E2E - 5.6" + agents: + queue: macos-14-isolated + depends_on: plugin_5_6 + env: + UE_VERSION: "5.6" + XCODE_VERSION: "16.1.0" + JAVA_VERSION: "21" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - features/scripts/build-fixture.sh Mac + plugins: + artifacts#v1.5.0: + download: Build/Plugin/Bugsnag-*-UE_5.6-macOS.zip + upload: + - TestFixture-macOS-5.6.zip + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + timeout_in_minutes: 30 + key: mac_fixture_5_6 + + - group: ":test_tube: E2E Tests UE 5.6" + steps: + - label: ":android: E2E Tests - 5.6 Android 11" + depends_on: android_fixture_5_6 + agents: + queue: opensource + timeout_in_minutes: 30 + plugins: + artifacts#v1.3.0: + download: + - build/TestFixture-Android-Shipping-5.6-arm64.apk + upload: + - "maze_output/**/*" + docker-compose#v3.3.0: + run: maze-runner + command: + - "--app=/app/build/TestFixture-Android-Shipping-5.6-arm64.apk" + - "--device=ANDROID_11" + - "--farm=bs" + - "--order=random" + - "--appium-version=1.22.0" + test-collector#v1.10.2: + files: "reports/TEST-*.xml" + format: "junit" + branch: "^main|next$$" + concurrency: 5 + concurrency_group: browserstack-app + concurrency_method: eager + retry: + automatic: + - exit_status: -1 + limit: 2 + + - label: ":ios: E2E Tests - 5.6 iOS 16" + depends_on: ios_fixture_5_6 + agents: + queue: opensource + timeout_in_minutes: 30 + plugins: + artifacts#v1.3.0: + download: + - build/TestFixture-IOS-Shipping-5.6.ipa + - build/TestFixture-IOS-Shipping-5.6-file.dSYM + upload: + - maze_output/failed/**/* + docker-compose#v3.3.0: + run: maze-runner + command: + - "--app=/app/build/TestFixture-IOS-Shipping-5.6.ipa" + - "--device=IOS_18" + - "--farm=bs" + - "--appium-version=1.22.0" + - "--order=random" + test-collector#v1.10.2: + files: "reports/TEST-*.xml" + format: "junit" + branch: "^main|next$$" + concurrency: 5 + concurrency_group: browserstack-app + concurrency_method: eager + retry: + automatic: + - exit_status: -1 + limit: 2 + +# Pending PLAT-12729 +# - label: ":macos: E2E Tests - 5.6 macOS 14" +# depends_on: mac_fixture_5_6 +# agents: +# queue: macos-14 +# env: +# XCODE_VERSION: "15.4.0" +# UE_VERSION: "5.6" +# timeout_in_minutes: 20 +# commands: +# - echo '--- Extracting test fixture' +# - unzip TestFixture-macOS-5.6.zip +# - echo '--- Installing dependencies' +# - bundle install +# - echo '--- Running tests' +# - bundle exec maze-runner --os=macos +# plugins: +# artifacts#v1.5.0: +# download: +# - TestFixture-macOS-5.6.zip +# upload: +# - maze_output/failed/**/* diff --git a/.buildkite/unreal.5.7.yml b/.buildkite/unreal.5.7.yml new file mode 100644 index 00000000..badaef32 --- /dev/null +++ b/.buildkite/unreal.5.7.yml @@ -0,0 +1,166 @@ +agents: + queue: macos-15-isolated + +steps: + - group: ":hammer: Builds UE 5.7" + steps: + - label: ":macos: Build Plugin - 5.7" + env: + UE_VERSION: "5.7" + XCODE_VERSION: "16.3.0" + JAVA_VERSION: "11" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - make package + plugins: + artifacts#v1.5.0: + upload: + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + artifact_paths: + - Build/Plugin/*.zip + timeout_in_minutes: 30 + key: plugin_5_7 + + - label: ":android: Build E2E - 5.7" + depends_on: plugin_5_7 + env: + UE_VERSION: "5.7" + XCODE_VERSION: "16.3.0" + JAVA_VERSION: "21" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - features/scripts/build-fixture.sh Android + plugins: + artifacts#v1.5.0: + download: Build/Plugin/Bugsnag-*-UE_5.7-macOS.zip + upload: + - build/TestFixture-Android-Shipping-5.7-arm64.apk + - build/TestFixture-Android-Shipping-5.7-armv7.apk + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + timeout_in_minutes: 30 + key: android_fixture_5_7 + + - label: ":ios: Build E2E - 5.7" + depends_on: plugin_5_7 + env: + UE_VERSION: "5.7" + XCODE_VERSION: "16.3.0" + JAVA_VERSION: "21" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - features/scripts/build-fixture.sh IOS + plugins: + artifacts#v1.5.0: + download: Build/Plugin/Bugsnag-*-UE_5.7-macOS.zip + upload: + - build/TestFixture-IOS-Shipping-5.7.ipa + - build/TestFixture-IOS-Shipping-5.7-file.dSYM + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + timeout_in_minutes: 30 + key: ios_fixture_5_7 + + - label: ":mac: Build E2E - 5.7" + depends_on: plugin_5_7 + env: + UE_VERSION: "5.7" + XCODE_VERSION: "16.3.0" + JAVA_VERSION: "21" + commands: + - rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + - features/scripts/build-fixture.sh Mac + plugins: + artifacts#v1.5.0: + download: Build/Plugin/Bugsnag-*-UE_5.7-macOS.zip + upload: + - TestFixture-macOS-5.7.zip + - "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*" + timeout_in_minutes: 30 + key: mac_fixture_5_7 + + - group: ":test_tube: E2E Tests UE 5.7" + steps: + - label: ":android: E2E Tests - 5.7 Android 11" + depends_on: android_fixture_5_7 + agents: + queue: opensource + timeout_in_minutes: 30 + plugins: + artifacts#v1.3.0: + download: + - build/TestFixture-Android-Shipping-5.7-arm64.apk + upload: + - "maze_output/**/*" + docker-compose#v3.3.0: + run: maze-runner + command: + - "--app=/app/build/TestFixture-Android-Shipping-5.7-arm64.apk" + - "--device=ANDROID_11" + - "--farm=bs" + - "--order=random" + - "--appium-version=1.22.0" + test-collector#v1.10.2: + files: "reports/TEST-*.xml" + format: "junit" + branch: "^main|next$$" + concurrency: 5 + concurrency_group: browserstack-app + concurrency_method: eager + retry: + automatic: + - exit_status: -1 + limit: 2 + + - label: ":ios: E2E Tests - 5.7 iOS 18" + depends_on: ios_fixture_5_7 + agents: + queue: opensource + timeout_in_minutes: 30 + plugins: + artifacts#v1.3.0: + download: + - build/TestFixture-IOS-Shipping-5.7.ipa + - build/TestFixture-IOS-Shipping-5.7-file.dSYM + upload: + - maze_output/failed/**/* + docker-compose#v3.3.0: + run: maze-runner + command: + - "--app=/app/build/TestFixture-IOS-Shipping-5.7.ipa" + - "--device=IOS_18" + - "--farm=bs" + - "--appium-version=1.22.0" + - "--order=random" + test-collector#v1.10.2: + files: "reports/TEST-*.xml" + format: "junit" + branch: "^main|next$$" + concurrency: 5 + concurrency_group: browserstack-app + concurrency_method: eager + retry: + automatic: + - exit_status: -1 + limit: 2 + +# Pending PLAT-12729 +# - label: ":macos: E2E Tests - 5.7 macOS 14" +# depends_on: mac_fixture_5_7 +# agents: +# queue: macos-14 +# env: +# XCODE_VERSION: "15.4.0" +# UE_VERSION: "5.7" +# timeout_in_minutes: 20 +# commands: +# - echo '--- Extracting test fixture' +# - unzip TestFixture-macOS-5.7.zip +# - echo '--- Installing dependencies' +# - bundle install +# - echo '--- Running tests' +# - bundle exec maze-runner --os=macos +# plugins: +# artifacts#v1.5.0: +# download: +# - TestFixture-macOS-5.7.zip +# upload: +# - maze_output/failed/**/* diff --git a/.github/scripts/update-dependencies.rb b/.github/scripts/update-dependencies.rb new file mode 100755 index 00000000..3b7c244b --- /dev/null +++ b/.github/scripts/update-dependencies.rb @@ -0,0 +1,37 @@ +#! /usr/bin/env ruby + +require 'bumpsnag' + +def update_version(file, from, to) + initial_content = File.open(file).read + output_content = initial_content.gsub(from, to) + File.open(file, 'w') { |file| file.puts output_content } +end + +target_submodule = ENV['SUBMODULE'].dup +target_version = ENV['VERSION'].dup + +if target_submodule.nil? || target_version.nil? + raise 'Submodule or version targets not provided, exiting' + exit(1) +end + +if target_submodule.eql?('bugsnag-android') + version = /(\d+\.\d+\.\d+)/.match(target_version)[1] + update_version( + 'Plugins/Bugsnag/Source/Bugsnag/Bugsnag_UPL.xml', + /com.bugsnag,bugsnag-android,\d{1,3}\.\d{1,3}\.\d{1,3}/, + "com.bugsnag,bugsnag-android,#{version}" + ) + update_version( + 'deps/bugsnag-plugin-android-unreal/build.gradle', + /com.bugsnag:bugsnag-android-core:\d{1,3}\.\d{1,3}\.\d{1,3}/, + "com.bugsnag:bugsnag-android-core:#{version}" + ) +elsif target_submodule.eql?('bugsnag-cocoa') + Bumpsnag.update_submodule('deps/bugsnag-cocoa', target_version) +else + raise "Submodule #{target_submodule} not supported, exiting" +end + + diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7948b736..bae5ddeb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,7 @@ on: [push] jobs: lint: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml new file mode 100644 index 00000000..b9c30b8d --- /dev/null +++ b/.github/workflows/update-dependencies.yml @@ -0,0 +1,67 @@ +name: update-dependencies +permissions: read-all + +on: + repository_dispatch: + types: [update-dependency] + workflow_dispatch: + inputs: + target_submodule: + description: 'Submodule to update' + required: true + type: string + target_version: + description: 'Version of the submodule to update to' + required: true + type: string + +jobs: + update-dependencies: + runs-on: macos-latest + permissions: + contents: write + pull-requests: write + env: + SUBMODULE: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.target_submodule || inputs.target_submodule }} + VERSION: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.target_version || inputs.target_version }} + BUNDLE_GITHUB__COM: ${{ secrets.BUNDLE_ACCESS_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REVIEWER: richardelms + steps: + - uses: actions/checkout@v4 + with: + ref: next + + - run: | + git config --global user.name 'Bumpsnag bot' + git config --global user.email '' + + - run: git fetch --prune --unshallow + - run: git submodule update --init --recursive + + - name: Install ruby + uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0 + with: + ruby-version: 2.7 + + - name: Install dependencies + run: bundle install + + - name: Update references locally + run: bundle exec .github/scripts/update-dependencies.rb + + - name: Commit and push changes + run: bundle exec bumpsnag commit-update $SUBMODULE $VERSION + + - name: List current branch name + id: current-branch + run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_OUTPUT + + - name: Create pull request + if: ${{ steps.current-branch.outputs.branch != 'next'}} + run: > + gh pr create -B next + -H bumpsnag-$SUBMODULE-$VERSION + --title "Update $SUBMODULE to version $VERSION" + --body 'Created by bumpsnag' + --reviewer $REVIEWER diff --git a/.gitignore b/.gitignore index c19ac493..20420e07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ -# Visual Studio 2015 user specific files +Gemfile.lock + +# IDE user specific files .vs/ +.idea/ +bugsnag-unreal.iml # Compiled Object files *.slo diff --git a/Build/Android/keystore.jks b/Build/Android/keystore.jks deleted file mode 100644 index 8cf8e875..00000000 Binary files a/Build/Android/keystore.jks and /dev/null differ diff --git a/Build/Android/project.properties b/Build/Android/project.properties deleted file mode 100644 index 738e84e9..00000000 --- a/Build/Android/project.properties +++ /dev/null @@ -1,14 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-19 diff --git a/CHANGELOG.md b/CHANGELOG.md index 45f3aa01..7ffc7a29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,43 +1,51 @@ Changelog ========= +### 2.1.0 (2025-12-01) -## 2.0.0 (2024-01-12) +* Add support for Unreal Engine 5.7 [#260](https://github.com/bugsnag/bugsnag-unreal/pull/260) +* Update bugsnag-android to [v6.19.0](https//github.com/bugsnag/bugsnag-android/releases/tag/v6.19.0) [#262](https://github.com/bugsnag/bugsnag-unreal/pull/262) +* Update bugsnag-cocoa to [v6.34.1](https//github.com/bugsnag/bugsnag-cocoa/releases/tag/v6.34.1) [#263](https://github.com/bugsnag/bugsnag-unreal/pull/263) +* Updates the bugsnag-android dependency from v5.31.3 to [v6.8.0](https://github.com/bugsnag/bugsnag-android/blob/v6.8.0/CHANGELOG.md) +* Included apple privacy manifest in released package [#234](https://github.com/bugsnag/bugsnag-unreal/pull/234) +* Updates the bugsnag-cocoa dependency from v6.28.0 to [v6.29.0](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6290-2024-06-19) + +### 2.0.0 (2024-01-12) * Removed the bugsnag android gradle plugin due to incompatibility with UE 5.1+. Symbols can now be uploaded via the [BugSnag CLI](https://docs.bugsnag.com/platforms/unreal-engine/showing-full-stacktraces/#android-proguard-and-ndk-mappings)[#220](https://github.com/bugsnag/bugsnag-unreal/pull/220) * Updates the bugsnag-cocoa dependency from v6.26.2 to [v6.28.0](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6280-2023-12-13) (includes compliance with Apple's Required Reasons API – see [online docs](https://docs.bugsnag.com/platforms/ios/appstore-privacy/#declaring-required-reasons-for-api-usage)) * Updates the bugsnag-android dependency from v5.30.0 to [v5.31.3](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5313-2023-11-06) -## 1.8.0 (2023-08-28) +### 1.8.0 (2023-08-28) * Added support for Unreal Engine 5.2 * Updates the bugsnag-cocoa dependency from v6.25.2 to [v6.26.2](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6262-2023-04-20) * Updates the bugsnag-android dependency from v5.28.4 to [v5.30.0](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5300-2023-05-11) * Increased MaxBreadcrumb limit from 100 to 500 [#212](https://github.com/bugsnag/bugsnag-unreal/pull/212) -## 1.7.0 (2022-03-13) +### 1.7.0 (2022-03-13) * Add support for Unreal Engine v5.1.1 * Updates the bugsnag-android dependency from v5.28.1 to [v5.28.4](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5284-2023-02-08) * Updates the bugsnag-cocoa dependency from v6.25.0 to [v6.25.2](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6252-2023-01-18) -## 1.6.0 (2022-11-09) +### 1.6.0 (2022-11-09) * Adds the `Telemetry.Usage` configuration property. [#194](https://github.com/bugsnag/bugsnag-unreal/pull/194) * Adds the `MaxStringValueLength` configuration property. [#193](https://github.com/bugsnag/bugsnag-unreal/pull/193) * Updates the package branding -## 1.5.1 (2022-10-27) +### 1.5.1 (2022-10-27) * Updates the bugsnag-cocoa dependency from v6.19.0 to [v6.25.0](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6240-2022-10-05) * Updates the bugsnag-android dependency from v5.24.0 to [v5.28.1](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5281-2022-10-19) -## 1.5.0 (2022-07-06) +### 1.5.0 (2022-07-06) * Adds the `Telemetry` configuration property. * Updates the bugsnag-android dependency from v5.22.1 to [v5.24.0](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5240-2022-06-30) * Updates the bugsnag-cocoa dependency from v6.16.8 to [v6.19.0](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6190-2022-06-29) -## 1.4.0 (2022-05-11) +### 1.4.0 (2022-05-11) * Adds official support for Unreal Engine 5.0 🚀 * Fixes improper use of `TCHAR_TO_UTF8()` that could result in use-after-free on Android. @@ -45,42 +53,39 @@ Changelog * Updates the bugsnag-android dependency from v5.22.0 to [v5.22.1](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5221-2022-04-28) * Updates the bugsnag-cocoa dependency from v6.16.6 to [v6.16.8](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6168-2022-05-04) -## 1.3.1 (2022-04-26) +### 1.3.1 (2022-04-26) * Fixes `java.lang.ClassNotFoundException` in minified Android builds. [#151](https://github.com/bugsnag/bugsnag-unreal/pull/151) -## 1.3.0 (2022-04-11) +### 1.3.0 (2022-04-11) * Adds the `MaxReportedThreads` configuration property (Android only.) [#144](https://github.com/bugsnag/bugsnag-unreal/pull/144) * Updates the bugsnag-android dependency from v5.19.2 to [v5.22.0](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5220-2022-03-31) * Updates the bugsnag-cocoa dependency from v6.16.1 to [v6.16.6](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6166-2022-04-06) -## 1.2.0 (2022-02-17) +### 1.2.0 (2022-02-17) * Adds support for macOS as a target platform. [#136](https://github.com/bugsnag/bugsnag-unreal/pull/136) -## 1.1.0 (2022-02-02) +### 1.1.0 (2022-02-02) * New APIs to support forthcoming feature flag and experiment functionality. For more information, please see https://docs.bugsnag.com/product/features-experiments [#123](https://github.com/bugsnag/bugsnag-unreal/pull/123) - * Updates the bugsnag-android dependency from v5.16.0 to [v5.19.2](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5192-2022-01-31) * Updates the bugsnag-cocoa dependency from v6.14.3 to [v6.16.1](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6161-2022-01-19) -## 1.0.1 (2022-01-04) +### 1.0.1 (2022-01-04) * Plugin is no longer flagged as "beta" -## 1.0.0 (2021-12-17) +### 1.0.0 (2021-12-17) This is the initial public release of Bugsnag for Unreal Engine, supporting Android and iOS as target platforms. - Documentation: https://docs.bugsnag.com/platforms/unreal-engine/ - Download: https://www.unrealengine.com/marketplace/en-US/product/bugsnag - 🚀 + diff --git a/Gemfile b/Gemfile index 898f12be..a7cfaa22 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,9 @@ source 'https://rubygems.org' -gem 'bugsnag-maze-runner', '~>8.13' +# Only install bumpsnag if we're using Github actions +if ENV['GITHUB_ACTIONS'].nil? + gem 'bugsnag-maze-runner', '~>10.0' + gem 'cocoapods' +else + gem 'bumpsnag', git: 'https://github.com/bugsnag/platforms-bumpsnag', branch: 'main' +end diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 6aa870ed..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,127 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - appium_lib (12.0.1) - appium_lib_core (~> 5.0) - nokogiri (~> 1.8, >= 1.8.1) - tomlrb (>= 1.1, < 3.0) - appium_lib_core (5.4.0) - faye-websocket (~> 0.11.0) - selenium-webdriver (~> 4.2, < 4.6) - bugsnag (6.26.0) - concurrent-ruby (~> 1.0) - bugsnag-maze-runner (8.13.1) - appium_lib (~> 12.0.0) - appium_lib_core (~> 5.4.0) - bugsnag (~> 6.24) - cucumber (~> 7.1) - cucumber-expressions (~> 6.0.0) - curb (~> 0.9.6) - dogstatsd-ruby (~> 5.5.0) - json_schemer (~> 0.2.24) - optimist (~> 3.0.1) - os (~> 1.0.0) - rack (~> 2.2) - rake (~> 12.3.3) - rubyzip (~> 2.3.2) - selenium-webdriver (~> 4.0) - test-unit (~> 3.5.2) - webrick (~> 1.7.0) - builder (3.2.4) - childprocess (4.1.0) - concurrent-ruby (1.2.2) - cucumber (7.1.0) - builder (~> 3.2, >= 3.2.4) - cucumber-core (~> 10.1, >= 10.1.0) - cucumber-create-meta (~> 6.0, >= 6.0.1) - cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) - cucumber-gherkin (~> 22.0, >= 22.0.0) - cucumber-html-formatter (~> 17.0, >= 17.0.0) - cucumber-messages (~> 17.1, >= 17.1.1) - cucumber-wire (~> 6.2, >= 6.2.0) - diff-lcs (~> 1.4, >= 1.4.4) - mime-types (~> 3.3, >= 3.3.1) - multi_test (~> 0.1, >= 0.1.2) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-core (10.1.1) - cucumber-gherkin (~> 22.0, >= 22.0.0) - cucumber-messages (~> 17.1, >= 17.1.1) - cucumber-tag-expressions (~> 4.1, >= 4.1.0) - cucumber-create-meta (6.0.4) - cucumber-messages (~> 17.1, >= 17.1.1) - sys-uname (~> 1.2, >= 1.2.2) - cucumber-cucumber-expressions (14.0.0) - cucumber-expressions (6.0.1) - cucumber-gherkin (22.0.0) - cucumber-messages (~> 17.1, >= 17.1.1) - cucumber-html-formatter (17.0.0) - cucumber-messages (~> 17.1, >= 17.1.0) - cucumber-messages (17.1.1) - cucumber-tag-expressions (4.1.0) - cucumber-wire (6.2.1) - cucumber-core (~> 10.1, >= 10.1.0) - cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) - curb (0.9.11) - diff-lcs (1.5.0) - dogstatsd-ruby (5.5.0) - ecma-re-validator (0.4.0) - regexp_parser (~> 2.2) - eventmachine (1.2.7) - faye-websocket (0.11.3) - eventmachine (>= 0.12.0) - websocket-driver (>= 0.5.1) - ffi (1.16.3) - hana (1.3.7) - json_schemer (0.2.25) - ecma-re-validator (~> 0.3) - hana (~> 1.3) - regexp_parser (~> 2.0) - simpleidn (~> 0.2) - uri_template (~> 0.7) - mime-types (3.5.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2023.1003) - mini_portile2 (2.8.5) - multi_test (0.1.2) - nokogiri (1.15.5) - mini_portile2 (~> 2.8.2) - racc (~> 1.4) - optimist (3.0.1) - os (1.0.1) - power_assert (2.0.3) - racc (1.7.3) - rack (2.2.8) - rake (12.3.3) - regexp_parser (2.8.2) - rexml (3.2.6) - rubyzip (2.3.2) - selenium-webdriver (4.5.0) - childprocess (>= 0.5, < 5.0) - rexml (~> 3.2, >= 3.2.5) - rubyzip (>= 1.2.2, < 3.0) - websocket (~> 1.0) - simpleidn (0.2.1) - unf (~> 0.1.4) - sys-uname (1.2.3) - ffi (~> 1.1) - test-unit (3.5.9) - power_assert - tomlrb (2.0.3) - unf (0.1.4) - unf_ext - unf_ext (0.0.9.1) - uri_template (0.7.0) - webrick (1.7.0) - websocket (1.2.10) - websocket-driver (0.7.6) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - -PLATFORMS - ruby - -DEPENDENCIES - bugsnag-maze-runner (> 8.0) - -BUNDLED WITH - 2.4.8 diff --git a/Makefile b/Makefile index 35ddf1eb..03a05143 100644 --- a/Makefile +++ b/Makefile @@ -125,7 +125,7 @@ e2e_ios: $(TEST_IOS_APP) .PHONY: e2e_ios_local e2e_ios_local: $(TEST_IOS_APP) - ideviceinstaller --uninstall com.bugsnag.examples.UnrealTestFixture + ideviceinstaller --uninstall com.bugsnag.example.unrealtestfixture bundle exec maze-runner --app=$< --farm=local --os=ios --os-version=14 --apple-team-id=7W9PZ27Y5F --udid="$(shell idevice_id -l)" $(TESTS) --color .PHONY: e2e_mac diff --git a/Plugins/Bugsnag/Bugsnag.uplugin b/Plugins/Bugsnag/Bugsnag.uplugin index 2f0259ea..369972fe 100644 --- a/Plugins/Bugsnag/Bugsnag.uplugin +++ b/Plugins/Bugsnag/Bugsnag.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, - "Version": 14, - "VersionName": "2.0.0", + "Version": 15, + "VersionName": "2.1.0", "FriendlyName": "BugSnag", "Description": "BugSnag is an error monitoring and application stability management solution.", "Category": "Developer", diff --git a/Plugins/Bugsnag/Resources/PrivacyInfo.xcprivacy b/Plugins/Bugsnag/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..080ea006 --- /dev/null +++ b/Plugins/Bugsnag/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,96 @@ + + + + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeUserID + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeDeviceID + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeProductInteraction + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeCrashData + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeOtherDataTypes + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + + diff --git a/Plugins/Bugsnag/Source/Bugsnag/Bugsnag_UPL.xml b/Plugins/Bugsnag/Source/Bugsnag/Bugsnag_UPL.xml index 866b48cb..a4eb001f 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Bugsnag_UPL.xml +++ b/Plugins/Bugsnag/Source/Bugsnag/Bugsnag_UPL.xml @@ -9,15 +9,25 @@ - com.bugsnag,bugsnag-plugin-android-unreal,2.0.0 - com.bugsnag,bugsnag-android,5.31.3 + com.bugsnag,bugsnag-plugin-android-unreal,2.1.0 + com.bugsnag,bugsnag-android,6.19.0 - + + + configurations.all { + exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib-jdk7" + exclude group: "org.jetbrains.kotlin", module: "kotlin-stdlib-jdk8" + resolutionStrategy { + force "org.jetbrains.kotlin:kotlin-stdlib:1.9.0" + } + } + + diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidPlatformBugsnag.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidPlatformBugsnag.cpp index 2677fe8d..9de37315 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidPlatformBugsnag.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidPlatformBugsnag.cpp @@ -46,14 +46,6 @@ void FAndroidPlatformBugsnag::Start(const TSharedRef& Con jstring jValue = FAndroidPlatformJNI::ParseFString(Env, BugsnagUtils::GetUnrealEngineVersion()); (*Env).CallVoidMethod(jClient, JNICache.ClientAddRuntimeVersionInfo, jKey, jValue); FAndroidPlatformJNI::CheckAndClearException(Env); - - if (Config->GetAutoTrackSessions()) - { - // start first session - initialization happens too late in the Android lifecycle to be detected - // automatically, though later sessions generated by moving the app to the background / foreground - // will be detected. - StartSession(); - } } } } diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidPlatformConfiguration.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidPlatformConfiguration.cpp index 7dfe9113..76515cff 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidPlatformConfiguration.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidPlatformConfiguration.cpp @@ -53,7 +53,9 @@ jobject FAndroidPlatformConfiguration::Parse(JNIEnv* Env, } if (Config->GetDiscardClasses().Num()) { - jniCallWithSet(Env, Cache, jConfig, Cache->ConfigSetDiscardClasses, Config->GetDiscardClasses()); + jobject jPatternSet = FAndroidPlatformJNI::ParsePatternSet(Env, Cache, Config->GetDiscardClasses()); + ReturnNullOnFail(jPatternSet); + jniCallWithObjects(Env, jConfig, Cache->ConfigSetDiscardClasses, jPatternSet); } jobject jEnabledTypes = FAndroidPlatformJNI::ParseBreadcrumbTypeSet(Env, Cache, Config->GetEnabledBreadcrumbTypes()); ReturnNullOnFail(jEnabledTypes); @@ -99,7 +101,9 @@ jobject FAndroidPlatformConfiguration::Parse(JNIEnv* Env, if (Config->GetRedactedKeys().Num()) { - jniCallWithSet(Env, Cache, jConfig, Cache->ConfigSetRedactedKeys, Config->GetRedactedKeys()); + jobject jPatternSet = FAndroidPlatformJNI::ParsePatternSet(Env, Cache, Config->GetRedactedKeys()); + ReturnNullOnFail(jPatternSet); + jniCallWithObjects(Env, jConfig, Cache->ConfigSetRedactedKeys, jPatternSet); } if (Config->GetProjectPackages().Num()) diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidThread.h b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidThread.h index 953902f5..1dfd4eeb 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidThread.h +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidThread.h @@ -22,17 +22,33 @@ class FAndroidThread : public IBugsnagThread, FJavaObjectWrapper FString GetId() const override { - auto Id = (*Env).CallLongMethod(JavaObject, Cache->ThreadGetId); - FAndroidPlatformJNI::CheckAndClearException(Env); - return Id ? FString::Printf(TEXT("{Id}"), Id) : TEXT(""); + // Retrieve the thread ID as a Java string + jstring jId = static_cast((*Env).CallObjectMethod(JavaObject, Cache->ThreadGetId)); + if (FAndroidPlatformJNI::CheckAndClearException(Env) || !jId) + { + return TEXT(""); + } + + const char* nativeString = (*Env).GetStringUTFChars(jId, nullptr); + if (!nativeString) + { + return TEXT(""); + } + FString Id = FString(UTF8_TO_TCHAR(nativeString)); + (*Env).ReleaseStringUTFChars(jId, nativeString); + + return Id; } void SetId(const FString& Value) override { - int64 Id = FCString::Atoi64(*Value); - if (Id) + // Convert the FString to a Java string + jstring jId = FAndroidPlatformJNI::ParseFString(Env, Value); + if (jId) { - (*Env).CallVoidMethod(JavaObject, Cache->ThreadSetId, Id); + (*Env).CallVoidMethod(JavaObject, Cache->ThreadSetId, jId); + FAndroidPlatformJNI::CheckAndClearException(Env); + (*Env).DeleteLocalRef(jId); // Clean up local reference } } @@ -48,7 +64,7 @@ class FAndroidThread : public IBugsnagThread, FJavaObjectWrapper EBugsnagErrorType GetErrorType() const override { - jobject jErrorType = (*Env).CallObjectMethod(JavaObject, Cache->ThreadGetType); + jobject jErrorType = (*Env).CallObjectMethod(JavaObject, Cache->ErrorGetType); ReturnValueOnException(Env, EBugsnagErrorType::C); return FAndroidPlatformJNI::ParseErrorType(Env, Cache, jErrorType); } diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/JNIUtilities.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/JNIUtilities.cpp index 52852f3f..8372287b 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/JNIUtilities.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/JNIUtilities.cpp @@ -86,7 +86,6 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheExternalJavaClass(env, cache->UserClass, "com.bugsnag.android.User"); CacheExternalJavaClass(env, cache->EndpointConfigurationClass, "com.bugsnag.android.EndpointConfiguration"); CacheExternalJavaClass(env, cache->ThreadSendPolicyClass, "com.bugsnag.android.ThreadSendPolicy"); - CacheExternalJavaClass(env, cache->ThreadTypeClass, "com.bugsnag.android.ThreadType"); CacheExternalJavaClass(env, cache->MetadataParserClass, "com.bugsnag.android.unreal.MetadataParser"); CacheExternalJavaClass(env, cache->MetadataSerializerClass, "com.bugsnag.android.unreal.MetadataSerializer"); @@ -105,6 +104,7 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheSystemJavaClass(env, cache->NumberClass, "java/lang/Number"); CacheSystemJavaClass(env, cache->StringClass, "java/lang/String"); CacheSystemJavaClass(env, cache->TraceClass, "java/lang/StackTraceElement"); + CacheSystemJavaClass(env, cache->PatternClass, "java/util/regex/Pattern"); CacheInstanceJavaMethod(env, cache->AppGetBinaryArch, cache->AppClass, "getBinaryArch", "()Ljava/lang/String;"); CacheInstanceJavaMethod(env, cache->AppGetBuildUuid, cache->AppClass, "getBuildUuid", "()Ljava/lang/String;"); @@ -120,7 +120,6 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheInstanceJavaMethod(env, cache->AppSetType, cache->AppClass, "setType", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->AppSetVersion, cache->AppClass, "setVersion", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->AppSetVersionCode, cache->AppClass, "setVersionCode", "(Ljava/lang/Number;)V"); - CacheInstanceJavaMethod(env, cache->AppWithStateGetDuration, cache->AppWithStateClass, "getDuration", "()Ljava/lang/Number;"); CacheInstanceJavaMethod(env, cache->AppWithStateGetDurationInForeground, cache->AppWithStateClass, "getDurationInForeground", "()Ljava/lang/Number;"); CacheInstanceJavaMethod(env, cache->AppWithStateGetInForeground, cache->AppWithStateClass, "getInForeground", "()Ljava/lang/Boolean;"); @@ -129,7 +128,6 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheInstanceJavaMethod(env, cache->AppWithStateSetDurationInForeground, cache->AppWithStateClass, "setDurationInForeground", "(Ljava/lang/Number;)V"); CacheInstanceJavaMethod(env, cache->AppWithStateSetInForeground, cache->AppWithStateClass, "setInForeground", "(Ljava/lang/Boolean;)V"); CacheInstanceJavaMethod(env, cache->AppWithStateSetIsLaunching, cache->AppWithStateClass, "setLaunching", "(Ljava/lang/Boolean;)V"); - CacheInstanceJavaMethod(env, cache->BreadcrumbGetMessage, cache->BreadcrumbClass, "getMessage", "()Ljava/lang/String;"); CacheInstanceJavaMethod(env, cache->BreadcrumbGetMetadata, cache->BreadcrumbClass, "getMetadata", "()Ljava/util/Map;"); CacheInstanceJavaMethod(env, cache->BreadcrumbGetTimestamp, cache->BreadcrumbClass, "getTimestamp", "()Ljava/util/Date;"); @@ -157,20 +155,18 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheStaticJavaMethod(env, cache->BugsnagResumeSession, cache->BugsnagClass, "resumeSession", "()Z"); CacheStaticJavaMethod(env, cache->BugsnagSetUser, cache->BugsnagClass, "setUser", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); CacheStaticJavaMethod(env, cache->BugsnagPauseSession, cache->BugsnagClass, "pauseSession", "()V"); - + CacheStaticJavaMethod(env, cache->PatternCompileMethod, cache->PatternClass, "compile", "(Ljava/lang/String;)Ljava/util/regex/Pattern;"); CacheStaticJavaMethod(env, cache->BugsnagUnrealPluginGetEventMetadataSection, cache->BugsnagUnrealPluginClass, "getMetadata", "(Lcom/bugsnag/android/Event;Ljava/lang/String;)[B"); CacheStaticJavaMethod(env, cache->BugsnagUnrealPluginGetEventMetadataValue, cache->BugsnagUnrealPluginClass, "getMetadata", "(Lcom/bugsnag/android/Event;Ljava/lang/String;Ljava/lang/String;)[B"); CacheStaticJavaMethod(env, cache->BugsnagUnrealPluginGetMetadataSection, cache->BugsnagUnrealPluginClass, "getMetadata", "(Ljava/lang/String;)[B"); CacheStaticJavaMethod(env, cache->BugsnagUnrealPluginGetMetadataValue, cache->BugsnagUnrealPluginClass, "getMetadata", "(Ljava/lang/String;Ljava/lang/String;)[B"); CacheStaticJavaMethod(env, cache->BugsnagUnrealPluginNotify, cache->BugsnagUnrealPluginClass, "notify", "(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/StackTraceElement;Ljava/nio/ByteBuffer;)V"); + CacheInstanceJavaMethod(env, cache->BugsnagUnrealPluginConstructor, cache->BugsnagUnrealPluginClass, "", "(Lcom/bugsnag/android/Configuration;)V"); CacheStaticJavaMethod(env, cache->MetadataParserParse, cache->MetadataParserClass, "parse", "([B)Ljava/util/Map;"); - CacheStaticJavaMethod(env, cache->MetadataSerializerSerialize, cache->MetadataSerializerClass, "serialize", "(Ljava/util/Map;)[B"); - CacheInstanceJavaMethod(env, cache->ClientAddRuntimeVersionInfo, cache->ClientClass, "addRuntimeVersionInfo", "(Ljava/lang/String;Ljava/lang/String;)V"); - CacheInstanceJavaMethod(env, cache->ConfigConstructor, cache->ConfigClass, "", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->ConfigAddFeatureFlag, cache->ConfigClass, "addFeatureFlag", "(Ljava/lang/String;Ljava/lang/String;)V"); @@ -205,12 +201,9 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheInstanceJavaMethod(env, cache->ConfigSetTelemetry, cache->ConfigClass, "setTelemetry", "(Ljava/util/Set;)V"); CacheInstanceJavaMethod(env, cache->ConfigSetUser, cache->ConfigClass, "setUser", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->ConfigSetVersionCode, cache->ConfigClass, "setVersionCode", "(Ljava/lang/Integer;)V"); - CacheInstanceJavaMethod(env, cache->ContextGetApplication, cache->ContextClass, "getApplicationContext", "()Landroid/content/Context;"); - CacheInstanceJavaMethod(env, cache->DateConstructor, cache->DateClass, "", "(J)V"); CacheInstanceJavaMethod(env, cache->DateGetTime, cache->DateClass, "getTime", "()J"); - CacheInstanceJavaMethod(env, cache->DeviceGetCpuAbi, cache->DeviceClass, "getCpuAbi", "()[Ljava/lang/String;"); CacheInstanceJavaMethod(env, cache->DeviceGetId, cache->DeviceClass, "getId", "()Ljava/lang/String;"); CacheInstanceJavaMethod(env, cache->DeviceGetJailbroken, cache->DeviceClass, "getJailbroken", "()Ljava/lang/Boolean;"); @@ -231,7 +224,6 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheInstanceJavaMethod(env, cache->DeviceSetOsVersion, cache->DeviceClass, "setOsVersion", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->DeviceSetRuntimeVersions, cache->DeviceClass, "setRuntimeVersions", "(Ljava/util/Map;)V"); CacheInstanceJavaMethod(env, cache->DeviceSetTotalMemory, cache->DeviceClass, "setTotalMemory", "(Ljava/lang/Long;)V"); - CacheInstanceJavaMethod(env, cache->DeviceWithStateGetFreeDisk, cache->DeviceWithStateClass, "getFreeDisk", "()Ljava/lang/Long;"); CacheInstanceJavaMethod(env, cache->DeviceWithStateGetFreeMemory, cache->DeviceWithStateClass, "getFreeMemory", "()Ljava/lang/Long;"); CacheInstanceJavaMethod(env, cache->DeviceWithStateGetOrientation, cache->DeviceWithStateClass, "getOrientation", "()Ljava/lang/String;"); @@ -240,11 +232,8 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheInstanceJavaMethod(env, cache->DeviceWithStateSetFreeMemory, cache->DeviceWithStateClass, "setFreeMemory", "(Ljava/lang/Long;)V"); CacheInstanceJavaMethod(env, cache->DeviceWithStateSetOrientation, cache->DeviceWithStateClass, "setOrientation", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->DeviceWithStateSetTime, cache->DeviceWithStateClass, "setTime", "(Ljava/util/Date;)V"); - CacheInstanceJavaMethod(env, cache->EnumGetName, cache->EnumClass, "name", "()Ljava/lang/String;"); - CacheInstanceJavaMethod(env, cache->EndpointConfigurationConstructor, cache->EndpointConfigurationClass, "", "(Ljava/lang/String;Ljava/lang/String;)V"); - CacheInstanceJavaMethod(env, cache->ErrorGetErrorClass, cache->ErrorClass, "getErrorClass", "()Ljava/lang/String;"); CacheInstanceJavaMethod(env, cache->ErrorGetErrorMessage, cache->ErrorClass, "getErrorMessage", "()Ljava/lang/String;"); CacheInstanceJavaMethod(env, cache->ErrorGetStacktrace, cache->ErrorClass, "getStacktrace", "()Ljava/util/List;"); @@ -252,9 +241,7 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheInstanceJavaMethod(env, cache->ErrorSetErrorClass, cache->ErrorClass, "setErrorClass", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->ErrorSetErrorMessage, cache->ErrorClass, "setErrorMessage", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->ErrorSetType, cache->ErrorClass, "setType", "(Lcom/bugsnag/android/ErrorType;)V"); - CacheInstanceJavaMethod(env, cache->ErrorTypesConstructor, cache->ErrorTypesClass, "", "(ZZZZ)V"); - CacheInstanceJavaMethod(env, cache->EventAddFeatureFlag, cache->EventClass, "addFeatureFlag", "(Ljava/lang/String;Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->EventAddMetadataToSection, cache->EventClass, "addMetadata", "(Ljava/lang/String;Ljava/util/Map;)V"); CacheInstanceJavaMethod(env, cache->EventAddMetadataValue, cache->EventClass, "addMetadata", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V"); @@ -280,29 +267,22 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheInstanceJavaMethod(env, cache->EventSetUnhandled, cache->EventClass, "setUnhandled", "(Z)V"); CacheInstanceJavaMethod(env, cache->EventSetUser, cache->EventClass, "setUser", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->EventUpdateSeverityReason, cache->EventClass, "updateSeverityReason", "(Ljava/lang/String;)V"); - CacheInstanceJavaMethod(env, cache->FileConstructor, cache->FileClass, "", "(Ljava/lang/String;)V"); - CacheInstanceJavaMethod(env, cache->HashMapConstructor, cache->HashMapClass, "", "()V"); CacheInstanceJavaMethod(env, cache->HashMapGet, cache->HashMapClass, "get", "(Ljava/lang/Object;)Ljava/lang/Object;"); - CacheInstanceJavaMethod(env, cache->LastRunInfoGetCrashed, cache->LastRunInfoClass, "getCrashed", "()Z"); CacheInstanceJavaMethod(env, cache->LastRunInfoGetCrashedDuringLaunch, cache->LastRunInfoClass, "getCrashedDuringLaunch", "()Z"); CacheInstanceJavaMethod(env, cache->LastRunInfoGetConsecutiveLaunchCrashes, cache->LastRunInfoClass, "getConsecutiveLaunchCrashes", "()I"); - CacheInstanceJavaMethod(env, cache->ListAdd, cache->ListClass, "add", "(Ljava/lang/Object;)Z"); CacheInstanceJavaMethod(env, cache->ListClear, cache->ListClass, "clear", "()V"); CacheInstanceJavaMethod(env, cache->ListGet, cache->ListClass, "get", "(I)Ljava/lang/Object;"); CacheInstanceJavaMethod(env, cache->ListSize, cache->ListClass, "size", "()I"); - CacheInstanceJavaMethod(env, cache->LongConstructor, cache->LongClass, "", "(J)V"); - CacheInstanceJavaMethod(env, cache->NotifierConstructor, cache->NotifierClass, "", "()V"); CacheInstanceJavaMethod(env, cache->NotifierSetDependencies, cache->NotifierClass, "setDependencies", "(Ljava/util/List;)V"); CacheInstanceJavaMethod(env, cache->NotifierSetName, cache->NotifierClass, "setName", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->NotifierSetUrl, cache->NotifierClass, "setUrl", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->NotifierSetVersion, cache->NotifierClass, "setVersion", "(Ljava/lang/String;)V"); - CacheInstanceJavaMethod(env, cache->SessionGetApp, cache->SessionClass, "getApp", "()Lcom/bugsnag/android/App;"); CacheInstanceJavaMethod(env, cache->SessionGetDevice, cache->SessionClass, "getDevice", "()Lcom/bugsnag/android/Device;"); CacheInstanceJavaMethod(env, cache->SessionGetId, cache->SessionClass, "getId", "()Ljava/lang/String;"); @@ -311,7 +291,6 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheInstanceJavaMethod(env, cache->SessionSetId, cache->SessionClass, "setId", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->SessionSetStartedAt, cache->SessionClass, "setStartedAt", "(Ljava/util/Date;)V"); CacheInstanceJavaMethod(env, cache->SessionSetUser, cache->SessionClass, "setUser", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); - CacheInstanceJavaMethod(env, cache->StackframeGetFile, cache->StackframeClass, "getFile", "()Ljava/lang/String;"); CacheInstanceJavaMethod(env, cache->StackframeGetInProject, cache->StackframeClass, "getInProject", "()Ljava/lang/Boolean;"); CacheInstanceJavaMethod(env, cache->StackframeGetLineNumber, cache->StackframeClass, "getLineNumber", "()Ljava/lang/Number;"); @@ -322,37 +301,27 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheInstanceJavaMethod(env, cache->StackframeSetLineNumber, cache->StackframeClass, "setLineNumber", "(Ljava/lang/Number;)V"); CacheInstanceJavaMethod(env, cache->StackframeSetMethod, cache->StackframeClass, "setMethod", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->StackframeSetType, cache->StackframeClass, "setType", "(Lcom/bugsnag/android/ErrorType;)V"); - CacheInstanceJavaMethod(env, cache->ThreadGetErrorReportingThread, cache->ThreadClass, "getErrorReportingThread", "()Z"); - CacheInstanceJavaMethod(env, cache->ThreadGetId, cache->ThreadClass, "getId", "()J"); + CacheInstanceJavaMethod(env, cache->ThreadGetId, cache->ThreadClass, "getId", "()Ljava/lang/String;"); CacheInstanceJavaMethod(env, cache->ThreadGetName, cache->ThreadClass, "getName", "()Ljava/lang/String;"); - CacheInstanceJavaMethod(env, cache->ThreadGetType, cache->ThreadClass, "getType", "()Lcom/bugsnag/android/ThreadType;"); CacheInstanceJavaMethod(env, cache->ThreadGetStacktrace, cache->ThreadClass, "getStacktrace", "()Ljava/util/List;"); - CacheInstanceJavaMethod(env, cache->ThreadSetId, cache->ThreadClass, "setId", "(J)V"); + CacheInstanceJavaMethod(env, cache->ThreadSetId, cache->ThreadClass, "setId", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->ThreadSetName, cache->ThreadClass, "setName", "(Ljava/lang/String;)V"); CacheInstanceJavaMethod(env, cache->ThreadSetStacktrace, cache->ThreadClass, "setStacktrace", "(Ljava/util/List;)V"); - CacheInstanceJavaMethod(env, cache->UserGetEmail, cache->UserClass, "getEmail", "()Ljava/lang/String;"); CacheInstanceJavaMethod(env, cache->UserGetId, cache->UserClass, "getId", "()Ljava/lang/String;"); CacheInstanceJavaMethod(env, cache->UserGetName, cache->UserClass, "getName", "()Ljava/lang/String;"); - CacheInstanceJavaMethod(env, cache->ArrayListConstructor, cache->ArrayListClass, "", "()V"); CacheInstanceJavaMethod(env, cache->ArrayListCollectionConstructor, cache->ArrayListClass, "", "(Ljava/util/Collection;)V"); - CacheInstanceJavaMethod(env, cache->BooleanConstructor, cache->BooleanClass, "", "(Z)V"); CacheInstanceJavaMethod(env, cache->BooleanBooleanValue, cache->BooleanClass, "booleanValue", "()Z"); - CacheInstanceJavaMethod(env, cache->IntegerConstructor, cache->IntegerClass, "", "(I)V"); - CacheInstanceJavaMethod(env, cache->HashSetConstructor, cache->HashSetClass, "", "()V"); CacheInstanceJavaMethod(env, cache->HashSetAdd, cache->HashSetClass, "add", "(Ljava/lang/Object;)Z"); - CacheInstanceJavaMethod(env, cache->MapKeySet, cache->MapClass, "keySet", "()Ljava/util/Set;"); CacheInstanceJavaMethod(env, cache->MapSize, cache->MapClass, "size", "()I"); - CacheInstanceJavaMethod(env, cache->NumberIntValue, cache->NumberClass, "intValue", "()I"); CacheInstanceJavaMethod(env, cache->NumberLongValue, cache->NumberClass, "longValue", "()J"); - CacheInstanceJavaMethod(env, cache->TraceConstructor, cache->TraceClass, "", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V"); CacheStaticJavaField(env, cache->SeverityFieldInfo, cache->SeverityClass, "INFO", "Lcom/bugsnag/android/Severity;"); @@ -373,8 +342,6 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac CacheStaticJavaField(env, cache->ThreadSendPolicyAlways, cache->ThreadSendPolicyClass, "ALWAYS", "Lcom/bugsnag/android/ThreadSendPolicy;"); CacheStaticJavaField(env, cache->ThreadSendPolicyUnhandledOnly, cache->ThreadSendPolicyClass, "UNHANDLED_ONLY", "Lcom/bugsnag/android/ThreadSendPolicy;"); CacheStaticJavaField(env, cache->ThreadSendPolicyNever, cache->ThreadSendPolicyClass, "NEVER", "Lcom/bugsnag/android/ThreadSendPolicy;"); - CacheStaticJavaField(env, cache->ThreadTypeAndroid, cache->ThreadTypeClass, "ANDROID", "Lcom/bugsnag/android/ThreadType;"); - CacheStaticJavaField(env, cache->ThreadTypeC, cache->ThreadTypeClass, "C", "Lcom/bugsnag/android/ThreadType;"); return true; } @@ -467,6 +434,32 @@ jobject FAndroidPlatformJNI::ParseStringSet(JNIEnv* Env, const JNIReferenceCache return jSet; } +jobject FAndroidPlatformJNI::ParsePatternSet(JNIEnv* Env, const JNIReferenceCache* Cache, const TArray& Values) +{ + jobject jSet = Env->NewObject(Cache->HashSetClass, Cache->HashSetConstructor); + if (CheckAndClearException(Env) || !jSet) + { + return nullptr; + } + for (const FString& Value : Values) + { + jstring jPatternString = ParseFString(Env, Value); + if (!jPatternString) + { + continue; + } + jobject jPattern = Env->CallStaticObjectMethod(Cache->PatternClass, Cache->PatternCompileMethod, jPatternString); + CheckAndClearException(Env); + if (!jPattern) + { + continue; + } + Env->CallBooleanMethod(jSet, Cache->HashSetAdd, jPattern); + CheckAndClearException(Env); + } + return jSet; +} + jobject FAndroidPlatformJNI::ParseJsonObject(JNIEnv* Env, const JNIReferenceCache* Cache, const TSharedPtr& Object) { if (!Object.IsValid()) diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/JNIUtilities.h b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/JNIUtilities.h index 21fd653d..927f7c4f 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/JNIUtilities.h +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/JNIUtilities.h @@ -35,7 +35,6 @@ typedef struct jclass TelemetryClass; jclass ThreadClass; jclass ThreadSendPolicyClass; - jclass ThreadTypeClass; jclass SessionClass; jclass SeverityClass; jclass StackframeClass; @@ -55,6 +54,7 @@ typedef struct jclass MapClass; jclass NumberClass; jclass StringClass; + jclass PatternClass; jmethodID ArrayListConstructor; jmethodID ArrayListCollectionConstructor; @@ -226,6 +226,7 @@ typedef struct jmethodID NotifierSetUrl; jmethodID NotifierSetVersion; jmethodID NotifierSetDependencies; + jmethodID PatternCompileMethod; jmethodID SessionGetApp; jmethodID SessionGetDevice; jmethodID SessionGetId; @@ -247,7 +248,6 @@ typedef struct jmethodID ThreadGetErrorReportingThread; jmethodID ThreadGetId; jmethodID ThreadGetName; - jmethodID ThreadGetType; jmethodID ThreadGetStacktrace; jmethodID ThreadSetId; jmethodID ThreadSetName; @@ -292,8 +292,7 @@ typedef struct jfieldID ThreadSendPolicyAlways; jfieldID ThreadSendPolicyUnhandledOnly; jfieldID ThreadSendPolicyNever; - jfieldID ThreadTypeAndroid; - jfieldID ThreadTypeC; + } JNIReferenceCache; class FAndroidPlatformJNI @@ -352,6 +351,7 @@ class FAndroidPlatformJNI * @return A Java object reference or null on failure */ static jobject ParseBreadcrumbType(JNIEnv* Env, const JNIReferenceCache* Cache, EBugsnagBreadcrumbType Type); + /** * Convert an array of strings into a Java Set * @@ -363,6 +363,17 @@ class FAndroidPlatformJNI */ static jobject ParseStringSet(JNIEnv* Env, const JNIReferenceCache* Cache, const TArray& Values); + /** + * Convert an array of strings into a Java Set + * + * @param Env A JNI environment for the current thread + * @param Cache A reference to a cache object to populate. Must not be null. + * @param Values The array to convert + * + * @return A Java object reference or null on failure + */ + static jobject ParsePatternSet(JNIEnv* Env, const JNIReferenceCache* Cache, const TArray& Values); + /** * Convert enabled breadcrumb types into Set * diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/Specs/AndroidPlatformConfiguration.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/Specs/AndroidPlatformConfiguration.spec.cpp index 25ea2ec8..5de1dd71 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Android/Specs/AndroidPlatformConfiguration.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Android/Specs/AndroidPlatformConfiguration.spec.cpp @@ -1,8 +1,11 @@ // Copyright 2022 Bugsnag. All Rights Reserved. -#include "Android/AndroidJavaEnv.h" +#include "Android/AndroidApplication.h" + #include "AutomationTest.h" +#include "Runtime/Launch/Resources/Version.h" + #include "../AndroidPlatformConfiguration.h" // @@ -11,8 +14,15 @@ // * Open Unreal Editor's "Session Frontend" and find the running game in "My Sessions" // * Click the "Automation" tab, select the tests to run, and click "Start Tests"! // +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists BEGIN_DEFINE_SPEC(FAndroidPlatformConfigurationSpec, "Bugsnag.FAndroidPlatformConfigurationSpec", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(FAndroidPlatformConfigurationSpec, "Bugsnag.FAndroidPlatformConfigurationSpec", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(FAndroidPlatformConfigurationSpec) void FAndroidPlatformConfigurationSpec::Define() { @@ -21,14 +31,14 @@ void FAndroidPlatformConfigurationSpec::Define() static JNIReferenceCache JNICache; if (!JNICache.loaded) { - JNICache.loaded = FAndroidPlatformJNI::LoadReferenceCache(AndroidJavaEnv::GetJavaEnv(), &JNICache); + JNICache.loaded = FAndroidPlatformJNI::LoadReferenceCache(FAndroidApplication::GetJavaEnv(), &JNICache); } Describe("Telemetry", [this]() { It("Should contain all types by default", [this]() { - JNIEnv* Env = AndroidJavaEnv::GetJavaEnv(); + JNIEnv* Env = FAndroidApplication::GetJavaEnv(); jmethodID SizeMethod = Env->GetMethodID(Env->FindClass("java/util/Set"), "size", "()I"); jmethodID GetTelemetryMethod = Env->GetMethodID(JNICache.ConfigClass, "getTelemetry", "()Ljava/util/Set;"); TEST_FALSE(Env->ExceptionCheck()); @@ -46,7 +56,7 @@ void FAndroidPlatformConfigurationSpec::Define() It("Should be empty after setting EBugsnagTelemetryTypes::None", [this]() { - JNIEnv* Env = AndroidJavaEnv::GetJavaEnv(); + JNIEnv* Env = FAndroidApplication::GetJavaEnv(); jmethodID SizeMethod = Env->GetMethodID(Env->FindClass("java/util/Set"), "size", "()I"); jmethodID GetTelemetryMethod = Env->GetMethodID(JNICache.ConfigClass, "getTelemetry", "()Ljava/util/Set;"); diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleBreadcrumb.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleBreadcrumb.spec.cpp index 947c5333..c261ebc6 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleBreadcrumb.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleBreadcrumb.spec.cpp @@ -2,10 +2,19 @@ #include "AutomationTest.h" +#include "Runtime/Launch/Resources/Version.h" + #include "../AppleBreadcrumb.h" +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists BEGIN_DEFINE_SPEC(FAppleBreadcrumbSpec, "Bugsnag.FAppleBreadcrumbSpec", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(FAppleBreadcrumbSpec, "Bugsnag.FAppleBreadcrumbSpec", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(FAppleBreadcrumbSpec) void FAppleBreadcrumbSpec::Define() { diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleBugsnagUtils.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleBugsnagUtils.spec.cpp index d6606195..27810e1a 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleBugsnagUtils.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleBugsnagUtils.spec.cpp @@ -2,10 +2,19 @@ #include "AutomationTest.h" +#include "Runtime/Launch/Resources/Version.h" + #include "../AppleBugsnagUtils.h" +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists BEGIN_DEFINE_SPEC(FAppleBugsnagUtilsSpec, "Bugsnag.FAppleBugsnagUtilsSpec", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(FAppleBugsnagUtilsSpec, "Bugsnag.FAppleBugsnagUtilsSpec", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(FAppleBugsnagUtilsSpec) void FAppleBugsnagUtilsSpec::Define() { diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleDevice.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleDevice.spec.cpp index ac337f83..8dc0764f 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleDevice.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleDevice.spec.cpp @@ -2,10 +2,19 @@ #include "AutomationTest.h" +#include "Runtime/Launch/Resources/Version.h" + #include "../AppleDevice.h" +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists BEGIN_DEFINE_SPEC(FAppleDeviceSpec, "Bugsnag.FAppleDeviceSpec", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(FAppleDeviceSpec, "Bugsnag.FAppleDeviceSpec", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(FAppleDeviceSpec) void FAppleDeviceSpec::Define() { diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleError.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleError.spec.cpp index d4f288a0..fdfa9652 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleError.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleError.spec.cpp @@ -2,12 +2,21 @@ #include "AutomationTest.h" +#include "Runtime/Launch/Resources/Version.h" + #include "../AppleError.h" #import +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists BEGIN_DEFINE_SPEC(FAppleErrorSpec, "Bugsnag.FAppleErrorSpec", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(FAppleErrorSpec, "Bugsnag.FAppleErrorSpec", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(FAppleErrorSpec) void FAppleErrorSpec::Define() { diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleEvent.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleEvent.spec.cpp index faeeb036..74cac710 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleEvent.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleEvent.spec.cpp @@ -2,12 +2,21 @@ #include "AutomationTest.h" +#include "Runtime/Launch/Resources/Version.h" + #include "../AppleEvent.h" #import +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists BEGIN_DEFINE_SPEC(FAppleEventSpec, "Bugsnag.FAppleEventSpec", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(FAppleEventSpec, "Bugsnag.FAppleEventSpec", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(FAppleEventSpec) void FAppleEventSpec::Define() { diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/ApplePlatformConfiguration.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/ApplePlatformConfiguration.spec.cpp index ca302c1a..2883ee22 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/ApplePlatformConfiguration.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/ApplePlatformConfiguration.spec.cpp @@ -5,6 +5,8 @@ #include "../ApplePlatformConfiguration.h" #include "BugsnagConfiguration.h" +#include "Runtime/Launch/Resources/Version.h" + #import // @@ -12,8 +14,15 @@ // // https://docs.unrealengine.com/en-US/TestingAndOptimization/Automation/AutomationSpec/ // +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists BEGIN_DEFINE_SPEC(FApplePlatformConfigurationSpec, "Bugsnag.FApplePlatformConfigurationSpec", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(FApplePlatformConfigurationSpec, "Bugsnag.FApplePlatformConfigurationSpec", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(FApplePlatformConfigurationSpec) void FApplePlatformConfigurationSpec::Define() { diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleStackframe.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleStackframe.spec.cpp index 87d1e1c5..d1685463 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleStackframe.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleStackframe.spec.cpp @@ -2,12 +2,21 @@ #include "AutomationTest.h" +#include "Runtime/Launch/Resources/Version.h" + #include "../AppleStackframe.h" #import +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists BEGIN_DEFINE_SPEC(FAppleStackframeSpec, "Bugsnag.FAppleStackframeSpec", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(FAppleStackframeSpec, "Bugsnag.FAppleStackframeSpec", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(FAppleStackframeSpec) void FAppleStackframeSpec::Define() { diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleThread.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleThread.spec.cpp index 90727e8c..2df39f83 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleThread.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Apple/Specs/AppleThread.spec.cpp @@ -2,12 +2,21 @@ #include "AutomationTest.h" +#include "Runtime/Launch/Resources/Version.h" + #include "../AppleThread.h" #import +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists BEGIN_DEFINE_SPEC(FAppleThreadSpec, "Bugsnag.FAppleThreadSpec", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(FAppleThreadSpec, "Bugsnag.FAppleThreadSpec", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(FAppleThreadSpec) void FAppleThreadSpec::Define() { diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Specs/BugsnagConfiguration.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Specs/BugsnagConfiguration.spec.cpp index 714609c6..7f853c40 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Specs/BugsnagConfiguration.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Specs/BugsnagConfiguration.spec.cpp @@ -2,6 +2,8 @@ #include "Misc/AutomationTest.h" +#include "Runtime/Launch/Resources/Version.h" + #include "BugsnagConfiguration.h" #define TEST_TRUE(expression) \ @@ -18,8 +20,15 @@ // // https://docs.unrealengine.com/4.27/en-US/TestingAndOptimization/Automation/AutomationSpec/ // +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists BEGIN_DEFINE_SPEC(FBugsnagConfigurationSpec, "Bugsnag.FBugsnagConfigurationSpec", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(FBugsnagConfigurationSpec, "Bugsnag.FBugsnagConfigurationSpec", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(FBugsnagConfigurationSpec) void FBugsnagConfigurationSpec::Define() { diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Specs/BugsnagFunctionLibrary.spec.cpp b/Plugins/Bugsnag/Source/Bugsnag/Private/Specs/BugsnagFunctionLibrary.spec.cpp index 3ac75516..1ea0721f 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Specs/BugsnagFunctionLibrary.spec.cpp +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Specs/BugsnagFunctionLibrary.spec.cpp @@ -2,6 +2,8 @@ #include "Misc/AutomationTest.h" +#include "Runtime/Launch/Resources/Version.h" + #include "BugsnagFunctionLibrary.h" #define TEST_TRUE(expression) \ @@ -18,8 +20,16 @@ // // https://docs.unrealengine.com/en-US/TestingAndOptimization/Automation/AutomationSpec/ // -BEGIN_DEFINE_SPEC(UBugsnagFunctionLibrarySpec, "Bugsnag.UBugsnagFunctionLibrarySpec", + +#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 5) +// For UE5.0–5.4: ApplicationContextMask still exists +BEGIN_DEFINE_SPEC(UBugsnagFunctionLibrarySpec, "Bugsnag.FunctionLibrary", EAutomationTestFlags::ProductFilter | EAutomationTestFlags::ApplicationContextMask) +#else +// For UE5.5+ (ApplicationContextMask removed) +BEGIN_DEFINE_SPEC(UBugsnagFunctionLibrarySpec, "Bugsnag.FunctionLibrary", + EAutomationTestFlags::ProductFilter | EAutomationTestFlags::EditorContext) +#endif END_DEFINE_SPEC(UBugsnagFunctionLibrarySpec) void UBugsnagFunctionLibrarySpec::Define() { diff --git a/Plugins/Bugsnag/Source/Bugsnag/Private/Version.h b/Plugins/Bugsnag/Source/Bugsnag/Private/Version.h index 6e6a40b6..3b249085 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Private/Version.h +++ b/Plugins/Bugsnag/Source/Bugsnag/Private/Version.h @@ -4,4 +4,4 @@ #define BUGSNAG_UNREAL_NAME "Unreal Bugsnag Notifier" #define BUGSNAG_UNREAL_URL "https://github.com/bugsnag/bugsnag-unreal" -#define BUGSNAG_UNREAL_VERSION_STRING "2.0.0" +#define BUGSNAG_UNREAL_VERSION_STRING "2.1.0" diff --git a/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagConfiguration.h b/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagConfiguration.h index 724c9084..6ace3744 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagConfiguration.h +++ b/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagConfiguration.h @@ -553,7 +553,7 @@ class BUGSNAG_API FBugsnagConfiguration final : public IBugsnagFeatureFlagStore, * * The callback should return `true` to allow or `false` to prevent the event being sent. * - * Note that the callback will not normally be invoked on the thread where the error ocurred, + * Note that the callback will not normally be invoked on the thread where the error occurred, * and may run at a much later point in time or after the application has been relaunched. */ void AddOnSendError(FBugsnagOnErrorCallback Callback) { OnSendErrorCallbacks.Add(Callback); } diff --git a/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagError.h b/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagError.h index daec5be5..0fa9ef1f 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagError.h +++ b/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagError.h @@ -35,7 +35,7 @@ class BUGSNAG_API IBugsnagError virtual EBugsnagErrorType GetErrorType() const = 0; /** - * The stack trace at the time the error ocurred. + * The stack trace at the time the error occurred. */ virtual TArray> GetStacktrace() const = 0; diff --git a/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagEvent.h b/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagEvent.h index 60c64523..c2ee7f3f 100644 --- a/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagEvent.h +++ b/Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagEvent.h @@ -64,12 +64,12 @@ class BUGSNAG_API IBugsnagEvent : public virtual IBugsnagFeatureFlagStore, publi virtual void SetGroupingHash(const TOptional&) = 0; /** - * Information about the app at the time the error ocurred. + * Information about the app at the time the error occurred. */ virtual const TSharedRef GetApp() const = 0; /** - * Information about the computer or device running the app at the time the error ocurred. + * Information about the computer or device running the app at the time the error occurred. */ virtual const TSharedRef GetDevice() const = 0; diff --git a/Plugins/Bugsnag/Source/ThirdParty/BugsnagCocoa/BugsnagCocoa.Build.cs b/Plugins/Bugsnag/Source/ThirdParty/BugsnagCocoa/BugsnagCocoa.Build.cs index 62830d2a..33bd7756 100644 --- a/Plugins/Bugsnag/Source/ThirdParty/BugsnagCocoa/BugsnagCocoa.Build.cs +++ b/Plugins/Bugsnag/Source/ThirdParty/BugsnagCocoa/BugsnagCocoa.Build.cs @@ -14,6 +14,7 @@ public BugsnagCocoa(ReadOnlyTargetRules Target) : base(Target) CheckFileExists(Path.Combine(IncludePath, "Bugsnag", "Bugsnag.h")); CheckFileExists(Path.Combine(IncludePath, "BugsnagPrivate", "Bugsnag+Private.h")); PublicSystemIncludePaths.Add(IncludePath); + PublicSystemIncludePaths.Add(Path.Combine(IncludePath, "BugsnagPrivate")); string LibraryPath = Path.Combine(ModuleDirectory, Target.Platform.ToString(), "libBugsnagStatic.a"); CheckFileExists(LibraryPath); diff --git a/VERSION b/VERSION index 227cea21..7ec1d6db 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 +2.1.0 diff --git a/deps/bugsnag-cocoa b/deps/bugsnag-cocoa index 49f60b8d..f4348c29 160000 --- a/deps/bugsnag-cocoa +++ b/deps/bugsnag-cocoa @@ -1 +1 @@ -Subproject commit 49f60b8dc2e94e7ede1114e2c39ba6ac0b576f42 +Subproject commit f4348c29cc881ce80e4e22a46f29d7f5a18e924b diff --git a/deps/bugsnag-plugin-android-unreal/build.gradle b/deps/bugsnag-plugin-android-unreal/build.gradle index efe5198a..26a4dcdd 100644 --- a/deps/bugsnag-plugin-android-unreal/build.gradle +++ b/deps/bugsnag-plugin-android-unreal/build.gradle @@ -28,7 +28,7 @@ android { } dependencies { - api "com.bugsnag:bugsnag-android-core:5.31.3" + api "com.bugsnag:bugsnag-android-core:6.19.0" androidTestImplementation 'androidx.test:runner:1.4.0' androidTestImplementation 'androidx.test:rules:1.4.0' androidTestImplementation 'junit:junit:4.12' @@ -40,7 +40,7 @@ task generatePom { pom { project { groupId 'com.bugsnag' - version '2.0.0' + version '2.1.0' packaging 'aar' } }.writeTo("$buildDir/outputs/aar/bugsnag-plugin-android-unreal-release.pom") diff --git a/deps/bugsnag-plugin-android-unreal/src/main/java/com/bugsnag/android/unreal/UnrealPlugin.java b/deps/bugsnag-plugin-android-unreal/src/main/java/com/bugsnag/android/unreal/UnrealPlugin.java index ddd3cd13..ab1e7fed 100644 --- a/deps/bugsnag-plugin-android-unreal/src/main/java/com/bugsnag/android/unreal/UnrealPlugin.java +++ b/deps/bugsnag-plugin-android-unreal/src/main/java/com/bugsnag/android/unreal/UnrealPlugin.java @@ -19,6 +19,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.regex.Pattern; public class UnrealPlugin implements Plugin { static final String DEFAULT_HANDLED_REASON = "handledError"; @@ -90,7 +91,8 @@ public boolean onSession(Session session) { */ static native void setSeverityReason(Event event, String reasonType); - static private Set discardClasses; + private static Set discardClasses; + public UnrealPlugin(Configuration config) { config.addOnBreadcrumb(onBreadcrumbRunner); @@ -118,8 +120,12 @@ static void notify(String name, String message, StackTraceElement[] stacktrace, if (client == null || name == null) { return; } - if (discardClasses != null && discardClasses.contains(name)) { - return; + if (discardClasses != null) { + for (Pattern pattern : discardClasses) { + if (pattern.matcher(name).matches()) { + return; + } + } } Throwable exc = new RuntimeException(); diff --git a/docker-compose.yml b/docker-compose.yml index 50c3d356..521cfec4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ -version: '3.6' services: maze-runner: - image: 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner-releases:latest-v8-cli + image: 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner-releases:latest-v10-cli environment: DEBUG: BUILDKITE: @@ -17,9 +16,14 @@ services: BUILDKITE_REPO: BUILDKITE_RETRY_COUNT: BUILDKITE_STEP_KEY: + BUILDKITE_ANALYTICS_TOKEN: BROWSER_STACK_USERNAME: BROWSER_STACK_ACCESS_KEY: + MAZE_NO_FAIL_FAST: + MAZE_BUGSNAG_API_KEY: + MAZE_APPIUM_BUGSNAG_API_KEY: volumes: - ./build:/app/build - ./features/:/app/features/ - ./maze_output:/app/maze_output + - ./reports/:/app/reports/ diff --git a/features/fixtures/generic/Config/DefaultEngine.ini b/features/fixtures/generic/Config/DefaultEngine.ini index 27deaee8..bd8b1035 100644 --- a/features/fixtures/generic/Config/DefaultEngine.ini +++ b/features/fixtures/generic/Config/DefaultEngine.ini @@ -10,7 +10,7 @@ GameDefaultMap=/Game/MainLevel.MainLevel [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings] Orientation=Portrait -PackageName=com.bugsnag.examples.UnrealTestFixture +PackageName=com.bugsnag.example.unrealtestfixture bBuildForArm64=True bPackageDataInsideApk=True bShowLaunchImage=False @@ -35,7 +35,7 @@ ManualIPAddress= [/Script/IOSRuntimeSettings.IOSRuntimeSettings] BundleDisplayName=TestFixture -BundleIdentifier=com.bugsnag.examples.UnrealTestFixture +BundleIdentifier=com.bugsnag.example.unrealtestfixture BundleName=TestFixture IOSTeamID=7W9PZ27Y5F MobileProvision= @@ -46,13 +46,17 @@ bSupportsLandscapeRightOrientation=False bSupportsPortraitOrientation=True bShipForBitcode=False bDisableHTTPS=True +bGeneratedSYMFile=True +bEnableNSAllowsArbitraryLoads=true + +AdditionalPlistData=NSAppTransportSecurityNSExceptionDomainsbs-local.comNSExceptionAllowsInsecureHTTPLoadsNSIncludesSubdomainsNSTemporaryExceptionAllowsInsecureHTTPLoadsNSTemporaryExceptionMinimumTLSVersionTLSv1.0 [/Script/Bugsnag.BugsnagSettings] bStartAutomaticallyAtLaunch=False [/Script/MacTargetPlatform.XcodeProjectSettings] CodeSigningTeam=7W9PZ27Y5F -BundleIdentifier=com.bugsnag.examples.UnrealTestFixture +BundleIdentifier=com.bugsnag.example.unrealtestfixture CodeSigningPrefix=$(UE_SIGNING_PREFIX).$(UE_PRODUCT_NAME_STRIPPED) bUseAutomaticCodeSigning=True bUseModernXcode=False diff --git a/features/fixtures/generic/Config/DefaultGame.ini b/features/fixtures/generic/Config/DefaultGame.ini index 1f504f6f..f0f3ae17 100644 --- a/features/fixtures/generic/Config/DefaultGame.ini +++ b/features/fixtures/generic/Config/DefaultGame.ini @@ -11,6 +11,7 @@ ForDistribution=True bShouldWindowPreserveAspectRatio=False bAllowWindowResize=False CopyrightNotice=Copyright 2021 Bugsnag. All Rights Reserved. +ProjectName=unrealtestfixture [/Script/Engine.AssetManagerSettings] -PrimaryAssetTypesToScan=(PrimaryAssetType="Map",AssetBaseClass=/Script/Engine.World,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game/Maps")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) diff --git a/features/fixtures/generic/Plugins/Tweaks/Source/Tweaks/Tweaks_UPL.xml b/features/fixtures/generic/Plugins/Tweaks/Source/Tweaks/Tweaks_UPL.xml index 15b6360c..4fab371d 100644 --- a/features/fixtures/generic/Plugins/Tweaks/Source/Tweaks/Tweaks_UPL.xml +++ b/features/fixtures/generic/Plugins/Tweaks/Source/Tweaks/Tweaks_UPL.xml @@ -7,10 +7,43 @@ - android.compileSdkVersion 31 + def ueVersion = System.getenv("UE_VERSION") + + if (ueVersion != null) + { + if( + ueVersion == "4.27" || + ueVersion == "5.0" || + ueVersion == "5.1" ) + { + android.compileSdkVersion 31 + android.defaultConfig { + minSdkVersion 26 + } + android.compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } + else if( + ueVersion == "5.2" || + ueVersion == "5.3" || + ueVersion == "5.4" ) + { + android.compileSdkVersion 34 + } + else + { + android.compileSdkVersion 35 + } + } + else + { + android.compileSdkVersion 35 + } - + import android.content.Intent; @@ -29,9 +62,7 @@ public void clearBugsnagCache() { File cache = getCacheDir(); - deleteRecursive(cache, "bugsnag-native"); - deleteRecursive(cache, "bugsnag-errors"); - deleteRecursive(cache, "bugsnag-sessions"); + deleteRecursive(cache, "bugsnag"); } public void deleteRecursive(File file) { @@ -52,3 +83,5 @@ + + diff --git a/features/fixtures/generic/Source/TestFixture/Scenarios/BadMemoryAccessScenario.cpp b/features/fixtures/generic/Source/TestFixture/Scenarios/BadMemoryAccessScenario.cpp index ab8704d0..49deb4dc 100644 --- a/features/fixtures/generic/Source/TestFixture/Scenarios/BadMemoryAccessScenario.cpp +++ b/features/fixtures/generic/Source/TestFixture/Scenarios/BadMemoryAccessScenario.cpp @@ -65,7 +65,7 @@ class BadMemoryAccessScenario : public Scenario UBugsnagFunctionLibrary::AddMetadata(TEXT("custom"), TEXT("someValue"), TEXT("foobar")); TSharedPtr CustomMetadata = UBugsnagFunctionLibrary::GetMetadata("custom"); TSharedPtr ExistingValue = UBugsnagFunctionLibrary::GetMetadata("custom", "someValue"); - if (CustomMetadata.IsValid() && ExistingValue.IsValid() && CustomMetadata->HasField("someValue")) + if (CustomMetadata.IsValid() && ExistingValue.IsValid() && CustomMetadata->HasField(TEXT("someValue"))) { UBugsnagFunctionLibrary::ClearMetadata("custom", "someValue"); UBugsnagFunctionLibrary::AddMetadata("custom", "someOtherValue", ExistingValue); diff --git a/features/fixtures/generic/Source/TestFixture/Scenarios/ModifyCrumbsScenario.cpp b/features/fixtures/generic/Source/TestFixture/Scenarios/ModifyCrumbsScenario.cpp index 670b9bf4..402dd198 100644 --- a/features/fixtures/generic/Source/TestFixture/Scenarios/ModifyCrumbsScenario.cpp +++ b/features/fixtures/generic/Source/TestFixture/Scenarios/ModifyCrumbsScenario.cpp @@ -9,7 +9,7 @@ class ModifyCrumbsScenario : public Scenario { FString Message = Crumb->GetMessage(); TSharedPtr Metadata = Crumb->GetMetadata(); - if (Crumb->GetType() == EBugsnagBreadcrumbType::User && Metadata->HasField("forty") && Metadata->HasField("macaron") && Message.Compare("Crash time", ESearchCase::CaseSensitive) == 0) + if (Crumb->GetType() == EBugsnagBreadcrumbType::User && Metadata->HasField(TEXT("forty")) && Metadata->HasField(TEXT("macaron")) && Message.Compare("Crash time", ESearchCase::CaseSensitive) == 0) // HasField returns false when the value is false { Metadata->SetStringField("forty", "four zero"); diff --git a/features/fixtures/generic/Source/TestFixture/Scenarios/NotifyWithLaunchInfoScenario.cpp b/features/fixtures/generic/Source/TestFixture/Scenarios/NotifyWithLaunchInfoScenario.cpp index 179719f1..bd2af7d3 100644 --- a/features/fixtures/generic/Source/TestFixture/Scenarios/NotifyWithLaunchInfoScenario.cpp +++ b/features/fixtures/generic/Source/TestFixture/Scenarios/NotifyWithLaunchInfoScenario.cpp @@ -1,4 +1,7 @@ +#include "Engine/Engine.h" +#include "Engine/World.h" #include "Scenario.h" +#include "TimerManager.h" #include "Dom/JsonValue.h" diff --git a/features/fixtures/generic/Source/TestFixture/Scenarios/OpenBadLevelScenario.cpp b/features/fixtures/generic/Source/TestFixture/Scenarios/OpenBadLevelScenario.cpp index 7aace22a..0e5dc006 100644 --- a/features/fixtures/generic/Source/TestFixture/Scenarios/OpenBadLevelScenario.cpp +++ b/features/fixtures/generic/Source/TestFixture/Scenarios/OpenBadLevelScenario.cpp @@ -1,3 +1,4 @@ +#include "Engine/World.h" #include "Scenario.h" #include "Kismet/GameplayStatics.h" @@ -13,7 +14,8 @@ class OpenBadLevelScenario : public Scenario void Run() override { // Will be processed safely on the next tick in UGameEngine::Tick() - UGameplayStatics::OpenLevel(GetCurrentPlayWorld(), TEXT("/Game/NonExistant")); + UWorld* World = GetCurrentPlayWorld(); + UGameplayStatics::OpenLevel(World, TEXT("/Game/NonExistant")); FCoreUObjectDelegates::PostLoadMapWithWorld.AddLambda([](UWorld* World) { diff --git a/features/fixtures/generic/Source/TestFixture/Scenarios/OpenLevelBreadcrumbsScenario.cpp b/features/fixtures/generic/Source/TestFixture/Scenarios/OpenLevelBreadcrumbsScenario.cpp index d6100afe..ed9aa9db 100644 --- a/features/fixtures/generic/Source/TestFixture/Scenarios/OpenLevelBreadcrumbsScenario.cpp +++ b/features/fixtures/generic/Source/TestFixture/Scenarios/OpenLevelBreadcrumbsScenario.cpp @@ -1,4 +1,7 @@ +#include "Engine/Engine.h" +#include "Engine/World.h" #include "Scenario.h" +#include "TimerManager.h" #include "Kismet/GameplayStatics.h" diff --git a/features/fixtures/generic/Source/TestFixture/Scenarios/Scenario.cpp b/features/fixtures/generic/Source/TestFixture/Scenarios/Scenario.cpp index 7c2e877f..7be761af 100644 --- a/features/fixtures/generic/Source/TestFixture/Scenarios/Scenario.cpp +++ b/features/fixtures/generic/Source/TestFixture/Scenarios/Scenario.cpp @@ -1,4 +1,6 @@ #include "Scenario.h" +#include "Engine/Engine.h" +#include "Engine/World.h" #if PLATFORM_ANDROID #include "Android/AndroidJavaEnv.h" @@ -28,7 +30,8 @@ void Scenario::ClearPersistentData() { if (![Error.domain isEqual:NSCocoaErrorDomain] && Error.code != NSFileNoSuchFileError) { - UE_LOG(LogTestFixture, Error, TEXT("%@"), UTF8_TO_TCHAR(Error.description.UTF8String)); + FString ErrorDescription = UTF8_TO_TCHAR([Error.description UTF8String]); + UE_LOG(LogTestFixture, Error, TEXT("%s"), *ErrorDescription); } } #endif diff --git a/features/handled_errors.feature b/features/handled_errors.feature index 1a93fbdb..1d45e5cb 100644 --- a/features/handled_errors.feature +++ b/features/handled_errors.feature @@ -13,7 +13,7 @@ Feature: Reporting handled errors And the event "context" starts with "Lorem ipsum dolor sit amet" And the event "app.duration" equals 37 And the event "app.durationInForeground" is not null - And the event "app.id" equals "com.bugsnag.examples.UnrealTestFixture" + And the event "app.id" equals "com.bugsnag.example.unrealtestfixture" And the event "app.inForeground" is true And the event "app.isLaunching" is true And the event "app.releaseStage" equals "production" @@ -117,8 +117,7 @@ Feature: Reporting handled errors And the exception "message" equals "Its literally a function argument" And the error payload field "events.0.threads" is a non-empty array And the error payload field "events.0.threads.0.name" equals "Why would you change this either?" - And on iOS, the error payload field "events.0.threads.0.id" equals "9000" - And on Android, the error payload field "events.0.threads.0.id" equals 9000 + And the error payload field "events.0.threads.0.id" equals "9000" @slow Scenario: Cancel notify from callback diff --git a/features/scripts/build-fixture.sh b/features/scripts/build-fixture.sh index 8f599eeb..adfcafdc 100755 --- a/features/scripts/build-fixture.sh +++ b/features/scripts/build-fixture.sh @@ -2,30 +2,51 @@ set -o errexit set -o nounset +set -x PLATFORM=$1 UPROJECT="${PWD}/features/fixtures/generic/TestFixture.uproject" +XCODE_EXPORT_OPTIONS="${PWD}/features/scripts/exportOptions.plist" + UE_VERSION="${UE_VERSION:-4.27}" UE_HOME="/Users/Shared/Epic Games/UE_${UE_VERSION}" UE_BUILD="${UE_HOME}/Engine/Build/BatchFiles/Mac/Build.sh" UE_RUNUAT="${UE_HOME}/Engine/Build/BatchFiles/RunUAT.sh" - +MODERN_IOS=false +MODERN_MAC_OS=false + +# Function to compare semantic versions +version_gte() { + # returns true (0) if $1 >= $2 + [[ "$(printf '%s\n' "$2" "$1" | sort -V | head -n1)" == "$2" ]] +} + +if version_gte "${UE_VERSION}" "5.4" && [[ "${PLATFORM}" == "IOS" ]]; then + echo "--- Using iOS modern xcode setup" + MODERN_IOS=true +fi + +if version_gte "${UE_VERSION}" "5.3" && [[ "${PLATFORM}" == "Mac" ]]; then + echo "--- Using MacOS modern Xcode setup" + MODERN_MAC_OS=true +fi + +if [[ "$MODERN_IOS" == true ]]; then + echo "--- Deleting Xcode Archives directory" + rm -rf ~/Library/Developer/Xcode/Archives +fi + +if [[ "$MODERN_IOS" == true || "$MODERN_MAC_OS" == true ]]; then + echo "--- Enabling Modern Xcode Build" + sed -i '' 's/bUseModernXcode=False/bUseModernXcode=True/' features/fixtures/generic/Config/DefaultEngine.ini +fi echo "--- Installing plugin" unzip -o "Build/Plugin/Bugsnag-$(cat VERSION)-$(git rev-parse --short=7 HEAD)-UE_${UE_VERSION}-macOS.zip" -d features/fixtures/generic/Plugins -case "${UE_VERSION}" in - 5.3) - if [[ "$PLATFORM" == "Mac" ]]; then - echo "--- Enabling Modern Xcode Build" - sed -i '' 's/bUseModernXcode=False/bUseModernXcode=True/' features/fixtures/generic/Config/DefaultEngine.ini - fi - ;; -esac - echo "--- Building Editor dependencies" "${UE_BUILD}" TestFixture Mac Development -TargetType=Editor -ForceUnity "${UPROJECT}" @@ -44,6 +65,10 @@ case "${PLATFORM}" in Mac) RUNUAT_ARGS+=(-archive) ;; esac +if [[ "$MODERN_IOS" == true ]]; then + RUNUAT_ARGS+=(-distribution) +fi + "${UE_RUNUAT}" "${RUNUAT_ARGS[@]}" -unattended -utf8output @@ -58,20 +83,47 @@ case "${PLATFORM}" in ;; IOS) + if [[ "$MODERN_IOS" == true ]]; then + echo "--- Building ipa and dsym files after modern xcode build" + echo "--- Finding the xcarchive file" + ARCHIVE_PATH=$(find ~/Library/Developer/Xcode/Archives -type d -name "*.xcarchive" -print -quit) + + if [[ -n "$ARCHIVE_PATH" ]]; then + echo "--- Found xcarchive at $ARCHIVE_PATH" + echo "--- Building IPA from xcarchive" + xcodebuild -exportArchive -archivePath "$ARCHIVE_PATH" \ + -exportPath build/TestFixture-IOS-Shipping-"${UE_VERSION}" \ + -exportOptionsPlist "$XCODE_EXPORT_OPTIONS" + + echo "xcode finished building" + + echo "--- IPA built successfully" + + mv build/TestFixture-IOS-Shipping-"${UE_VERSION}"/TestFixture-IOS-Shipping.ipa build/TestFixture-IOS-Shipping-"${UE_VERSION}".ipa + + # Check and move the dSYM file + DSYM_PATH="${ARCHIVE_PATH}/dSYMs/TestFixture-IOS-Shipping.app.dSYM" + if [[ -d "$DSYM_PATH" ]]; then + echo "--- Found dSYM at $DSYM_PATH" + mv "$DSYM_PATH" build/TestFixture-IOS-Shipping-"${UE_VERSION}".dSYM + cp build/TestFixture-IOS-Shipping-"${UE_VERSION}".dSYM/Contents/Resources/DWARF/TestFixture-IOS-Shipping build/TestFixture-IOS-Shipping-"${UE_VERSION}"-file.dSYM + else + echo "Error: dSYM file not found." + exit 1 + fi + else + echo "Error: No xcarchive found." + exit 1 + fi + else mv features/fixtures/generic/Binaries/IOS/TestFixture-IOS-Shipping.dSYM build/TestFixture-IOS-Shipping-"${UE_VERSION}".dSYM mv features/fixtures/generic/Binaries/IOS/TestFixture-IOS-Shipping.ipa build/TestFixture-IOS-Shipping-"${UE_VERSION}".ipa - ;; + fi + ;; Mac) - case "${UE_VERSION}" in - 4.23) - mv features/fixtures/generic/ArchivedBuilds/MacNoEditor/TestFixture.app features/fixtures/generic/ArchivedBuilds/MacNoEditor/TestFixture-Mac-Shipping.app - mv features/fixtures/generic/ArchivedBuilds/MacNoEditor/TestFixture-Mac-Shipping.app/Contents/MacOS/TestFixture features/fixtures/generic/ArchivedBuilds/MacNoEditor/TestFixture-Mac-Shipping.app/Contents/MacOS/TestFixture-Mac-Shipping - ;; - 5.*) - mv features/fixtures/generic/ArchivedBuilds/Mac/ features/fixtures/generic/ArchivedBuilds/MacNoEditor/ - ;; - esac + mkdir -p features/fixtures/generic/ArchivedBuilds/MacNoEditor + mv features/fixtures/generic/ArchivedBuilds/TestFixture-Mac-Shipping.app features/fixtures/generic/ArchivedBuilds/MacNoEditor/TestFixture-Mac-Shipping.app zip -r TestFixture-macOS-"${UE_VERSION}".zip features/fixtures/generic/ArchivedBuilds ;; esac diff --git a/features/scripts/exportOptions.plist b/features/scripts/exportOptions.plist new file mode 100644 index 00000000..d5cbd19d --- /dev/null +++ b/features/scripts/exportOptions.plist @@ -0,0 +1,18 @@ + + + + + teamID + 7W9PZ27Y5F + stripSwiftSymbols + + compileBitcode + + thinning + <none> + uploadSymbols + + generateAppStoreInformation + + + diff --git a/features/sessions.feature b/features/sessions.feature index b207c951..c4c1d574 100644 --- a/features/sessions.feature +++ b/features/sessions.feature @@ -46,5 +46,4 @@ Feature: Session tracking @slow Scenario: Automatic session tracking disabled When I run "AutoTrackSessionsDisabledScenario" - And I background the app for 3 seconds Then I should receive no sessions diff --git a/features/steps/unreal_steps.rb b/features/steps/unreal_steps.rb index 9def688b..d5eb5b50 100644 --- a/features/steps/unreal_steps.rb +++ b/features/steps/unreal_steps.rb @@ -22,19 +22,9 @@ run_fixture(:start_bugsnag, scenario_2) end -When('I background the app for {int} seconds') do |duration| - if is_platform? :macos - `osascript -e 'tell application "System Events" to tell process "TestFixture-Mac-Shipping" to set visible to false'` - sleep duration - `osascript -e 'tell application "TestFixture-Mac-Shipping" to activate'` - else - Maze.driver.background_app(duration) - end -end - Then('the mobile app is not running') do wait_for_true do - state = app_state() + state = Maze::Api::Appium::AppManager.new.state # workaround for faulty app state detection in appium v1.23 and lower on # Android where an app that is not running is detected to be running in # the background @@ -97,7 +87,7 @@ def run_fixture(action, scenario_name, wait_for_crash: false) wait_for_get_command if wait_for_crash step 'the mobile app is not running' - Maze.driver.launch_app + Maze::Api::Appium::AppManager.new.launch sleep 3 end when 'macos' diff --git a/features/support/env.rb b/features/support/env.rb index 67e680f6..bf066a86 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -22,6 +22,14 @@ skip_this_scenario("Not compatible with iOS") if is_platform? 'iOS' end +def skip_between(os, version_lo, version_hi) + skip_this_scenario("Skipping scenario") if Maze::Helper.get_current_platform == os and Maze.config.os_version >= version_lo and Maze.config.os_version <= version_hi +end + +Before('@skip_ios_18') do |_scenario| + skip_between('ios', 18, 18.99) +end + def is_platform? name # case-insensitive string compare, also accepts symbols. examples: # @@ -47,10 +55,6 @@ def artifact_path end end -def app_state - Maze.driver.app_state('com.bugsnag.examples.UnrealTestFixture') -end - Maze.hooks.before do $started_at = Time.now end diff --git a/features/support/maze.buildkite.cfg b/features/support/maze.buildkite.cfg new file mode 100644 index 00000000..c5bc1827 --- /dev/null +++ b/features/support/maze.buildkite.cfg @@ -0,0 +1,3 @@ +--format=junit +--out=reports +--format=pretty diff --git a/features/unhandled_errors.feature b/features/unhandled_errors.feature index d4f96bb6..a780a009 100644 --- a/features/unhandled_errors.feature +++ b/features/unhandled_errors.feature @@ -54,6 +54,7 @@ Feature: Unhandled errors And on iOS, the error payload field "events.0.exceptions.0.stacktrace.0.symbolAddress" is not null @skip_android #PLAT-9770 + @skip_ios_18 # Skipping due to PLAT-15245 Scenario: Crash after setting optional configuration options Given I run "MaxConfigCrashScenario" and restart the crashed app And I wait to receive an error diff --git a/make/Cocoa.make b/make/Cocoa.make index 062f3473..c6818047 100644 --- a/make/Cocoa.make +++ b/make/Cocoa.make @@ -21,7 +21,8 @@ clean: $(HEADERS): $(shell find $(SRCDIR) -type f -name '*.h') rsync --delete --recursive --times $(SRCDIR)/include/ $@/ - find $(SRCDIR) -type f -name '*.h' | grep -v $(SRCDIR)/include/ | rsync --delete --files-from - --no-relative --times . $@/BugsnagPrivate/ + find $(SRCDIR) -type f -name '*.h' | grep -v $(SRCDIR)/include/ | rsync --files-from - --no-relative --times . $@/BugsnagPrivate/ + rsync --recursive --times --include='*/' --include='*.h' --exclude='*' --prune-empty-dirs $(SRCDIR)/ $@/BugsnagPrivate/ --exclude=include/ touch $@ $(IOS_LIB): $(shell find $(SRCDIR) -type f)