diff --git a/.buildkite/block.full.yml b/.buildkite/block.full.yml index 443182410..88c22efae 100644 --- a/.buildkite/block.full.yml +++ b/.buildkite/block.full.yml @@ -4,4 +4,9 @@ steps: - label: 'Upload the full test pipeline' depends_on: 'trigger-full-build' - command: buildkite-agent pipeline upload .buildkite/pipeline.full.yml + command: > + buildkite-agent pipeline upload .buildkite/pipeline.android.full.yml && + buildkite-agent pipeline upload .buildkite/pipeline.ios.full.yml && + buildkite-agent pipeline upload .buildkite/pipeline.windows.full.yml && + buildkite-agent pipeline upload .buildkite/pipeline.macos.full.yml && + buildkite-agent pipeline upload .buildkite/pipeline.webgl.full.yml diff --git a/.buildkite/pipeline.android.full.yml b/.buildkite/pipeline.android.full.yml new file mode 100644 index 000000000..a67c62299 --- /dev/null +++ b/.buildkite/pipeline.android.full.yml @@ -0,0 +1,274 @@ +aliases: + - &2020 "2020.3.48f1" + - &2021 "2021.3.36f1" + - &2022 "2022.3.22f1" + - &2023 "2023.2.19f1" + +agents: + queue: macos-14 + +steps: + # + # Build Android test fixtures + # + - label: ":android: Build Android test fixture for Unity 2020" + timeout_in_minutes: 30 + key: "build-android-fixture-2020" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2020 + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - features/fixtures/maze_runner/mazerunner_2020.apk + - features/fixtures/build_android_apk.log + commands: + - bundle install + - rake test:android:build + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ":android: Build Android DEV test fixture for Unity 2021" + timeout_in_minutes: 30 + key: "build-android-dev-fixture-2021" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2021 + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - features/fixtures/maze_runner/mazerunner_dev_2021.apk + - features/fixtures/build_android_apk.log + commands: + - bundle install + - rake test:android:build_dev + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ":android: Build Android test fixture for Unity 2022" + timeout_in_minutes: 30 + key: "build-android-fixture-2022" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2022 + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - features/fixtures/maze_runner/mazerunner_2022.apk + - features/fixtures/build_android_apk.log + commands: + - bundle install + - rake test:android:build + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ":android: Build Android test fixture for Unity 2023" + timeout_in_minutes: 30 + key: "build-android-fixture-2023" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2023 + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - features/fixtures/maze_runner/mazerunner_2023.apk + - features/fixtures/build_android_apk.log + commands: + - bundle install + - rake test:android:build + retry: + automatic: + - exit_status: "*" + limit: 1 + + # - label: ':android: Build Android EDM test fixture for Unity 2020' + # timeout_in_minutes: 30 + # key: 'build-edm-fixture-2020' + # depends_on: 'build-artifacts' + # env: + # UNITY_VERSION: *2020 + # plugins: + # artifacts#v1.9.0: + # download: + # - Bugsnag.unitypackage + # upload: + # - features/fixtures/EDM_Fixture/edm_2020.apk + # - features/scripts/buildEdmFixture.log + # - features/scripts/edmImport.log + # - features/scripts/enableEdm.log + # commands: + # - rake test:edm:build + # retry: + # automatic: + # - exit_status: "*" + # limit: 1 + + # + # Run Android tests + # + - label: ":bitbar: :android: Run Android e2e tests for Unity 2020" + timeout_in_minutes: 60 + depends_on: "build-android-fixture-2020" + agents: + queue: opensource + env: + UNITY_VERSION: *2020 + plugins: + artifacts#v1.9.0: + download: + - "features/fixtures/maze_runner/mazerunner_2020.apk" + upload: + - "maze_output/**/*" + - "maze_output/metrics.csv" + docker-compose#v4.7.0: + pull: maze-runner-bitbar + run: maze-runner-bitbar + service-ports: true + command: + - "features/csharp" + - "features/android" + - "--app=features/fixtures/maze_runner/mazerunner_2020.apk" + - "--farm=bb" + - "--appium-version=1.22" + - "--device=ANDROID_10|ANDROID_11|ANDROID_12|ANDROID_13" + - "--no-tunnel" + - "--aws-public-ip" + - "--fail-fast" + concurrency: 25 + concurrency_group: "bitbar" + concurrency_method: eager + + - label: ":bitbar: :android: Run Android DEV e2e tests for Unity 2021" + timeout_in_minutes: 60 + depends_on: "build-android-dev-fixture-2021" + agents: + queue: opensource + env: + UNITY_VERSION: *2021 + plugins: + artifacts#v1.5.0: + download: + - "features/fixtures/maze_runner/mazerunner_dev_2021.apk" + upload: + - "maze_output/**/*" + - "maze_output/metrics.csv" + docker-compose#v4.7.0: + pull: maze-runner-bitbar + run: maze-runner-bitbar + service-ports: true + command: + - "features/csharp" + - "features/android" + - "--app=features/fixtures/maze_runner/mazerunner_dev_2021.apk" + - "--farm=bb" + - "--appium-version=1.22" + - "--device=ANDROID_10|ANDROID_11|ANDROID_12|ANDROID_13" + - "--no-tunnel" + - "--aws-public-ip" + concurrency: 25 + concurrency_group: "bitbar" + concurrency_method: eager + + - label: ":bitbar: :android: Run Android e2e tests for Unity 2022" + timeout_in_minutes: 60 + depends_on: "build-android-fixture-2022" + agents: + queue: opensource + env: + UNITY_VERSION: *2022 + plugins: + artifacts#v1.9.0: + download: + - "features/fixtures/maze_runner/mazerunner_2022.apk" + upload: + - "maze_output/**/*" + - "maze_output/metrics.csv" + docker-compose#v4.7.0: + pull: maze-runner-bitbar + run: maze-runner-bitbar + service-ports: true + command: + - "features/csharp" + - "features/android" + - "--app=features/fixtures/maze_runner/mazerunner_2022.apk" + - "--farm=bb" + - "--appium-version=1.22" + - "--device=ANDROID_10|ANDROID_11|ANDROID_12|ANDROID_13" + - "--no-tunnel" + - "--aws-public-ip" + - "--fail-fast" + concurrency: 25 + concurrency_group: "bitbar" + concurrency_method: eager + + - label: ":bitbar: :android: Run Android e2e tests for Unity 2023" + timeout_in_minutes: 60 + depends_on: "build-android-fixture-2023" + agents: + queue: opensource + env: + UNITY_VERSION: *2023 + plugins: + artifacts#v1.9.0: + download: + - "features/fixtures/maze_runner/mazerunner_2023.apk" + upload: + - "maze_output/**/*" + - "maze_output/metrics.csv" + docker-compose#v4.7.0: + pull: maze-runner-bitbar + run: maze-runner-bitbar + service-ports: true + command: + - "features/csharp" + - "features/android" + - "--app=features/fixtures/maze_runner/mazerunner_2023.apk" + - "--farm=bb" + - "--appium-version=1.22" + - "--device=ANDROID_10|ANDROID_11|ANDROID_12|ANDROID_13" + - "--no-tunnel" + - "--aws-public-ip" + - "--fail-fast" + concurrency: 25 + concurrency_group: "bitbar" + concurrency_method: eager + + # - label: ':android: Run Android EDM e2e tests for Unity 2020' + # timeout_in_minutes: 60 + # depends_on: 'build-edm-fixture-2020' + # agents: + # queue: opensource + # env: + # UNITY_VERSION: *2021 + # plugins: + # artifacts#v1.9.0: + # download: + # - "features/fixtures/EDM_Fixture/edm_2020.apk" + # upload: + # - "maze_output/**/*" + # docker-compose#v3.7.0: + # pull: maze-runner + # run: maze-runner + # command: + # - "--app=/app/features/fixtures/EDM_Fixture/edm_2020.apk" + # - "--farm=bs" + # - "--device=ANDROID_11_0" + # - "features/edm" + # concurrency: 5 + # concurrency_group: browserstack-app + # concurrency_method: eager + diff --git a/.buildkite/pipeline.full.yml b/.buildkite/pipeline.full.yml deleted file mode 100644 index 69e3ab7e6..000000000 --- a/.buildkite/pipeline.full.yml +++ /dev/null @@ -1,715 +0,0 @@ -agents: - queue: macos-12-arm-unity - -steps: - - # Build MacOS and WebGL test fixtures - # - - label: Build Unity 2018 MacOS and WebGL test fixtures - timeout_in_minutes: 30 - key: 'cocoa-webgl-2018-fixtures' - depends_on: 'build-artifacts' - env: - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - UNITY_VERSION: "2018.4.36f1" - # Python2 needed for WebGL to build - EMSDK_PYTHON: "/Library/Frameworks/Python.framework/Versions/2.7/bin/python" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - commands: - - scripts/ci-build-macos-packages.sh - artifact_paths: - - unity.log - - features/fixtures/maze_runner/build/MacOS-2018.4.36f1.zip - - features/fixtures/maze_runner/build/WebGL-2018.4.36f1.zip - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: Build Unity 2019 MacOS and WebGL test fixtures - timeout_in_minutes: 30 - key: 'cocoa-webgl-2019-fixtures' - depends_on: 'build-artifacts' - env: - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - UNITY_VERSION: "2019.4.35f1" - # Python2 needed for WebGL to build - EMSDK_PYTHON: "/Library/Frameworks/Python.framework/Versions/2.7/bin/python" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - commands: - - scripts/ci-build-macos-packages.sh - artifact_paths: - - unity.log - - features/fixtures/maze_runner/build/MacOS-2019.4.35f1.zip - - features/fixtures/maze_runner/build/WebGL-2019.4.35f1.zip - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: Build Unity 2021 MacOS and WebGL test fixtures - timeout_in_minutes: 30 - key: 'cocoa-webgl-2021-fixtures' - depends_on: 'build-artifacts' - env: - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - UNITY_VERSION: "2021.3.13f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - commands: - - scripts/ci-build-macos-packages.sh - artifact_paths: - - unity.log - - features/fixtures/maze_runner/build/MacOS-2021.3.13f1.zip - - features/fixtures/maze_runner/build/WebGL-2021.3.13f1.zip - retry: - automatic: - - exit_status: "*" - limit: 1 - - # - # Run macOS desktop tests - # - - label: Run MacOS e2e tests for Unity 2018 - timeout_in_minutes: 60 - depends_on: 'cocoa-webgl-2018-fixtures' - agents: - queue: macos-12-arm-unity - env: - UNITY_VERSION: "2018.4.36f1" - plugins: - artifacts#v1.5.0: - download: - - features/fixtures/maze_runner/build/MacOS-2018.4.36f1.zip - upload: - - maze_output/**/* - - Mazerunner.log - commands: - - scripts/ci-run-macos-tests-csharp.sh - - - label: Run MacOS e2e tests for Unity 2019 - timeout_in_minutes: 60 - depends_on: 'cocoa-webgl-2019-fixtures' - agents: - queue: macos-12-arm-unity - env: - UNITY_VERSION: "2019.4.35f1" - plugins: - artifacts#v1.5.0: - download: - - features/fixtures/maze_runner/build/MacOS-2019.4.35f1.zip - upload: - - maze_output/**/* - - Mazerunner.log - commands: - - scripts/ci-run-macos-tests-csharp.sh - - # DISABLED Pending PLAT-9177 - # - label: Run MacOS e2e tests for Unity 2021 - # timeout_in_minutes: 60 - # depends_on: 'cocoa-webgl-2021-fixtures' - # agents: - # queue: macos-12-arm-unity - # env: - # UNITY_VERSION: "2021.3.13f1" - # plugins: - # artifacts#v1.5.0: - # download: - # - features/fixtures/maze_runner/build/MacOS-2021.3.13f1.zip - # upload: - # - maze_output/**/* - # - Mazerunner.log - # commands: - # - scripts/ci-run-macos-tests-csharp.sh - - # - # Run WebGL tests - # - # Note: These are run on Intel due to an issue with persistence with Firefox on ARM. - # - - label: Run WebGL e2e tests for Unity 2018 - timeout_in_minutes: 30 - depends_on: 'cocoa-webgl-2018-fixtures' - agents: - queue: opensource-mac-cocoa-11 - env: - UNITY_VERSION: "2018.4.36f1" - plugins: - artifacts#v1.5.0: - download: - - features/fixtures/maze_runner/build/WebGL-2018.4.36f1.zip - upload: - - maze_output/**/* - # TODO: WebGL persistence tests are currently skipped pending PLAT-8151 - commands: - - scripts/ci-run-webgl-tests.sh - - - label: Run WebGL e2e tests for Unity 2019 - timeout_in_minutes: 30 - depends_on: 'cocoa-webgl-2019-fixtures' - agents: - queue: opensource-mac-cocoa-11 - env: - UNITY_VERSION: "2019.4.35f1" - plugins: - artifacts#v1.5.0: - download: - - features/fixtures/maze_runner/build/WebGL-2019.4.35f1.zip - upload: - - maze_output/**/* - # TODO: WebGL persistence tests are currently skipped pending PLAT-8151 - commands: - - scripts/ci-run-webgl-tests.sh - - # DISABLED Pending PLAT-9177 - # - label: Run WebGL e2e tests for Unity 2021 - # timeout_in_minutes: 30 - # depends_on: 'cocoa-webgl-2021-fixtures' - # env: - # UNITY_VERSION: "2021.3.13f1" - # plugins: - # artifacts#v1.5.0: - # download: - # - features/fixtures/maze_runner/build/WebGL-2021.3.13f1.zip - # upload: - # - maze_output/**/* - # # TODO: WebGL persistence tests are currently skipped pending PLAT-8151 - # commands: - # - scripts/ci-run-webgl-tests.sh - - # - # Build Android test fixtures - # - - label: ':android: Build Android test fixture for Unity 2018' - timeout_in_minutes: 30 - key: 'build-android-fixture-2018' - depends_on: 'build-artifacts' - env: - UNITY_VERSION: "2018.4.36f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - upload: - - features/fixtures/maze_runner/mazerunner_2018.4.36f1.apk - - features/fixtures/unity.log - commands: - - rake test:android:build - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: ':android: Build Android test fixture for Unity 2019' - timeout_in_minutes: 30 - key: 'build-android-fixture-2019' - depends_on: 'build-artifacts' - env: - UNITY_VERSION: "2019.4.35f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - upload: - - features/fixtures/maze_runner/mazerunner_2019.4.35f1.apk - - features/fixtures/unity.log - commands: - - rake test:android:build - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: ':android: Build Android test fixture for Unity 2021' - timeout_in_minutes: 30 - key: 'build-android-fixture-2021' - depends_on: 'build-artifacts' - env: - UNITY_VERSION: "2021.3.13f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - upload: - - features/fixtures/maze_runner/mazerunner_2021.3.13f1.apk - - features/fixtures/unity.log - commands: - - rake test:android:build - retry: - automatic: - - exit_status: "*" - limit: 1 - - # - label: ':android: Build Android EDM test fixture for Unity 2021' - # timeout_in_minutes: 30 - # key: 'build-edm-fixture-2021' - # depends_on: 'build-artifacts' - # env: - # UNITY_VERSION: "2021.3.13f1" - # plugins: - # artifacts#v1.5.0: - # download: - # - Bugsnag.unitypackage - # upload: - # - features/fixtures/EDM_Fixture/edm_2021.3.13f1.apk - # - features/scripts/buildEdmFixture.log - # - features/scripts/edmImport.log - # - features/scripts/enableEdm.log - # commands: - # - rake test:edm:build - # retry: - # automatic: - # - exit_status: "*" - # limit: 1 - - # - # Run Android tests - # - - label: ':android: Run Android e2e tests for Unity 2018' - timeout_in_minutes: 60 - depends_on: 'build-android-fixture-2018' - agents: - queue: opensource - env: - UNITY_VERSION: "2018.4.36f1" - plugins: - artifacts#v1.5.0: - download: - - "features/fixtures/maze_runner/mazerunner_2018.4.36f1.apk" - upload: - - "maze_output/**/*" - docker-compose#v3.7.0: - pull: maze-runner - run: maze-runner - command: - - "--app=/app/features/fixtures/maze_runner/mazerunner_2018.4.36f1.apk" - - "--farm=bs" - - "--device=ANDROID_11_0" - - "features/csharp" - - "features/android" - - concurrency: 24 - concurrency_group: browserstack-app - concurrency_method: eager - - - label: ':android: Run Android e2e tests for Unity 2019' - timeout_in_minutes: 60 - depends_on: 'build-android-fixture-2019' - agents: - queue: opensource - plugins: - artifacts#v1.5.0: - download: - - "features/fixtures/maze_runner/mazerunner_2019.4.35f1.apk" - upload: - - "maze_output/**/*" - docker-compose#v3.7.0: - pull: maze-runner - run: maze-runner - command: - - "--app=/app/features/fixtures/maze_runner/mazerunner_2019.4.35f1.apk" - - "--farm=bs" - - "--device=ANDROID_11_0" - - "features/csharp" - - "features/android" - concurrency: 24 - concurrency_group: browserstack-app - concurrency_method: eager - - - label: ':android: Run Android e2e tests for Unity 2021' - timeout_in_minutes: 60 - depends_on: 'build-android-fixture-2021' - agents: - queue: opensource - plugins: - artifacts#v1.5.0: - download: - - "features/fixtures/maze_runner/mazerunner_2021.3.13f1.apk" - upload: - - "maze_output/**/*" - docker-compose#v3.7.0: - pull: maze-runner - run: maze-runner - command: - - "--app=/app/features/fixtures/maze_runner/mazerunner_2021.3.13f1.apk" - - "--farm=bs" - - "--device=ANDROID_11_0" - - "features/csharp" - - "features/android" - concurrency: 24 - concurrency_group: browserstack-app - concurrency_method: eager - - # - label: ':android: Run Android EDM e2e tests for Unity 2021' - # timeout_in_minutes: 60 - # depends_on: 'build-edm-fixture-2021' - # agents: - # queue: opensource - # env: - # UNITY_VERSION: "2021.3.13f1" - # plugins: - # artifacts#v1.5.0: - # download: - # - "features/fixtures/EDM_Fixture/edm_2021.3.13f1.apk" - # upload: - # - "maze_output/**/*" - # docker-compose#v3.7.0: - # pull: maze-runner - # run: maze-runner - # command: - # - "--app=/app/features/fixtures/EDM_Fixture/edm_2021.3.13f1.apk" - # - "--farm=bs" - # - "--device=ANDROID_11_0" - # - "features/edm" - # concurrency: 24 - # concurrency_group: browserstack-app - # concurrency_method: eager - - # - # Build iOS test fixtures - # - - label: ':ios: Generate Xcode project - Unity 2018' - timeout_in_minutes: 30 - key: 'generate-fixture-project-2018' - depends_on: 'build-artifacts' - env: - UNITY_VERSION: "2018.4.36f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - upload: - - features/fixtures/unity.log - - project_2018.tgz - commands: - - rake test:ios:generate_xcode - - tar -zvcf project_2018.tgz features/fixtures/maze_runner/mazerunner_xcode - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: ':ios: Build iOS test fixture for Unity 2018' - timeout_in_minutes: 30 - key: 'build-ios-fixture-2018' - depends_on: 'generate-fixture-project-2018' - agents: - queue: macos-12-arm-unity - env: - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - UNITY_VERSION: "2018.4.36f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - - project_2018.tgz - upload: - - features/fixtures/maze_runner/mazerunner_2018.4.36f1.ipa - - features/fixtures/unity.log - commands: - - tar -zxf project_2018.tgz features/fixtures/maze_runner - - rake test:ios:build_xcode - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: ':ios: Generate Xcode project - Unity 2019' - timeout_in_minutes: 30 - key: 'generate-fixture-project-2019' - depends_on: 'build-artifacts' - env: - UNITY_VERSION: "2019.4.35f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - upload: - - features/fixtures/unity.log - - project_2019.tgz - commands: - - rake test:ios:generate_xcode - - tar -zvcf project_2019.tgz features/fixtures/maze_runner/mazerunner_xcode - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: ':ios: Build iOS test fixture for Unity 2019' - timeout_in_minutes: 30 - key: 'build-ios-fixture-2019' - depends_on: 'generate-fixture-project-2019' - agents: - queue: macos-12-arm-unity - env: - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - UNITY_VERSION: "2019.4.35f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - - project_2019.tgz - upload: - - features/fixtures/maze_runner/mazerunner_2019.4.35f1.ipa - - features/fixtures/unity.log - commands: - - tar -zxf project_2019.tgz features/fixtures/maze_runner - - rake test:ios:build_xcode - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: ':ios: Generate Xcode project - Unity 2021' - timeout_in_minutes: 30 - key: 'generate-fixture-project-2021' - depends_on: 'build-artifacts' - env: - UNITY_VERSION: "2021.3.13f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - upload: - - features/fixtures/unity.log - - project_2021.tgz - commands: - - rake test:ios:generate_xcode - - tar -zvcf project_2021.tgz features/fixtures/maze_runner/mazerunner_xcode - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: ':ios: Build iOS test fixture for Unity 2021' - timeout_in_minutes: 30 - key: 'build-ios-fixture-2021' - depends_on: 'generate-fixture-project-2021' - agents: - queue: macos-12-arm-unity - env: - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - UNITY_VERSION: "2021.3.13f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - - project_2021.tgz - upload: - - features/fixtures/maze_runner/mazerunner_2021.3.13f1.ipa - - features/fixtures/unity.log - commands: - - tar -zxf project_2021.tgz features/fixtures/maze_runner - - rake test:ios:build_xcode - retry: - automatic: - - exit_status: "*" - limit: 1 - - # - # Run iOS tests - # - - label: ':ios: Run iOS e2e tests for Unity 2018' - timeout_in_minutes: 60 - depends_on: 'build-ios-fixture-2018' - agents: - queue: opensource - env: - UNITY_VERSION: "2018.4.36f1" - plugins: - artifacts#v1.5.0: - download: - - "features/fixtures/maze_runner/mazerunner_2018.4.36f1.ipa" - upload: - - "maze_output/**/*" - docker-compose#v3.7.0: - pull: maze-runner - run: maze-runner - command: - - "--app=/app/features/fixtures/maze_runner/mazerunner_2018.4.36f1.ipa" - - "--farm=bs" - - "--device=IOS_15" - - "--fail-fast" - - "features/csharp" - - "features/ios" - concurrency: 24 - concurrency_group: browserstack-app - concurrency_method: eager - - - label: ':ios: Run iOS e2e tests for Unity 2019' - timeout_in_minutes: 60 - depends_on: 'build-ios-fixture-2019' - agents: - queue: opensource - plugins: - artifacts#v1.5.0: - download: - - "features/fixtures/maze_runner/mazerunner_2019.4.35f1.ipa" - upload: - - "maze_output/**/*" - docker-compose#v3.7.0: - pull: maze-runner - run: maze-runner - command: - - "--app=/app/features/fixtures/maze_runner/mazerunner_2019.4.35f1.ipa" - - "--farm=bs" - - "--device=IOS_15" - - "--fail-fast" - - "features/csharp" - - "features/ios" - concurrency: 24 - concurrency_group: browserstack-app - concurrency_method: eager - - - label: ':ios: Run iOS e2e tests for Unity 2021' - timeout_in_minutes: 60 - depends_on: 'build-ios-fixture-2021' - agents: - queue: opensource - plugins: - artifacts#v1.5.0: - download: - - "features/fixtures/maze_runner/mazerunner_2021.3.13f1.ipa" - upload: - - "maze_output/**/*" - docker-compose#v3.7.0: - pull: maze-runner - run: maze-runner - command: - - "--app=/app/features/fixtures/maze_runner/mazerunner_2021.3.13f1.ipa" - - "--farm=bs" - - "--device=IOS_15" - - "--fail-fast" - - "features/csharp" - - "features/ios" - concurrency: 24 - concurrency_group: browserstack-app - concurrency_method: eager - - # - # Build Windows test fixtures - # - - label: Build Unity 2018 Windows test fixture - timeout_in_minutes: 30 - key: 'windows-2018-fixture' - depends_on: 'build-artifacts' - agents: - queue: windows-unity-wsl - env: - UNITY_VERSION: "2018.4.36f1" - command: - - scripts/ci-build-windows-fixture-wsl.sh - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - upload: - - unity.log - - features/fixtures/maze_runner/build/Windows-2018.4.36f1.zip - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: Build Unity 2019 Windows test fixture - timeout_in_minutes: 30 - key: 'windows-2019-fixture' - depends_on: 'build-artifacts' - agents: - queue: windows-unity-wsl - env: - UNITY_VERSION: "2019.4.35f1" - command: - - scripts/ci-build-windows-fixture-wsl.sh - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - upload: - - unity.log - - features/fixtures/maze_runner/build/Windows-2019.4.35f1.zip - retry: - automatic: - - exit_status: "*" - limit: 1 - - - label: Build Unity 2021 Windows test fixture - timeout_in_minutes: 30 - key: 'windows-2021-fixture' - depends_on: 'build-artifacts' - agents: - queue: windows-unity-wsl - env: - UNITY_VERSION: "2021.3.13f1" - commands: - - scripts/ci-build-windows-fixture-wsl.sh - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - upload: - - unity.log - - features/fixtures/maze_runner/build/Windows-2021.3.13f1.zip - retry: - automatic: - - exit_status: "*" - limit: 1 - - # - # Run Windows e2e tests - # - - label: Run Windows e2e tests for Unity 2018 - timeout_in_minutes: 30 - depends_on: 'windows-2018-fixture' - agents: - queue: windows-general-wsl - env: - UNITY_VERSION: "2018.4.36f1" - plugins: - artifacts#v1.5.0: - download: - - features/fixtures/maze_runner/build/Windows-2018.4.36f1.zip - upload: - - maze_output/**/* - commands: - - scripts/ci-run-windows-tests-wsl.sh - - - label: Run Windows e2e tests for Unity 2019 - timeout_in_minutes: 30 - depends_on: 'windows-2019-fixture' - agents: - queue: windows-general-wsl - env: - UNITY_VERSION: "2019.4.35f1" - plugins: - artifacts#v1.5.0: - download: - - features/fixtures/maze_runner/build/Windows-2019.4.35f1.zip - upload: - - maze_output/**/* - commands: - - scripts/ci-run-windows-tests-wsl.sh - - - label: Run Windows e2e tests for Unity 2021 - timeout_in_minutes: 30 - depends_on: 'windows-2021-fixture' - agents: - queue: windows-general-wsl - env: - UNITY_VERSION: "2021.3.13f1" - plugins: - artifacts#v1.5.0: - download: - - features/fixtures/maze_runner/build/Windows-2021.3.13f1.zip - upload: - - maze_output/**/* - commands: - - scripts/ci-run-windows-tests-wsl.sh diff --git a/.buildkite/pipeline.ios.full.yml b/.buildkite/pipeline.ios.full.yml new file mode 100644 index 000000000..e422ff1f2 --- /dev/null +++ b/.buildkite/pipeline.ios.full.yml @@ -0,0 +1,321 @@ +aliases: + - &2020 "2020.3.48f1" + - &2021 "2021.3.36f1" + - &2022 "2022.3.22f1" + - &2023 "2023.2.19f1" + + +agents: + queue: macos-14 + +steps: + # + # Build iOS test fixtures + # + - label: ":ios: Generate Xcode project - Unity 2020" + timeout_in_minutes: 30 + key: "generate-fixture-project-2020" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2020 + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - features/fixtures/unity.log + - project_2020.tgz + commands: + - bundle install + - rake test:ios:generate_xcode + - tar -zvcf project_2020.tgz features/fixtures/maze_runner/mazerunner_xcode + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ":ios: Build iOS test fixture for Unity 2020" + timeout_in_minutes: 30 + key: "build-ios-fixture-2020" + depends_on: "generate-fixture-project-2020" + env: + XCODE_VERSION: "15.3.0" + UNITY_VERSION: *2020 + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + - project_2020.tgz + upload: + - features/fixtures/maze_runner/mazerunner_2020.ipa + - features/fixtures/unity.log + commands: + - bundle install + - tar -zxf project_2020.tgz features/fixtures/maze_runner + - rake test:ios:build_xcode + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ":ios: Generate Xcode DEV project - Unity 2021" + timeout_in_minutes: 30 + key: "generate-dev-fixture-project-2021" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2021 + plugins: + artifacts#v1.5.0: + download: + - Bugsnag.unitypackage + upload: + - features/fixtures/unity.log + - project_dev_2021.tgz + commands: + - bundle install + - rake test:ios:generate_xcode_dev + - tar -zvcf project_dev_2021.tgz features/fixtures/maze_runner/mazerunner_dev_xcode + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ":ios: Build DEV iOS test fixture for Unity 2021" + timeout_in_minutes: 30 + key: "build-ios-dev-fixture-2021" + depends_on: "generate-dev-fixture-project-2021" + env: + UNITY_VERSION: *2021 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.5.0: + download: + - Bugsnag.unitypackage + - project_dev_2021.tgz + upload: + - features/fixtures/maze_runner/mazerunner_dev_2021.ipa + - features/fixtures/unity.log + commands: + - bundle install + - tar -zxf project_dev_2021.tgz features/fixtures/maze_runner + - rake test:ios:build_xcode_dev + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ":ios: Generate Xcode project - Unity 2022" + timeout_in_minutes: 30 + key: "generate-fixture-project-2022" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2022 + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - features/fixtures/unity.log + - project_2022.tgz + commands: + - bundle install + - rake test:ios:generate_xcode + - tar -zvcf project_2022.tgz features/fixtures/maze_runner/mazerunner_xcode + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ":ios: Build iOS test fixture for Unity 2022" + timeout_in_minutes: 30 + key: "build-ios-fixture-2022" + depends_on: "generate-fixture-project-2022" + env: + UNITY_VERSION: *2022 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + - project_2022.tgz + upload: + - features/fixtures/maze_runner/mazerunner_2022.ipa + - features/fixtures/unity.log + commands: + - bundle install + - tar -zxf project_2022.tgz features/fixtures/maze_runner + - rake test:ios:build_xcode + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ":ios: Generate Xcode project - Unity 2023" + timeout_in_minutes: 30 + key: "generate-fixture-project-2023" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2023 + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - features/fixtures/unity.log + - project_2023.tgz + commands: + - bundle install + - rake test:ios:generate_xcode + - tar -zvcf project_2023.tgz features/fixtures/maze_runner/mazerunner_xcode + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: ":ios: Build iOS test fixture for Unity 2023" + timeout_in_minutes: 30 + key: "build-ios-fixture-2023" + depends_on: "generate-fixture-project-2023" + env: + UNITY_VERSION: *2023 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + - project_2023.tgz + upload: + - features/fixtures/maze_runner/mazerunner_2023.ipa + - features/fixtures/unity.log + commands: + - bundle install + - tar -zxf project_2023.tgz features/fixtures/maze_runner + - rake test:ios:build_xcode + retry: + automatic: + - exit_status: "*" + limit: 1 + + # + # Run iOS tests + # + - label: ":bitbar: :ios: Run iOS e2e tests for Unity 2020" + timeout_in_minutes: 60 + depends_on: "build-ios-fixture-2020" + agents: + queue: opensource + plugins: + artifacts#v1.9.0: + download: + - "features/fixtures/maze_runner/mazerunner_2020.ipa" + upload: + - "maze_output/**/*" + - "maze_output/metrics.csv" + docker-compose#v4.7.0: + pull: maze-runner-bitbar + run: maze-runner-bitbar + service-ports: true + command: + - "features/csharp" + - "features/ios" + - "--app=features/fixtures/maze_runner/mazerunner_2020.ipa" + - "--farm=bb" + - "--appium-version=1.22" + - "--device=IOS_13|IOS_14|IOS_15" + - "--no-tunnel" + - "--aws-public-ip" + - "--fail-fast" + concurrency: 25 + concurrency_group: "bitbar" + concurrency_method: eager + + - label: ":bitbar: :ios: Run iOS e2e DEV tests for Unity 2021" + timeout_in_minutes: 60 + depends_on: "build-ios-dev-fixture-2021" + agents: + queue: opensource + plugins: + artifacts#v1.5.0: + download: + - "features/fixtures/maze_runner/mazerunner_dev_2021.ipa" + upload: + - "maze_output/**/*" + - "maze_output/metrics.csv" + + docker-compose#v4.7.0: + pull: maze-runner-bitbar + run: maze-runner-bitbar + service-ports: true + command: + - "features/csharp" + - "features/ios" + - "--app=features/fixtures/maze_runner/mazerunner_dev_2021.ipa" + - "--farm=bb" + - "--appium-version=1.22" + - "--device=IOS_13|IOS_14|IOS_15" + - "--no-tunnel" + - "--aws-public-ip" + - "--fail-fast" + concurrency: 25 + concurrency_group: "bitbar" + concurrency_method: eager + + - label: ":bitbar: :ios: Run iOS e2e tests for Unity 2022" + timeout_in_minutes: 60 + depends_on: "build-ios-fixture-2022" + agents: + queue: opensource + plugins: + artifacts#v1.9.0: + download: + - "features/fixtures/maze_runner/mazerunner_2022.ipa" + upload: + - "maze_output/**/*" + - "maze_output/metrics.csv" + docker-compose#v4.7.0: + pull: maze-runner-bitbar + run: maze-runner-bitbar + service-ports: true + command: + - "features/csharp" + - "features/ios" + - "--app=features/fixtures/maze_runner/mazerunner_2022.ipa" + - "--farm=bb" + - "--appium-version=1.22" + - "--device=IOS_13|IOS_14|IOS_15" + - "--no-tunnel" + - "--aws-public-ip" + - "--fail-fast" + concurrency: 25 + concurrency_group: "bitbar" + concurrency_method: eager + + - label: ":bitbar: :ios: Run iOS e2e tests for Unity 2023" + timeout_in_minutes: 60 + depends_on: "build-ios-fixture-2023" + agents: + queue: opensource + plugins: + artifacts#v1.9.0: + download: + - "features/fixtures/maze_runner/mazerunner_2023.ipa" + upload: + - "maze_output/**/*" + - "maze_output/metrics.csv" + docker-compose#v4.7.0: + pull: maze-runner-bitbar + run: maze-runner-bitbar + service-ports: true + command: + - "features/csharp" + - "features/ios" + - "--app=features/fixtures/maze_runner/mazerunner_2023.ipa" + - "--farm=bb" + - "--appium-version=1.22" + - "--device=IOS_13|IOS_14|IOS_15" + - "--no-tunnel" + - "--aws-public-ip" + - "--fail-fast" + concurrency: 25 + concurrency_group: "bitbar" + concurrency_method: eager diff --git a/.buildkite/pipeline.macos.full.yml b/.buildkite/pipeline.macos.full.yml new file mode 100644 index 000000000..da21fdc6e --- /dev/null +++ b/.buildkite/pipeline.macos.full.yml @@ -0,0 +1,209 @@ +aliases: + - &2020 "2020.3.48f1" + - &2021 "2021.3.36f1" + - &2022 "2022.3.22f1" + - &2023 "2023.2.19f1" + + +agents: + queue: macos-14 + +steps: + + # Build MacOS test fixtures + # + - label: Build Unity 2020 MacOS test fixture + timeout_in_minutes: 30 + key: "macos-2020-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2020 + XCODE_VERSION: "15.3.0" + # Python2 needed for WebGL to build + EMSDK_PYTHON: "/Library/Frameworks/Python.framework/Versions/2.7/bin/python" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + commands: + - scripts/ci-build-macos-fixture.sh release + artifact_paths: + - unity.log + - features/fixtures/maze_runner/build/MacOS-release-2020.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2021 MacOS test fixture + timeout_in_minutes: 30 + key: "macos-2021-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2021 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + commands: + - scripts/ci-build-macos-fixture.sh release + artifact_paths: + - unity.log + - features/fixtures/maze_runner/build/MacOS-release-2021.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2021 MacOS DEV test fixture + timeout_in_minutes: 30 + key: "macos-2021-dev-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2021 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + commands: + - scripts/ci-build-macos-fixture.sh dev + artifact_paths: + - unity.log + - features/fixtures/maze_runner/build/MacOS-dev-2021.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2022 MacOS fixture + timeout_in_minutes: 30 + key: "macos-2022-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2022 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + commands: + - scripts/ci-build-macos-fixture.sh release + artifact_paths: + - unity.log + - features/fixtures/maze_runner/build/MacOS-release-2022.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2023 MacOS test fixture + timeout_in_minutes: 30 + key: "macos-2023-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2023 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + commands: + - scripts/ci-build-macos-fixture.sh release + artifact_paths: + - unity.log + - features/fixtures/maze_runner/build/MacOS-release-2023.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + # + # Run macOS desktop tests + # + - label: Run MacOS e2e tests for Unity 2020 + timeout_in_minutes: 60 + depends_on: "macos-2020-fixture" + agents: + queue: macos-14 + env: + UNITY_VERSION: *2020 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/MacOS-release-2020.zip + upload: + - maze_output/**/* + - '*-mazerunner.log' + - maze_output/metrics.csv + commands: + - scripts/ci-run-macos-tests.sh release + + - label: Run MacOS e2e tests for Unity 2021 + timeout_in_minutes: 60 + depends_on: 'macos-2021-fixture' + agents: + queue: macos-12-arm-unity + env: + UNITY_VERSION: *2021 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/MacOS-release-2021.zip + upload: + - maze_output/**/* + - Mazerunner.log + commands: + - scripts/ci-run-macos-tests.sh release + + - label: Run MacOS e2e DEV tests for Unity 2021 + timeout_in_minutes: 60 + depends_on: 'macos-2021-dev-fixture' + agents: + queue: macos-12-arm-unity + env: + UNITY_VERSION: *2021 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/MacOS-dev-2021.zip + upload: + - maze_output/**/* + - Mazerunner.log + commands: + - scripts/ci-run-macos-tests.sh dev + + - label: Run MacOS e2e tests for Unity 2022 + timeout_in_minutes: 60 + depends_on: 'macos-2022-fixture' + agents: + queue: macos-14 + env: + UNITY_VERSION: *2022 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/MacOS-release-2022.zip + upload: + - maze_output/**/* + - '*-mazerunner.log' + commands: + - scripts/ci-run-macos-tests.sh release + + - label: Run MacOS e2e tests for Unity 2023 + timeout_in_minutes: 60 + depends_on: 'macos-2023-fixture' + agents: + queue: macos-12-arm + env: + UNITY_VERSION: *2023 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/MacOS-release-2023.zip + upload: + - maze_output/**/* + - '*-mazerunner.log' + commands: + - scripts/ci-run-macos-tests.sh release diff --git a/.buildkite/pipeline.webgl.full.yml b/.buildkite/pipeline.webgl.full.yml new file mode 100644 index 000000000..5c435cfc6 --- /dev/null +++ b/.buildkite/pipeline.webgl.full.yml @@ -0,0 +1,202 @@ +aliases: + - &2020 "2020.3.48f1" + - &2021 "2021.3.36f1" + - &2022 "2022.3.22f1" + - &2023 "2023.2.19f1" + + +agents: + queue: macos-14 + +steps: + # Build WebGL test fixtures + # + - label: Build Unity 2020 WebGL test fixture + timeout_in_minutes: 30 + key: "webgl-2020-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2020 + XCODE_VERSION: "15.3.0" + # Python2 needed for WebGL to build + EMSDK_PYTHON: "/Library/Frameworks/Python.framework/Versions/2.7/bin/python" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + commands: + - scripts/ci-build-webgl-fixture.sh release + artifact_paths: + - unity.log + - features/fixtures/maze_runner/build/WebGL-release-2020.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2021 WebGL test fixture + timeout_in_minutes: 30 + key: "webgl-2021-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2021 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + commands: + - scripts/ci-build-webgl-fixture.sh release + artifact_paths: + - unity.log + - features/fixtures/maze_runner/build/WebGL-release-2021.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2021 DEV WebGL test fixture + timeout_in_minutes: 30 + key: "webgl-2021-dev-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2021 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + commands: + - scripts/ci-build-webgl-fixture.sh dev + artifact_paths: + - unity.log + - features/fixtures/maze_runner/build/WebGL-dev-2021.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2022 WebGL test fixture + timeout_in_minutes: 30 + key: "webgl-2022-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2022 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + commands: + - scripts/ci-build-webgl-fixture.sh release + artifact_paths: + - unity.log + - features/fixtures/maze_runner/build/WebGL-release-2022.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2023 WebGL test fixture + timeout_in_minutes: 30 + key: "webgl-2023-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2023 + XCODE_VERSION: "15.3.0" + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + commands: + - scripts/ci-build-webgl-fixture.sh release + artifact_paths: + - unity.log + - features/fixtures/maze_runner/build/WebGL-release-2023.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + # + # Run WebGL tests + # + # Note: These are run on Intel due to an issue with persistence with Firefox on ARM. + # + - label: Run WebGL e2e tests for Unity 2020 + timeout_in_minutes: 30 + depends_on: "webgl-2020-fixture" + env: + UNITY_VERSION: *2020 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/WebGL-release-2020.zip + upload: + - maze_output/**/* + - maze_output/metrics.csv + + # TODO: WebGL persistence tests are currently skipped pending PLAT-8151 + commands: + - scripts/ci-run-webgl-tests.sh release + + - label: Run WebGL e2e tests for Unity 2021 + timeout_in_minutes: 30 + depends_on: 'webgl-2021-fixture' + env: + UNITY_VERSION: *2021 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/WebGL-release-2021.zip + upload: + - maze_output/**/* + # TODO: WebGL persistence tests are currently skipped pending PLAT-8151 + commands: + - scripts/ci-run-webgl-tests.sh release + + - label: Run WebGL e2e DEV tests for Unity 2021 + timeout_in_minutes: 30 + depends_on: 'webgl-2021-dev-fixture' + env: + UNITY_VERSION: *2021 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/WebGL-dev-2021.zip + upload: + - maze_output/**/* + # TODO: WebGL persistence tests are currently skipped pending PLAT-8151 + commands: + - scripts/ci-run-webgl-tests.sh dev + + - label: Run WebGL e2e tests for Unity 2022 + timeout_in_minutes: 30 + depends_on: 'webgl-2022-fixture' + env: + UNITY_VERSION: *2022 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/WebGL-release-2022.zip + upload: + - maze_output/**/* + # TODO: WebGL persistence tests are currently skipped pending PLAT-8151 + commands: + - scripts/ci-run-webgl-tests.sh release + + - label: Run WebGL e2e tests for Unity 2023 + timeout_in_minutes: 30 + depends_on: 'webgl-2023-fixture' + env: + UNITY_VERSION: *2023 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/WebGL-release-2023.zip + upload: + - maze_output/**/* + # TODO: WebGL persistence tests are currently skipped pending PLAT-8151 + commands: + - scripts/ci-run-webgl-tests.sh release + diff --git a/.buildkite/pipeline.windows.full.yml b/.buildkite/pipeline.windows.full.yml new file mode 100644 index 000000000..585f3359d --- /dev/null +++ b/.buildkite/pipeline.windows.full.yml @@ -0,0 +1,214 @@ +aliases: + - &2020 "2020.3.48f1" + - &2021 "2021.3.36f1" + - &2022 "2022.3.22f1" + - &2023 "2023.2.19f1" + +steps: + # + # Build Windows test fixtures + # + - label: Build Unity 2020 Windows test fixture + timeout_in_minutes: 30 + key: "windows-2020-fixture" + depends_on: "build-artifacts" + agents: + queue: windows-unity-wsl + env: + UNITY_VERSION: *2020 + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - unity.log + - features/fixtures/maze_runner/build/Windows-release-2020.zip + commands: + - scripts/ci-build-windows-fixture-wsl.sh release + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2021 Windows test fixture + timeout_in_minutes: 30 + key: "windows-2021-fixture" + depends_on: "build-artifacts" + agents: + queue: windows-unity-wsl + env: + UNITY_VERSION: *2021 + commands: + - scripts/ci-build-windows-fixture-wsl.sh release + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - unity.log + - unity_import.log + - features/fixtures/maze_runner/build/Windows-release-2021.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2021 Windows DEV test fixture + timeout_in_minutes: 30 + key: "windows-2021-dev-fixture" + depends_on: "build-artifacts" + agents: + queue: windows-unity-wsl + env: + UNITY_VERSION: *2021 + commands: + - scripts/ci-build-windows-fixture-wsl.sh dev + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - unity.log + - unity_import.log + - features/fixtures/maze_runner/build/Windows-dev-2021.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2022 Windows test fixture + timeout_in_minutes: 30 + key: "windows-2022-fixture" + depends_on: "build-artifacts" + agents: + queue: windows-unity-wsl + env: + UNITY_VERSION: *2022 + commands: + - scripts/ci-build-windows-fixture-wsl.sh release + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - unity.log + - unity_import.log + - features/fixtures/maze_runner/build/Windows-release-2022.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2023 Windows test fixture + skip: Pending PLAT-12072 + timeout_in_minutes: 30 + key: "windows-2023-fixture" + depends_on: "build-artifacts" + agents: + queue: windows-unity-wsl + env: + UNITY_VERSION: *2023 + commands: + - scripts/ci-build-windows-fixture-wsl.sh release + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - unity.log + - unity_import.log + - features/fixtures/maze_runner/build/Windows-release-2023.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + # + # Run Windows e2e tests + # + - label: Run Windows e2e tests for Unity 2020 + timeout_in_minutes: 30 + depends_on: "windows-2020-fixture" + agents: + queue: windows-general-wsl + env: + UNITY_VERSION: *2020 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/Windows-release-2020.zip + upload: + - maze_output/**/* + - maze_output/metrics.csv + + command: + - scripts/ci-run-windows-tests-wsl.sh release + + - label: Run Windows e2e tests for Unity 2021 + timeout_in_minutes: 30 + depends_on: "windows-2021-fixture" + agents: + queue: windows-general-wsl + env: + UNITY_VERSION: *2021 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/Windows-release-2021.zip + upload: + - maze_output/**/* + - maze_output/metrics.csv + commands: + - scripts/ci-run-windows-tests-wsl.sh release + + - label: Run Windows e2e DEV tests for Unity 2021 + timeout_in_minutes: 30 + depends_on: "windows-2021-dev-fixture" + agents: + queue: windows-general-wsl + env: + UNITY_VERSION: *2021 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/Windows-dev-2021.zip + upload: + - maze_output/**/* + - maze_output/metrics.csv + commands: + - scripts/ci-run-windows-tests-wsl.sh dev + + - label: Run Windows e2e tests for Unity 2022 + timeout_in_minutes: 30 + depends_on: "windows-2022-fixture" + agents: + queue: windows-general-wsl + env: + UNITY_VERSION: *2022 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/Windows-release-2022.zip + upload: + - maze_output/**/* + - maze_output/metrics.csv + commands: + - scripts/ci-run-windows-tests-wsl.sh release + + - label: Run Windows e2e tests for Unity 2023 + skip: Pending PLAT-12072 + timeout_in_minutes: 30 + depends_on: "windows-2023-fixture" + agents: + queue: windows-general-wsl + env: + UNITY_VERSION: *2023 + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/Windows-release-2023.zip + upload: + - maze_output/**/* + - maze_output/metrics.csv + commands: + - scripts/ci-run-windows-tests-wsl.sh release diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index a35475bf0..abf00f89c 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,17 +1,18 @@ +aliases: + - &2021 "2021.3.36f1" + agents: - queue: macos-12-arm-unity + queue: macos-14 steps: - # - # Build notifier. We run tests for all Unity versions with the 2018 artifacts, as that is what we ship. + # Build notifier. We run tests for all Unity versions with the 2020 artifacts, as that is what we ship. # - label: Build released notifier artifact timeout_in_minutes: 30 - key: 'build-artifacts' + key: "build-artifacts" env: - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - UNITY_VERSION: "2018.4.36f1" + UNITY_VERSION: *2021 commands: - bundle install - bundle exec rake plugin:export @@ -22,131 +23,54 @@ steps: - exit_status: "*" limit: 1 - - label: Ensure notifier builds on Windows (for development) - timeout_in_minutes: 30 - agents: - queue: windows-unity-wsl - env: - UNITY_VERSION: "2018.4.36f1" - WSLENV: UNITY_VERSION - command: - - /mnt/c/Windows/System32/cmd.exe /c .\\scripts\\ci-build-windows-plugin.bat - plugins: - artifacts#v1.5.0: - upload: - - from: Bugsnag.unitypackage - to: Bugsnag_WindowsBuilt.unitypackage - retry: - automatic: - - exit_status: "*" - limit: 1 - - # - # Build MacOS and WebGL test fixtures - # - - label: Build Unity 2020 MacOS and WebGL test fixtures - timeout_in_minutes: 30 - key: 'cocoa-webgl-2020-fixtures' - depends_on: 'build-artifacts' + - label: 'build size impact reporting' + timeout_in_minutes: 10 + depends_on: build-artifacts env: - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - UNITY_VERSION: "2020.3.32f1" - # Python2 needed for WebGL to build - EMSDK_PYTHON: "/Library/Frameworks/Python.framework/Versions/2.7/bin/python" + UNITY_VERSION: *2021 plugins: - artifacts#v1.5.0: + 'artifacts#v1.9.0': download: - Bugsnag.unitypackage commands: - - scripts/ci-build-macos-packages.sh - artifact_paths: - - unity.log - - features/fixtures/maze_runner/build/MacOS-2020.3.32f1.zip - - features/fixtures/maze_runner/build/WebGL-2020.3.32f1.zip - retry: - automatic: - - exit_status: "*" - limit: 1 - - - - # - # Run macos tests - # - - label: Run MacOS e2e csharp tests - timeout_in_minutes: 60 - depends_on: 'cocoa-webgl-2020-fixtures' - agents: - queue: macos-12-arm-unity - env: - UNITY_VERSION: "2020.3.32f1" - plugins: - artifacts#v1.5.0: - download: - - features/fixtures/maze_runner/build/MacOS-2020.3.32f1.zip - upload: - - maze_output/**/* - - Mazerunner.log - commands: - - scripts/ci-run-macos-tests-csharp.sh - - # - # Run WebGL tests - # - # Note: These are run on Intel due to an issue with persistence with Firefox on ARM. - - - label: Run WebGL e2e tests for Unity 2020 - timeout_in_minutes: 30 - depends_on: 'cocoa-webgl-2020-fixtures' - agents: - queue: opensource-mac-cocoa-11 - env: - UNITY_VERSION: "2020.3.32f1" - plugins: - artifacts#v1.5.0: - download: - - features/fixtures/maze_runner/build/WebGL-2020.3.32f1.zip - upload: - - maze_output/**/* - # TODO: WebGL persistence tests are currently skipped pending PLAT-8151 - commands: - - scripts/ci-run-webgl-tests.sh - + features/scripts/do_size_test.sh # Build Android test fixtures - - - label: ':android: Build Android test fixture for Unity 2020' + - label: ":android: Build Android test fixture for Unity 2021" timeout_in_minutes: 30 - key: 'build-android-fixture-2020' - depends_on: 'build-artifacts' + key: "build-android-fixture-2021" + depends_on: "build-artifacts" env: - UNITY_VERSION: "2020.3.32f1" + UNITY_VERSION: *2021 plugins: - artifacts#v1.5.0: + artifacts#v1.9.0: download: - Bugsnag.unitypackage upload: - - features/fixtures/maze_runner/mazerunner_2020.3.32f1.apk - - features/fixtures/unity.log + - features/fixtures/maze_runner/mazerunner_2021.apk + - features/fixtures/build_android_apk.log commands: + - bundle install - rake test:android:build retry: automatic: - exit_status: "*" limit: 1 - # - label: ':android: Build Android EDM test fixture for Unity 2020' + + + # - label: ':android: Build Android EDM test fixture for Unity 2021' # timeout_in_minutes: 30 - # key: 'build-edm-fixture-2020' + # key: 'build-edm-fixture-2021' # depends_on: 'build-artifacts' # env: - # UNITY_VERSION: "2020.3.32f1" + # UNITY_VERSION: *2021 # plugins: # artifacts#v1.5.0: # download: # - Bugsnag.unitypackage # upload: - # - features/fixtures/EDM_Fixture/edm_2020.3.32f1.apk + # - features/fixtures/EDM_Fixture/edm_2021.3.36f1.apk # - features/scripts/buildEdmFixture.log # - features/scripts/edmImport.log # - features/scripts/enableEdm.log @@ -160,101 +84,107 @@ steps: # # Run Android tests # - - label: ':android: Run Android e2e tests for Unity 2020' + - label: ":bitbar: :android: Run Android e2e tests for Unity 2021" timeout_in_minutes: 60 - depends_on: 'build-android-fixture-2020' + depends_on: "build-android-fixture-2021" agents: queue: opensource env: - UNITY_VERSION: "2020.3.32f1" + UNITY_VERSION: *2021 plugins: artifacts#v1.5.0: download: - - "features/fixtures/maze_runner/mazerunner_2020.3.32f1.apk" + - "features/fixtures/maze_runner/mazerunner_2021.apk" upload: - "maze_output/**/*" - docker-compose#v3.7.0: - pull: maze-runner - run: maze-runner + - "maze_output/metrics.csv" + docker-compose#v4.7.0: + pull: maze-runner-bitbar + run: maze-runner-bitbar + service-ports: true command: - - "--app=/app/features/fixtures/maze_runner/mazerunner_2020.3.32f1.apk" - - "--farm=bs" - - "--device=ANDROID_11_0" - "features/csharp" - "features/android" - concurrency: 24 - concurrency_group: browserstack-app + - "--app=features/fixtures/maze_runner/mazerunner_2021.apk" + - "--farm=bb" + - "--appium-version=1.22" + - "--device=ANDROID_10|ANDROID_11|ANDROID_12|ANDROID_13" + - "--no-tunnel" + - "--aws-public-ip" + concurrency: 25 + concurrency_group: "bitbar" concurrency_method: eager - # Run Android EDM tests - # - label: ':android: Run Android EDM e2e tests for Unity 2020' + # - label: ':android: Run Android EDM e2e tests for Unity 2021' # timeout_in_minutes: 30 - # depends_on: 'build-edm-fixture-2020' + # depends_on: 'build-edm-fixture-2021' # agents: # queue: opensource # env: - # UNITY_VERSION: "2020.3.32f1" + # UNITY_VERSION: "2021.3.36f1" # plugins: # artifacts#v1.5.0: # download: - # - "features/fixtures/EDM_Fixture/edm_2020.3.32f1.apk" + # - "features/fixtures/EDM_Fixture/edm_2021.3.36f1.apk" # upload: # - "maze_output/**/*" # docker-compose#v3.7.0: # pull: maze-runner # run: maze-runner # command: - # - "--app=/app/features/fixtures/EDM_Fixture/edm_2020.3.32f1.apk" + # - "--app=/app/features/fixtures/EDM_Fixture/edm_2021.3.36f1.apk" # - "--farm=bs" # - "--device=ANDROID_11_0" # - "features/edm" - # concurrency: 24 + # concurrency: 5 # concurrency_group: browserstack-app # concurrency_method: eager # # Build iOS test fixtures # - - label: ':ios: Generate Xcode project - Unity 2020' + - label: ":ios: Generate Xcode project - Unity 2021" timeout_in_minutes: 30 - key: 'generate-fixture-project-2020' - depends_on: 'build-artifacts' + key: "generate-fixture-project-2021" + depends_on: "build-artifacts" env: - UNITY_VERSION: "2020.3.32f1" + UNITY_VERSION: *2021 plugins: artifacts#v1.5.0: download: - Bugsnag.unitypackage upload: - features/fixtures/unity.log - - project_2020.tgz + - project_2021.tgz commands: + - bundle install - rake test:ios:generate_xcode - - tar -zvcf project_2020.tgz features/fixtures/maze_runner/mazerunner_xcode + - tar -zvcf project_2021.tgz features/fixtures/maze_runner/mazerunner_xcode retry: automatic: - exit_status: "*" limit: 1 - - label: ':ios: Build iOS test fixture for Unity 2020' + - label: ":ios: Build iOS test fixture for Unity 2021" timeout_in_minutes: 30 - key: 'build-ios-fixture-2020' - depends_on: 'generate-fixture-project-2020' + key: "build-ios-fixture-2021" + depends_on: "generate-fixture-project-2021" env: - DEVELOPER_DIR: "/Applications/Xcode13.4.app" - UNITY_VERSION: "2020.3.32f1" + UNITY_VERSION: *2021 + XCODE_VERSION: "15.3.0" plugins: artifacts#v1.5.0: download: - Bugsnag.unitypackage - - project_2020.tgz + - project_2021.tgz upload: - - features/fixtures/maze_runner/mazerunner_2020.3.32f1.ipa + - features/fixtures/maze_runner/mazerunner_2021.ipa - features/fixtures/unity.log commands: - - tar -zxf project_2020.tgz features/fixtures/maze_runner + - bundle install + - tar -zxf project_2021.tgz features/fixtures/maze_runner - rake test:ios:build_xcode retry: automatic: @@ -264,80 +194,40 @@ steps: # # Run iOS tests # - - label: ':ios: Run iOS e2e tests for Unity 2020' + - label: ":bitbar: :ios: Run iOS e2e tests for Unity 2021" timeout_in_minutes: 60 - depends_on: 'build-ios-fixture-2020' + depends_on: "build-ios-fixture-2021" agents: queue: opensource plugins: artifacts#v1.5.0: download: - - "features/fixtures/maze_runner/mazerunner_2020.3.32f1.ipa" + - "features/fixtures/maze_runner/mazerunner_2021.ipa" upload: - "maze_output/**/*" - docker-compose#v3.7.0: - pull: maze-runner - run: maze-runner + - "maze_output/metrics.csv" + + docker-compose#v4.7.0: + pull: maze-runner-bitbar + run: maze-runner-bitbar + service-ports: true command: - - "--app=/app/features/fixtures/maze_runner/mazerunner_2020.3.32f1.ipa" - - "--farm=bs" - - "--device=IOS_15" - - "--fail-fast" - "features/csharp" - "features/ios" - - concurrency: 24 - concurrency_group: browserstack-app + - "--app=features/fixtures/maze_runner/mazerunner_2021.ipa" + - "--farm=bb" + - "--appium-version=1.22" + - "--device=IOS_13|IOS_14|IOS_15" + - "--no-tunnel" + - "--aws-public-ip" + - "--fail-fast" + concurrency: 25 + concurrency_group: "bitbar" concurrency_method: eager - # - # Build Windows test fixture - - - label: Build Unity 2020 Windows test fixture - timeout_in_minutes: 30 - key: 'windows-2020-fixture' - depends_on: 'build-artifacts' - agents: - queue: windows-unity-wsl - env: - UNITY_VERSION: "2020.3.32f1" - plugins: - artifacts#v1.5.0: - download: - - Bugsnag.unitypackage - upload: - - unity.log - - features/fixtures/maze_runner/build/Windows-2020.3.32f1.zip - commands: - - scripts/ci-build-windows-fixture-wsl.sh - retry: - automatic: - - exit_status: "*" - limit: 1 - - # - # Run Windows e2e tests - - - label: Run Windows e2e tests for Unity 2020 - timeout_in_minutes: 30 - depends_on: 'windows-2020-fixture' - agents: - queue: windows-general-wsl - env: - UNITY_VERSION: "2020.3.32f1" - plugins: - artifacts#v1.5.0: - download: - - features/fixtures/maze_runner/build/Windows-2020.3.32f1.zip - upload: - - maze_output/**/* - command: - - scripts/ci-run-windows-tests-wsl.sh - # # Conditionally trigger full pipeline # - - label: 'Conditionally trigger full set of tests' + - label: "Conditionally trigger full set of tests" timeout_in_minutes: 30 command: sh -c .buildkite/pipeline_trigger.sh - diff --git a/.buildkite/pipeline_trigger.sh b/.buildkite/pipeline_trigger.sh index ac0534eac..8be39d688 100755 --- a/.buildkite/pipeline_trigger.sh +++ b/.buildkite/pipeline_trigger.sh @@ -6,7 +6,11 @@ if [[ "$BUILDKITE_MESSAGE" == *"[full ci]"* || ! -z "$FULL_SCHEDULED_BUILD" || "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" == "master" ]]; then echo "Running full build" - buildkite-agent pipeline upload .buildkite/pipeline.full.yml + buildkite-agent pipeline upload .buildkite/pipeline.android.full.yml + buildkite-agent pipeline upload .buildkite/pipeline.ios.full.yml + buildkite-agent pipeline upload .buildkite/pipeline.windows.full.yml + buildkite-agent pipeline upload .buildkite/pipeline.macos.full.yml + buildkite-agent pipeline upload .buildkite/pipeline.webgl.full.yml else # Basic build, but allow a full build to be triggered echo "Running basic build" diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml new file mode 100644 index 000000000..75d1f8bf1 --- /dev/null +++ b/.github/workflows/update-dependencies.yml @@ -0,0 +1,65 @@ +name: update-dependencies + +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: ubuntu-latest + env: + TARGET_SUBMODULE: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.target_submodule || inputs.target_submodule }} + TARGET_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 }} + 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 libcurl4-openssl-dev and net-tools + run: | + sudo apt-get update + sudo apt-get install libcurl4-openssl-dev net-tools + + + - name: Install ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + + - name: Install dependencies + run: bundle install + + - run: bundle exec rake dependencies:update + + - 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-$TARGET_SUBMODULE-$TARGET_VERSION + --title "Update $TARGET_SUBMODULE to version $TARGET_VERSION" + --body 'Created by bumpsnag' + --reviewer rich-bugsnag diff --git a/.gitignore b/.gitignore index dee8dc153..fb9b9d51e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,8 @@ Bugsnag.meta unity/PackageProject/Assets/Bugsnag nunit-agent*.log features/fixtures/maze_runner/Assets/Bugsnag +*.log +features/fixtures/minimalapp/Assets/Bugsnag +features/fixtures/minimalapp/minimal_with_xcode +features/fixtures/minimalapp/minimal_without_xcode +features/fixtures/minimalapp/Packages diff --git a/.gitmodules b/.gitmodules index 67f106eda..feddaa92c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "bugsnag-android"] path = bugsnag-android url = https://github.com/bugsnag/bugsnag-android +[submodule "src/BugsnagUnity/BugsnagUnityWebRequest"] + path = src/BugsnagUnity/BugsnagUnityWebRequest + url = https://github.com/bugsnag/bugsnag-unity-web-request diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae3c1441..a6888a8f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,148 @@ ## TBD -- Updated BugSnag UI branding +### Enhancements + +- Added the BugsnagUnity version to the configuration window. [#819](https://github.com/bugsnag/bugsnag-unity/pull/819) + +- Added automatic and manual network request breadcrumbs. [#817](https://github.com/bugsnag/bugsnag-unity/pull/817) + +- Remove unnecessary ToArray() call when constructing an error. [#822](https://github.com/bugsnag/bugsnag-unity/pull/822) + +- Updated BugSnag UI branding. [#701](https://github.com/bugsnag/bugsnag-unity/pull/701) + +### Bug Fixes + +- Fix timing issues when Bugsnag is started after the focus event. [#821](https://github.com/bugsnag/bugsnag-unity/pull/821) + +### Dependencies + +- Update bugsnag-cocoa to [v6.29.0](https://github.com/bugsnag/bugsnag-cocoa/releases/tag/v6.29.0) [#814](https://github.com/bugsnag/bugsnag-unity/pull/814) + + +## 8.0.0 (2024-06-12) + +### Enhancements + +- Added the `Bugsnag-Integrity` header to outgoing Bugsnag requests to avoid extraneous releases being generated if payloads are altered. [#797](https://github.com/bugsnag/bugsnag-unity/pull/797) + +- Changed `Configuration.DiscardClasses` and `Configuration.RedactedKeys` to Regex types. [#807](https://github.com/bugsnag/bugsnag-unity/pull/807) + +- `Event.Unhandled` is (accessed via OnError and OnSend callbacks) is now non-nullable. [#813](https://github.com/bugsnag/bugsnag-unity/pull/813) + +### Bug Fixes + +- Added a null check to the Bugsnag client to prevent crashes when accessing the client before it has been initialised [#788](https://github.com/bugsnag/bugsnag-unity/pull/788) + +- Made all callback collections within the Configuration class thread safe. [#810](https://github.com/bugsnag/bugsnag-unity/pull/810) + +- Added GenerateAnonymousId to the BugsnagSettingsObject. This fixes a null object reference error on GenerateAnonymousId when using both the performance SDK and Error monitoring SDK, where the error monitoring SDK shares the confirguration with the performance monitoring SDK. [#812](https://github.com/bugsnag/bugsnag-unity/pull/812) + +### Dependencies + +- Update bugsnag-cocoa to [v6.28.1](https://github.com/bugsnag/bugsnag-cocoa/releases/tag/v6.28.1) [#774](https://github.com/bugsnag/bugsnag-unity/pull/774) + +- Update bugsnag-android from [v5.30.0](https://github.com/bugsnag/bugsnag-android/releases/tag/v5.30.0) to [v6.5.0](https://github.com/bugsnag/bugsnag-android/releases/tag/v6.5.0) + +### Deprecations + +- Bugsnag Unity will no longer officially support Unity versions below Unity 2020. Older versions may work, but we will not test against them during development. + + +## 7.7.6 (2024-05-17) + +### Bug Fixes + +- Fixed issue where meta files for the MacOS bundle were not generated. [#802](https://github.com/bugsnag/bugsnag-unity/pull/802) + +## 7.7.5 (2024-05-02) + +### Bug Fixes + +- Fixed issue where changes to device.TotalMemory and device.ModelNumber in cocoa on send callbacks were not respected. [#793](https://github.com/bugsnag/bugsnag-unity/pull/793) + +## 7.7.4 (2024-04-19) + +### Bug Fixes + +- Fixed issue where iOS C# events reported the incorrect value for device.osName. [#791](https://github.com/bugsnag/bugsnag-unity/pull/791) + +## 7.7.3 (2024-04-11) + +### Bug Fixes + +- Changed initialisation of time api to reduce the risk of iOS app hangs on start [#783](https://github.com/bugsnag/bugsnag-unity/pull/783) +- Updated naming for BugsnagEditor EDM menu to reduce potential conflicts with other tools [#780](https://github.com/bugsnag/bugsnag-unity/pull/780) + +## 7.7.2 (2024-03-01) + +### Enhancements + +- Improved handling of serialisation errors when flushing the event cache [#773](https://github.com/bugsnag/bugsnag-unity/pull/773) + +## 7.7.1 (2024-01-25) + +### Bug Fixes + +- Copy the xprivacy api usage file from bugsnag-cocoa on build [#768](https://github.com/bugsnag/bugsnag-unity/pull/768) + +## 7.7.0 (2024-01-04) + +### Enhancements + +- Added `IsStarted` check method that returns false if start has not been called on the BugSnag client. +- Update bugsnag-cocoa from v6.27.2 to [v6.28.0](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6280-2023-12-13) + +## 7.6.5 (2023-08-17) + +### Bug Fixes + +- Fix for Android memory leak. [#738](https://github.com/bugsnag/bugsnag-unity/pull/738) + +## 7.6.4 (2023-08-09) + +### Bug Fixes + +- Add null guard in the Bugsnag exception handler. [#734](https://github.com/bugsnag/bugsnag-unity/pull/734) + +## 7.6.3 (2023-08-03) + +- Update bugsnag-cocoa from v6.26.2 to [v6.27.2](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6272-2023-07-24) +### Bug Fixes + +- Handle exceptions thrown during deserialisation of a cached events and sessions and log the problematic json. [#731](https://github.com/bugsnag/bugsnag-unity/pull/731) + +## 7.6.2 (2023-07-06) + +### Bug Fixes + +- Remove unnecessary usages of DateTimeOffset.Now to prevent iOS app hangs resulting from Unity native code accessing non-thread safe methods. [#725](https://github.com/bugsnag/bugsnag-unity/pull/725) + +## 7.6.1 (2023-06-13) + +### Bug Fixes + +- Prevent callback to Unity from native layers for session and event callbacks if not used to avoid potential ANRs and improve performance. [#717](https://github.com/bugsnag/bugsnag-unity/pull/717) + +## 7.6.0 (2023-05-25) + +- Update bugsnag-cocoa from v6.25.2 to [v6.26.2](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6262-2023-04-20) +- Update bugsnag-android from v5.28.4 to [v5.30.0](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5300-2023-05-11) +### Bug fixes + +* Fix an issue where stack frames containing (wrapper some/wrapper) entries were incorrectly formatted. [#713](https://github.com/bugsnag/bugsnag-unity/pull/713) +* Fix an issue where Config.GenerateAnonymousId was not respected. [#704](https://github.com/bugsnag/bugsnag-unity/pull/704) + +## 7.5.2 (2023-03-08) ### Bug fixes * Fix a race condition in Bugsnag.Start involving creation of gameobjects outside of the main Unity thread. [#699](https://github.com/bugsnag/bugsnag-unity/pull/699) +* Fix an issue causing empty stacktraces in some Android events. [#700](https://github.com/bugsnag/bugsnag-unity/pull/700) + +### Dependency updates + +* Update bugsnag-android from v5.28.3 to [v5.28.4](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5284-2023-02-08) ## 7.5.1 (2023-02-08) @@ -17,9 +154,7 @@ ### Bug fixes * Fix an issue where collections in metadata were not present in native Android crashes. [#685](https://github.com/bugsnag/bugsnag-unity/pull/685) - * Fix an issue where errors in serialisation threw exceptions. [#693](https://github.com/bugsnag/bugsnag-unity/pull/693) - * Fix an issue where persisted events had 'unhandled' set to null [#695](https://github.com/bugsnag/bugsnag-unity/pull/695) ## 7.5.0 (2023-01-04) @@ -27,11 +162,8 @@ ### Enhancements * Added checks in delivery to ensure payloads can't get stuck in a retry loop. [#683](https://github.com/bugsnag/bugsnag-unity/pull/683) - * Raised `Configuration.MaxBreadcrumbs` default from 50 to 100, raised the limit from 100 to 500 and added a check to truncate breadcrumbs from oversized payloads. [#671](https://github.com/bugsnag/bugsnag-unity/pull/671) - * Add `Configuration.MaxStringValueLength` config option. [#668](https://github.com/bugsnag/bugsnag-unity/pull/668) - * Added `Telemetry.Usage` configuration option to set the [native Android option](https://docs.bugsnag.com/platforms/android/configuration-options/#telemetry) and the [native Cocoa option](https://docs.bugsnag.com/platforms/ios/configuration-options/#telemetry) [#666](https://github.com/bugsnag/bugsnag-unity/pull/666) ### Dependency updates @@ -42,15 +174,10 @@ ### Bug fixes * Fix an issue where bundle version was not reported correctly on iOS and MacOS. [#672](https://github.com/bugsnag/bugsnag-unity/pull/672) - * Fix an issue where a null value in metadata could cause an exception. [#652](https://github.com/bugsnag/bugsnag-unity/pull/652) - * Fix an issue where android metadata was not deserialised as the correct type, which could cause exceptions when processing metadata. [#652](https://github.com/bugsnag/bugsnag-unity/pull/652) - * Fix an issue where android sessions had inaccurate Session.Handled and Unhandled counts. [#684](https://github.com/bugsnag/bugsnag-unity/pull/684) - * Fix an issue where Cocoa Device and App data was serialized incorrectly causing invalid cast exceptions in callbacks [#680](https://github.com/bugsnag/bugsnag-unity/pull/680) - * Fixed an issue where user changes made in OnSession callbacks did not make it to the generated payload [#681](https://github.com/bugsnag/bugsnag-unity/pull/681) ## 7.4.0 (2022-10-26) @@ -95,10 +222,8 @@ * Fixed issue where exceptions thrown in async methods were missing some stack frames [#610](https://github.com/bugsnag/bugsnag-unity/pull/610) - * Added `DontSave` HideFlags to gameObjects created by the Bugsnag SDK to negate the chances of them making scenes dirty in the editor [#604](https://github.com/bugsnag/bugsnag-unity/pull/604) - * Fixed compilation errors when building with IL2CPP for Android after changes to the Unity API `BlockCopy` method caused `ArgumentException` [#605](https://github.com/bugsnag/bugsnag-unity/pull/605) @@ -122,21 +247,16 @@ * Increased thread saftey of the metadata dictionary in Bugsnag.LeaveBreadcrumb [#564](https://github.com/bugsnag/bugsnag-unity/pull/564) - * Fixed an issue where events occuring directly after Bugsnag init had no session information attached. [#571](https://github.com/bugsnag/bugsnag-unity/pull/571) - ## 7.0.0 (2022-05-30) This version contains **breaking** changes: some errors generated by the new version will no longer group in the Bugnsag dashboard with equivalent errors generated by older versions. This is due to the introduction of a new exception interceptor that gets passed the C# exception objects, rather than having to parse the information from Unity logs. - Please see the [upgrade guide](./UPGRADING.md) for details of all the changes and instructions on how to upgrade. - ### Dependency updates * Update bugsnag-android from v5.22.0 to [v5.22.4](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5224-2022-05-24) - * Update bugsnag-cocoa from v6.16.1 to [v6.17.1](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6171-2022-05-18) ## 6.3.2 (2022-05-27) @@ -165,7 +285,6 @@ Please see the [upgrade guide](./UPGRADING.md) for details of all the changes an * Fixed an issue where the use of ToUpper caused a crash on devices using the Turkish language [#543](https://github.com/bugsnag/bugsnag-unity/pull/543) - * Fixed an issue where breadcrumbs with null messages caused errors [#545](https://github.com/bugsnag/bugsnag-unity/pull/545) @@ -174,7 +293,6 @@ Please see the [upgrade guide](./UPGRADING.md) for details of all the changes an ### Enhancements * Added Android support for [EDM4U](https://github.com/googlesamples/unity-jar-resolver). For manual installs there see the new menu item at Window/Bugsnag/Enable EDM Support. For UPM installs we have a [dedicated package](https://github.com/bugsnag/bugsnag-unity-upm-edm4u). [#528](https://github.com/bugsnag/bugsnag-unity/pull/528) - * Update bugsnag-android to v5.21.0 * Fix inconsistencies in stack trace quality for C/C++ events. Resolves a few cases where file and line number information was not resolving to the correct @@ -190,9 +308,7 @@ Please see the [upgrade guide](./UPGRADING.md) for details of all the changes an ### Enhancements * Added offline persistence of C# events/exceptions (all platforms); and of sessions and device ID (Windows and WebGL) [#512](https://github.com/bugsnag/bugsnag-unity/pull/512) [#509](https://github.com/bugsnag/bugsnag-unity/pull/509) [#514](https://github.com/bugsnag/bugsnag-unity/pull/514) - * Add `Configuration.MaxReportedThreads` config option to set the [native Android option](https://docs.bugsnag.com/platforms/android/configuration-options/#maxreportedthreads) [523](https://github.com/bugsnag/bugsnag-unity/pull/523) - * Update bugsnag-android to v5.20.0 * The number of threads reported can now be limited using `Configuration.setMaxReportedThreads` (defaulting to 200) [bugsnag-android#1607](https://github.com/bugsnag/bugsnag-android/pull/1607) @@ -207,7 +323,6 @@ Please see the [upgrade guide](./UPGRADING.md) for details of all the changes an * New APIs to support forthcoming feature flag and experiment functionality. For more information, please see https://docs.bugsnag.com/product/features-experiments [#504](https://github.com/bugsnag/bugsnag-unity/pull/504) [#501](https://github.com/bugsnag/bugsnag-unity/pull/501) - * Update bugsnag-cocoa to v6.16.1 * New APIs to support forthcoming feature flag and experiment functionality. For more information, please see https://docs.bugsnag.com/product/features-experiments @@ -244,7 +359,6 @@ Please see the [upgrade guide](./UPGRADING.md) for details of all the changes an [bugsnag-cocoa#1214](https://github.com/bugsnag/bugsnag-cocoa/pull/1214) * Fix missing imports when building with `CLANG_ENABLE_MODULES=NO` [bugsnag-cocoa#1284](https://github.com/bugsnag/bugsnag-cocoa/pull/1284) - * Update bugsnag-android to v5.19.2 * New APIs to support forthcoming feature flag and experiment functionality. For more information, please see https://docs.bugsnag.com/product/features-experiments. * Explicitly define Kotlin api/language versions @@ -260,15 +374,11 @@ Please see the [upgrade guide](./UPGRADING.md) for details of all the changes an * Fix a bug where api keys set in React Native callbacks were ignored [bugsnag-android#1592](https://github.com/bugsnag/bugsnag-android/pull/1592) - ## 6.0.0 (2022-01-20) This version contains **breaking** changes, as bugsnag-unity has been updated to allow for more convenient and performant initialisation and configuration features. - Please see the [upgrade guide](./UPGRADING.md) for details of all the changes and instructions on how to upgrade. - In addition to the changes mentioned in the upgrade guide, the bundled Bugsnag Android Notifier has been updated. See below for details. - * Update bugsnag-android to v5.18.0 * Bump compileSdkVersion to apiLevel 31 [bugsnag-android#1536](https://github.com/bugsnag/bugsnag-android/pull/1536) @@ -303,14 +413,13 @@ In addition to the changes mentioned in the upgrade guide, the bundled Bugsnag A * Update bugsnag-cocoa to v6.14.2 * Fix missing `configuration.user` and manually resumed `session` info in unhandled errors. [bugsnag-cocoa#1215](https://github.com/bugsnag/bugsnag-cocoa/pull/1215) -* Update bugsnag-android to v5.15.0 +* Update bugsnag-android to v5.15.0 * Avoid reporting false-positive background ANRs with improved foreground detection [bugsnag-android#1429](https://github.com/bugsnag/bugsnag-android/pull/1429) * Prevent events being attached to phantom sessions when they are blocked by an `OnSessionCallback` [bugsnag-android#1434](https://github.com/bugsnag/bugsnag-android/pull/1434) * Plugins will correctly mirror metadata added using `addMetadata(String, Map)` [bugsnag-android#1454](https://github.com/bugsnag/bugsnag-android/pull/1454) - ### Bug fixes * Fixed an issue where breadcrumbs from non fatal apphang errors caused a crash on retrieval @@ -321,12 +430,10 @@ In addition to the changes mentioned in the upgrade guide, the bundled Bugsnag A ### Enhancements * Removed the limit on the length of a breadcrumbs name [#399](https://github.com/bugsnag/bugsnag-unity/pull/399) - * Update bugsnag-android to v5.14.0 * Capture and report thread state (running, sleeping, etc.) for Android Runtime and Native threads [bugsnag-android#1367](https://github.com/bugsnag/bugsnag-android/pull/1367) [bugsnag-android#1390](https://github.com/bugsnag/bugsnag-android/pull/1390) - * Update bugsnag-cocoa to v6.14.1 * Disable automatic session tracking in app extensions (it was not working as intended.) [bugsnag-cocoa#1211](https://github.com/bugsnag/bugsnag-cocoa/pull/1211) @@ -336,7 +443,7 @@ In addition to the changes mentioned in the upgrade guide, the bundled Bugsnag A [bugsnag-cocoa#1209](https://github.com/bugsnag/bugsnag-cocoa/pull/1209) * Apply `redactedKeys` to breadcrumb metadata. [bugsnag-cocoa#1204](https://github.com/bugsnag/bugsnag-cocoa/pull/1204) - * Capture and report thread states (running, stopped, waiting, etc.) + * Capture and report thread states (running, stopped, waiting, etc.) [bugsnag-cocoa#1200](https://github.com/bugsnag/bugsnag-cocoa/pull/1200) * Disable app hang detection for app extensions. [bugsnag-cocoa#1198](https://github.com/bugsnag/bugsnag-cocoa/pull/1198) @@ -351,24 +458,18 @@ In addition to the changes mentioned in the upgrade guide, the bundled Bugsnag A ### Enhancements * Update bugsnag-cocoa to v6.12.2 - * Stop dropping breadcrumbs when provided invalid metadata (that is not JSON convertible.) [bugsnag-cocoa#1187](https://github.com/bugsnag/bugsnag-cocoa/pull/1187) - * Fix Swift fatal error parsing for messages with no filename. [bugsnag-cocoa#1186](https://github.com/bugsnag/bugsnag-cocoa/pull/1186) - * Events now include a `thermalState` property in the `device` tab, and unexpected app terminations that occur when the thermal state is critical will now be reported as a "Thermal Kill" rather than Out Of Memory error. [bugsnag-cocoa#1171](https://github.com/bugsnag/bugsnag-cocoa/pull/1171) - * Fix a regression where the session was not captured at launch if Bugsnag was started before `willFinishLaunchingWithOptions` in iOS apps that do not adopt the UIScene life-cycle. [bugsnag-cocoa#1180](https://github.com/bugsnag/bugsnag-cocoa/pull/1180) - * Fatal app hangs will no longer be reported if the `willTerminateNotification` is received. [bugsnag-cocoa#1176](https://github.com/bugsnag/bugsnag-cocoa/pull/1176) - * Update bugsnag-android to v5.13.0 * The `app.lowMemory` value always report the most recent `onTrimMemory`/`onLowMemory` status [bugsnag-android#1342](https://github.com/bugsnag/bugsnag-android/pull/1342) * Added the `app.memoryTrimLevel` metadata to report a description of the latest `onTrimMemory` status [bugsnag-android#1344](https://github.com/bugsnag/bugsnag-android/pull/1344) @@ -386,18 +487,11 @@ In addition to the changes mentioned in the upgrade guide, the bundled Bugsnag A [bugsnag-android#1375](https://github.com/bugsnag/bugsnag-android/pull/1375) * Use SystemClock.elapsedRealtime to track `app.durationInForeground` [bugsnag-android#1375](https://github.com/bugsnag/bugsnag-android/pull/1375) - - * Add new automatically collected Device data to Windows, WebGL and Unity Editor events: `batteryLevel, charging, id, model, screenDensity, screenResolution, totalMemory` [#390](https://github.com/bugsnag/bugsnag-unity/pull/390) - * Add new automatically collected App data to Windows, WebGL and Unity Editor events: `duration, id, isLaunching, lowMemory` [#390](https://github.com/bugsnag/bugsnag-unity/pull/390) - * Add new Bugsnag.Notify overloads: `Notify(exception, stacktrace)` `Notify(exception, stacktrace, callback)` `Notify(name, message, stacktrace)` `Notify(name, message, stacktrace, callback)` [#380](https://github.com/bugsnag/bugsnag-unity/pull/380) - * Add `Bugsnag.GetLastRunInfo()` To get relevant crash information regarding the last run of the application [#379](https://github.com/bugsnag/bugsnag-unity/pull/379) - * Add `Configuration.SendLaunchCrashesSynchronously` config option to set the [native Android option](https://docs.bugsnag.com/platforms/android/configuration-options/#launchdurationmillis) and the [native Cocoa option](https://docs.bugsnag.com/platforms/ios/configuration-options/#launchdurationmillis) [#379](https://github.com/bugsnag/bugsnag-unity/pull/379) - * Add `Configuration.LaunchDurationMillis` config option to set the [native Android option](https://docs.bugsnag.com/platforms/android/configuration-options/#sendlaunchcrashessynchronously) and the [native Cocoa option](https://docs.bugsnag.com/platforms/ios/configuration-options/#sendlaunchcrashessynchronously) [#379](https://github.com/bugsnag/bugsnag-unity/pull/379) ### Deprecated @@ -409,203 +503,138 @@ In addition to the changes mentioned in the upgrade guide, the bundled Bugsnag A * Fixed an issue where app.type was not sent in native Cocoa crash reports [#395](https://github.com/bugsnag/bugsnag-unity/pull/395) - ## 5.3.0 (2021-09-01) ### Enhancements * Add `Configuration.VersionCode` config option to set the [native Android option](https://docs.bugsnag.com/platforms/android/configuration-options/#versioncode) [#373](https://github.com/bugsnag/bugsnag-unity/pull/373) - * Add `Configuration.PersistenceDirectory` to set the [native Android option](https://docs.bugsnag.com/platforms/android/configuration-options/#persistencedirectory) [#368](https://github.com/bugsnag/bugsnag-unity/pull/368) - * Add `Configuration.SendThreads` config option to set the [native Android option](https://docs.bugsnag.com/platforms/android/configuration-options/#sendthreads) and the [native Cocoa option](https://docs.bugsnag.com/platforms/ios/configuration-options/#sendthreads) [#375](https://github.com/bugsnag/bugsnag-unity/pull/375) - * Add `Configuration.PersistUser` config option to set the [native Android option](https://docs.bugsnag.com/platforms/android/configuration-options/#persistuser) and the [native Cocoa option](https://docs.bugsnag.com/platforms/ios/configuration-options/#persistuser) [#372](https://github.com/bugsnag/bugsnag-unity/pull/372) - * Add `Configuration.MaxPersistedEvents` config option to set the [native Android option](https://docs.bugsnag.com/platforms/android/configuration-options/#maxpersistedevents) and the [native Cocoa option](https://docs.bugsnag.com/platforms/ios/configuration-options/#maxpersistedevents) [#371](https://github.com/bugsnag/bugsnag-unity/pull/371) - * Add `Configuration.RedactedKeys` configuration option to enable redacting specific keys in metadata [#367](https://github.com/bugsnag/bugsnag-unity/pull/367) - * Add `Configuration.Endpoints` to enable setting custom endpoints for events and sessions [#366](https://github.com/bugsnag/bugsnag-unity/pull/366) - * Add `Configuration.ProjectPackages` config option to set the [native Android option](https://docs.bugsnag.com/platforms/android/configuration-options/#projectpackages) [#364](https://github.com/bugsnag/bugsnag-unity/pull/364) - * Add `Configuration.BundleVersion` config option to set the [native Cocoa option](https://docs.bugsnag.com/platforms/ios/configuration-options/#bundleversion) [#359](https://github.com/bugsnag/bugsnag-unity/pull/359) - * Add `Configuration.AppType` configuration option to enable setting a custom value for the app.type field in an event [#363](https://github.com/bugsnag/bugsnag-unity/pull/363) - * Update bugsnag-cocoa to v6.11.0 - * Add breadcrumbs for `UIScene` notifications. [#1165](https://github.com/bugsnag/bugsnag-cocoa/pull/1165) - * Fix another rare crash in `bsg_ksmachgetThreadQueueName`. [#1157](https://github.com/bugsnag/bugsnag-cocoa/pull/1157) - * Fix ThreadSanitizer data race in `BugsnagBreadcrumbs`. [#1160](https://github.com/bugsnag/bugsnag-cocoa/pull/1160) - * Add `DiscardClasses` configuration option to disable sending events that contain user defined error classes. [#361](https://github.com/bugsnag/bugsnag-unity/pull/361) - * Update bugsnag-android to v5.11.0: * Add Bugsnag listeners for StrictMode violation detection [#1331](https://github.com/bugsnag/bugsnag-android/pull/1331) - * Address pre-existing StrictMode violations [#1328](https://github.com/bugsnag/bugsnag-android/pull/1328) - + ### Deprecated * `Bugsnag.SetContext(string context)` has been deprecated in favour of the new `Bugsnag.Context` property and will be removed in the next major release. - * `Configuration.Endpoint` has been deprecated in favour of the new `Configuration.Endpoints` class and will be removed in the next major release. - -* `Configuration.SessionEndpoint` has been deprecated in favour of the new `Configuration.Endpoints` class and will be removed in the next major release. - -* `Configuration.NotifyReleaseStages` has been deprecated in favour of `Configuration.EnabledReleaseStages` and will be removed in the next major release. +* `Configuration.SessionEndpoint` has been deprecated in favour of the new `Configuration.Endpoints` class and will be removed in the next major release. +* `Configuration.NotifyReleaseStages` has been deprecated in favour of `Configuration.EnabledReleaseStages` and will be removed in the next major release. ## 5.2.0 (2021-08-04) ### Enhancements * Add `AppHangThresholdMillis` to set the [native Cocoa option](https://docs.bugsnag.com/platforms/ios/configuration-options/#apphangthresholdmillis) [#347](https://github.com/bugsnag/bugsnag-unity/pull/347) - * Add `EnabledErrorTypes` configuration option to enable/disable different types of errors [#341](https://github.com/bugsnag/bugsnag-unity/pull/341) - -* [Android] Automatic [App Not Responding](https://developer.android.com/topic/performance/vitals/anr) (ANR) detection is now enabled by default +* [Android] Automatic [App Not Responding](https://developer.android.com/topic/performance/vitals/anr) (ANR) detection is now enabled by default [#339](https://github.com/bugsnag/bugsnag-unity/pull/339) - * Update bugsnag-cocoa to v6.10.2 - * Fix ThreadSanitizer data race warning in `BSGAppHangDetector`. [#1153](https://github.com/bugsnag/bugsnag-cocoa/pull/1153) - * Remove (duplicated) `user` information from `metaData`. [#1151](https://github.com/bugsnag/bugsnag-cocoa/pull/1151) - * Fix a potential stack overflow in `+[BugsnagThread allThreadsWithCurrentThreadBacktrace:]`. [#1148](https://github.com/bugsnag/bugsnag-cocoa/pull/1148) - * Fix `NSNull` handling in `+[BugsnagError errorFromJson:]` and `+[BugsnagStackframe frameFromJson:]`. [#1143](https://github.com/bugsnag/bugsnag-cocoa/pull/1143) - * Fix a rare crash in `bsg_ksmachgetThreadQueueName`. [#1147](https://github.com/bugsnag/bugsnag-cocoa/pull/1147) - * Fix an issue that could cause C++ exceptions with very long descriptions to not be reported. [#1137](https://github.com/bugsnag/bugsnag-cocoa/pull/1137) - * Improve performance of adding metadata by using async file I/O. [#1133](https://github.com/bugsnag/bugsnag-cocoa/pull/1133) - * Improve performance of leaving breadcrumbs by using async file I/O. [#1124](https://github.com/bugsnag/bugsnag-cocoa/pull/1124) - * Prevent some potential false positive detection of app hangs. [#1122](https://github.com/bugsnag/bugsnag-cocoa/pull/1122) - * Update bugsnag-android to v5.10.1: - * Prefer `calloc()` to `malloc()` in NDK code [#1320](https://github.com/bugsnag/bugsnag-android/pull/1320) - * Ensure correct value always collected for activeScreen [#1322](https://github.com/bugsnag/bugsnag-android/pull/1322) - * Capture process name in Event payload [#1318](https://github.com/bugsnag/bugsnag-android/pull/1318) - * Avoid unnecessary BroadcastReceiver registration for monitoring device orientation [#1303](https://github.com/bugsnag/bugsnag-android/pull/1303) - * Register system callbacks on background thread [#1292](https://github.com/bugsnag/bugsnag-android/pull/1292) - * Fix rare NullPointerExceptions from ConnectivityManager [#1311](https://github.com/bugsnag/bugsnag-android/pull/1311) - * Respect manual setting of context [#1310](https://github.com/bugsnag/bugsnag-android/pull/1310) - * Handle interrupt when shutting down executors [#1315](https://github.com/bugsnag/bugsnag-android/pull/1315) - * Allow serializing enabledBreadcrumbTypes as null [#1316](https://github.com/bugsnag/bugsnag-android/pull/1316) - * Properly handle ANRs after multiple calls to autoNotify and autoDetectAnrs [#1265](https://github.com/bugsnag/bugsnag-android/pull/1265) - * Cache value of app.backgroundWorkRestricted [#1275](https://github.com/bugsnag/bugsnag-android/pull/1275) - * Optimize execution of callbacks [#1276](https://github.com/bugsnag/bugsnag-android/pull/1276) - * Optimize implementation of internal state change observers [#1274](https://github.com/bugsnag/bugsnag-android/pull/1274) - * Optimize metadata implementation by reducing type casts [#1277](https://github.com/bugsnag/bugsnag-android/pull/1277) - * Trim stacktraces to <200 frames before attempting to construct POJOs [#1281](https://github.com/bugsnag/bugsnag-android/pull/1281) - * Use direct field access when adding breadcrumbs and state updates [#1279](https://github.com/bugsnag/bugsnag-android/pull/1279) - * Avoid using regex to validate api key [#1282](https://github.com/bugsnag/bugsnag-android/pull/1282) - * Discard unwanted automatic data earlier where possible [#1280](https://github.com/bugsnag/bugsnag-android/pull/1280) - * Enable ANR handling on immediately if started from the main thread [#1283](https://github.com/bugsnag/bugsnag-android/pull/1283) - * Include `app.binaryArch` in all events [#1287](https://github.com/bugsnag/bugsnag-android/pull/1287) - * Cache results from PackageManager [#1288](https://github.com/bugsnag/bugsnag-android/pull/1288) - * Use ring buffer to store breadcrumbs [#1286](https://github.com/bugsnag/bugsnag-android/pull/1286) - * Avoid expensive set construction in Config constructor [#1289](https://github.com/bugsnag/bugsnag-android/pull/1289) - * Replace calls to String.format() with concatenation [#1293](https://github.com/bugsnag/bugsnag-android/pull/1293) - * Optimize capture of thread traces - [#1300](https://github.com/bugsnag/bugsnag-android/pull/1300) - + [#1300](https://github.com/bugsnag/bugsnag-android/pull/1300) + ### Bug fixes -* Fixed an issue where Windows events would have incorrectly split stacktraces resulting in all lines being bundled into one +* Fixed an issue where Windows events would have incorrectly split stacktraces resulting in all lines being bundled into one [#350](https://github.com/bugsnag/bugsnag-unity/pull/350) - -* Fixed an issue where WebGL web requests that initially fail were not respecting the 10 second delay before retrying +* Fixed an issue where WebGL web requests that initially fail were not respecting the 10 second delay before retrying [#321](https://github.com/bugsnag/bugsnag-unity/pull/321) - * Fixed an issue where Breadcrumbs were reported in the wrong order on Windows and in the Unity Editor [#322](https://github.com/bugsnag/bugsnag-unity/pull/322) - * Fixed an issue where a "Bugsnag loaded" breadcrumb was not added on Windows, Linux, WebGL, and editor builds [#327](https://github.com/bugsnag/bugsnag-unity/pull/327) - * Fixed an issue where the fallback was not reporting the correct app.type [#325](https://github.com/bugsnag/bugsnag-unity/pull/325) - + ### Deprecated * `Configuration.NotifyLevel` has been deprecated in favour of `Configuration.NotifyLogLevel` and will be removed in the next major release. - * `Configuration.AutoNotify` has been deprecated in favour of `Configuration.AutoDetectErrors` and will be removed in the next major release. - * `Configuration.AutoCaptureSessions` has been deprecated in favour of `Configuration.AutoTrackSessions` and will be removed in the next major release. - ## 5.1.1 (2021-06-24) @@ -625,31 +654,23 @@ In addition to the changes mentioned in the upgrade guide, the bundled Bugsnag A * `unity.osLanguage` -> `device.osLanguage` * `unity.unityException` -> removed as a duplicate of the error class * `unity.unityLogType` -> removed as is contained in the error class for generic logs - * Add `EnabledBreadcrumbTypes` configuration option to enable/disable automatically recorded breadcrumbs [#301](https://github.com/bugsnag/bugsnag-unity/pull/301) * Add `MaxBreadcrumbs` configuration option to control the number of breadcrumbs collected on all platforms [#275](https://github.com/bugsnag/bugsnag-unity/pull/275) [#304](https://github.com/bugsnag/bugsnag-unity/pull/304) - * Update bugsnag-cocoa to v6.9.6: - * Improve accuracy of app hang event information to better reflect state at time of detection. [#1118](https://github.com/bugsnag/bugsnag-cocoa/pull/1118) - * Stop app hangs being reported if app is launched in the background. [#1112](https://github.com/bugsnag/bugsnag-cocoa/pull/1112) - * Stop session being reported if app is launched in the background. [#1107](https://github.com/bugsnag/bugsnag-cocoa/pull/1107) - * Fix KSCrash state storage for apps with no CFBundleName. [#1103](https://github.com/bugsnag/bugsnag-cocoa/pull/1103) - * Improve performance of `notify()`. [#1102](https://github.com/bugsnag/bugsnag-cocoa/pull/1102) [#1104](https://github.com/bugsnag/bugsnag-cocoa/pull/1104) [#1105](https://github.com/bugsnag/bugsnag-cocoa/pull/1105) - * Fix a crash in `-[BugsnagApp deserializeFromJson:]` if main Mach-O image could not be identified, and improve reliability of identification. [#1097](https://github.com/bugsnag/bugsnag-cocoa/issues/1097) [#1101](https://github.com/bugsnag/bugsnag-cocoa/pull/1101) @@ -658,29 +679,22 @@ In addition to the changes mentioned in the upgrade guide, the bundled Bugsnag A * Fix an issue where the Device.time of an event was missing the milliseconds [#298](https://github.com/bugsnag/bugsnag-unity/pull/298) - * Adjust post build script to support Unity 2021 builds [#289](https://github.com/bugsnag/bugsnag-unity/pull/289) - * Fix an issue where timestamps and other `:`-containing log message content was interpreted as the error class [#292](https://github.com/bugsnag/bugsnag-unity/pull/292) - * Correct Android session start times [#291](https://github.com/bugsnag/bugsnag-unity/pull/291) - * Fix duplicate events being sent for Android C/C++ crashes - + ## 5.0.0 (2021-06-08) This version contains **breaking** changes, as bugsnag-unity has been updated to use the latest available versions of bugsnag-android (v4.22.2 -> v5.9.4) and bugsnag-cocoa (v5.23.5 -> v6.9.3). - Please see the [upgrade guide](./UPGRADING.md) for details of all the changes and instructions on how to upgrade. - ### Bug fixes * Stop scene changes overrriding context when manually set [#255](https://github.com/bugsnag/bugsnag-unity/pull/255) - * Don't Destroy TimingTrackerObject, so it persists across scenes [#239](https://github.com/bugsnag/bugsnag-unity/pull/239) @@ -711,7 +725,6 @@ Please see the [upgrade guide](./UPGRADING.md) for details of all the changes an * Avoid JNI crash in leaveBreadcrumb by pushing local frame [#214](https://github.com/bugsnag/bugsnag-unity/pull/214) - * Respect autoNotify flag on Android [#207](https://github.com/bugsnag/bugsnag-unity/pull/207) @@ -721,35 +734,27 @@ Please see the [upgrade guide](./UPGRADING.md) for details of all the changes an * Add device id to error reports on Cocoa platforms [#203](https://github.com/bugsnag/bugsnag-unity/pull/203) - * Update bugsnag-cocoa to v5.23.5: - * Fix JSON serialisation of strings with control characters [#739](https://github.com/bugsnag/bugsnag-cocoa/pull/739) - * Removed non-thread safe date formatter [#758](https://github.com/bugsnag/bugsnag-cocoa/pull/758) - * Avoid dereference null pointer in JSON serialisation [#637](https://github.com/bugsnag/bugsnag-cocoa/pull/637) [Naugladur](https://github.com/Naugladur) - * Fixed an issue where an app could deadlock during a crash if unfavourable timing caused DYLD lock contention. [#580](https://github.com/bugsnag/bugsnag-cocoa/pull/580) [#675](https://github.com/bugsnag/bugsnag-cocoa/pull/675) [#725](https://github.com/bugsnag/bugsnag-cocoa/pull/725) [#721](https://github.com/bugsnag/bugsnag-cocoa/pull/721) - * Fix possible report corruption when using `notify()` from multiple threads when configured to skip capturing/reporting background thread contents (generally only Unity games). [#442](https://github.com/bugsnag/bugsnag-cocoa/pull/442) - * Added several additional event fields (`codeBundleId`, `osName`, `modelNumber`, `locale`) that were missing from the OOM reports. [#444](https://github.com/bugsnag/bugsnag-cocoa/pull/444) - * Bugsnag now correctly records a new session if it is returning to the foreground after more than 60 seconds in the background. [#529](https://github.com/bugsnag/bugsnag-cocoa/pull/529) @@ -760,7 +765,6 @@ Please see the [upgrade guide](./UPGRADING.md) for details of all the changes an * Delete local JNI references to avoid leaks [#198](https://github.com/bugsnag/bugsnag-unity/pull/198) - * Add option to `Configuration` to prevent automatic breadcrumb collection [#199](https://github.com/bugsnag/bugsnag-unity/pull/199) @@ -784,7 +788,6 @@ Please see the [upgrade guide](./UPGRADING.md) for details of all the changes an This release adds ANR detection for Unity apps running in Android. To enable this option you should set `Bugsnag.Configuration.AutoDetectAnrs` to `true` after initialising bugsnag in the normal way. - * Detect ANRs on Android and provide configuration option to enable detection [#184](https://github.com/bugsnag/bugsnag-unity/pull/184) @@ -796,16 +799,12 @@ set `Bugsnag.Configuration.AutoDetectAnrs` to `true` after initialising bugsnag ## 4.7.0 (2020-01-22) * Update bugsnag-android to v4.22.2: - * This release adds a compile-time dependency on the Kotlin standard library. This should not affect the use of any API supplied by bugsnag-unity. - * Modularise bugsnag-android into Core, NDK, and ANR artifacts [#522](https://github.com/bugsnag/bugsnag-android/pull/522) - * Migrate dependencies to androidx [#554](https://github.com/bugsnag/bugsnag-android/pull/554) - * Report internal SDK errors to bugsnag [#570](https://github.com/bugsnag/bugsnag-android/pull/570) [#581](https://github.com/bugsnag/bugsnag-android/pull/581) @@ -813,48 +812,36 @@ set `Bugsnag.Configuration.AutoDetectAnrs` to `true` after initialising bugsnag [#605](https://github.com/bugsnag/bugsnag-android/pull/605) [#588](https://github.com/bugsnag/bugsnag-android/pull/588) [#612](https://github.com/bugsnag/bugsnag-android/pull/612) - * Add `detectNdkCrashes` configuration option to bugsnag-android to toggle whether C/C++ crashes are detected [#491](https://github.com/bugsnag/bugsnag-android/pull/491) - * Use NetworkCallback to monitor connectivity changes on newer API levels [#501](https://github.com/bugsnag/bugsnag-android/pull/501) - * Fix deserialization of custom stackframe fields in cached error reports [#576](https://github.com/bugsnag/bugsnag-android/pull/576) - * Buffer IO when reading from cached error files, improving SDK performance [#573](https://github.com/bugsnag/bugsnag-android/pull/573) - * flushOnLaunch() does not cancel previous requests if they timeout, leading to potential duplicate reports [#593](https://github.com/bugsnag/bugsnag-android/pull/593) - * Report correct value for free disk space [#589](https://github.com/bugsnag/bugsnag-android/pull/589) - * Allow overriding the versionCode via Configuration [#610](https://github.com/bugsnag/bugsnag-android/pull/610) - * Catch throwables when invoking methods on system services [#623](https://github.com/bugsnag/bugsnag-android/pull/623) - * Update bugsnag-cocoa to v5.23.0: * Fix unrecognized selector crash when adding metadata [#430](https://github.com/bugsnag/bugsnag-cocoa/pull/430) - * This release removes support for reporting 'partial' or 'minimal' crash reports where the crash report could not be entirely written (due to disk space or other issues like the device battery dying). While sometimes the reports could point in the right direction for debugging, they could also be confusing or not enough information to pursue and close the issue successfully. - This release also renames a few configuration properties to align better with the intended use and other Bugsnag libraries, so people who use more than one platform can easily find related functionality in a different library. The old names are deprecated but still supported until the next major release. [#435](https://github.com/bugsnag/bugsnag-cocoa/pull/435) - * `Bugsnag.setBreadcrumbCapacity()` is now `setMaxBreadcrumbs()` on the `BugsnagConfiguration` class. In addition, the default number of breadcrumbs saved has been raised to 25 and limited to no more than 100. @@ -929,13 +916,10 @@ set `Bugsnag.Configuration.AutoDetectAnrs` to `true` after initialising bugsnag * Support disabling native reporting during initialization [#164](https://github.com/bugsnag/bugsnag-unity/pull/164) - The new API can be used as follows: - ```c# Bugsnag.Init("your-api=key-here", false /* disable crash reporting */); ``` - or by unchecking "Auto Notify" when initializing Bugsnag via a GameObject in the Unity Inspector. @@ -1052,14 +1036,11 @@ set `Bugsnag.Configuration.AutoDetectAnrs` to `true` after initialising bugsnag * Migrate version information in reports to device.runtimeVersions, adding additional info like scripting backend [#149](https://github.com/bugsnag/bugsnag-unity/pull/149) - * Update bugsnag-android dependency to v4.14.0: * Improve In-foreground calculation for report metadata [#466](https://github.com/bugsnag/bugsnag-android/pull/466) - * Migrate version information to device.runtimeVersions [#472](https://github.com/bugsnag/bugsnag-android/pull/472) - * Update bugsnag-cocoa dependency to v5.22.0: * Migrate version information to device.runtimeVersions [#340](https://github.com/bugsnag/bugsnag-cocoa/pull/340) @@ -1101,7 +1082,6 @@ set `Bugsnag.Configuration.AutoDetectAnrs` to `true` after initialising bugsnag main thread-only `logMessageReceived` callback receives more stackframes on some versions of Unity 2017, improving the debugging experience. - ## 4.4.0 (2019-04-05) ### Enhancements @@ -1109,10 +1089,8 @@ set `Bugsnag.Configuration.AutoDetectAnrs` to `true` after initialising bugsnag * Update bugsnag-android dependency to v4.13.0: * Add ANR detection to bugsnag-android (ANR detection is disabled on Unity) [bugsnag-android#442](https://github.com/bugsnag/bugsnag-android/pull/442) - * Add unhandled_events field to native payload [bugsnag-android#445](https://github.com/bugsnag/bugsnag-android/pull/445) - * Add stopSession() and resumeSession() to Client [bugsnag-android#429](https://github.com/bugsnag/bugsnag-android/pull/429) @@ -1121,16 +1099,12 @@ set `Bugsnag.Configuration.AutoDetectAnrs` to `true` after initialising bugsnag * Update bugsnag-android dependency to v4.13.0: * Prevent overwriting config.projectPackages if already set [bugsnag-android#428](https://github.com/bugsnag/bugsnag-android/pull/428) - * Fix incorrect session handledCount when notifying in quick succession [bugsnag-android#434](https://github.com/bugsnag/bugsnag-android/pull/434) - * Ensure boolean object from map serialised as boolean primitive in JNI [bugsnag-android#452](https://github.com/bugsnag/bugsnag-android/pull/452) - * Prevent NPE occurring when calling resumeSession() [bugsnag-android#444](https://github.com/bugsnag/bugsnag-android/pull/444) - * Update bugsnag-cocoa dependency to v5.19.1: * Fix generating an incorrect stacktrace used when logging an exception to Bugsnag from a location other than the original call site (for example, from a @@ -1141,7 +1115,6 @@ set `Bugsnag.Configuration.AutoDetectAnrs` to `true` after initialising bugsnag reporting the handler code stacktrace rather than the reported exception stack. [bugsnag-cocoa#334](https://github.com/bugsnag/bugsnag-cocoa/pull/334) - * Fix network connectivity monitor by connecting to the correct domain [Jacky Wijaya](https://github.com/Jekiwijaya) [bugsnag-cocoa#332](https://github.com/bugsnag/bugsnag-cocoa/pull/332) @@ -1152,12 +1125,10 @@ This release is the first to distribute Unity packages with and without 64-bit ABI libraries for Android. In most cases, `Bugsnag.unitypackage` is the correct package to use, as by default most Unity Android apps only can use 32-bit binaries. - ### Enhancements * Add StopSession() and ResumeSession() to public API [#136](https://github.com/bugsnag/bugsnag-unity/pull/136) - * Update bugsnag-android dependency to v4.11.0: * Add stopSession() and resumeSession() to Client [bugsnag-android#429](https://github.com/bugsnag/bugsnag-android/pull/429) @@ -1165,7 +1136,6 @@ binaries. [bugsnag-android#428](https://github.com/bugsnag/bugsnag-android/pull/428) * Fix incorrect session handledCount when notifying in quick succession [bugsnag-android#434](https://github.com/bugsnag/bugsnag-android/pull/434) - * Update bugsnag-cocoa dependency to v5.19.0: * Add stopSession() and resumeSession() to Bugsnag [bugsnag-cocoa#325](https://github.com/bugsnag/bugsnag-cocoa/pull/325) @@ -1179,13 +1149,10 @@ binaries. [#138](https://github.com/bugsnag/bugsnag-unity/pull/138) [bugsnag-cocoa#333](https://github.com/bugsnag/bugsnag-cocoa/pull/333) [bugsnag-android#439](https://github.com/bugsnag/bugsnag-android/pull/439) - * [Android] Remove references to 64-bit ABIs included in the package [#139](https://github.com/bugsnag/bugsnag-unity/pull/139) - * Make `ErrorClass` and `ErrorMessage` mutable on `Exception`. This allows for modifying both properties from callbacks: - ```cs Bugsnag.Notify(exception, report => { report.Exceptions[0].ErrorClass = "CustomException"; @@ -1193,7 +1160,6 @@ binaries. }); ``` [#140](https://github.com/bugsnag/bugsnag-unity/pull/140) - * Set severity reason when manually specifying severity as a parameter to `Notify()`. This sets the correct reason for the severity selection on the dashboard. @@ -1229,7 +1195,6 @@ binaries. * Ensure configuration options are synced with native layer [#124](https://github.com/bugsnag/bugsnag-unity/pull/124) - * Add retry delays after delivery failure to stop excess logging [#126](https://github.com/bugsnag/bugsnag-unity/pull/126) @@ -1261,7 +1226,6 @@ Update bugsnag-android dependency to v4.11.0: * Update dependent libraries: * bugsnag-cocoa v5.17.3 * bugsnag-android v4.10.0 - ### Enhancements * Add a configuration option for allowing Unity exceptions to reduce a project's @@ -1281,7 +1245,6 @@ This is a new major release with many features and fixes. See the [upgrade guide](https://github.com/bugsnag/bugsnag-unity/blob/master/UPGRADING.md) for more information on how to update your integration, or the [integration guide](https://docs.bugsnag.com/platforms/unity/) to get started. - ### Enhancements * Unity/C# errors are now automatically detected and reported on Windows and any @@ -1300,15 +1263,12 @@ guide](https://docs.bugsnag.com/platforms/unity/) to get started. | [#94](https://github.com/bugsnag/bugsnag-unity/pull/94) * Report app information in WebGL: `duration`, `inForeground` and `durationInForeground` | [#94](https://github.com/bugsnag/bugsnag-unity/pull/94) - **Note:** During the preparation for this release we noticed a workflow issue when targeting tvOS. In order to successfully build for tvOS, after importing the Bugsnag plugin there is a manual step required: - - In the Unity editor, go to Project > Assets > iOS > Bugsnag - Select all source files in this directory - In the inspector pane check `tvOS` in the "Include platforms" list - Click the "Apply" button at the bottom of the inspector pane - We'll work on making this install process smoother in the future. ## 3.6.6 (2018-05-24) @@ -1327,7 +1287,6 @@ We'll work on making this install process smoother in the future. - Ensure timezone is serialised in report payload. [#248](https://github.com/bugsnag/bugsnag-cocoa/pull/248) [Jamie Lynch](https://github.com/fractalwrench) - * Upgrade bugsnag-android to v4.3.4: - *Bug Fixes:* - Avoid adding extra comma separator in JSON if File input is empty or null [#284](https://github.com/bugsnag/bugsnag-android/pull/284) @@ -1347,7 +1306,6 @@ We'll work on making this install process smoother in the future. ## 3.6.4 (2018-02-21) * (iOS) Fix error message displayed when thread tracing disabled - * Update dependent libraries: * bugsnag-cocoa v5.15.4 * bugsnag-android v4.3.1 @@ -1376,6 +1334,7 @@ We'll work on making this install process smoother in the future. app health ## 3.5.5 (2017-11-30) + * (iOS) Fix encoding of control characters in crash reports. Ensures crash reports are written correctly and delivered when containing U+0000 - U+001F @@ -1404,7 +1363,6 @@ written correctly and delivered when containing U+0000 - U+001F ## 3.5.0 (2017-02-10) * Track whether an error is handled or unhandled - * Update native libraries ## 3.4.0 (2017-19-09) @@ -1413,11 +1371,9 @@ written correctly and delivered when containing U+0000 - U+001F * Improve error grouping by standardizing log message format [#45](https://github.com/bugsnag/bugsnag-unity/pull/45) - * Add breadcrumbs for scene changes [Jamie Lynch](https://github.com/fractalwrench) [#54](https://github.com/bugsnag/bugsnag-unity/pull/54) - * Load WebGL extension locally, negating the need for a separate request [#46](https://github.com/bugsnag/bugsnag-unity/pull/46) @@ -1528,7 +1484,6 @@ written correctly and delivered when containing U+0000 - U+001F This release includes significant updates to the underlying android and cocoa libraries. - ### Enhancements * Add support for WebGL @@ -1536,7 +1491,6 @@ libraries. * Add support for setting user metadata * Add support for setting app version * Add support for setting breadcrumbs - * Upgrade bugsnag-android from 3.2.5 -> 3.4.0 * Upgrade bugsnag-cocoa from 4.0.7 -> 4.1.0 @@ -1545,54 +1499,36 @@ libraries. * Fix crash resulting from use of deprecated method [Simon Maynard](https://github.com/snmaynard) [#13](https://github.com/bugsnag/bugsnag-unity/pull/13) - * Update callback registration method to remove deprecations [Delisa Mason](https://github.com/kattrali) [#20](https://github.com/bugsnag/bugsnag-unity/pull/20) - 2.2.6 ----- - - Fix compilation under arm64 - 2.2.5 ----- - - Allow passing Context as a second argument to Bugsnag.Notify - 2.2.4 ----- - - Fix use-after-free on NSNotification - 2.2.3 ----- - - Make context thread safe too - 2.2.2 ----- - - Make metaData thread safe - 2.2.1 ----- - - Improve speed during manual notifies on android and ios. - 2.2.0 ----- - - Fix LogHandler in non-debug builds. - Make Bugsnag methods static. - Fix crashes caused by passing unexpected nulls into Bugsnag. - 2.1.0 ----- - - Fix stacktrace generation in Bugsnag.Notify() on unthrown exceptions. - 2.0.0 ----- - - Rewrite to use bugsnag-android and bugsnag-ios. + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 56e5a1b42..36fe23181 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,21 +108,20 @@ bundle exec maze-runner features/handled_errors.feature 1. Make sure any changes made since last release in `master` are merged into `next`. -2. Checkout the `next` branch. Set the version number in the change log and `build.cake`. +2. Checkout the `next` branch. -3. Commit the changelog and version updates: +3. To bump the version in `build.sh` and `CHANGELOG.md`, run: + + ``` + rake "plugin:bump[1.2.3]" + ``` - ``` - git add CHANGELOG.md build.cake - git commit -m "Release v7.x.x" - ``` 4. Make a pull request to merge the changes into `master` -5. Once merged, tag the new release version, pushing the tag to GitHub: +5. Once merged, tag the new release version, pushing the tag to GitHub using: ``` - git tag v7.x.x - git push origin v7.x.x + rake plugin:release ``` 6. Wait. The CI build will build the new package and create a draft release. @@ -135,20 +134,10 @@ Once the UnityPackage release is confirmed a UPM release should be deployed 1. Make sure that the package used in the github release is present in the root of the repo. -2. Build the upm package by running the `build-upm-package.sh` script in the upm-tools directory. You should pass the version number of the release like so `./build-upm-package.sh 7.x.x`. You must run the script from within the upm-tools folder. This will build the upm package in a directory called `upm-package` - -3. Test that the built package installs by using the install local package option in unity package manager. - -4. Clone the `bugsnag-unity-upm` repo and make sure you are in the `main` branch. - -5. Replace the contents of the repo with the contents of the `upm-package` directory in the `bugsnag-unity` repo -6. Commit these changes to main with the message `Release V7.x.x` -7. Tag the release and push the tag - ``` - git tag v7.x.x - git push origin v7.x.x +2. Run: + ``` + rake plugin:package ``` -8. Run the script `./build-edm-package.sh` , this will convert the built package to the EDM4U support version. Repeat the UPM release steps but with the `bugsnag-unity-upm-edm4u` repo. #### Post-release diff --git a/Gemfile b/Gemfile index ab2a4b2a9..ef58191c0 100644 --- a/Gemfile +++ b/Gemfile @@ -3,14 +3,21 @@ source 'https://rubygems.org' gem 'rake' gem 'xcpretty' gem 'xcodeproj' +gem 'cocoapods' +gem 'rake' unless Gem.win_platform? # Use official Maze Runner release - gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v7.11.0' + gem 'bugsnag-maze-runner', '~>9.0' # Use a specific Maze Runner branch - #gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', branch: 'master' + # gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', branch: 'master' # Use a local copy of Maze Runner for development purposes #gem 'bugsnag-maze-runner', path: '../maze-runner' end + +# Only install bumpsnag if we're using Github actions +unless ENV['GITHUB_ACTIONS'].nil? + gem 'bumpsnag', git: 'https://github.com/bugsnag/platforms-bumpsnag', branch: 'main' +end diff --git a/Gemfile.lock b/Gemfile.lock index d85494bfe..20e1113fa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,26 +1,7 @@ -GIT - remote: https://github.com/bugsnag/maze-runner - revision: 81f79a9b405fb63bbfc8ef6cc8f20cd1f2c3905e - tag: v7.2.1 - specs: - bugsnag-maze-runner (7.2.1) - appium_lib (~> 12.0) - bugsnag (~> 6.24) - cucumber (~> 7.1) - cucumber-expressions (~> 6.0.0) - curb (~> 0.9.6) - optimist (~> 3.0.1) - os (~> 1.0.0) - rake (~> 12.3.3) - rubyzip (~> 2.3.2) - selenium-webdriver (~> 4.0) - test-unit (~> 3.5.2) - webrick (~> 1.7.0) - GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.5) + CFPropertyList (3.0.6) rexml appium_lib (12.0.1) appium_lib_core (~> 5.0) @@ -30,13 +11,30 @@ GEM faye-websocket (~> 0.11.0) selenium-webdriver (~> 4.2, < 4.6) atomos (0.1.3) - bugsnag (6.24.2) + bugsnag (6.26.4) concurrent-ruby (~> 1.0) + bugsnag-maze-runner (9.6.0) + 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) claide (1.1.0) colored2 (3.1.2) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.3) cucumber (7.1.0) builder (~> 3.2, >= 3.2.4) cucumber-core (~> 10.1, >= 10.1.0) @@ -69,31 +67,37 @@ GEM cucumber-core (~> 10.1, >= 10.1.0) cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) curb (0.9.11) - diff-lcs (1.5.0) + diff-lcs (1.5.1) + dogstatsd-ruby (5.5.0) + ecma-re-validator (0.4.0) + regexp_parser (~> 2.2) eventmachine (1.2.7) - faye-websocket (0.11.1) + faye-websocket (0.11.3) eventmachine (>= 0.12.0) websocket-driver (>= 0.5.1) - ffi (1.15.5) - mime-types (3.4.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.2) mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) - mini_portile2 (2.8.0) + mime-types-data (3.2024.0305) multi_test (0.1.2) nanaimo (0.3.0) - nokogiri (1.13.8) - mini_portile2 (~> 2.8.0) - racc (~> 1.4) - nokogiri (1.13.8-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.13.8-x86_64-linux) + nokogiri (1.16.3-x86_64-darwin) racc (~> 1.4) optimist (3.0.1) os (1.0.1) - power_assert (2.0.1) - racc (1.6.0) + power_assert (2.0.3) + racc (1.7.3) + rack (2.2.9) rake (12.3.3) - rexml (3.2.5) + regexp_parser (2.9.0) + rexml (3.2.6) rouge (2.0.7) rubyzip (2.3.2) selenium-webdriver (4.5.0) @@ -101,17 +105,23 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sys-uname (1.2.2) + simpleidn (0.2.1) + unf (~> 0.1.4) + sys-uname (1.2.3) ffi (~> 1.1) - test-unit (3.5.5) + 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.9) - websocket-driver (0.7.5) + websocket (1.2.10) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - xcodeproj (1.21.0) + xcodeproj (1.23.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -124,13 +134,12 @@ GEM PLATFORMS x86_64-darwin-19 x86_64-darwin-20 - x86_64-linux DEPENDENCIES - bugsnag-maze-runner! + bugsnag-maze-runner (~> 9.0) rake xcodeproj xcpretty BUNDLED WITH - 2.3.18 + 2.4.8 diff --git a/Rakefile b/Rakefile index 64800ffa3..456c7a2fb 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,13 @@ require "open3" require "xcodeproj" require "rbconfig" +require 'fileutils' +require 'tmpdir' +require "json" + +unless ENV['GITHUB_ACTIONS'].nil? + require "bumpsnag" +end HOST_OS = RbConfig::CONFIG['host_os'] def is_mac?; HOST_OS =~ /darwin/i; end @@ -15,17 +22,13 @@ def is_windows?; HOST_OS =~ /mingw|mswin|windows/i; end def unity_directory if ENV.has_key? 'UNITY_VERSION' - if is_mac? - "/Applications/Unity/Hub/Editor/#{ENV['UNITY_VERSION']}" + "/Applications/Unity/Hub/Editor/#{ENV['UNITY_VERSION']}" elsif is_windows? "C:\\Program Files\\Unity\\Hub\\Editor\\#{ENV['UNITY_VERSION']}" end - - elsif ENV.has_key? "UNITY_DIR" - ENV["UNITY_DIR"] else - raise 'No unity directory set - use $UNITY_DIR or $UNITY_VERSION' + raise 'No unity version set - use $UNITY_VERSION' end end @@ -37,13 +40,13 @@ def unity_executable dir=unity_directory [File.join(dir, "Unity.app", "Contents", "MacOS", "Unity"), File.join(dir, "Editor", "Unity"), File.join(dir, "Editor", "Unity.exe")].find do |unity| - File.exists? unity + File.exist? unity end end def unity_dll_location [File.join(unity_directory, "Unity.app", "Contents", "Managed"), File.join(unity_directory, "Editor", "Data", "Managed")].find do |unity| - File.exists? unity + File.exist? unity end end @@ -55,7 +58,7 @@ def get_required_unity_paths dir = unity_directory exe = unity_executable(dir) raise "No unity executable found in '#{dir}'" if exe.nil? - unless File.exists? exe + unless File.exist? exe raise "Unity not found at path '#{exe}' - set $UNITY_DIR (full path) or $UNITY_VERSION (loaded via hub) to customize" end [dir, exe] @@ -79,7 +82,7 @@ def unity(*cmd, force_free: true, no_graphics: true) cmd = cmd.unshift(*cmd_prepend) sh *cmd do |ok, res| if !ok - puts File.read("unity.log") if File.exists?("unity.log") + puts File.read("unity.log") if File.exist?("unity.log") raise "unity error: #{res}" end @@ -100,7 +103,7 @@ end def export_package name="Bugsnag.unitypackage" package_output = File.join(current_directory, name) - rm_f package_output + FileUtils.rm_rf package_output unity "-projectPath", project_path, "-exportPackage", "Assets/Bugsnag", package_output, force_free: false end @@ -108,11 +111,11 @@ def assemble_android filter_abis=true abi_filters = filter_abis ? "-PABI_FILTERS=armeabi-v7a,x86" : "-Pnoop_filters=true" android_dir = File.join(assets_path, "Android") - cd "bugsnag-android" do + Dir.chdir"bugsnag-android" do sh "./gradlew", "assembleRelease", abi_filters end - cd "bugsnag-android-unity" do + Dir.chdir"bugsnag-android-unity" do sh "./gradlew", "assembleRelease", abi_filters end @@ -124,7 +127,7 @@ def assemble_android filter_abis=true # copy kotlin dependencies required by bugsnag-android. the exact files required for each # version can be found here: # https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.4.32/kotlin-stdlib-1.4.32.pom - # The exact version number here should match the version in the EDM manifest in the BugsnagEditor.cs script and in the upm-tools/EDM/BugsnagAndroidDependencies.xml file. + # The exact version number here should match the version in the EDM manifest in the BugsnagEditor.cs script and in the upm-tools/EDM/BugsnagAndroidDependencies.xml file. # All should be informed by what the android notifier is using kotlin_stdlib = File.join("android-libs", "org.jetbrains.kotlin.kotlin-stdlib-1.4.32.jar") kotlin_stdlib_common = File.join("android-libs", "org.jetbrains.kotlin.kotlin-stdlib-common-1.4.32.jar") @@ -132,15 +135,125 @@ def assemble_android filter_abis=true # copy unity lib unity_lib = File.join("bugsnag-android-unity", "build", "outputs", "aar", "bugsnag-android-unity-release.aar") + FileUtils.cp android_core_lib, File.join(android_dir, "bugsnag-android-release.aar") + FileUtils.cp ndk_lib, File.join(android_dir, "bugsnag-plugin-android-ndk-release.aar") + FileUtils.cp anr_lib, File.join(android_dir, "bugsnag-plugin-android-anr-release.aar") + FileUtils.cp unity_lib, File.join(android_dir, "bugsnag-android-unity-release.aar") + FileUtils.mkdir File.join(android_dir, "Kotlin") + FileUtils.cp kotlin_stdlib, File.join(android_dir, "Kotlin/kotlin-stdlib.jar") + FileUtils.cp kotlin_stdlib_common, File.join(android_dir, "Kotlin/kotlin-stdlib-common.jar") + FileUtils.cp kotlin_annotations, File.join(android_dir, "Kotlin/kotlin-annotations.jar") + +end + +def get_current_version() + version_line = File.open("build.sh").read.lines.find { |line| line.start_with?("VERSION=\"") }.strip + return version_line.delete_prefix("VERSION=\"").delete_suffix("\"") +end - cp android_core_lib, File.join(android_dir, "bugsnag-android-release.aar") - cp ndk_lib, File.join(android_dir, "bugsnag-android-ndk-release.aar") - cp anr_lib, File.join(android_dir, "bugsnag-plugin-android-anr-release.aar") - cp unity_lib, File.join(android_dir, "bugsnag-android-unity-release.aar") - mkdir File.join(android_dir, "Kotlin") - cp kotlin_stdlib, File.join(android_dir, "Kotlin/kotlin-stdlib.jar") - cp kotlin_stdlib_common, File.join(android_dir, "Kotlin/kotlin-stdlib-common.jar") - cp kotlin_annotations, File.join(android_dir, "Kotlin/kotlin-annotations.jar") +# Generate the upm package by importing the package file +def create_upm(package_dir, upm_tools, package_file, cli_args) + # Clone upm package + if File.directory?(package_dir) + FileUtils.remove_dir(package_dir) + end + system("git clone --recursive --depth 1 https://github.com/bugsnag/bugsnag-unity-upm.git #{package_dir}") + + version = get_current_version() + + # Check for the release package + if not File.file?(package_file) + throw "#{package_file} not found, please build the package." + end + puts "SDK package found" + + + if ENV["UNITY_UPM_VERSION"] != nil and ENV["UNITY_UPM_VERSION"].length > 0 + unity_executable = "/Applications/Unity/Hub/Editor/#{ENV["UNITY_UPM_VERSION"]}/Unity.app/Contents/MacOS" + elsif ENV["UNITY_PATH"] != nil and ENV["UNITY_PATH"].length > 0 + unity_executable = File.join(ENV["UNITY_PATH"], "Unity") + end + + puts "Unity executable #{unity_executable}" + # Importing the .unitypackage into the import project + project_path = File.join(upm_tools, "UPMImportProject") + system("#{unity_executable} #{cli_args} -projectPath #{project_path} -ignoreCompilerErrors -importPackage #{package_file}") + + puts "Copying over the unpacked sdk files" + import_project = File.join(project_path, "Assets", "Bugsnag", ".") + + # Copying the unpacked sdk files + FileUtils.cp_r(import_project, package_dir) + + # Copying the package manifest, assembly definitions, and README + ["package.json", "package.json.meta", "README.md", "README.md.meta"].each { |file| FileUtils.cp(File.join(upm_tools, file), package_dir)} + FileUtils.cp(File.join(upm_tools, "AssemblyDefinitions", "Bugsnag.asmdef"), File.join(package_dir, "Scripts")) + FileUtils.cp(File.join(upm_tools, "AssemblyDefinitions", "Bugsnag.asmdef.meta"), File.join(package_dir, "Scripts")) + FileUtils.cp(File.join(upm_tools, "AssemblyDefinitions", "BugsnagEditor.asmdef"), File.join(package_dir, "Editor")) + FileUtils.cp(File.join(upm_tools, "AssemblyDefinitions", "BugsnagEditor.asmdef.meta"), File.join(package_dir, "Editor")) + + # Remove EDM menu from package + if File.file?(File.join(package_dir, "Editor", "BugsnagEditor.EDM.cs")) + File.delete(File.join(package_dir, "Editor", "BugsnagEditor.EDM.cs")) + File.delete(File.join(package_dir, "Editor", "BugsnagEditor.EDM.cs.meta")) + end + + # Set version in manifest and README + puts "Setting the version #{version} in copied manifest and readme" + File.write(File.join(package_dir, "README.md"), File.read(File.join(package_dir, "README.md")).gsub("VERSION_STRING", "v#{version}")) + File.write(File.join(package_dir, "package.json"), File.read(File.join(package_dir, "package.json")).gsub("VERSION_STRING", version)) +end + +# Generate the upm-edm4u based on the upm package_dir +def create_edm(package_dir, upm_tools, edm_package) + if File.directory?(edm_package) + FileUtils.remove_dir(edm_package) + end + system("git clone --recursive --depth 1 https://github.com/bugsnag/bugsnag-unity-upm-edm4u.git #{edm_package}") + FileUtils.cp_r(package_dir, edm_package) + + # Remove bundled kotlin libs + if File.directory?(File.join(edm_package, "Plugins", "Android", "Kotlin")) + FileUtils.remove_dir(File.join(edm_package, "Plugins", "Android", "Kotlin")) + File.delete(File.join(edm_package, "Plugins", "Android", "Kotlin.meta")) + end + + # Copy in the EDM4U manifest + FileUtils.cp(File.join(upm_tools, "EDM", "BugsnagAndroidDependencies.xml"), File.join(edm_package, "Editor")) + FileUtils.cp(File.join(upm_tools, "EDM", "BugsnagAndroidDependencies.xml.meta"), File.join(edm_package, "Editor")) + + # Change the readme title to reference EDM4U + updated_readme = File.read(File.join(edm_package, "README.md")).gsub("Bugsnag SDK for Unity", "Bugsnag SDK for Unity Including EDM4U Support").gsub("bugsnag-unity-upm.git", "bugsnag-unity-upm-edm4u.git") + File.write(File.join(edm_package, "README.md"), updated_readme) +end + +# Test the UPM package by adding the file to the dependencies of the minimalapp +def test_package(cli_args, package_dir) + project_root = File.join(File.dirname(__FILE__), "features", "fixtures", "minimalapp") + manifest = File.join(project_root, "Packages", "manifest.json") + File.write(manifest, "{\"dependencies\": {\"com.bugsnag.unitynotifier\": \"file:#{package_dir}\"}}") + system("#{unity_executable} #{cli_args} -logFile unity.log -projectPath #{project_root}") + if $?.exitstatus == 1 + throw "Failed to import UPM" + end +end + +# Commit and tag the release +def update_package_git(package_dir) + version = get_current_version() + Dir.chdir(package_dir) do + system("git add -A") + system("git commit -m \"Release V#{version}\"") + system("git push") + if $?.exitstatus != 0 + throw "Cannot push." + end + system("git tag v#{version}") + system("git push origin v#{version}") + if $?.exitstatus != 0 + throw "Cannot push tag." + end + end end namespace :plugin do @@ -163,17 +276,17 @@ namespace :plugin do FileUtils.rm_rf cocoa_build_dir unless is_windows? # remove android build area - cd "bugsnag-android" do + Dir.chdir "./bugsnag-android" do sh "./gradlew", "clean" end - cd "bugsnag-android-unity" do + Dir.chdir "bugsnag-android-unity" do sh "./gradlew", "clean" end end end task :assets do - cp_r File.join(current_directory, "src", "Assets"), project_path, preserve: true + FileUtils.cp_r(File.join(current_directory, "src", "Assets"), project_path, preserve: true) end task :cocoa do next unless is_mac? @@ -183,7 +296,7 @@ namespace :plugin do bugsnag_unity_file = File.realpath("BugsnagUnity.m", "src") public_headers = Dir.entries(File.join(cocoa_build_dir, "Bugsnag", "include", "Bugsnag")) - cd cocoa_build_dir do + Dir.chdir cocoa_build_dir do ["bugsnag-ios", "bugsnag-osx", "bugsnag-tvos"].each do |project_name| project_file = File.join("#{project_name}.xcodeproj") next if File.exist?(project_file) @@ -194,7 +307,7 @@ namespace :plugin do # Define TARGET_OS* macros since they aren't added for static targets. case project_name when "bugsnag-tvos" - target = project.new_target(:static_library, "bugsnag-tvos", :tvos, "9.0") + target = project.new_target(:static_library, "bugsnag-tvos", :tvos, "9.2") target_macro = "-DTARGET_OS_TV" # Link UIKit during compilation @@ -203,7 +316,7 @@ namespace :plugin do phase.add_file_reference file_ref end when "bugsnag-ios" - target = project.new_target(:static_library, "bugsnag-ios", :ios, "8.0") + target = project.new_target(:static_library, "bugsnag-ios", :ios, "9.0") target_macro = "-DTARGET_OS_IPHONE" # Link UIKit during compilation @@ -212,16 +325,16 @@ namespace :plugin do phase.add_file_reference file_ref end when "bugsnag-osx" - target = project.new_target(:bundle, "bugsnag-osx", :osx, "10.8") + target = project.new_target(:bundle, "bugsnag-osx", :osx, "10.11") target_macro = "-DTARGET_OS_MAC" end group = project.new_group("Bugsnag") source_files = Dir.glob(File.join("Bugsnag", "**", "*.{c,h,mm,cpp,m}")) - .map(&File.method(:realpath)) - .tap { |files| files << bugsnag_unity_file } - .map { |f| group.new_file(f) } + .map(&File.method(:realpath)) + .tap { |files| files << bugsnag_unity_file } + .map { |f| group.new_file(f) } target.add_file_references(source_files) do |build_file| if public_headers.include? build_file.file_ref.name @@ -231,9 +344,12 @@ namespace :plugin do project.build_configurations.each do |build_configuration| build_configuration.build_settings["HEADER_SEARCH_PATHS"] = " $(SRCROOT)/Bugsnag/include/" + + build_configuration.build_settings["GENERATE_INFOPLIST_FILE"] = "YES" + if ["bugsnag-ios", "bugsnag-tvos"].include? project_name build_configuration.build_settings["ONLY_ACTIVE_ARCH"] = "NO" - build_configuration.build_settings["VALID_ARCHS"] = ["x86_64", "i386", "armv7", "arm64"] + build_configuration.build_settings["VALID_ARCHS"] = ["x86_64", "armv7", "arm64"] end case build_configuration.type when :debug @@ -260,15 +376,18 @@ namespace :plugin do tvos_dir = File.join(assets_path, "tvOS") - cd cocoa_build_dir do - cd "build" do + #copy framework usage api file + FileUtils.cp_r(File.join(current_directory,"bugsnag-cocoa", "Bugsnag", "resources", "PrivacyInfo.xcprivacy"), ios_dir) + + Dir.chdir cocoa_build_dir do + Dir.chdir "build" do def is_fat library_path stdout, stderr, status = Open3.capture3("lipo", "-info", library_path) return !stdout.start_with?('Non-fat') end # we just need to copy the os x bundle into the correct directory - cp_r File.join(build_type, "bugsnag-osx.bundle"), osx_dir + FileUtils.cp_r(File.join(build_type, "bugsnag-osx.bundle"), osx_dir) # for ios and tvos we need to build a fat binary that includes architecture # slices for both the device and the simulator @@ -277,7 +396,6 @@ namespace :plugin do device_library = File.join("#{build_type}-#{long_name}os", library) simulator_dir = "#{build_type}-#{long_name}simulator" simulator_library = File.join(simulator_dir, library) - simulator_x86 = File.join(simulator_dir, "libBugsnagStatic-x86.a") simulator_x64 = File.join(simulator_dir, "libBugsnagStatic-x64.a") output_library = File.join(directory, library) @@ -286,12 +404,9 @@ namespace :plugin do else simulator_x64 = simulator_library end - if short_name == "ios" - sh "lipo", "-extract", "i386", simulator_library, "-output", simulator_x86 - sh "lipo", "-create", device_library, simulator_x86, simulator_x64, "-output", output_library - else - sh "lipo", "-create", device_library, simulator_x64, "-output", output_library - end + + sh "lipo", "-create", device_library, simulator_x64, "-output", output_library + end end end @@ -318,14 +433,14 @@ namespace :plugin do end end - cd File.join("src", "BugsnagUnity", "bin", "Release", "net35") do - cp File.realpath("BugsnagUnity.dll"), assets_path - windows_dir = File.join(assets_path, "Windows") - cp File.realpath("BugsnagUnity.Windows.dll"), windows_dir - cp File.realpath("BugsnagUnity.iOS.dll"), File.join(assets_path, "tvOS") - cp File.realpath("BugsnagUnity.iOS.dll"), File.join(assets_path, "iOS") - cp File.realpath("BugsnagUnity.MacOS.dll"), File.join(assets_path, "OSX") - cp File.realpath("BugsnagUnity.Android.dll"), File.join(assets_path, "Android") + Dir.chdir File.join("src", "BugsnagUnity", "bin", "Release", "netstandard2.0") do + FileUtils.cp File.realpath("BugsnagUnity.dll"), assets_path + windows_dir = File.join(assets_path, "Windows") + FileUtils.cp File.realpath("BugsnagUnity.Windows.dll"), windows_dir + FileUtils.cp File.realpath("BugsnagUnity.iOS.dll"), File.join(assets_path, "tvOS") + FileUtils.cp File.realpath("BugsnagUnity.iOS.dll"), File.join(assets_path, "iOS") + FileUtils.cp File.realpath("BugsnagUnity.MacOS.dll"), File.join(assets_path, "OSX") + FileUtils.cp File.realpath("BugsnagUnity.Android.dll"), File.join(assets_path, "Android") end end @@ -349,6 +464,97 @@ namespace :plugin do Rake::Task["plugin:build:all_android64"].invoke export_package("Bugsnag.unitypackage") end + + desc "Create a PR for the release. Usage: `rake \"plugin:bump[8.1.0]\"`. Quotes required around args in zsh." + task :bump, [:version] do |task, args| + new_version = args[:version] + if new_version == nil or new_version.length < 5 or new_version.chars.any? { |letter| !"0123456789.".include? letter } + throw "New version required e.g. `rake \"plugin:bump[8.1.0]\"`." + end + + branch = %x|git rev-parse --abbrev-ref HEAD|.strip + if branch != "next" + throw "Must be on the 'next' branch. Current branch is #{branch}." + end + + # Update CHANGELOG.md if it doesn't already have the new version + changelog = File.open("CHANGELOG.md").read + if not changelog.include? "## #{new_version}" + insert_index = changelog.index("## TBD") + 6 + changelog.insert(insert_index, "\n\n\n## #{new_version} (#{Time.now.strftime("%Y-%m-%d")})") + File.write("CHANGELOG.md", changelog) + puts "Updated CHANGELOG.md" + end + + # Update build.sh + build_sh = File.open("build.sh").read.lines.map { |line| line.start_with?("VERSION=\"") ? "VERSION=\"#{new_version}\"\n" : line }.join + File.write("build.sh", build_sh) + + # Commit + %x|git add CHANGELOG.md build.sh| + %x|git diff --exit-code| + if $?.exitstatus == 1 + throw "You have unstaged changes." + end + system("git commit -m \"Release v#{new_version}\"") + system("git push origin next") + system("open", "https://github.com/bugsnag/bugsnag-unity/compare/master...next?expand=1&title=Release%20v#{new_version}") + puts "Once you have merged the PR you can run `rake plugin:release`" + end + + desc "Releases the current master branch" + task :release do + version = get_current_version() + + system("git fetch origin") + if %x|git rev-parse --abbrev-ref HEAD|.strip != "master" + puts "Switching to the 'master' branch..." + system("git switch master") + if $?.exitstatus != 0 + throw "Cannot switch to 'master'." + end + system("git rebase origin/master") + if $?.exitstatus != 0 + throw "Cannot rebase." + end + end + system("git diff origin/master..master") + if $?.exitstatus != 0 + throw "You have unpushed commits." + end + system("git tag v#{version}") + if $?.exitstatus != 0 + throw "Cannot create tag." + end + system("git push origin tag v#{version}") + if $?.exitstatus != 0 + throw "Cannot push tag." + end + end + + desc "Create UPM and EDM packages" + task :package do + pwd = File.dirname(__FILE__) + upm_tools = File.join(pwd, "upm-tools") + package_file = File.join(pwd, "Bugsnag.unitypackage") + cli_args = "-quit -batchmode -nographics -logFile unity.log" + package_dir = File.join(pwd, "bugsnag-unity-upm") + edm_package = File.join(pwd, "bugsnag-unity-upm-edm4u") + + + + + puts "Creating UPM package" + create_upm(package_dir, upm_tools, package_file, cli_args) + puts "Creating EDM package" + create_edm(package_dir, upm_tools, edm_package) + puts "Testing generated package" + test_package(cli_args, package_dir) + puts "Committing changes" + update_package_git(package_dir) + update_package_git(edm_package) + + end end namespace :example do @@ -395,7 +601,25 @@ namespace :test do end # Build the Android APK - script = File.join("features", "scripts", "build_android.sh") + script = File.join("features", "scripts", "build_android.sh release") + unless system env, script + raise 'Android APK build failed' + end + end + + task :build_dev do + # Check that a Unity version has been selected and the path exists before calling the build script + unity_path, unity = get_required_unity_paths + + # Prepare the test fixture project by importing the plugins + env = { "UNITY_PATH" => File.dirname(unity) } + script = File.join("features", "scripts", "prepare_fixture.sh") + unless system env, script + raise 'Preparation of test fixture failed' + end + + # Build the Android APK + script = File.join("features", "scripts", "build_android.sh dev") unless system env, script raise 'Android APK build failed' end @@ -429,8 +653,28 @@ namespace :test do end # Generate the Xcode project - cd "features" do - script = File.join("scripts", "generate_xcode_project.sh") + Dir.chdir"features" do + script = File.join("scripts", "generate_xcode_project.sh release") + unless system env, script + raise 'IPA build failed' + end + end + end + + task :generate_xcode_dev do + # Check that a Unity version has been selected and the path exists before calling the build script + unity_path, unity = get_required_unity_paths + + # Prepare the test fixture project by importing the plugins + env = { "UNITY_PATH" => File.dirname(unity) } + script = File.join("features", "scripts", "prepare_fixture.sh") + unless system env, script + raise 'Preparation of test fixture failed' + end + + # Generate the Xcode project + Dir.chdir"features" do + script = File.join("scripts", "generate_xcode_project.sh dev") unless system env, script raise 'IPA build failed' end @@ -439,8 +683,18 @@ namespace :test do task :build_xcode do # Build and archive from the Xcode project - cd "features" do - script = File.join("scripts", "build_ios.sh") + Dir.chdir"features" do + script = File.join("scripts", "build_ios.sh release") + unless system script + raise 'IPA build failed' + end + end + end + + task :build_xcode_dev do + # Build and archive from the Xcode project + Dir.chdir"features" do + script = File.join("scripts", "build_ios.sh dev") unless system script raise 'IPA build failed' end @@ -451,3 +705,43 @@ namespace :test do end end end + +namespace :dependencies do + task :update do + target_submodule = ENV['TARGET_SUBMODULE'] + target_version = ENV['TARGET_VERSION'] + + if target_submodule.nil? || target_version.nil? + raise 'Submodule or version targets not provided, exiting' + exit(1) + end + + pp "Updating submodule: #{target_submodule} to version: #{target_version}" + updated = Bumpsnag.update_submodule(target_submodule, target_version) + + if updated + local_info = Bumpsnag.get_git_info + target_info = Bumpsnag.get_git_info(target_submodule) + + target_pr = local_info[:latest_pr] + 1 + origin_repo = 'https://github.com/bugsnag/bugsnag-unity' + target_repo = target_info[:origin] + + changelog_message = "Update #{target_submodule} to [#{target_version}](#{target_repo}/releases/tag/#{target_version}) [##{target_pr}](#{origin_repo}/pull/#{target_pr})" + + Bumpsnag.add_changelog_entry(changelog_message, 'Dependencies') + + release_branch = "bumpsnag-#{target_submodule}-#{target_version}" + + commit_message = "Update #{target_submodule} to #{target_version} [full ci]" + + Bumpsnag.change_branch(release_branch, true) + Bumpsnag.commit_changes(commit_message, [target_submodule, 'CHANGELOG.md']) + Bumpsnag.push_changes(release_branch) + + pp 'Update complete' + else + pp "Nothing was updated" + end + end +end diff --git a/UPGRADING.md b/UPGRADING.md index a0c622661..9430c9daa 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,6 +1,14 @@ Upgrading ========= +## 7.x to 8.x + +`Configuration.DiscardClasses` and `Configuration.RedactedKeys` are now [Regex](https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex?view=net-8.0) collections instead of string collections. This allows developers to have more control over how they perform. + +If you are using the `DiscardClasses` and `RedactedKeys` sections of the Bugsnag Unity Configuration Window, you can enter Regex patterns as strings and they will be converted into Regex objects when the Bugsnag SDK is started. + +`Event.Unhandled` (accessed via OnError and OnSend callbacks) is now non-nullable. + ## 6.x to 7.x When building using Unity 2019+, the Bugsnag SDK now uses a new method to intercept uncaught C# exceptions. This allows us access to the original exception object, meaning more accurate exception data and full support for inner exceptions. diff --git a/android-libs/org.jetbrains.kotlin.kotlin-stdlib-1.5.10.jar b/android-libs/org.jetbrains.kotlin.kotlin-stdlib-1.5.10.jar new file mode 100644 index 000000000..5015b3a03 Binary files /dev/null and b/android-libs/org.jetbrains.kotlin.kotlin-stdlib-1.5.10.jar differ diff --git a/android-libs/org.jetbrains.kotlin.kotlin-stdlib-common-1.5.10.jar b/android-libs/org.jetbrains.kotlin.kotlin-stdlib-common-1.5.10.jar new file mode 100644 index 000000000..7999449e8 Binary files /dev/null and b/android-libs/org.jetbrains.kotlin.kotlin-stdlib-common-1.5.10.jar differ diff --git a/bugsnag-android b/bugsnag-android index 824fc4f71..594600185 160000 --- a/bugsnag-android +++ b/bugsnag-android @@ -1 +1 @@ -Subproject commit 824fc4f71e5b70e6d491c75d66dfd57774846826 +Subproject commit 59460018551750dfcce4fd4e9f612eae7826559e diff --git a/bugsnag-android-unity/build.gradle b/bugsnag-android-unity/build.gradle index 696356b9d..bcebd874b 100644 --- a/bugsnag-android-unity/build.gradle +++ b/bugsnag-android-unity/build.gradle @@ -28,7 +28,7 @@ android { abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64" } } - ndkVersion = "16.1.4479499" + ndkVersion = "21.4.7075529" } externalNativeBuild { diff --git a/bugsnag-cocoa b/bugsnag-cocoa index b260ddb55..cd3a27c2d 160000 --- a/bugsnag-cocoa +++ b/bugsnag-cocoa @@ -1 +1 @@ -Subproject commit b260ddb5570883ee8fd35860d8d7ff381250d4a1 +Subproject commit cd3a27c2d7ad344c102bd7ec168c0584939ab7b1 diff --git a/build.cake b/build.cake deleted file mode 100644 index da3b1d5fe..000000000 --- a/build.cake +++ /dev/null @@ -1,33 +0,0 @@ -#addin nuget:?package=Cake.Git&version=1.1.0 -#tool "nuget:?package=NUnit.ConsoleRunner" - -var target = Argument("target", "Default"); -var solution = File("./BugsnagUnity.sln"); -var configuration = Argument("configuration", "Release"); -var project = File("./src/BugsnagUnity/BugsnagUnity.csproj"); -var version = "7.5.1"; - -Task("Restore-NuGet-Packages") - .Does(() => NuGetRestore(solution)); - -Task("Build") - .IsDependentOn("Restore-NuGet-Packages") - .Does(() => { - MSBuild(solution, settings => - settings - .SetVerbosity(Verbosity.Minimal) - .WithProperty("Version", version) - .SetConfiguration(configuration)); - }); - -Task("Test") - .IsDependentOn("Build") - .Does(() => { - var assemblies = GetFiles($"./tests/**/bin/{configuration}/**/*.Tests.dll"); - NUnit3(assemblies); - }); - -Task("Default") - .IsDependentOn("Test"); - -RunTarget(target); diff --git a/build.sh b/build.sh index b9e12527f..9b618e661 100755 --- a/build.sh +++ b/build.sh @@ -1,117 +1,50 @@ #!/usr/bin/env bash -########################################################################## -# This is the Cake bootstrapper script for Linux and OS X. -# This file was downloaded from https://github.com/cake-build/resources -# Feel free to change this file to fit your needs. -########################################################################## - -# Define directories. -SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -TOOLS_DIR=$SCRIPT_DIR/tools -ADDINS_DIR=$TOOLS_DIR/Addins -MODULES_DIR=$TOOLS_DIR/Modules -NUGET_EXE=$TOOLS_DIR/nuget.exe -CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe -PACKAGES_CONFIG=$TOOLS_DIR/packages.config -PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum -ADDINS_PACKAGES_CONFIG=$ADDINS_DIR/packages.config -MODULES_PACKAGES_CONFIG=$MODULES_DIR/packages.config - -# Define md5sum or md5 depending on Linux/OSX -MD5_EXE= -if [[ "$(uname -s)" == "Darwin" ]]; then - MD5_EXE="md5 -r" -else - MD5_EXE="md5sum" -fi - # Define default arguments. -SCRIPT="build.cake" -CAKE_ARGUMENTS=() +CONFIGURATION="Release" +SOLUTION="./BugsnagUnity.sln" +VERSION="8.0.0" # Parse arguments. for i in "$@"; do case $1 in - -s|--script) SCRIPT="$2"; shift ;; - --) shift; CAKE_ARGUMENTS+=("$@"); break ;; - *) CAKE_ARGUMENTS+=("$1") ;; + -c|--configuration) CONFIGURATION="$2"; shift ;; + -v|--version) VERSION="$2"; shift ;; + *) ;; esac shift done -# Make sure the tools folder exist. -if [ ! -d "$TOOLS_DIR" ]; then - mkdir "$TOOLS_DIR" -fi - -# Make sure that packages.config exist. -if [ ! -f "$TOOLS_DIR/packages.config" ]; then - echo "Downloading packages.config..." - curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages - if [ $? -ne 0 ]; then - echo "An error occurred while downloading packages.config." - exit 1 - fi -fi - -# Download NuGet if it does not exist. -if [ ! -f "$NUGET_EXE" ]; then - echo "Downloading NuGet..." - curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - if [ $? -ne 0 ]; then - echo "An error occurred while downloading nuget.exe." - exit 1 - fi -fi - -# Restore tools from NuGet. -pushd "$TOOLS_DIR" >/dev/null -if [ ! -f "$PACKAGES_CONFIG_MD5" ] || [ "$( cat "$PACKAGES_CONFIG_MD5" | sed 's/\r$//' )" != "$( $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' )" ]; then - find . -type d ! -name . ! -name 'Cake.Bakery' | xargs rm -rf -fi +# Restore NuGet packages +# NOTE it is necessary to call restore on every project, not just the solution! +# Builds will intermitently fail if this is not done every time. +echo "Restoring NuGet packages..." +dotnet restore "$SOLUTION" +dotnet restore src/BugsnagUnity/BugsnagUnity.csproj +dotnet restore src/BugsnagUnity/BugsnagUnity.Android.csproj +dotnet restore src/BugsnagUnity/BugsnagUnity.iOS.csproj +dotnet restore src/BugsnagUnity/BugsnagUnity.MacOS.csproj +dotnet restore src/BugsnagUnity/BugsnagUnity.Windows.csproj -mono "$NUGET_EXE" install -ExcludeVersion if [ $? -ne 0 ]; then - echo "Could not restore NuGet tools." + echo "An error occurred while restoring NuGet packages." exit 1 fi -$MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' >| "$PACKAGES_CONFIG_MD5" - -popd >/dev/null - -# Restore addins from NuGet. -if [ -f "$ADDINS_PACKAGES_CONFIG" ]; then - pushd "$ADDINS_DIR" >/dev/null - - mono "$NUGET_EXE" install -ExcludeVersion - if [ $? -ne 0 ]; then - echo "Could not restore NuGet addins." - exit 1 - fi - - popd >/dev/null -fi - -# Restore modules from NuGet. -if [ -f "$MODULES_PACKAGES_CONFIG" ]; then - pushd "$MODULES_DIR" >/dev/null - - mono "$NUGET_EXE" install -ExcludeVersion - if [ $? -ne 0 ]; then - echo "Could not restore NuGet modules." - exit 1 - fi - - popd >/dev/null +# Build the solution +echo "Building the solution..." +dotnet build "$SOLUTION" -c "$CONFIGURATION" /p:Version="$VERSION" +if [ $? -ne 0 ]; then + echo "An error occurred while building the solution." + exit 1 fi -# Make sure that Cake has been installed. -if [ ! -f "$CAKE_EXE" ]; then - echo "Could not find Cake.exe at '$CAKE_EXE'." +# Run tests +echo "Running tests..." +dotnet test "$SOLUTION" -c "$CONFIGURATION" --no-build +if [ $? -ne 0 ]; then + echo "An error occurred while running tests." exit 1 fi -# Start Cake -exec mono "$CAKE_EXE" $SCRIPT "${CAKE_ARGUMENTS[@]}" +echo "Build and tests completed successfully." diff --git a/docker-compose.yml b/docker-compose.yml index a072580fc..82fb4acf5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,28 @@ version: '3.6' -services: +x-common-environment: &common-environment + DEBUG: + VERBOSE: + BUILDKITE: + BUILDKITE_BRANCH: + BUILDKITE_BUILD_CREATOR: + BUILDKITE_BUILD_NUMBER: + BUILDKITE_BUILD_URL: + BUILDKITE_JOB_ID: + BUILDKITE_LABEL: + BUILDKITE_MESSAGE: + BUILDKITE_PIPELINE_NAME: + BUILDKITE_PIPELINE_SLUG: + BUILDKITE_REPO: + BUILDKITE_RETRY_COUNT: + BUILDKITE_STEP_KEY: + MAZE_BUGSNAG_API_KEY: + MAZE_REPEATER_API_KEY: + UNITY_VERSION: + +services: maze-runner: - image: 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner-releases:latest-v7-cli + image: 855461928732.dkr.ecr.us-west-1.amazonaws.com/maze-runner-releases:latest-v9-cli environment: DEBUG: BUILDKITE: @@ -14,3 +34,17 @@ services: - ./test:/app/test - ./features/:/app/features - ./maze_output:/app/maze_output + + maze-runner-bitbar: + image: 855461928731.dkr.ecr.us-west-1.amazonaws.com/maze-runner-releases:latest-v9-cli + environment: + <<: *common-environment + BITBAR_USERNAME: + BITBAR_ACCESS_KEY: + ports: + - "9000-9499:9339" + volumes: + - ./test:/app/test + - ./features/:/app/features + - ./maze_output:/app/maze_output + - /var/run/docker.sock:/var/run/docker.sock diff --git a/example/ProjectSettings/ProjectVersion.txt b/example/ProjectSettings/ProjectVersion.txt index 95dcc9f42..da76706d2 100644 --- a/example/ProjectSettings/ProjectVersion.txt +++ b/example/ProjectSettings/ProjectVersion.txt @@ -1 +1,2 @@ -m_EditorVersion: 2018.4.34f1 +m_EditorVersion: 2020.3.48f1 +m_EditorVersionWithRevision: 2020.3.48f1 (b805b124c6b7) diff --git a/features/csharp/csharp_breadcrumbs.feature b/features/csharp/csharp_breadcrumbs.feature index 9808a4744..c3253b52b 100644 --- a/features/csharp/csharp_breadcrumbs.feature +++ b/features/csharp/csharp_breadcrumbs.feature @@ -77,3 +77,43 @@ Feature: Csharp Breadcrumbs And the error payload field "events.0.breadcrumbs" is an array with 99 elements And the event "breadcrumbs.98.name" equals "Removed, along with 2 older breadcrumbs, to reduce payload size" And the event "breadcrumbs.98.type" equals "manual" + + Scenario: Network breadcrumb success + When I run the game in the "NetworkBreadcrumbsSuccess" state + And I wait to receive an error + Then the error is valid for the error reporting API sent by the Unity notifier + And the exception "message" equals "NetworkBreadcrumbsSuccess" + + And the event "breadcrumbs.0.name" equals "UnityWebRequest succeeded" + And the event "breadcrumbs.0.type" equals "request" + And the event "breadcrumbs.0.metaData.method" equals "GET" + And the error payload field "events.0.breadcrumbs.0.metaData.url" matches the regex "^http:\/\/\S*:\d{4}(\/.*)?" + And the event "breadcrumbs.0.metaData.status" equals 200 + And the event "breadcrumbs.0.metaData.urlParams.success" equals "true" + And the event "breadcrumbs.0.metaData.urlParams.redactthis" equals "[REDACTED]" + And the event "breadcrumbs.0.metaData.duration" is greater than 0 + And the event "breadcrumbs.0.metaData.responseContentLength" is greater than 0 + + And the event "breadcrumbs.1.name" equals "UnityWebRequest succeeded" + And the event "breadcrumbs.1.type" equals "request" + And the event "breadcrumbs.1.metaData.method" equals "POST" + And the error payload field "events.0.breadcrumbs.1.metaData.url" matches the regex "^http:\/\/\S*:\d{4}(\/.*)?" + And the event "breadcrumbs.1.metaData.status" equals 200 + And the event "breadcrumbs.1.metaData.duration" is greater than 0 + And the event "breadcrumbs.1.metaData.responseContentLength" is greater than 0 + And the event "breadcrumbs.1.metaData.requestContentLength" is greater than 0 + + + Scenario: Network breadcrumb fails + When I run the game in the "NetworkBreadcrumbsFail" state + And I wait to receive an error + Then the error is valid for the error reporting API sent by the Unity notifier + And the exception "message" equals "NetworkBreadcrumbsFail" + And the event "breadcrumbs.1.name" equals "UnityWebRequest failed" + And the event "breadcrumbs.1.type" equals "request" + And the event "breadcrumbs.1.metaData.method" equals "GET" + And the error payload field "events.0.breadcrumbs.1.metaData.url" equals "https://localhost:994/?success=false" + And the event "breadcrumbs.1.metaData.status" has failed + And the event "breadcrumbs.1.metaData.urlParams.success" equals "false" + And the event "breadcrumbs.1.metaData.duration" is greater than 0 + diff --git a/features/csharp/csharp_callbacks.feature b/features/csharp/csharp_callbacks.feature index 644862a75..f584d19c9 100644 --- a/features/csharp/csharp_callbacks.feature +++ b/features/csharp/csharp_callbacks.feature @@ -45,7 +45,6 @@ Feature: Callbacks And the exception "message" equals "Error 2" And all possible parameters have been edited in a callback - @skip_android #pending PLAT-9092 Scenario: Callback passed directly to Notify When I run the game in the "CallbackInNotify" state And I wait to receive 1 error diff --git a/features/csharp/csharp_config.feature b/features/csharp/csharp_config.feature index dccc88a39..5954f26d0 100644 --- a/features/csharp/csharp_config.feature +++ b/features/csharp/csharp_config.feature @@ -10,6 +10,12 @@ Feature: csharp events And the exception "message" equals "InfiniteLaunchDuration" And the event "app.isLaunching" is true + Scenario: Check if IsStarted equals true + When I run the game in the "IsStarted" state + And I wait to receive an error + Then the error is valid for the error reporting API sent by the Unity notifier + And the exception "message" equals "IsStarted" + Scenario: Call mark launch complete When I run the game in the "MarkLaunchComplete" state And I wait to receive 2 errors @@ -108,3 +114,11 @@ Feature: csharp events And the event "breadcrumbs.1.metaData.stringList.0" equals "12345678901234567890***80 CHARS TRUNCATED***" And the event "breadcrumbs.1.metaData.dictionary.stringArray.0" equals "12345678901234567890***80 CHARS TRUNCATED***" And the event "breadcrumbs.1.metaData.stringDictionary.testKey" equals "12345678901234567890***80 CHARS TRUNCATED***" + + @skip_cocoa #not supported on these platforms + Scenario: GenerateAnonymousId + When I run the game in the "GenerateAnonymousId" state + And I wait to receive an error + Then the error is valid for the error reporting API sent by the Unity notifier + And the exception "message" equals "GenerateAnonymousId" + And the event "device.id" is null diff --git a/features/csharp/csharp_events.feature b/features/csharp/csharp_events.feature index 98489631e..fb5a8f17d 100644 --- a/features/csharp/csharp_events.feature +++ b/features/csharp/csharp_events.feature @@ -3,7 +3,6 @@ Feature: csharp events Background: Given I clear the Bugsnag cache - @skip_android #pending PLAT-9092 Scenario: Notify smoke test When I run the game in the "NotifySmokeTest" state And I wait to receive an error @@ -13,8 +12,7 @@ Feature: csharp events And the event "unhandled" is false And custom metadata is included in the event And the stack frame methods should match: - | NotifySmokeTest.Run() | - | ScenarioRunner.RunScenario(string scenarioName, string apiKey, string host) | + | NotifySmokeTest.Run() | Main+d__8.MoveNext() | And expected device metadata is included in the event And expected app metadata is included in the event @@ -28,7 +26,7 @@ Feature: csharp events And custom metadata is included in the event And the stack frame methods should match: | UncaughtExceptionSmokeTest.Run() | | - | ScenarioRunner.RunScenario(System.String scenarioName, System.String apiKey, System.String host) | Main+d__5.MoveNext() | + | ScenarioRunner.RunScenario(System.String scenarioName, System.String apiKey, System.String host) | Main+d__8.MoveNext() | And expected device metadata is included in the event And expected app metadata is included in the event @@ -41,7 +39,7 @@ Feature: csharp events And the event "unhandled" is false And custom metadata is included in the event And the stack frame methods should match: - | DebugLogExceptionSmokeTest:Run() | DebugLogExceptionSmokeTest.Run() | d__5:MoveNext() | UnityEngine.SetupCoroutine.InvokeMoveNext(IEnumerator enumerator, IntPtr returnValueAddress) | + | DebugLogExceptionSmokeTest:Run() | DebugLogExceptionSmokeTest.Run() | d__8:MoveNext() | UnityEngine.SetupCoroutine.InvokeMoveNext(IEnumerator enumerator, IntPtr returnValueAddress) | | ScenarioRunner:RunScenario(String, String, String) | ScenarioRunner.RunScenario(string scenarioName, string apiKey, string host) | UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) | UnityEngine.SetupCoroutine.InvokeMoveNext(IEnumerator enumerator, IntPtr returnValueAddress) | And expected device metadata is included in the event And expected app metadata is included in the event @@ -55,7 +53,7 @@ Feature: csharp events And the event "unhandled" is false And custom metadata is included in the event And the stack frame methods should match: - | DebugLogErrorSmokeTest:Run() | DebugLogErrorSmokeTest.Run() | d__5:MoveNext() | | + | DebugLogErrorSmokeTest:Run() | DebugLogErrorSmokeTest.Run() | d__8:MoveNext() | | | ScenarioRunner:RunScenario(String, String, String) | ScenarioRunner.RunScenario(string scenarioName, string apiKey, string host) | ScenarioRunner:RunScenario(string,string,string) | UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) | And expected device metadata is included in the event And expected app metadata is included in the event @@ -69,7 +67,7 @@ Feature: csharp events And the event "unhandled" is false And custom metadata is included in the event And the stack frame methods should match: - | DebugLogWarningSmokeTest:Run() | DebugLogWarningSmokeTest.Run() | d__5:MoveNext() | | + | DebugLogWarningSmokeTest:Run() | DebugLogWarningSmokeTest.Run() | d__8:MoveNext() | | | ScenarioRunner:RunScenario(String, String, String) | ScenarioRunner.RunScenario(string scenarioName, string apiKey, string host) | ScenarioRunner:RunScenario(string,string,string) | UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) | And expected device metadata is included in the event And expected app metadata is included in the event @@ -83,7 +81,7 @@ Feature: csharp events And the event "unhandled" is false And custom metadata is included in the event And the stack frame methods should match: - | DebugLogSmokeTest:Run() | DebugLogSmokeTest.Run() | d__5:MoveNext() | | + | DebugLogSmokeTest:Run() | DebugLogSmokeTest.Run() | d__8:MoveNext() | | | ScenarioRunner:RunScenario(String, String, String) | ScenarioRunner.RunScenario(string scenarioName, string apiKey, string host) | ScenarioRunner:RunScenario(string,string,string) | UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) | And expected device metadata is included in the event And expected app metadata is included in the event @@ -97,7 +95,7 @@ Feature: csharp events And the event "unhandled" is false And custom metadata is included in the event And the stack frame methods should match: - | DebugLogAssertSmokeTest:Run() | DebugLogAssertSmokeTest.Run() | d__5:MoveNext() | | + | DebugLogAssertSmokeTest:Run() | DebugLogAssertSmokeTest.Run() | d__8:MoveNext() | | | ScenarioRunner:RunScenario(String, String, String) | ScenarioRunner.RunScenario(string scenarioName, string apiKey, string host) | ScenarioRunner:RunScenario(string,string,string) | UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) | And expected device metadata is included in the event And expected app metadata is included in the event diff --git a/features/csharp/csharp_metadata.feature b/features/csharp/csharp_metadata.feature index 11e1575a3..23f6a8b47 100644 --- a/features/csharp/csharp_metadata.feature +++ b/features/csharp/csharp_metadata.feature @@ -40,4 +40,23 @@ Feature: Metadata And the event "metaData.numberArray.testKey.1" equals 2 And the event "metaData.stringArray.testKey.1" equals "2" And the event "metaData.dictionary.foo" equals "bar" - And the event "metaData.number.testKey" equals 123 \ No newline at end of file + And the event "metaData.number.testKey" equals 123 + + # these platform specific tests are smoke tests, if os name is wrong then it's a sign that the native information has not been properly retrieved from the native layer and the unity placeholder data is being used + @ios_only + Scenario: iOS specific metadata + When I run the game in the "NotifySmokeTest" state + And I wait to receive an error + Then the error is valid for the error reporting API sent by the Unity notifier + And expected device metadata is included in the event + And expected app metadata is included in the event + And the event "device.osName" equals "iOS" + + @android_only + Scenario: Android specific metadata + When I run the game in the "NotifySmokeTest" state + And I wait to receive an error + Then the error is valid for the error reporting API sent by the Unity notifier + And expected device metadata is included in the event + And expected app metadata is included in the event + And the event "device.osName" equals "android" diff --git a/features/csharp/csharp_persistence.feature b/features/csharp/csharp_persistence.feature index 88c49a3ba..c56f2e2ad 100644 --- a/features/csharp/csharp_persistence.feature +++ b/features/csharp/csharp_persistence.feature @@ -5,7 +5,7 @@ Feature: Unity Persistence @skip_windows @skip_webgl @skip_cocoa @skip_android #pending PLAT-8632 Scenario: Receive a persisted session - When I set the HTTP status code for the next requests to "408" + When I set the HTTP status code for the next request to 408 And I run the game in the "PersistSession" state And I wait to receive 1 session And I wait for requests to persist @@ -21,7 +21,7 @@ Feature: Unity Persistence And the session payload field "app.releaseStage" equals "Session 2" Scenario: Receive a persisted event - When I set the HTTP status code for the next requests to "408" + When I set the HTTP status code for the next request to 408 And I run the game in the "PersistEvent" state And I wait to receive an error And I wait for requests to persist @@ -40,7 +40,7 @@ Feature: Unity Persistence And the exception "message" equals "Error 2" Scenario: Receive a persisted event with on send callback - When I set the HTTP status code for the next requests to "408" + When I set the HTTP status code for the next request to 408 And I run the game in the "PersistEvent" state And I wait to receive an error And I wait for requests to persist @@ -60,7 +60,7 @@ Feature: Unity Persistence And the event "metaData.Persist Section.Persist Key" equals "Persist Value" Scenario: Max Persisted Events - When I set the HTTP status code for the next requests to "408,408,408,408" + When I set the HTTP status code for the next request to 408,408,408,408 When I run the game in the "MaxPersistEvents" state And I wait to receive 4 errors And I wait for requests to persist @@ -76,7 +76,7 @@ Feature: Unity Persistence @skip_cocoa @skip_android #These platforms handle sessions separately and will have separate tests Scenario: Max Persisted Sessions - When I set the HTTP status code for the next requests to "408,408,408,408" + When I set the HTTP status code for the next request to 408,408,408,408 And I run the game in the "MaxPersistSessions" state And I wait to receive 4 sessions And I wait for requests to persist @@ -103,3 +103,15 @@ Feature: Unity Persistence And the exception "message" equals "PersistDeviceId" And the error payload field "events.0.device.id" equals the stored value "device_id" + Scenario: Handle Corrupt Json + And I run the game in the "CorruptedCacheFile" state + And I wait for requests to persist + And I close the Unity app + And On Mobile I relaunch the app + And I run the game in the "PersistEventReport" state + And I wait for requests to persist + And I wait to receive 1 errors + And the error is valid for the error reporting API sent by the Unity notifier + And the exception "message" equals "Error 2" + + diff --git a/features/csharp/csharp_sessions.feature b/features/csharp/csharp_sessions.feature index 8dfbec873..ac5e29d9c 100644 --- a/features/csharp/csharp_sessions.feature +++ b/features/csharp/csharp_sessions.feature @@ -29,7 +29,7 @@ Feature: Session Tracking @skip_macos #Unable to reliably get the in focus notification from macos Scenario: Automatically receiving a session - When I run the game in the "StartSDKDefault" state + When I run the game in the "AutoTrackSessions" state And I wait to receive a session Then the session is valid for the session reporting API version "1.0" for the "Unity Bugsnag Notifier" notifier And the session payload field "app.version" is not null diff --git a/features/fixtures/NativeCrashy.xcodeproj/project.pbxproj b/features/fixtures/NativeCrashy.xcodeproj/project.pbxproj index e1ad7d40b..0f1bf0320 100644 --- a/features/fixtures/NativeCrashy.xcodeproj/project.pbxproj +++ b/features/fixtures/NativeCrashy.xcodeproj/project.pbxproj @@ -272,7 +272,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = 372ZUL2ZB7; + DEVELOPMENT_TEAM = 7W9PZ27Y5F; INFOPLIST_FILE = NativeCrashy/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; PRODUCT_BUNDLE_IDENTIFIER = com.bugsnag.NativeCrashy; @@ -287,7 +287,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = 372ZUL2ZB7; + DEVELOPMENT_TEAM = 7W9PZ27Y5F; INFOPLIST_FILE = NativeCrashy/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; PRODUCT_BUNDLE_IDENTIFIER = com.bugsnag.NativeCrashy; diff --git a/features/fixtures/maze_runner/Assets/Editor/Builder.cs b/features/fixtures/maze_runner/Assets/Editor/Builder.cs index 94a569540..59eea7505 100644 --- a/features/fixtures/maze_runner/Assets/Editor/Builder.cs +++ b/features/fixtures/maze_runner/Assets/Editor/Builder.cs @@ -8,56 +8,111 @@ public class Builder : MonoBehaviour { - static void Build(string folder, BuildTarget target) + static void BuildStandalone(string folder, BuildTarget target, bool dev) { BuildPlayerOptions opts = new BuildPlayerOptions(); + PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, "UNITY_ASSERTIONS"); + PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.WebGL, "UNITY_ASSERTIONS"); var scenes = EditorBuildSettings.scenes.Where(s => s.enabled).Select(s => s.path).ToArray(); opts.scenes = scenes; opts.locationPathName = folder; opts.target = target; - opts.options = BuildOptions.Development; + opts.options = dev ? BuildOptions.Development : BuildOptions.None; BuildPipeline.BuildPlayer(opts); } - public static void MacOS() + public static void MacOSRelease() + { + MacOS(false); + } + + public static void Win64Release() + { + Win64(false); + } + + public static void WebGLRelease() + { + WebGL(false); + } + + public static void MacOSDev() + { + MacOS(true); + } + + public static void Win64Dev() + { + Win64(true); + } + + public static void WebGLDev() + { + WebGL(true); + } + + static void MacOS(bool dev) { - Build("build/MacOS/Mazerunner", BuildTarget.StandaloneOSX); + BuildStandalone(dev ? "build/MacOS/Mazerunner_dev" : "build/MacOS/Mazerunner", BuildTarget.StandaloneOSX, dev); } - public static void Win64() + static void Win64(bool dev) { - Build("build/Windows/Mazerunner.exe", BuildTarget.StandaloneWindows64); + BuildStandalone(dev ? "build/Windows/Mazerunner_dev.exe" : "build/Windows/Mazerunner.exe", BuildTarget.StandaloneWindows64, dev); } - public static void WebGL() + static void WebGL(bool dev) { - Build("build/WebGL/Mazerunner", BuildTarget.WebGL); + BuildStandalone("build/WebGL/Mazerunner" + (dev ? "_dev" : ""), BuildTarget.WebGL, dev); } + + public static void AndroidDev() + { + BuildAndroid(true); + } + + public static void AndroidRelease() + { + BuildAndroid(false); + } // Generates the Mazerunner APK - public static void AndroidBuild() + static void BuildAndroid(bool dev) { Debug.Log("Building Android app..."); - PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, "com.bugsnag.mazerunner"); - var opts = CommonOptions("mazerunner.apk"); + PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, "com.bugsnag.fixtures.unity.notifier.android"); + var opts = CommonMobileBuildOptions(dev ? "mazerunner_dev.apk" : "mazerunner.apk", dev); opts.target = BuildTarget.Android; +#if UNITY_2022_1_OR_NEWER + PlayerSettings.insecureHttpOption = InsecureHttpOption.AlwaysAllowed; +#endif + var result = BuildPipeline.BuildPlayer(opts); Debug.Log("Result: " + result); } + + // Generates the Mazerunner IPA - public static void IosBuild() + public static void IosDev() + { + IosBuild(true); + } + + public static void IosRelease() + { + IosBuild(false); + } + static void IosBuild(bool dev) { Debug.Log("Building iOS app..."); - PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, "com.bugsnag.unity.mazerunner"); - PlayerSettings.iOS.appleDeveloperTeamID = "372ZUL2ZB7"; + PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, "com.bugsnag.fixtures.unity.notifier.ios"); + PlayerSettings.iOS.appleDeveloperTeamID = "7W9PZ27Y5F"; PlayerSettings.iOS.appleEnableAutomaticSigning = true; PlayerSettings.iOS.allowHTTPDownload = true; - - var opts = CommonOptions("mazerunner_xcode"); + var opts = CommonMobileBuildOptions(dev ? "mazerunner_dev_xcode" : "mazerunner_xcode", dev); opts.target = BuildTarget.iOS; - var result = BuildPipeline.BuildPlayer(opts); Debug.Log("Result: " + result); } @@ -65,8 +120,8 @@ public static void IosBuild() public static void SwitchBuild() { Debug.Log("Building Switch app..."); - PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Switch, "com.bugsnag.mazerunner"); - var opts = CommonOptions("mazerunner.nspd"); + PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Switch, "com.bugsnag.fixtures.unity.notifier.ios"); + var opts = CommonMobileBuildOptions("mazerunner.nspd",false); opts.target = BuildTarget.Switch; opts.options = BuildOptions.Development; @@ -74,15 +129,18 @@ public static void SwitchBuild() Debug.Log("Result: " + result); } - private static BuildPlayerOptions CommonOptions(string outputFile) + private static BuildPlayerOptions CommonMobileBuildOptions(string outputFile, bool dev) { var scenes = EditorBuildSettings.scenes.Where(s => s.enabled).Select(s => s.path).ToArray(); PlayerSettings.defaultInterfaceOrientation = UIOrientation.Portrait; + PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, "UNITY_ASSERTIONS"); + PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS, "UNITY_ASSERTIONS"); + BuildPlayerOptions opts = new BuildPlayerOptions(); opts.scenes = scenes; opts.locationPathName = Application.dataPath + "/../" + outputFile; - opts.options = BuildOptions.None; + opts.options = dev ? BuildOptions.Development : BuildOptions.None; return opts; } diff --git a/features/fixtures/maze_runner/Assets/Editor/DisablingBitcodeiOS.cs b/features/fixtures/maze_runner/Assets/Editor/DisablingBitcodeiOS.cs new file mode 100644 index 000000000..b875aa841 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Editor/DisablingBitcodeiOS.cs @@ -0,0 +1,41 @@ +#if UNITY_IOS +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEditor.iOS.Xcode; + +public class DisablingBitcodeiOS +{ + + [PostProcessBuild(1000)] + public static void PostProcessBuildAttribute(BuildTarget target, string pathToBuildProject) + { + if (target == BuildTarget.iOS) + { + string projectPath = PBXProject.GetPBXProjectPath(pathToBuildProject); + + PBXProject pbxProject = new PBXProject(); + pbxProject.ReadFromFile(projectPath); +#if UNITY_2019_3_OR_NEWER + var targetGuid = pbxProject.GetUnityMainTargetGuid(); +#else + var targetName = PBXProject.GetUnityTargetName(); + var targetGuid = pbxProject.TargetGuidByName(targetName); +#endif + pbxProject.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO"); + pbxProject.WriteToFile(projectPath); + + var projectInString = File.ReadAllText(projectPath); + + projectInString = projectInString.Replace("ENABLE_BITCODE = YES;", + $"ENABLE_BITCODE = NO;"); + File.WriteAllText(projectPath, projectInString); + } + } + +} + +#endif \ No newline at end of file diff --git a/features/fixtures/maze_runner/Assets/Editor/DisablingBitcodeiOS.cs.meta b/features/fixtures/maze_runner/Assets/Editor/DisablingBitcodeiOS.cs.meta new file mode 100644 index 000000000..da5a957b0 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Editor/DisablingBitcodeiOS.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7c2c2e2275f81452f85b06b3f114f684 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/maze_runner/Assets/Plugins/Android/AndroidManifest.xml b/features/fixtures/maze_runner/Assets/Plugins/Android/AndroidManifest.xml index e2bd8eb32..29d6b526a 100644 --- a/features/fixtures/maze_runner/Assets/Plugins/Android/AndroidManifest.xml +++ b/features/fixtures/maze_runner/Assets/Plugins/Android/AndroidManifest.xml @@ -2,7 +2,7 @@ - + diff --git a/features/fixtures/maze_runner/Assets/Scenes/MainScene.unity b/features/fixtures/maze_runner/Assets/Scenes/MainScene.unity index 17e0ca76c..c18310998 100644 --- a/features/fixtures/maze_runner/Assets/Scenes/MainScene.unity +++ b/features/fixtures/maze_runner/Assets/Scenes/MainScene.unity @@ -38,12 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.3731316, g: 0.38074902, b: 0.3587254, a: 1} + m_IndirectSpecularColor: {r: 0.37311932, g: 0.38073996, b: 0.3587271, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 + serializedVersion: 12 m_GIWorkflowMode: 0 m_GISettings: serializedVersion: 2 @@ -54,7 +54,7 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 10 + serializedVersion: 12 m_Resolution: 2 m_BakeResolution: 40 m_AtlasSize: 1024 @@ -62,6 +62,7 @@ LightmapSettings: m_AOMaxDistance: 1 m_CompAOExponent: 1 m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 m_Padding: 2 m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 @@ -76,10 +77,16 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 m_PVRFilterTypeDirect: 0 m_PVRFilterTypeIndirect: 0 m_PVRFilterTypeAO: 0 - m_PVRFilteringMode: 1 + m_PVREnvironmentMIS: 0 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 @@ -87,9 +94,12 @@ LightmapSettings: m_PVRFilteringAtrousPositionSigmaDirect: 0.5 m_PVRFilteringAtrousPositionSigmaIndirect: 2 m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ShowResolutionOverlay: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 + m_LightingSettings: {fileID: 4890085278179872738, guid: e7a03624f4ce4430090b5b8a0b8729b5, + type: 2} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -109,6 +119,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} @@ -134,6 +146,8 @@ GameObject: - component: {fileID: 355371095} - component: {fileID: 355371094} - component: {fileID: 355371106} + - component: {fileID: 355371107} + - component: {fileID: 355371108} m_Layer: 0 m_Name: Config m_TagString: Untagged @@ -151,6 +165,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1419179097} m_RootOrder: 8 @@ -169,7 +184,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371095 MonoBehaviour: m_ObjectHideFlags: 0 @@ -184,7 +200,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371096 MonoBehaviour: m_ObjectHideFlags: 0 @@ -199,7 +216,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371097 MonoBehaviour: m_ObjectHideFlags: 0 @@ -214,7 +232,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371098 MonoBehaviour: m_ObjectHideFlags: 0 @@ -229,7 +248,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371099 MonoBehaviour: m_ObjectHideFlags: 0 @@ -244,7 +264,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371100 MonoBehaviour: m_ObjectHideFlags: 0 @@ -259,7 +280,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371101 MonoBehaviour: m_ObjectHideFlags: 0 @@ -274,7 +296,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371102 MonoBehaviour: m_ObjectHideFlags: 0 @@ -289,7 +312,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371103 MonoBehaviour: m_ObjectHideFlags: 0 @@ -304,7 +328,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371104 MonoBehaviour: m_ObjectHideFlags: 0 @@ -319,7 +344,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371105 MonoBehaviour: m_ObjectHideFlags: 0 @@ -334,7 +360,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &355371106 MonoBehaviour: m_ObjectHideFlags: 0 @@ -349,7 +376,40 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' +--- !u!114 &355371107 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 355371092} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: baf1eed2267d34714a6a95342c863cfe, type: 3} + m_Name: + m_EditorClassIdentifier: + CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) + + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' +--- !u!114 &355371108 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 355371092} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98657fae1a3494aeeb952c009b146b6d, type: 3} + m_Name: + m_EditorClassIdentifier: + CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) + + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &372057234 GameObject: m_ObjectHideFlags: 0 @@ -397,9 +457,10 @@ Camera: m_ClearFlags: 2 m_BackGroundColor: {r: 0.6281589, g: 0.30449826, b: 0.64705884, a: 0} m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} - m_GateFitMode: 2 m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 @@ -437,6 +498,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -473,6 +535,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1754371141} m_RootOrder: 1 @@ -491,7 +554,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &425821761 MonoBehaviour: m_ObjectHideFlags: 0 @@ -506,7 +570,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &425821762 MonoBehaviour: m_ObjectHideFlags: 0 @@ -521,7 +586,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &425821763 MonoBehaviour: m_ObjectHideFlags: 0 @@ -536,7 +602,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &425821764 MonoBehaviour: m_ObjectHideFlags: 0 @@ -551,7 +618,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &425821765 MonoBehaviour: m_ObjectHideFlags: 0 @@ -566,7 +634,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &547010188 GameObject: m_ObjectHideFlags: 0 @@ -596,6 +665,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1419179097} m_RootOrder: 7 @@ -614,7 +684,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &547010191 MonoBehaviour: m_ObjectHideFlags: 0 @@ -629,7 +700,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &547010192 MonoBehaviour: m_ObjectHideFlags: 0 @@ -644,7 +716,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &555502126 GameObject: m_ObjectHideFlags: 0 @@ -673,6 +746,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1419179097} m_RootOrder: 0 @@ -691,7 +765,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &555502129 MonoBehaviour: m_ObjectHideFlags: 0 @@ -706,7 +781,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &700367034 GameObject: m_ObjectHideFlags: 0 @@ -739,6 +815,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1419179097} m_RootOrder: 6 @@ -757,7 +834,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &700367037 MonoBehaviour: m_ObjectHideFlags: 0 @@ -772,7 +850,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &700367038 MonoBehaviour: m_ObjectHideFlags: 0 @@ -787,7 +866,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &700367039 MonoBehaviour: m_ObjectHideFlags: 0 @@ -802,7 +882,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &700367040 MonoBehaviour: m_ObjectHideFlags: 0 @@ -817,7 +898,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &700367041 MonoBehaviour: m_ObjectHideFlags: 0 @@ -832,7 +914,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &992980886 GameObject: m_ObjectHideFlags: 0 @@ -860,9 +943,10 @@ MonoBehaviour: m_GameObject: {fileID: 992980886} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} m_Name: m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 m_HorizontalAxis: Horizontal m_VerticalAxis: Vertical m_SubmitButton: Submit @@ -879,7 +963,7 @@ MonoBehaviour: m_GameObject: {fileID: 992980886} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} m_Name: m_EditorClassIdentifier: m_FirstSelected: {fileID: 0} @@ -895,6 +979,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 @@ -929,6 +1014,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1754371141} m_RootOrder: 5 @@ -947,7 +1033,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1105517634 MonoBehaviour: m_ObjectHideFlags: 0 @@ -962,7 +1049,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1105517635 MonoBehaviour: m_ObjectHideFlags: 0 @@ -977,7 +1065,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1105517636 MonoBehaviour: m_ObjectHideFlags: 0 @@ -992,7 +1081,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &1114049719 GameObject: m_ObjectHideFlags: 0 @@ -1020,6 +1110,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1754371141} m_RootOrder: 6 @@ -1038,7 +1129,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &1160627402 GameObject: m_ObjectHideFlags: 0 @@ -1071,6 +1163,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1419179097} m_RootOrder: 5 @@ -1089,7 +1182,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1160627405 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1104,7 +1198,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1160627406 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1119,7 +1214,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1160627407 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1134,7 +1230,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1160627408 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1149,7 +1246,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1160627409 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1164,7 +1262,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &1338701864 GameObject: m_ObjectHideFlags: 0 @@ -1179,6 +1278,8 @@ GameObject: - component: {fileID: 1338701868} - component: {fileID: 1338701869} - component: {fileID: 1338701870} + - component: {fileID: 1338701872} + - component: {fileID: 1338701871} m_Layer: 0 m_Name: Breadcrumbs m_TagString: Untagged @@ -1196,6 +1297,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1419179097} m_RootOrder: 1 @@ -1214,7 +1316,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1338701867 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1229,7 +1332,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1338701868 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1244,7 +1348,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1338701869 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1259,7 +1364,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1338701870 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1274,7 +1380,32 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' +--- !u!114 &1338701871 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1338701864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3cbe76e3ceae047ee85769786e2840dd, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1338701872 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1338701864} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 36160400d18884e48983505794649646, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1388241496 GameObject: m_ObjectHideFlags: 0 @@ -1310,6 +1441,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1754371141} m_RootOrder: 3 @@ -1328,7 +1460,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1388241499 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1343,7 +1476,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1388241500 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1358,7 +1492,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1388241501 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1373,7 +1508,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1388241502 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1388,7 +1524,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1388241503 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1403,7 +1540,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1388241504 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1418,7 +1556,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1388241505 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1433,7 +1572,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1388241506 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1448,7 +1588,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &1419179096 GameObject: m_ObjectHideFlags: 0 @@ -1475,6 +1616,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 555502127} - {fileID: 1338701865} @@ -1505,6 +1647,7 @@ GameObject: - component: {fileID: 1523264808} - component: {fileID: 1523264809} - component: {fileID: 1523264810} + - component: {fileID: 1523264811} m_Layer: 0 m_Name: Persistence m_TagString: Untagged @@ -1522,6 +1665,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1419179097} m_RootOrder: 3 @@ -1540,7 +1684,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1523264804 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1555,7 +1700,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1523264805 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1570,7 +1716,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1523264806 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1585,7 +1732,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1523264807 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1600,7 +1748,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1523264808 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1615,7 +1764,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1523264809 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1630,7 +1780,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1523264810 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1645,7 +1796,24 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' +--- !u!114 &1523264811 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1523264801} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 395039af028ee4010baf61afa7f7e066, type: 3} + m_Name: + m_EditorClassIdentifier: + CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) + + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &1746155638 GameObject: m_ObjectHideFlags: 0 @@ -1665,6 +1833,7 @@ GameObject: - component: {fileID: 1746155645} - component: {fileID: 1746155649} - component: {fileID: 1746155648} + - component: {fileID: 1746155650} m_Layer: 0 m_Name: Sessions m_TagString: Untagged @@ -1682,6 +1851,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1419179097} m_RootOrder: 4 @@ -1700,7 +1870,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1746155641 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1715,7 +1886,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1746155642 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1730,7 +1902,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1746155643 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1745,7 +1918,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1746155644 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1760,7 +1934,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1746155645 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1775,7 +1950,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1746155646 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1790,7 +1966,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1746155647 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1805,7 +1982,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1746155648 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1820,7 +1998,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1746155649 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1835,7 +2014,24 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' +--- !u!114 &1746155650 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1746155638} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d02b26eecba248eabc16ab8aa86040c, type: 3} + m_Name: + m_EditorClassIdentifier: + CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) + + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &1754371139 GameObject: m_ObjectHideFlags: 0 @@ -1875,6 +2071,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1419179097} - {fileID: 425821759} @@ -1926,6 +2123,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1754371141} m_Father: {fileID: 0} @@ -1964,6 +2162,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1754371141} m_RootOrder: 4 @@ -1982,7 +2181,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1947744088 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1997,7 +2197,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1947744089 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2012,7 +2213,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1947744090 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2027,7 +2229,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1947744091 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2042,7 +2245,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1947744092 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2057,7 +2261,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &1947744093 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2072,7 +2277,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &2039813460 GameObject: m_ObjectHideFlags: 0 @@ -2115,6 +2321,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1419179097} m_RootOrder: 2 @@ -2133,7 +2340,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813463 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2148,7 +2356,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813464 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2163,7 +2372,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813465 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2178,7 +2388,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813466 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2193,7 +2404,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813467 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2208,7 +2420,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813468 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2223,7 +2436,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813469 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2238,7 +2452,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813470 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2253,7 +2468,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813471 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2268,7 +2484,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813472 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2283,7 +2500,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813473 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2298,7 +2516,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813474 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2313,7 +2532,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813475 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2328,7 +2548,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813476 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2343,7 +2564,8 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!114 &2039813477 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2356,6 +2578,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b0623c2806d68426e86c8fc6ba822dd8, type: 3} m_Name: m_EditorClassIdentifier: + CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) + + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' --- !u!1 &2059449697 GameObject: m_ObjectHideFlags: 0 @@ -2383,6 +2609,7 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1754371141} m_RootOrder: 2 @@ -2401,4 +2628,5 @@ MonoBehaviour: m_EditorClassIdentifier: CustomStacktrace: 'Main.CUSTOM1 () (at Assets/Scripts/Main.cs:123) - Main.CUSTOM2 () (at Assets/Scripts/Main.cs:123)' + Main.CUSTOM2 + () (at Assets/Scripts/Main.cs:123)' diff --git a/features/fixtures/maze_runner/Assets/Scripts/Logger.cs b/features/fixtures/maze_runner/Assets/Scripts/Logger.cs new file mode 100644 index 000000000..092763202 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Logger.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; + +public class Logger : MonoBehaviour +{ + + const string LOG_PREFIX = "BUGSNAG_MAZERUNNER_LOG : "; + + const string LOG_FILE_NAME = "mazerunner-unity.log"; + + private static string _currentLog; + + public static void I(string msg) + { + Debug.Log(LOG_PREFIX + msg); + _currentLog += msg + "\n"; + WriteLogFile(); + } + + private static void WriteLogFile() + { + var path = Path.Combine(Application.persistentDataPath, LOG_FILE_NAME); + File.WriteAllText(path, _currentLog); + } + +} diff --git a/features/fixtures/maze_runner/Assets/Scripts/Logger.cs.meta b/features/fixtures/maze_runner/Assets/Scripts/Logger.cs.meta new file mode 100644 index 000000000..8cc31f3d0 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Logger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c0b994281fb547a891f2ecbfc0fadb6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/maze_runner/Assets/Scripts/Main.cs b/features/fixtures/maze_runner/Assets/Scripts/Main.cs index 5ba1c3179..c42ecd5e7 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Main.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Main.cs @@ -12,6 +12,12 @@ public class Command public string scenarioName; } +[Serializable] +public class FixtureConfig +{ + public string maze_address; +} + public class Main : MonoBehaviour { @@ -25,23 +31,20 @@ public class Main : MonoBehaviour private static extern void ClearPersistentData(); #endif + private string _fixtureConfigFileName = "/fixture_config.json"; + private const string API_KEY = "a35a2a72bd230ac0aa0f52715bbdc6aa"; - private string _mazeHost; + public static string MazeHost; + + private const int MAX_CONFIG_GET_TRIES = 15; public ScenarioRunner ScenarioRunner; - public void Start() + public IEnumerator Start() { - Debug.Log("Maze Runner app started"); - - - _mazeHost = "http://localhost:9339"; + Log("Maze Runner app started"); - if (Application.platform == RuntimePlatform.IPhonePlayer || - Application.platform == RuntimePlatform.Android) - { - _mazeHost = "http://bs-local.com:9339"; - } + yield return GetFixtureConfig(); #if UNITY_STANDALONE_OSX PreventCrashPopups(); @@ -49,6 +52,46 @@ public void Start() InvokeRepeating("DoRunNextMazeCommand",0,1); } + private IEnumerator GetFixtureConfig() + { + if (Application.platform == RuntimePlatform.Android || + Application.platform == RuntimePlatform.IPhonePlayer) + { + var numTries = 0; + while (numTries < MAX_CONFIG_GET_TRIES) + { + var configPath = Application.persistentDataPath + _fixtureConfigFileName; + if (File.Exists(configPath)) + { + var configJson = File.ReadAllText(configPath); + Log("Mazerunner got fixture config json: " + configJson); + var config = JsonUtility.FromJson(configJson); + MazeHost = "http://" + config.maze_address; + break; + } + else + { + numTries++; + Log(string.Format("Maze Runner did not find the config file at path {0} try number {1}", configPath, numTries)); + yield return new WaitForSeconds(1); + } + } + } + + if (string.IsNullOrEmpty(MazeHost)) + { + Log("Host not set from config file, using hard coded"); + MazeHost = "http://localhost:9339"; + + if (Application.platform == RuntimePlatform.IPhonePlayer || + Application.platform == RuntimePlatform.Android) + { + MazeHost = "http://bs-local.com:9339"; + } + } + Log("Mazerunner host set to: " + MazeHost); + } + private void DoRunNextMazeCommand() { StartCoroutine(RunNextMazeCommand()); @@ -56,8 +99,8 @@ private void DoRunNextMazeCommand() IEnumerator RunNextMazeCommand() { - var url = _mazeHost + "/command"; - Console.WriteLine("RunNextMazeCommand called, requesting command from: {0}", url); + var url = MazeHost + "/command"; + Log("Requesting maze command from: " + url); using (UnityWebRequest request = UnityWebRequest.Get(url)) { yield return request.SendWebRequest(); @@ -69,23 +112,23 @@ IEnumerator RunNextMazeCommand() !request.isNetworkError; #endif - Console.WriteLine("result is " + result); + Log("result is " + result); if (result) { var response = request.downloadHandler?.text; - Console.WriteLine("Raw response: " + response); + Log("Raw response: " + response); if (response == null || response == "null" || response == "No commands to provide") { - Console.WriteLine("No Maze Runner command to process at present"); + Log("No Maze Runner command to process at present"); } else { var command = JsonUtility.FromJson(response); if (command != null) { - Console.WriteLine("Received Maze Runner command:"); - Console.WriteLine("Action: " + command.action); - Console.WriteLine("Scenario: " + command.scenarioName); + Log("Received Maze Runner command:"); + Log("Action: " + command.action); + Log("Scenario: " + command.scenarioName); if ("clear_cache".Equals(command.action)) { @@ -93,7 +136,7 @@ IEnumerator RunNextMazeCommand() } else if ("run_scenario".Equals(command.action)) { - ScenarioRunner.RunScenario(command.scenarioName, API_KEY, _mazeHost); + ScenarioRunner.RunScenario(command.scenarioName, API_KEY, MazeHost); } else if ("close_application".Equals(command.action)) { @@ -138,6 +181,11 @@ public static void ClearIOSData() #endif } + private static void Log(string msg) + { + Logger.I(msg); + } + } diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenario.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenario.cs index 2372cec79..dd7686691 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenario.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenario.cs @@ -25,6 +25,8 @@ public class Scenario : MonoBehaviour #endif + public const string FAIL_URL = "https://localhost:994"; + public Configuration Configuration; [HideInInspector] @@ -37,6 +39,11 @@ public virtual void PrepareConfig(string apiKey, string host) Configuration.ScriptingBackend = FindScriptingBackend(); Configuration.DotnetScriptingRuntime = FindDotnetScriptingRuntime(); Configuration.DotnetApiCompatibility = FindDotnetApiCompatibility(); + Configuration.AutoTrackSessions = false; + if (Application.platform == RuntimePlatform.IPhonePlayer) + { + Configuration.EnabledErrorTypes.OOMs = false; + } } public void AddSwitchConfigValues(SwitchCacheType switchCacheType, int switchCacheIndex, string switchMountName) diff --git a/features/fixtures/maze_runner/Assets/Scripts/ScenarioRunner.cs b/features/fixtures/maze_runner/Assets/Scripts/ScenarioRunner.cs index ee875862a..f0090dabd 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/ScenarioRunner.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/ScenarioRunner.cs @@ -1,7 +1,13 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Diagnostics; +using BugsnagUnity; +using BugsnagUnity.Payload; +using System.Globalization; using UnityEngine; +using UnityEngine.Networking; +using System.Text; public class ScenarioRunner : MonoBehaviour { @@ -23,16 +29,50 @@ public void RunScenario(string scenarioName, string apiKey, string host) { var scenario = GetScenario(scenarioName); - scenario.PrepareConfig(apiKey,host); + scenario.PrepareConfig(apiKey, host); #if UNITY_SWITCH GetSwitchArguments(); scenario.AddSwitchConfigValues(_switchCacheType, _switchCacheIndex, _switchCacheMountName); #endif + var sw = new Stopwatch(); + sw.Start(); scenario.StartBugsnag(); + sw.Stop(); + ReportStartTime(host, sw.ElapsedMilliseconds, scenarioName); scenario.Run(); } + [Serializable] + private class StartupTimeReport + { + + public StartupTimeReport(long startupTimeMill, string scenarioName) + { + bugsnagStartTime = startupTimeMill; + ScenarioName = scenarioName; + } + + public long bugsnagStartTime; + public string ScenarioName; + public string Platform = Application.platform.ToString(); + public string UnityVersion = Application.unityVersion; + public string DeviceModel = SystemInfo.deviceModel; + public string DeviceName = SystemInfo.deviceName; + + } + + private void ReportStartTime(string host, long mill, string scenarioName) + { + var data = new StartupTimeReport(mill, scenarioName); + var req = new UnityWebRequest(host + "/metrics"); + req.SetRequestHeader("Content-Type", "application/json"); + req.SetRequestHeader("Bugsnag-Sent-At", DateTimeOffset.Now.ToString("o", CultureInfo.InvariantCulture)); + req.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(JsonUtility.ToJson(data))); + req.method = UnityWebRequest.kHttpVerbPOST; + req.SendWebRequest(); + } + private Scenario GetScenario(string scenarioName) { diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Android/AndroidBackgroundJVMSmokeTest.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Android/AndroidBackgroundJVMSmokeTest.cs index 1c2c98c11..2d155d4e8 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Android/AndroidBackgroundJVMSmokeTest.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Android/AndroidBackgroundJVMSmokeTest.cs @@ -10,6 +10,7 @@ public override void PrepareConfig(string apiKey, string host) base.PrepareConfig(apiKey, host); Configuration.SetUser("1", "2", "3"); Configuration.ProjectPackages = new string[] { "test.test.test" }; + Configuration.AddOnSession((s) => { return true; }); } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsFail.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsFail.cs new file mode 100644 index 000000000..bd5b59bc7 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsFail.cs @@ -0,0 +1,20 @@ +using System.Collections; +using BugsnagNetworking; +using UnityEngine; + +public class NetworkBreadcrumbsFail: Scenario +{ + + public override void Run() + { + StartCoroutine(DoRun()); + } + + private IEnumerator DoRun() + { + var www = BugsnagUnityWebRequest.Get(FAIL_URL + "?success=false"); + yield return www.SendWebRequest(); + yield return new WaitForSeconds(1); + throw new System.Exception("NetworkBreadcrumbsFail"); + } +} diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsFail.cs.meta b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsFail.cs.meta new file mode 100644 index 000000000..c4b42247d --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsFail.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36160400d18884e48983505794649646 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsSuccess.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsSuccess.cs new file mode 100644 index 000000000..500035180 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsSuccess.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using BugsnagNetworking; +using BugsnagUnity; +using UnityEngine; + +public class NetworkBreadcrumbsSuccess : Scenario +{ + + public override void PrepareConfig(string apiKey, string host) + { + base.PrepareConfig(apiKey, host); + Configuration.RedactedKeys = new List { new Regex("redactthis") }; + Configuration.EnabledBreadcrumbTypes = new BugsnagUnity.Payload.BreadcrumbType[] { BugsnagUnity.Payload.BreadcrumbType.Request }; + } + public override void Run() + { + StartCoroutine(DoRun()); + } + + private IEnumerator DoRun() + { + var get = BugsnagUnityWebRequest.Get(Main.MazeHost + "?success=true&redactthis=notRedacted"); + yield return get.SendWebRequest(); + yield return new WaitForSeconds(1); + + var post = BugsnagUnityWebRequest.Post(Main.MazeHost, "{\"action\":\"success\"}"); + yield return post.SendWebRequest(); + yield return new WaitForSeconds(1); + + throw new System.Exception("NetworkBreadcrumbsSuccess"); + } +} diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsSuccess.cs.meta b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsSuccess.cs.meta new file mode 100644 index 000000000..ab0f16169 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Breadcrumbs/NetworkBreadcrumbsSuccess.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3cbe76e3ceae047ee85769786e2840dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Callbacks/OnSessionAfterStart.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Callbacks/OnSessionAfterStart.cs index 70e661a99..ea7407aa7 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Callbacks/OnSessionAfterStart.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Callbacks/OnSessionAfterStart.cs @@ -5,7 +5,6 @@ public class OnSessionAfterStart : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Callbacks/OnSessionInConfig.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Callbacks/OnSessionInConfig.cs index 136278546..42d0e014b 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Callbacks/OnSessionInConfig.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Callbacks/OnSessionInConfig.cs @@ -6,7 +6,6 @@ public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); Configuration.AddOnSession(SimpleSessionCallback); - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/DiscardErrorClass.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/DiscardErrorClass.cs index 6202bcb8d..8f9a291ec 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/DiscardErrorClass.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/DiscardErrorClass.cs @@ -1,11 +1,13 @@ -using BugsnagUnity; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using BugsnagUnity; public class DiscardErrorClass : Scenario { public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.DiscardClasses = new string[] { "IndexOutOfRangeException" }; + Configuration.DiscardClasses = new List { new Regex("IndexOutOfRangeException") }; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/GenerateAnonymousId.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/GenerateAnonymousId.cs new file mode 100644 index 000000000..ee51c016b --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/GenerateAnonymousId.cs @@ -0,0 +1,17 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class GenerateAnonymousId : Scenario +{ + public override void PrepareConfig(string apiKey, string host) + { + base.PrepareConfig(apiKey, host); + Configuration.GenerateAnonymousId = false; + } + + public override void Run() + { + DoSimpleNotify("GenerateAnonymousId"); + } +} diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/GenerateAnonymousId.cs.meta b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/GenerateAnonymousId.cs.meta new file mode 100644 index 000000000..9b7cce6ac --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/GenerateAnonymousId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: baf1eed2267d34714a6a95342c863cfe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/IsStarted.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/IsStarted.cs new file mode 100644 index 000000000..7dddcec57 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/IsStarted.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using BugsnagUnity; + +public class IsStarted : Scenario +{ + public override void Run() + { + if (Bugsnag.IsStarted()) + { + DoSimpleNotify("IsStarted"); + } + else + { + DoSimpleNotify("HasNotStarted"); + } + } +} \ No newline at end of file diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/IsStarted.cs.meta b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/IsStarted.cs.meta new file mode 100644 index 000000000..ed6e874d6 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/IsStarted.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98657fae1a3494aeeb952c009b146b6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/RedactedKeys.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/RedactedKeys.cs index 8d7198446..354ad9c1b 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/RedactedKeys.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Config/RedactedKeys.cs @@ -1,9 +1,12 @@ -public class RedactedKeys : Scenario +using System.Collections.Generic; +using System.Text.RegularExpressions; + +public class RedactedKeys : Scenario { public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.RedactedKeys = new string[] { "testKey" }; + Configuration.RedactedKeys = new List { new Regex("testKey") }; Configuration.AddMetadata("testSection","testKey","testValue"); } diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Events/SessionAfterStart.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Events/SessionAfterStart.cs index b7219c1a7..4d0c1e0df 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Events/SessionAfterStart.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Events/SessionAfterStart.cs @@ -4,6 +4,12 @@ public class SessionAfterStart : Scenario { + public override void PrepareConfig(string apiKey, string host) + { + base.PrepareConfig(apiKey, host); + Configuration.AutoTrackSessions = true; + } + public override void Run() { throw new System.Exception("SessionAfterStart"); diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/CorruptedCacheFile.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/CorruptedCacheFile.cs new file mode 100644 index 000000000..161f20241 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/CorruptedCacheFile.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; + +public class CorruptedCacheFile : Scenario +{ + + public override void PrepareConfig(string apiKey, string host) + { + base.PrepareConfig(apiKey, host); + } + + public override void Run() + { + var dirPath = Application.persistentDataPath + "/Bugsnag/Events"; + if (!Directory.Exists(dirPath)) + { + Directory.CreateDirectory(dirPath); + } + File.WriteAllText(dirPath + "/f04274f7-6f7d-448e-b62e-486cc019a708.event", "NOT JSON"); + } +} diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/CorruptedCacheFile.cs.meta b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/CorruptedCacheFile.cs.meta new file mode 100644 index 000000000..79565d892 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/CorruptedCacheFile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 395039af028ee4010baf61afa7f7e066 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/MaxPersistEvents.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/MaxPersistEvents.cs index e0199b4aa..6e744c32a 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/MaxPersistEvents.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/MaxPersistEvents.cs @@ -9,11 +9,6 @@ public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); Configuration.MaxPersistedEvents = 3; - Configuration.AutoTrackSessions = false; - if (Application.platform == RuntimePlatform.IPhonePlayer) - { - Configuration.EnabledErrorTypes.OOMs = false; - } } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/MaxPersistSessions.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/MaxPersistSessions.cs index 3af555b29..78c529c69 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/MaxPersistSessions.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/MaxPersistSessions.cs @@ -9,7 +9,6 @@ public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); Configuration.MaxPersistedSessions = 3; - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistDeviceId.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistDeviceId.cs index 49fc9f75a..fe3bdb812 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistDeviceId.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistDeviceId.cs @@ -5,10 +5,6 @@ public class PersistDeviceId : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - if (Application.platform == RuntimePlatform.IPhonePlayer) - { - Configuration.EnabledErrorTypes.OOMs = false; - } } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEvent.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEvent.cs index ea6e26861..02f553ed8 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEvent.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEvent.cs @@ -6,11 +6,6 @@ public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); Configuration.Context = "Error 1"; - Configuration.AutoTrackSessions = false; - if (Application.platform == RuntimePlatform.IPhonePlayer) - { - Configuration.EnabledErrorTypes.OOMs = false; - } } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEventReport.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEventReport.cs index 8f7206ce3..b55201d45 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEventReport.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEventReport.cs @@ -6,10 +6,6 @@ public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); Configuration.Context = "Error 2"; - if (Application.platform == RuntimePlatform.IPhonePlayer) - { - Configuration.EnabledErrorTypes.OOMs = false; - } } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEventReportCallback.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEventReportCallback.cs index 9a2afe199..cc7397822 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEventReportCallback.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/PersistEventReportCallback.cs @@ -7,7 +7,6 @@ public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); Configuration.Context = "Error 2"; - Configuration.AutoTrackSessions = false; Configuration.AddOnSendError((@event) => { @event.App.BinaryArch = "Persist BinaryArch"; @@ -27,10 +26,6 @@ public override void PrepareConfig(string apiKey, string host) return true; }); - if (Application.platform == RuntimePlatform.IPhonePlayer) - { - Configuration.EnabledErrorTypes.OOMs = false; - } } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/ReportMaxPersistedEvents.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/ReportMaxPersistedEvents.cs index 7a22bdbda..474a28579 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/ReportMaxPersistedEvents.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Persistence/ReportMaxPersistedEvents.cs @@ -10,10 +10,6 @@ public override void PrepareConfig(string apiKey, string host) { _eventsCorrect = CheckForEvents(); base.PrepareConfig(apiKey, host); - if (Application.platform == RuntimePlatform.IPhonePlayer) - { - Configuration.EnabledErrorTypes.OOMs = false; - } } private bool CheckForEvents() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/AutoTrackSessions.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/AutoTrackSessions.cs new file mode 100644 index 000000000..12cf8908d --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/AutoTrackSessions.cs @@ -0,0 +1,8 @@ +public class AutoTrackSessions : Scenario +{ + public override void PrepareConfig(string apiKey, string host) + { + base.PrepareConfig(apiKey, host); + Configuration.AutoTrackSessions = true; + } +} diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/AutoTrackSessions.cs.meta b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/AutoTrackSessions.cs.meta new file mode 100644 index 000000000..92af08b41 --- /dev/null +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/AutoTrackSessions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d02b26eecba248eabc16ab8aa86040c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/HandledErrorInSession.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/HandledErrorInSession.cs index b9206f3ee..7d3a9c628 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/HandledErrorInSession.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/HandledErrorInSession.cs @@ -5,7 +5,6 @@ public class HandledErrorInSession : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/ManualSession.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/ManualSession.cs index 85f1413f0..8ca6aca2a 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/ManualSession.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/ManualSession.cs @@ -5,7 +5,6 @@ public class ManualSession : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/MultipleEventCounts.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/MultipleEventCounts.cs index d6bc4bd0e..47210792e 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/MultipleEventCounts.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/MultipleEventCounts.cs @@ -9,7 +9,6 @@ public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); Configuration.ReportExceptionLogsAsHandled = false; - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/NewSession.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/NewSession.cs index b4ed7914d..b37793c18 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/NewSession.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/NewSession.cs @@ -8,7 +8,6 @@ public class NewSession : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/PausedSessionEvent.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/PausedSessionEvent.cs index 932f3944c..2473e6ac0 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/PausedSessionEvent.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/PausedSessionEvent.cs @@ -5,7 +5,6 @@ public class PausedSessionEvent : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/ResumedSession.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/ResumedSession.cs index 913bd1831..ee49c42fa 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/ResumedSession.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/ResumedSession.cs @@ -9,7 +9,6 @@ public class ResumedSession : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/UnhandledErrorInSession.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/UnhandledErrorInSession.cs index d254bd665..3d6a6c52d 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/UnhandledErrorInSession.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Csharp/Sessions/UnhandledErrorInSession.cs @@ -5,7 +5,6 @@ public class UnhandledErrorInSession : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; Configuration.ReportExceptionLogsAsHandled = false; } diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Switch/SwitchMaxCacheSize.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Switch/SwitchMaxCacheSize.cs index 1a173aa1e..57254489c 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Switch/SwitchMaxCacheSize.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/Switch/SwitchMaxCacheSize.cs @@ -9,7 +9,6 @@ public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); Configuration.SwitchCacheMaxSize = 2097155; - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosDisableCrashes.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosDisableCrashes.cs index dcdaec0c3..4a0783260 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosDisableCrashes.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosDisableCrashes.cs @@ -8,7 +8,6 @@ public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); Configuration.EnabledErrorTypes.Crashes = false; - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosLastRunInfo.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosLastRunInfo.cs index c18042e43..1eb90ec1c 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosLastRunInfo.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosLastRunInfo.cs @@ -6,7 +6,6 @@ public class IosLastRunInfo : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosNativeException.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosNativeException.cs index 4a24f70d2..4f09a4f19 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosNativeException.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosNativeException.cs @@ -5,7 +5,7 @@ public class IosNativeException : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; + Configuration.AddOnSession((s) => { return true; }); } public override void Run() diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosNativeOnSendCallback.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosNativeOnSendCallback.cs index 13b9331dc..5445f389d 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosNativeOnSendCallback.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosNativeOnSendCallback.cs @@ -10,7 +10,6 @@ public class IosNativeOnSendCallback : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; Configuration.AddOnSendError((@event) => { try { @@ -41,7 +40,9 @@ public override void PrepareConfig(string apiKey, string host) device.Jailbroken = true; device.Orientation = "Custom Orientation"; device.Time = new DateTimeOffset(1985, 08, 21, 01, 01, 01, TimeSpan.Zero); - + device.TotalMemory = 999; + device.ModelNumber = "Custom ModelNumber"; + // breadcrumbs foreach (var crumb in @event.Breadcrumbs) { diff --git a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosSignal.cs b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosSignal.cs index 6dc13a499..57a915277 100644 --- a/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosSignal.cs +++ b/features/fixtures/maze_runner/Assets/Scripts/Scenarios/iOS/IosSignal.cs @@ -5,7 +5,6 @@ public class IosSignal : Scenario public override void PrepareConfig(string apiKey, string host) { base.PrepareConfig(apiKey, host); - Configuration.AutoTrackSessions = false; } public override void Run() diff --git a/features/fixtures/maze_runner/ProjectSettings/ProjectSettings.asset b/features/fixtures/maze_runner/ProjectSettings/ProjectSettings.asset index 003a6bb0d..13a273ae4 100644 --- a/features/fixtures/maze_runner/ProjectSettings/ProjectSettings.asset +++ b/features/fixtures/maze_runner/ProjectSettings/ProjectSettings.asset @@ -159,9 +159,9 @@ PlayerSettings: androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 applicationIdentifier: - Android: com.bugsnag.mazerunner - iOS: com.bugsnag.unity.mazerunner - iPhone: com.bugsnag.unity.mazerunner + Android: com.bugsnag.fixtures.unity.notifier.android + iOS: com.bugsnag.fixtures.unity.notifier.ios + iPhone: com.bugsnag.fixtures.unity.notifier.ios buildNumber: Standalone: 111 iOS: 333 @@ -240,7 +240,7 @@ PlayerSettings: metalAPIValidation: 1 iOSRenderExtraFrameOnPause: 0 iosCopyPluginsCodeInsteadOfSymlink: 0 - appleDeveloperTeamID: 372ZUL2ZB7 + appleDeveloperTeamID: 7W9PZ27Y5F iOSManualSigningProvisioningProfileID: tvOSManualSigningProvisioningProfileID: iOSManualSigningProvisioningProfileType: 0 diff --git a/features/fixtures/maze_runner/ProjectSettings/ProjectVersion.txt b/features/fixtures/maze_runner/ProjectSettings/ProjectVersion.txt index 95dcc9f42..da76706d2 100644 --- a/features/fixtures/maze_runner/ProjectSettings/ProjectVersion.txt +++ b/features/fixtures/maze_runner/ProjectSettings/ProjectVersion.txt @@ -1 +1,2 @@ -m_EditorVersion: 2018.4.34f1 +m_EditorVersion: 2020.3.48f1 +m_EditorVersionWithRevision: 2020.3.48f1 (b805b124c6b7) diff --git a/features/fixtures/maze_runner/nativeplugin/android/build.gradle b/features/fixtures/maze_runner/nativeplugin/android/build.gradle index 687601e47..6c5ab09b8 100644 --- a/features/fixtures/maze_runner/nativeplugin/android/build.gradle +++ b/features/fixtures/maze_runner/nativeplugin/android/build.gradle @@ -21,7 +21,7 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 30 - ndkVersion = "16.1.4479499" + ndkVersion = "21.4.7075529" } externalNativeBuild.cmake.path "CMakeLists.txt" } diff --git a/features/fixtures/minimalapp/.gitignore b/features/fixtures/minimalapp/.gitignore new file mode 100644 index 000000000..7a5cd83ad --- /dev/null +++ b/features/fixtures/minimalapp/.gitignore @@ -0,0 +1,72 @@ +# This .gitignore file should be placed at the root of your Unity project directory +# +# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore +# +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Bb]uild/ +/[Bb]uilds/ +/[Ll]ogs/ +/[Uu]ser[Ss]ettings/ + +# MemoryCaptures can get excessive in size. +# They also could contain extremely sensitive data +/[Mm]emoryCaptures/ + +# Recordings can get excessive in size +/[Rr]ecordings/ + +# Uncomment this line if you wish to ignore the asset store tools plugin +# /[Aa]ssets/AssetStoreTools* + +# Autogenerated Jetbrains Rider plugin +/[Aa]ssets/Plugins/Editor/JetBrains* + +# Visual Studio cache directory +.vs/ + +# Gradle cache directory +.gradle/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb +*.mdb +*.opendb +*.VC.db + +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta +*.mdb.meta + +# Unity3D generated file on crash reports +sysinfo.txt + +# Builds +*.apk +*.aab +*.unitypackage +*.app + +# Crashlytics generated file +crashlytics-build.properties + +# Packed Addressables +/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* + +# Temporary auto-generated Android Assets +/[Aa]ssets/[Ss]treamingAssets/aa.meta +/[Aa]ssets/[Ss]treamingAssets/aa/* \ No newline at end of file diff --git a/features/fixtures/minimalapp/Assets/Editor.meta b/features/fixtures/minimalapp/Assets/Editor.meta new file mode 100644 index 000000000..b174ce0a4 --- /dev/null +++ b/features/fixtures/minimalapp/Assets/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f91ecdffc051346c88036020e7aa32de +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/minimalapp/Assets/Editor/Builder.cs b/features/fixtures/minimalapp/Assets/Editor/Builder.cs new file mode 100644 index 000000000..9c10d3fe5 --- /dev/null +++ b/features/fixtures/minimalapp/Assets/Editor/Builder.cs @@ -0,0 +1,61 @@ +using System.Linq; +using UnityEngine; + +#if UNITY_EDITOR +using UnityEditor; +using UnityEditor.Callbacks; + +public class Builder : MonoBehaviour +{ + + + public static void BuildAndroidWith() + { + AndroidBuild("_with_bugsnag"); + } + + public static void BuildAndroidWithout() + { + AndroidBuild("_without_bugsnag"); + } + + // Generates the Mazerunner APK + private static void AndroidBuild(string type) + { + var opts = CommonOptions("minimal" + type + ".apk"); + opts.target = BuildTarget.Android; + BuildPipeline.BuildPlayer(opts); + } + + public static void BuildIosWithout() + { + IosBuild("without"); + } + + public static void BuildIosWith() + { + IosBuild("with"); + } + + private static void IosBuild(string type) + { + PlayerSettings.iOS.appleDeveloperTeamID = "7W9PZ27Y5F"; + PlayerSettings.iOS.appleEnableAutomaticSigning = true; + PlayerSettings.iOS.allowHTTPDownload = true; + var opts = CommonOptions("minimal_" + type + "_xcode"); + opts.target = BuildTarget.iOS; + var result = BuildPipeline.BuildPlayer(opts); + } + + private static BuildPlayerOptions CommonOptions(string outputFile) + { + BuildPlayerOptions opts = new BuildPlayerOptions + { + scenes = EditorBuildSettings.scenes.Where(s => s.enabled).Select(s => s.path).ToArray(), + locationPathName = Application.dataPath + "/../" + outputFile, + options = BuildOptions.None + }; + return opts; + } +} +#endif diff --git a/features/fixtures/minimalapp/Assets/Editor/Builder.cs.meta b/features/fixtures/minimalapp/Assets/Editor/Builder.cs.meta new file mode 100644 index 000000000..22f38e75a --- /dev/null +++ b/features/fixtures/minimalapp/Assets/Editor/Builder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fbe82f91b8e61453bbd64caee0ca0402 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/minimalapp/Assets/Editor/DisablingBitcodeiOS.cs b/features/fixtures/minimalapp/Assets/Editor/DisablingBitcodeiOS.cs new file mode 100644 index 000000000..cb7abcd3d --- /dev/null +++ b/features/fixtures/minimalapp/Assets/Editor/DisablingBitcodeiOS.cs @@ -0,0 +1,37 @@ + +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; +using UnityEditor; +using UnityEditor.Callbacks; + +public class DisablingBitcodeiOS +{ + [PostProcessBuild(1000)] + public static void PostProcessBuildAttribute(BuildTarget target, string pathToBuildProject) + { + if (target == BuildTarget.iOS) + { + string projectPath = UnityEditor.iOS.Xcode.PBXProject.GetPBXProjectPath(pathToBuildProject); + + var pbxProject = new UnityEditor.iOS.Xcode.PBXProject(); + pbxProject.ReadFromFile(projectPath); +#if UNITY_2019_3_OR_NEWER + var targetGuid = pbxProject.GetUnityMainTargetGuid(); +#else + var targetName = PBXProject.GetUnityTargetName(); + var targetGuid = pbxProject.TargetGuidByName(targetName); +#endif + pbxProject.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO"); + pbxProject.WriteToFile(projectPath); + + var projectInString = File.ReadAllText(projectPath); + + projectInString = projectInString.Replace("ENABLE_BITCODE = YES;", + $"ENABLE_BITCODE = NO;"); + File.WriteAllText(projectPath, projectInString); + } + } +} + diff --git a/features/fixtures/minimalapp/Assets/Editor/DisablingBitcodeiOS.cs.meta b/features/fixtures/minimalapp/Assets/Editor/DisablingBitcodeiOS.cs.meta new file mode 100644 index 000000000..da5a957b0 --- /dev/null +++ b/features/fixtures/minimalapp/Assets/Editor/DisablingBitcodeiOS.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7c2c2e2275f81452f85b06b3f114f684 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/minimalapp/Assets/Scenes.meta b/features/fixtures/minimalapp/Assets/Scenes.meta new file mode 100644 index 000000000..4f9be34e6 --- /dev/null +++ b/features/fixtures/minimalapp/Assets/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f380915f856a74774a8d78abd3be28a7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/minimalapp/Assets/Scenes/SampleScene.unity b/features/fixtures/minimalapp/Assets/Scenes/SampleScene.unity new file mode 100644 index 000000000..9421266f5 --- /dev/null +++ b/features/fixtures/minimalapp/Assets/Scenes/SampleScene.unity @@ -0,0 +1,208 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &519420028 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 519420032} + - component: {fileID: 519420031} + - component: {fileID: 519420029} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &519420029 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519420028} + m_Enabled: 1 +--- !u!20 &519420031 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519420028} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 0 + m_HDR: 1 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 0 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &519420032 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519420028} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/features/fixtures/minimalapp/Assets/Scenes/SampleScene.unity.meta b/features/fixtures/minimalapp/Assets/Scenes/SampleScene.unity.meta new file mode 100644 index 000000000..c1e3c88e1 --- /dev/null +++ b/features/fixtures/minimalapp/Assets/Scenes/SampleScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2cda990e2423bbf4892e6590ba056729 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/features/fixtures/minimalapp/Dangerfile b/features/fixtures/minimalapp/Dangerfile new file mode 100644 index 000000000..f41e75934 --- /dev/null +++ b/features/fixtures/minimalapp/Dangerfile @@ -0,0 +1,27 @@ +require 'fileutils' + +apk_size = `stat -f "%z" minimal_without_bugsnag.apk`.to_i + +apk_bugsnag_size = `stat -f "%z" minimal_with_bugsnag.apk`.to_i + +ipa_size = `stat -f "%z" without_bugsnag.ipa`.to_i + +ipa_bugsnag_size = `stat -f "%z" with_bugsnag.ipa`.to_i + +calculated_sizes = { + :apk => apk_bugsnag_size - apk_size, + :ipa => ipa_bugsnag_size - ipa_size +} + +def format_kbs(size) + (size/1000.0).round(2) +end + +markdown(%Q{ + ### Build size impact + + | Format | Size impact of Bugsnag (kB) | + |------------------|-----------------------------------------------| + | IL2CPP APK | #{format_kbs(calculated_sizes[:apk])} | + | IL2CPP IPA | #{format_kbs(calculated_sizes[:ipa])} | +}) diff --git a/features/fixtures/minimalapp/ProjectSettings/AudioManager.asset b/features/fixtures/minimalapp/ProjectSettings/AudioManager.asset new file mode 100644 index 000000000..27287fec5 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/AudioManager.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!11 &1 +AudioManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Volume: 1 + Rolloff Scale: 1 + Doppler Factor: 1 + Default Speaker Mode: 2 + m_SampleRate: 0 + m_DSPBufferSize: 1024 + m_VirtualVoiceCount: 512 + m_RealVoiceCount: 32 + m_SpatializerPlugin: + m_AmbisonicDecoderPlugin: + m_DisableAudio: 0 + m_VirtualizeEffects: 1 + m_RequestedDSPBufferSize: 0 diff --git a/features/fixtures/minimalapp/ProjectSettings/ClusterInputManager.asset b/features/fixtures/minimalapp/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 000000000..e7886b266 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/features/fixtures/minimalapp/ProjectSettings/DynamicsManager.asset b/features/fixtures/minimalapp/ProjectSettings/DynamicsManager.asset new file mode 100644 index 000000000..72d14303c --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/DynamicsManager.asset @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!55 &1 +PhysicsManager: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_Gravity: {x: 0, y: -9.81, z: 0} + m_DefaultMaterial: {fileID: 0} + m_BounceThreshold: 2 + m_DefaultMaxDepenetrationVelocity: 10 + m_SleepThreshold: 0.005 + m_DefaultContactOffset: 0.01 + m_DefaultSolverIterations: 6 + m_DefaultSolverVelocityIterations: 1 + m_QueriesHitBackfaces: 0 + m_QueriesHitTriggers: 1 + m_EnableAdaptiveForce: 0 + m_ClothInterCollisionDistance: 0.1 + m_ClothInterCollisionStiffness: 0.2 + m_ContactsGeneration: 1 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_AutoSimulation: 1 + m_AutoSyncTransforms: 0 + m_ReuseCollisionCallbacks: 1 + m_ClothInterCollisionSettingsToggle: 0 + m_ClothGravity: {x: 0, y: -9.81, z: 0} + m_ContactPairsMode: 0 + m_BroadphaseType: 0 + m_WorldBounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 250, y: 250, z: 250} + m_WorldSubdivisions: 8 + m_FrictionType: 0 + m_EnableEnhancedDeterminism: 0 + m_EnableUnifiedHeightmaps: 1 + m_SolverType: 0 + m_DefaultMaxAngularSpeed: 50 diff --git a/features/fixtures/minimalapp/ProjectSettings/EditorBuildSettings.asset b/features/fixtures/minimalapp/ProjectSettings/EditorBuildSettings.asset new file mode 100644 index 000000000..82ab0f591 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/EditorBuildSettings.asset @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1045 &1 +EditorBuildSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Scenes: + - enabled: 1 + path: Assets/Scenes/SampleScene.unity + guid: 2cda990e2423bbf4892e6590ba056729 + m_configObjects: {} diff --git a/features/fixtures/minimalapp/ProjectSettings/EditorSettings.asset b/features/fixtures/minimalapp/ProjectSettings/EditorSettings.asset new file mode 100644 index 000000000..fa3ed4943 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/EditorSettings.asset @@ -0,0 +1,40 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!159 &1 +EditorSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_SerializationMode: 2 + m_LineEndingsForNewScripts: 0 + m_DefaultBehaviorMode: 1 + m_PrefabRegularEnvironment: {fileID: 0} + m_PrefabUIEnvironment: {fileID: 0} + m_SpritePackerMode: 4 + m_SpritePackerPaddingPower: 1 + m_EtcTextureCompressorBehavior: 1 + m_EtcTextureFastCompressor: 1 + m_EtcTextureNormalCompressor: 2 + m_EtcTextureBestCompressor: 4 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp + m_ProjectGenerationRootNamespace: + m_EnableTextureStreamingInEditMode: 1 + m_EnableTextureStreamingInPlayMode: 1 + m_AsyncShaderCompilation: 1 + m_CachingShaderPreprocessor: 1 + m_PrefabModeAllowAutoSave: 1 + m_EnterPlayModeOptionsEnabled: 0 + m_EnterPlayModeOptions: 3 + m_GameObjectNamingDigits: 1 + m_GameObjectNamingScheme: 0 + m_AssetNamingUsesSpace: 1 + m_UseLegacyProbeSampleCount: 0 + m_SerializeInlineMappingsOnOneLine: 1 + m_DisableCookiesInLightmapper: 1 + m_AssetPipelineMode: 1 + m_CacheServerMode: 0 + m_CacheServerEndpoint: + m_CacheServerNamespacePrefix: default + m_CacheServerEnableDownload: 1 + m_CacheServerEnableUpload: 1 + m_CacheServerEnableAuth: 0 + m_CacheServerEnableTls: 0 diff --git a/features/fixtures/minimalapp/ProjectSettings/GraphicsSettings.asset b/features/fixtures/minimalapp/ProjectSettings/GraphicsSettings.asset new file mode 100644 index 000000000..c165afb2a --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/GraphicsSettings.asset @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_LegacyDeferred: + m_Mode: 1 + m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_VideoShadersIncludeMode: 2 + m_AlwaysIncludedShaders: + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_CustomRenderPipeline: {fileID: 0} + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 0, z: 1} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_LightsUseLinearIntensity: 0 + m_LightsUseColorTemperature: 0 + m_DefaultRenderingLayerMask: 1 + m_LogWhenShaderIsCompiled: 0 diff --git a/features/fixtures/minimalapp/ProjectSettings/InputManager.asset b/features/fixtures/minimalapp/ProjectSettings/InputManager.asset new file mode 100644 index 000000000..b16147e95 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/InputManager.asset @@ -0,0 +1,487 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!13 &1 +InputManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Axes: + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: a + altPositiveButton: d + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: s + altPositiveButton: w + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: mouse 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: mouse 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: mouse 2 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: space + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse ScrollWheel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 2 + joyNum: 0 + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 1 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: enter + altNegativeButton: + altPositiveButton: space + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Cancel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Enable Debug Button 1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: joystick button 8 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Enable Debug Button 2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: backspace + altNegativeButton: + altPositiveButton: joystick button 9 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Reset + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Next + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: page down + altNegativeButton: + altPositiveButton: joystick button 5 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Previous + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: page up + altNegativeButton: + altPositiveButton: joystick button 4 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Validate + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Persistent + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: right shift + altNegativeButton: + altPositiveButton: joystick button 2 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Multiplier + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: joystick button 3 + gravity: 0 + dead: 0 + sensitivity: 0 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 2 + axis: 6 + joyNum: 0 + - serializedVersion: 3 + m_Name: Debug Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 2 + axis: 5 + joyNum: 0 diff --git a/features/fixtures/minimalapp/ProjectSettings/NavMeshAreas.asset b/features/fixtures/minimalapp/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 000000000..ad2654e02 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/NavMeshAreas.asset @@ -0,0 +1,93 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!126 &1 +NavMeshProjectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + areas: + - name: Walkable + cost: 1 + - name: Not Walkable + cost: 1 + - name: Jump + cost: 2 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + m_LastAgentTypeID: -887442657 + m_Settings: + - serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.75 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_SettingNames: + - Humanoid diff --git a/features/fixtures/minimalapp/ProjectSettings/NetworkManager.asset b/features/fixtures/minimalapp/ProjectSettings/NetworkManager.asset new file mode 100644 index 000000000..5dc6a831d --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/NetworkManager.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!149 &1 +NetworkManager: + m_ObjectHideFlags: 0 + m_DebugLevel: 0 + m_Sendrate: 15 + m_AssetToPrefab: {} diff --git a/features/fixtures/minimalapp/ProjectSettings/PackageManagerSettings.asset b/features/fixtures/minimalapp/ProjectSettings/PackageManagerSettings.asset new file mode 100644 index 000000000..b3a65dda6 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/PackageManagerSettings.asset @@ -0,0 +1,44 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_EnablePreReleasePackages: 0 + m_EnablePackageDependencies: 0 + m_AdvancedSettingsExpanded: 1 + m_ScopedRegistriesSettingsExpanded: 1 + m_SeeAllPackageVersions: 0 + oneTimeWarningShown: 0 + m_Registries: + - m_Id: main + m_Name: + m_Url: https://packages.unity.com + m_Scopes: [] + m_IsDefault: 1 + m_Capabilities: 7 + m_UserSelectedRegistryName: + m_UserAddingNewScopedRegistry: 0 + m_RegistryInfoDraft: + m_ErrorMessage: + m_Original: + m_Id: + m_Name: + m_Url: + m_Scopes: [] + m_IsDefault: 0 + m_Capabilities: 0 + m_Modified: 0 + m_Name: + m_Url: + m_Scopes: + - + m_SelectedScopeIndex: 0 diff --git a/features/fixtures/minimalapp/ProjectSettings/Physics2DSettings.asset b/features/fixtures/minimalapp/ProjectSettings/Physics2DSettings.asset new file mode 100644 index 000000000..6cfcddaac --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/Physics2DSettings.asset @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!19 &1 +Physics2DSettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_Gravity: {x: 0, y: -9.81} + m_DefaultMaterial: {fileID: 0} + m_VelocityIterations: 8 + m_PositionIterations: 3 + m_VelocityThreshold: 1 + m_MaxLinearCorrection: 0.2 + m_MaxAngularCorrection: 8 + m_MaxTranslationSpeed: 100 + m_MaxRotationSpeed: 360 + m_BaumgarteScale: 0.2 + m_BaumgarteTimeOfImpactScale: 0.75 + m_TimeToSleep: 0.5 + m_LinearSleepTolerance: 0.01 + m_AngularSleepTolerance: 2 + m_DefaultContactOffset: 0.01 + m_JobOptions: + serializedVersion: 2 + useMultithreading: 0 + useConsistencySorting: 0 + m_InterpolationPosesPerJob: 100 + m_NewContactsPerJob: 30 + m_CollideContactsPerJob: 100 + m_ClearFlagsPerJob: 200 + m_ClearBodyForcesPerJob: 200 + m_SyncDiscreteFixturesPerJob: 50 + m_SyncContinuousFixturesPerJob: 50 + m_FindNearestContactsPerJob: 100 + m_UpdateTriggerContactsPerJob: 100 + m_IslandSolverCostThreshold: 100 + m_IslandSolverBodyCostScale: 1 + m_IslandSolverContactCostScale: 10 + m_IslandSolverJointCostScale: 10 + m_IslandSolverBodiesPerJob: 50 + m_IslandSolverContactsPerJob: 50 + m_SimulationMode: 0 + m_QueriesHitTriggers: 1 + m_QueriesStartInColliders: 1 + m_CallbacksOnDisable: 1 + m_ReuseCollisionCallbacks: 1 + m_AutoSyncTransforms: 0 + m_AlwaysShowColliders: 0 + m_ShowColliderSleep: 1 + m_ShowColliderContacts: 0 + m_ShowColliderAABB: 0 + m_ContactArrowScale: 0.2 + m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} + m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} + m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} + m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/features/fixtures/minimalapp/ProjectSettings/PresetManager.asset b/features/fixtures/minimalapp/ProjectSettings/PresetManager.asset new file mode 100644 index 000000000..67a94daef --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/PresetManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1386491679 &1 +PresetManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_DefaultPresets: {} diff --git a/features/fixtures/minimalapp/ProjectSettings/ProjectSettings.asset b/features/fixtures/minimalapp/ProjectSettings/ProjectSettings.asset new file mode 100644 index 000000000..138c2a96d --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/ProjectSettings.asset @@ -0,0 +1,761 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!129 &1 +PlayerSettings: + m_ObjectHideFlags: 0 + serializedVersion: 23 + productGUID: a8621cb7a087c47ee8e9262191ec10b2 + AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 + AndroidEnableSustainedPerformanceMode: 0 + defaultScreenOrientation: 4 + targetDevice: 2 + useOnDemandResources: 0 + accelerometerFrequency: 60 + companyName: DefaultCompany + productName: minimalapp + defaultCursor: {fileID: 0} + cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} + m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} + defaultScreenWidth: 1920 + defaultScreenHeight: 1080 + defaultScreenWidthWeb: 960 + defaultScreenHeightWeb: 600 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 0 + m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 + iosShowActivityIndicatorOnLoading: -1 + androidShowActivityIndicatorOnLoading: -1 + iosUseCustomAppBackgroundBehavior: 0 + iosAllowHTTPDownload: 1 + allowedAutorotateToPortrait: 1 + allowedAutorotateToPortraitUpsideDown: 1 + allowedAutorotateToLandscapeRight: 1 + allowedAutorotateToLandscapeLeft: 1 + useOSAutorotation: 1 + use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 + disableDepthAndStencilBuffers: 0 + androidStartInFullscreen: 1 + androidRenderOutsideSafeArea: 1 + androidUseSwappy: 1 + androidBlitType: 0 + androidResizableWindow: 0 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 + defaultIsNativeResolution: 1 + macRetinaSupport: 1 + runInBackground: 0 + captureSingleScreen: 0 + muteOtherAudioSources: 0 + Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 + submitAnalytics: 1 + usePlayerLog: 1 + bakeCollisionMeshes: 0 + forceSingleInstance: 0 + useFlipModelSwapchain: 1 + resizableWindow: 0 + useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games + gpuSkinning: 0 + xboxPIXTextureCapture: 0 + xboxEnableAvatar: 0 + xboxEnableKinect: 0 + xboxEnableKinectAutoTracking: 0 + xboxEnableFitness: 0 + visibleInBackground: 1 + allowFullscreenSwitch: 1 + fullscreenMode: 1 + xboxSpeechDB: 0 + xboxEnableHeadOrientation: 0 + xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + xboxOneResolution: 0 + xboxOneSResolution: 0 + xboxOneXResolution: 3 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOneEnableTypeOptimization: 0 + xboxOnePresentImmediateThreshold: 0 + switchQueueCommandMemory: 1048576 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + stadiaPresentMode: 0 + stadiaTargetFramerate: 0 + vulkanNumSwapchainBuffers: 3 + vulkanEnableSetSRGBWrite: 0 + vulkanEnablePreTransform: 0 + vulkanEnableLateAcquireNextImage: 0 + vulkanEnableCommandBufferRecycling: 1 + m_SupportedAspectRatios: + 4:3: 1 + 5:4: 1 + 16:10: 1 + 16:9: 1 + Others: 1 + bundleVersion: 1.0 + preloadedAssets: [] + metroInputSource: 0 + wsaTransparentSwapchain: 0 + m_HolographicPauseOnTrackingLoss: 1 + xboxOneDisableKinectGpuReservation: 1 + xboxOneEnable7thCore: 1 + vrSettings: + enable360StereoCapture: 0 + isWsaHolographicRemotingEnabled: 0 + enableFrameTimingStats: 0 + useHDRDisplay: 0 + D3DHDRBitDepth: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 30 + resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 + applicationIdentifier: + Standalone: com.DefaultCompany.2DProject + buildNumber: + Standalone: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 1 + AndroidBundleVersionCode: 1 + AndroidMinSdkVersion: 19 + AndroidTargetSdkVersion: 0 + AndroidPreferredInstallLocation: 1 + aotOptions: + stripEngineCode: 1 + iPhoneStrippingLevel: 0 + iPhoneScriptCallOptimization: 0 + ForceInternetPermission: 0 + ForceSDCardPermission: 0 + CreateWallpaper: 0 + APKExpansionFiles: 0 + keepLoadedShadersAlive: 0 + StripUnusedMeshComponents: 0 + VertexChannelCompressionMask: 4054 + iPhoneSdkVersion: 988 + iOSTargetOSVersionString: 11.0 + tvOSSdkVersion: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 11.0 + uIPrerenderedIcon: 0 + uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 + uIStatusBarHidden: 1 + uIExitOnSuspend: 0 + uIStatusBarStyle: 0 + appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] + tvOSLargeIconLayers: [] + tvOSLargeIconLayers2x: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] + tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] + iOSLaunchScreenType: 0 + iOSLaunchScreenPortrait: {fileID: 0} + iOSLaunchScreenLandscape: {fileID: 0} + iOSLaunchScreenBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreenFillPct: 100 + iOSLaunchScreenSize: 100 + iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 + appleDeveloperTeamID: 7W9PZ27Y5F + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + iOSManualSigningProvisioningProfileType: 0 + tvOSManualSigningProvisioningProfileType: 0 + appleEnableAutomaticSigning: 1 + iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 + appleEnableProMotion: 0 + shaderPrecisionModel: 0 + clonedFromGUID: 10ad67313f4034357812315f3c407484 + templatePackageId: com.unity.template.2d@5.0.2 + templateDefaultScene: Assets/Scenes/SampleScene.unity + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomProguardFile: 0 + AndroidTargetArchitectures: 2 + AndroidTargetDevices: 0 + AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} + AndroidKeystoreName: + AndroidKeyaliasName: + AndroidBuildApkPerCpuArchitecture: 0 + AndroidTVCompatibility: 0 + AndroidIsGame: 1 + AndroidEnableTango: 0 + androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 + m_AndroidBanners: + - width: 320 + height: 180 + banner: {fileID: 0} + androidGamepadSupportLevel: 0 + chromeosInputEmulation: 1 + AndroidMinifyWithR8: 0 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 150 + m_BuildTargetIcons: [] + m_BuildTargetPlatformIcons: + - m_BuildTarget: Android + m_Icons: + - m_Textures: [] + m_Width: 432 + m_Height: 432 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 324 + m_Height: 324 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 216 + m_Height: 216 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 162 + m_Height: 162 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 108 + m_Height: 108 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 81 + m_Height: 81 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 1 + m_SubKind: + m_BuildTargetBatching: [] + m_BuildTargetGraphicsJobs: + - m_BuildTarget: MacStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: Switch + m_GraphicsJobs: 0 + - m_BuildTarget: MetroSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AppleTVSupport + m_GraphicsJobs: 0 + - m_BuildTarget: BJMSupport + m_GraphicsJobs: 0 + - m_BuildTarget: LinuxStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: PS4Player + m_GraphicsJobs: 0 + - m_BuildTarget: iOSSupport + m_GraphicsJobs: 0 + - m_BuildTarget: WindowsStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobs: 0 + - m_BuildTarget: LuminSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AndroidPlayer + m_GraphicsJobs: 0 + - m_BuildTarget: WebGLSupport + m_GraphicsJobs: 0 + m_BuildTargetGraphicsJobMode: [] + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: AndroidPlayer + m_APIs: 150000000b000000 + m_Automatic: 0 + - m_BuildTarget: iOSSupport + m_APIs: 10000000 + m_Automatic: 1 + m_BuildTargetVRSettings: [] + openGLRequireES31: 0 + openGLRequireES31AEP: 0 + openGLRequireES32: 0 + m_TemplateCustomTags: {} + mobileMTRendering: + Android: 1 + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: [] + m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetNormalMapEncoding: [] + playModeTestRunnerEnabled: 0 + runPlayModeTestAsEditModeTest: 0 + actionOnDotNetUnhandledException: 1 + enableInternalProfiler: 0 + logObjCUncaughtExceptions: 1 + enableCrashReportAPI: 0 + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + bluetoothUsageDescription: + switchNMETAOverride: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchUseGOLDLinker: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchTitleNames_15: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + switchPublisherNames_15: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchTouchScreenUsage: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchRatingsInt_12: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 + switchDataLossConfirmation: 0 + switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 + switchSupportedNpadStyles: 22 + switchNativeFsCacheSize: 32 + switchIsHoldTypeHorizontal: 0 + switchSupportedNpadCount: 8 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchPlayerConnectionEnabled: 1 + switchUseNewStyleFilepaths: 0 + switchUseLegacyFmodPriorities: 1 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 + ps4NPAgeRating: 12 + ps4NPTitleSecret: + ps4NPTrophyPackPath: + ps4ParentalLevel: 11 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000 + ps4Category: 0 + ps4MasterVersion: 01.00 + ps4AppVersion: 01.00 + ps4AppType: 0 + ps4ParamSfxPath: + ps4VideoOutPixelFormat: 0 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 60 + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: + ps4NPtitleDatPath: + ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 + ps4EnterButtonAssignment: 2 + ps4ApplicationParam1: 0 + ps4ApplicationParam2: 0 + ps4ApplicationParam3: 0 + ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 + ps4Passcode: bi9UOuSpM2Tlh01vOzwvSikHFswuzleh + ps4pnSessions: 1 + ps4pnPresence: 1 + ps4pnFriends: 1 + ps4pnGameCustomData: 1 + playerPrefsSupport: 0 + enableApplicationExit: 0 + resetTempFolder: 1 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 2 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 + ps4GPU800MHz: 1 + ps4attribEyeToEyeDistanceSettingVR: 0 + ps4IncludedModules: [] + ps4attribVROutputEnabled: 0 + monoEnv: + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 + spritePackerPolicy: + webGLMemorySize: 32 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLDataCaching: 1 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLCompressionFormat: 0 + webGLWasmArithmeticExceptions: 0 + webGLLinkerTarget: 1 + webGLThreadsSupport: 0 + webGLDecompressionFallback: 0 + scriptingDefineSymbols: + 1: BUGSNAG_PERFORMANCE + 4: BUGSNAG_PERFORMANCE + 7: BUGSNAG_PERFORMANCE + 13: BUGSNAG_PERFORMANCE + additionalCompilerArguments: {} + platformArchitecture: {} + scriptingBackend: + Android: 1 + il2cppCompilerConfiguration: {} + managedStrippingLevel: {} + incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 + allowUnsafeCode: 0 + useDeterministicCompilation: 1 + useReferenceAssemblies: 1 + enableRoslynAnalyzers: 1 + additionalIl2CppArgs: + scriptingRuntimeVersion: 1 + gcIncremental: 1 + assemblyVersionValidation: 1 + gcWBarrierValidation: 0 + apiCompatibilityLevelPerPlatform: {} + m_RenderingPath: 1 + m_MobileRenderingPath: 1 + metroPackageName: 2D_BuiltInRenderer + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: + metroCertificateNotAfter: 0000000000000000 + metroApplicationDescription: 2D_BuiltInRenderer + wsaImages: {} + metroTileShortName: + metroTileShowName: 0 + metroMediumTileShowName: 0 + metroLargeTileShowName: 0 + metroWideTileShowName: 0 + metroSupportStreamingInstall: 0 + metroLastRequiredScene: 0 + metroDefaultTileSize: 1 + metroTileForegroundText: 2 + metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} + metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} + metroSplashScreenUseBackgroundColor: 0 + platformCapabilities: {} + metroTargetDeviceFamilies: {} + metroFTAName: + metroFTAFileTypes: [] + metroProtocolName: + vcxProjDefaultLanguage: + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: + XboxOneVersion: 1.0.0.0 + XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 + XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} + XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 + XboxOneEnableGPUVariability: 1 + XboxOneSockets: {} + XboxOneSplashScreen: {fileID: 0} + XboxOneAllowedProductIds: [] + XboxOnePersistentLocalStorageSize: 0 + XboxOneXTitleMemory: 8 + XboxOneOverrideIdentityName: + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} + cloudServicesEnabled: {} + luminIcon: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: + luminCert: + m_CertPath: + m_SignPackage: 1 + luminIsChannelApp: 0 + luminVersion: + m_VersionCode: 1 + m_VersionName: + apiCompatibilityLevel: 6 + activeInputHandler: 0 + windowsGamepadBackendHint: 0 + cloudProjectId: + framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] + projectName: + organizationId: + cloudEnabled: 0 + legacyClampBlendShapeWeights: 0 + virtualTexturingSupportEnabled: 0 diff --git a/features/fixtures/minimalapp/ProjectSettings/ProjectVersion.txt b/features/fixtures/minimalapp/ProjectSettings/ProjectVersion.txt new file mode 100644 index 000000000..da76706d2 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/ProjectVersion.txt @@ -0,0 +1,2 @@ +m_EditorVersion: 2020.3.48f1 +m_EditorVersionWithRevision: 2020.3.48f1 (b805b124c6b7) diff --git a/features/fixtures/minimalapp/ProjectSettings/QualitySettings.asset b/features/fixtures/minimalapp/ProjectSettings/QualitySettings.asset new file mode 100644 index 000000000..bcd670653 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/QualitySettings.asset @@ -0,0 +1,239 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!47 &1 +QualitySettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_CurrentQuality: 5 + m_QualitySettings: + - serializedVersion: 2 + name: Very Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 15 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 1 + textureQuality: 1 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.3 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 2 + textureQuality: 0 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.4 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 16 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Medium + pixelLightCount: 1 + shadows: 1 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 1 + lodBias: 0.7 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 64 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: High + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 256 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Very High + pixelLightCount: 3 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 70 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 4 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1.5 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 1024 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Ultra + pixelLightCount: 4 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 4 + shadowDistance: 150 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 255 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 2 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4096 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + m_PerPlatformDefaultQuality: + Android: 2 + Lumin: 5 + GameCoreScarlett: 5 + GameCoreXboxOne: 5 + Nintendo Switch: 5 + PS4: 5 + PS5: 5 + Stadia: 5 + Standalone: 5 + WebGL: 3 + Windows Store Apps: 5 + XboxOne: 5 + iPhone: 2 + tvOS: 2 diff --git a/features/fixtures/minimalapp/ProjectSettings/TagManager.asset b/features/fixtures/minimalapp/ProjectSettings/TagManager.asset new file mode 100644 index 000000000..1c92a7840 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/TagManager.asset @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!78 &1 +TagManager: + serializedVersion: 2 + tags: [] + layers: + - Default + - TransparentFX + - Ignore Raycast + - + - Water + - UI + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + m_SortingLayers: + - name: Default + uniqueID: 0 + locked: 0 diff --git a/features/fixtures/minimalapp/ProjectSettings/TimeManager.asset b/features/fixtures/minimalapp/ProjectSettings/TimeManager.asset new file mode 100644 index 000000000..558a017e1 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/TimeManager.asset @@ -0,0 +1,9 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!5 &1 +TimeManager: + m_ObjectHideFlags: 0 + Fixed Timestep: 0.02 + Maximum Allowed Timestep: 0.33333334 + m_TimeScale: 1 + Maximum Particle Timestep: 0.03 diff --git a/features/fixtures/minimalapp/ProjectSettings/UnityConnectSettings.asset b/features/fixtures/minimalapp/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 000000000..a88bee0f1 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 1 + m_Enabled: 0 + m_TestMode: 0 + m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events + m_EventUrl: https://cdp.cloud.unity3d.com/v1/events + m_ConfigUrl: https://config.uca.cloud.unity3d.com + m_DashboardUrl: https://dashboard.unity3d.com + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com + m_Enabled: 0 + m_LogBufferSize: 10 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 0 + m_TestMode: 0 + m_InitializeOnStartup: 1 + m_PackageRequiringCoreStatsPresent: 0 + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/features/fixtures/minimalapp/ProjectSettings/VFXManager.asset b/features/fixtures/minimalapp/ProjectSettings/VFXManager.asset new file mode 100644 index 000000000..46f38e16e --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/VFXManager.asset @@ -0,0 +1,14 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!937362698 &1 +VFXManager: + m_ObjectHideFlags: 0 + m_IndirectShader: {fileID: 0} + m_CopyBufferShader: {fileID: 0} + m_SortShader: {fileID: 0} + m_StripUpdateShader: {fileID: 0} + m_RenderPipeSettingsPath: + m_FixedTimeStep: 0.016666668 + m_MaxDeltaTime: 0.05 + m_CompiledVersion: 0 + m_RuntimeVersion: 0 diff --git a/features/fixtures/minimalapp/ProjectSettings/VersionControlSettings.asset b/features/fixtures/minimalapp/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 000000000..dca288142 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/features/fixtures/minimalapp/ProjectSettings/XRSettings.asset b/features/fixtures/minimalapp/ProjectSettings/XRSettings.asset new file mode 100644 index 000000000..482590c19 --- /dev/null +++ b/features/fixtures/minimalapp/ProjectSettings/XRSettings.asset @@ -0,0 +1,10 @@ +{ + "m_SettingKeys": [ + "VR Device Disabled", + "VR Device User Alert" + ], + "m_SettingValues": [ + "False", + "False" + ] +} \ No newline at end of file diff --git a/features/fixtures/minimalapp/gemfile b/features/fixtures/minimalapp/gemfile new file mode 100644 index 000000000..8fc108320 --- /dev/null +++ b/features/fixtures/minimalapp/gemfile @@ -0,0 +1 @@ +gem "danger", "~> 9" \ No newline at end of file diff --git a/features/ios/ios_callbacks.feature b/features/ios/ios_callbacks.feature index a6332e03f..ebc6122e2 100644 --- a/features/ios/ios_callbacks.feature +++ b/features/ios/ios_callbacks.feature @@ -50,6 +50,10 @@ Feature: Callbacks And the event "device.osVersion" equals "Custom OsVersion" And the event "device.runtimeVersions.scoop" equals "dewoop" And the event "device.orientation" equals "Custom Orientation" + And the event "device.modelNumber" equals "Custom ModelNumber" + And the event "device.totalMemory" equals 999 + + # Breadcrumbs And the event "breadcrumbs.0.name" equals "Custom Message" diff --git a/features/ios/ios_native_errors.feature b/features/ios/ios_native_errors.feature index f5f011332..1a1ebd2fc 100644 --- a/features/ios/ios_native_errors.feature +++ b/features/ios/ios_native_errors.feature @@ -8,8 +8,7 @@ Feature: iOS Native Errors And I wait for 2 seconds And On Mobile I relaunch the app And I run the game in the "StartSDKDefault" state - And I wait to receive an error - And the exception "message" equals "The app was likely terminated by the operating system while in the foreground" + And I should receive no errors Scenario: Last Run Info When I run the game in the "IosNativeException" state @@ -22,6 +21,7 @@ Feature: iOS Native Errors And I discard the oldest error And the exception "message" equals "Last Run Info Correct" + @skip_unity_2018 Scenario: iOS native exception Smoke Test When I run the game in the "IosNativeException" state And I wait for 2 seconds @@ -60,6 +60,7 @@ Feature: iOS Native Errors And the error payload field "events.0.usage.config" is not null And the error payload field "events.0.usage.callbacks.onSession" equals 1 + @skip_unity_2018 Scenario: iOS signal Smoke Test When I run the game in the "IosSignal" state And I wait for 2 seconds diff --git a/features/scripts/build_android.sh b/features/scripts/build_android.sh index e9c2105ea..0fcad6229 100755 --- a/features/scripts/build_android.sh +++ b/features/scripts/build_android.sh @@ -1,12 +1,20 @@ #!/usr/bin/env bash -if [ -z "$UNITY_PATH" ] +if [ -z "$UNITY_VERSION" ] then - echo "UNITY_PATH must be set, to e.g. /Applications/Unity/Hub/Editor/2018.4.36f1/Unity.app/Contents/MacOS" + echo "UNITY_VERSION must be set" exit 1 fi -echo "\`which Unity\`=`which Unity`" +if [ -z "$1" ] +then + echo "Build type must be specified: 'release' or 'dev'" + exit 1 +fi + +BUILD_TYPE=$1 + +UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS" pushd "${0%/*}" script_path=`pwd` @@ -15,14 +23,26 @@ popd pushd "$script_path/../fixtures" # Run unity and immediately exit afterwards, log all output -DEFAULT_CLI_ARGS="-quit -batchmode -nographics -logFile unity.log" +DEFAULT_CLI_ARGS="-quit -batchmode -nographics -logFile build_android_apk.log" project_path=`pwd`/maze_runner -# Build for Android +if [ "$BUILD_TYPE" == "dev" ]; then + BUILD_METHOD="Builder.AndroidDev" + OUTPUT_APK="mazerunner_dev.apk" + RENAMED_APK="mazerunner_dev_${UNITY_VERSION:0:4}.apk" +elif [ "$BUILD_TYPE" == "release" ]; then + BUILD_METHOD="Builder.AndroidRelease" + OUTPUT_APK="mazerunner.apk" + RENAMED_APK="mazerunner_${UNITY_VERSION:0:4}.apk" +else + echo "Invalid build type specified: 'release' or 'dev' only" + exit 1 +fi -$UNITY_PATH/Unity $DEFAULT_CLI_ARGS -projectPath $project_path -executeMethod Builder.AndroidBuild +# Build for Android +$UNITY_PATH/Unity $DEFAULT_CLI_ARGS -projectPath $project_path -executeMethod $BUILD_METHOD RESULT=$? if [ $RESULT -ne 0 ]; then exit $RESULT; fi -mv $project_path/mazerunner.apk $project_path/mazerunner_$UNITY_VERSION.apk +mv $project_path/$OUTPUT_APK $project_path/$RENAMED_APK diff --git a/features/scripts/build_edm.sh b/features/scripts/build_edm.sh index 31bff0b80..a80241c92 100755 --- a/features/scripts/build_edm.sh +++ b/features/scripts/build_edm.sh @@ -41,4 +41,4 @@ $UNITY_PATH/Unity $DEFAULT_CLI_ARGS -buildTarget Android -logFile $script_path/b RESULT=$? if [ $RESULT -ne 0 ]; then exit $RESULT; fi - mv $project_path/edm.apk $project_path/edm_$UNITY_VERSION.apk + mv $project_path/edm.apk $project_path/edm_${UNITY_VERSION:0:4}.apk diff --git a/features/scripts/build_ios.sh b/features/scripts/build_ios.sh index fc8a7076c..bece9a7b1 100755 --- a/features/scripts/build_ios.sh +++ b/features/scripts/build_ios.sh @@ -1,5 +1,19 @@ #!/usr/bin/env bash +if [ -z "$UNITY_VERSION" ] +then + echo "UNITY_VERSION must be set" + exit 1 +fi + +if [ -z "$1" ] +then + echo "Build type must be specified: 'release' or 'dev'" + exit 1 +fi + +BUILD_TYPE=$1 + pushd "${0%/*}" script_path=`pwd` popd @@ -9,8 +23,19 @@ project_path=`pwd`/maze_runner # Clean any previous builds find $project_path/output/ -name "*.ipa" -exec rm '{}' \; +if [ "$BUILD_TYPE" == "dev" ]; then + XCODE_PROJECT="mazerunner_dev_xcode/Unity-iPhone.xcodeproj" + OUTPUT_IPA="mazerunner_dev_${UNITY_VERSION:0:4}.ipa" +elif [ "$BUILD_TYPE" == "release" ]; then + XCODE_PROJECT="mazerunner_xcode/Unity-iPhone.xcodeproj" + OUTPUT_IPA="mazerunner_${UNITY_VERSION:0:4}.ipa" +else + echo "Invalid build type specified: 'release' or 'dev' only" + exit 1 +fi + # Archive and export the project -xcrun xcodebuild -project $project_path/mazerunner_xcode/Unity-iPhone.xcodeproj \ +xcrun xcodebuild -project $project_path/$XCODE_PROJECT \ -scheme Unity-iPhone \ -configuration Debug \ -archivePath $project_path/archive/Unity-iPhone.xcarchive \ @@ -38,4 +63,4 @@ if [ $? -ne 0 ]; then fi # Move to known location for running (note - the name of the .ipa differs between Xcode versions) -find $project_path/output/ -name "*.ipa" -exec mv '{}' $project_path/mazerunner_$UNITY_VERSION.ipa \; +find $project_path/output/ -name "*.ipa" -exec mv '{}' $project_path/$OUTPUT_IPA \; diff --git a/features/scripts/build_maze_runner.sh b/features/scripts/build_maze_runner.sh index 73fcfdece..6bcce3ac4 100755 --- a/features/scripts/build_maze_runner.sh +++ b/features/scripts/build_maze_runner.sh @@ -5,31 +5,50 @@ if [ -z "$UNITY_VERSION" ]; then exit 1 fi -if [[ $# != 1 ]]; then - echo "Build platform (macos/webgl/windows) must be passed as a parameter" +if [[ $# != 2 ]]; then + echo "Build type (release/dev) and platform (macos/webgl/windows/wsl) must be passed as parameters" exit 2 fi -if [ "$1" == "macos" ]; then - PLATFORM="MacOS" +BUILD_TYPE=$1 +PLATFORM_TYPE=$2 + +if [ "$PLATFORM_TYPE" == "macos" ]; then + if [ "$BUILD_TYPE" == "release" ]; then + PLATFORM="MacOSRelease" + else + PLATFORM="MacOSDev" + fi UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity" -elif [ "$1" == "windows" ]; then - PLATFORM="Win64" +elif [ "$PLATFORM_TYPE" == "windows" ]; then + if [ "$BUILD_TYPE" == "release" ]; then + PLATFORM="Win64Release" + else + PLATFORM="Win64Dev" + fi set -m UNITY_PATH="/c/Program Files/Unity/Hub/Editor/$UNITY_VERSION/Editor/Unity.exe" -elif [ "$1" == "wsl" ]; then - PLATFORM="Win64" +elif [ "$PLATFORM_TYPE" == "wsl" ]; then + if [ "$BUILD_TYPE" == "release" ]; then + PLATFORM="Win64Release" + else + PLATFORM="Win64Dev" + fi set -m UNITY_PATH="/mnt/c/Program Files/Unity/Hub/Editor/$UNITY_VERSION/Editor/Unity.exe" -elif [ "$1" == "webgl" ]; then - PLATFORM="WebGL" +elif [ "$PLATFORM_TYPE" == "webgl" ]; then + if [ "$BUILD_TYPE" == "release" ]; then + PLATFORM="WebGLRelease" + else + PLATFORM="WebGLDev" + fi if [ "$(uname)" == "Darwin" ]; then UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity" else UNITY_PATH="/c/Program Files/Unity/Hub/Editor/$UNITY_VERSION/Editor/Unity.exe" fi else - echo "Unsupported platform: $1" + echo "Unsupported platform: $PLATFORM_TYPE" exit 3 fi @@ -46,7 +65,7 @@ pushd $SCRIPT_DIR package_path="$root_path/Bugsnag.unitypackage" project_path="$root_path/features/fixtures/maze_runner" - if [ "$1" == "wsl" ]; then + if [ "$PLATFORM_TYPE" == "wsl" ]; then # Solves an issue on WSL were wslpath fails if the file does not exist. if [ ! -f "$import_log_file" ]; then touch $import_log_file diff --git a/features/scripts/build_xcode_project.sh b/features/scripts/build_xcode_project.sh new file mode 100755 index 000000000..4e2c08120 --- /dev/null +++ b/features/scripts/build_xcode_project.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + + +# Check for unity version +if [ -z "$1" ] +then + echo "ERROR: No Path Set" + exit 1 +fi + +XCODE_PROJECT_PATH=$1 + +echo "Xcode Project path set to $XCODE_PROJECT_PATH" + +# Check for unity version +if [ -z "$2" ] +then + echo "ERROR: No export name Set" + exit 1 +fi + +EXPORT_NAME=$2 + + +echo "Xcode export name set to $EXPORT_NAME" + +# Clean any previous builds +find $XCODE_PROJECT_PATH/output/ -name "*.ipa" -exec rm '{}' \; + +# Archive and export the project +xcrun xcodebuild -project $XCODE_PROJECT_PATH/Unity-iPhone.xcodeproj \ + -scheme Unity-iPhone \ + -configuration Debug \ + -archivePath $XCODE_PROJECT_PATH/archive/Unity-iPhone.xcarchive \ + -allowProvisioningUpdates \ + -allowProvisioningDeviceRegistration \ + -quiet \ + GCC_WARN_INHIBIT_ALL_WARNINGS=YES \ + archive + +if [ $? -ne 0 ] +then + echo "Failed to archive project" + exit 1 +fi + +xcrun xcodebuild -exportArchive \ + -archivePath $XCODE_PROJECT_PATH/archive/Unity-iPhone.xcarchive \ + -exportPath $XCODE_PROJECT_PATH/output/ \ + -quiet \ + -exportOptionsPlist features/scripts/exportOptions.plist + +if [ $? -ne 0 ]; then + echo "Failed to export app" + exit 1 +fi + +# Move to known location for running (note - the name of the .ipa differs between Xcode versions) +find $XCODE_PROJECT_PATH/output/ -name "*.ipa" -exec mv '{}' features/fixtures/minimalapp/$EXPORT_NAME.ipa \; diff --git a/features/scripts/do_size_test.sh b/features/scripts/do_size_test.sh new file mode 100755 index 000000000..85db7acbd --- /dev/null +++ b/features/scripts/do_size_test.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +if [ -z "$UNITY_VERSION" ] +then + echo "UNITY_PERFORMANCE_VERSION must be set" + exit 1 +fi + +UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS" + +DEFAULT_CLI_ARGS="-quit -batchmode -nographics" + +project_path=features/fixtures/minimalapp + +package_path=Bugsnag.unitypackage + +imported_sdk_path="$project_path/Assets/Bugsnag" + +rm -rf "$project_path/Assets/Bugsnag" + +echo "building android without bugsnag" +$UNITY_PATH/Unity $DEFAULT_CLI_ARGS -projectPath $project_path -executeMethod Builder.BuildAndroidWithout -logFile build_android_minimal_without.log +RESULT=$? +if [ $RESULT -ne 0 ]; then exit $RESULT; fi + +echo "building ios without bugsnag" +$UNITY_PATH/Unity $DEFAULT_CLI_ARGS -projectPath $project_path -executeMethod Builder.BuildIosWithout -logFile export_ios_xcode_project_minimal_without.log +RESULT=$? +if [ $RESULT -ne 0 ]; then exit $RESULT; fi + +source ./features/scripts/build_xcode_project.sh features/fixtures/minimalapp/minimal_without_xcode without_bugsnag + +ls + +mv -f $package_path $project_path + +$UNITY_PATH/Unity $DEFAULT_CLI_ARGS \ + -projectPath $project_path \ + -ignoreCompilerErrors \ + -importPackage $package_path +RESULT=$? +if [ $RESULT -ne 0 ]; then exit $RESULT; fi + + +echo "building android with bugsnag" +$UNITY_PATH/Unity $DEFAULT_CLI_ARGS -projectPath $project_path -executeMethod Builder.BuildAndroidWith -logFile build_android_minimal_with.log +RESULT=$? +if [ $RESULT -ne 0 ]; then exit $RESULT; fi + +echo "building ios with bugsnag" +$UNITY_PATH/Unity $DEFAULT_CLI_ARGS -projectPath $project_path -executeMethod Builder.BuildIosWith -logFile export_ios_xcode_project_minimal_with.log +RESULT=$? +if [ $RESULT -ne 0 ]; then exit $RESULT; fi +ls + +source ./features/scripts/build_xcode_project.sh features/fixtures/minimalapp/minimal_with_xcode with_bugsnag + +cd features/fixtures/minimalapp + +bundle install +bundle exec danger \ No newline at end of file diff --git a/features/scripts/exportOptions.plist b/features/scripts/exportOptions.plist index 5b06e7427..dc2dd0404 100644 --- a/features/scripts/exportOptions.plist +++ b/features/scripts/exportOptions.plist @@ -3,7 +3,7 @@ teamID - 372ZUL2ZB7 + 7W9PZ27Y5F stripSwiftSymbols compileBitcode diff --git a/features/scripts/generate_xcode_project.sh b/features/scripts/generate_xcode_project.sh index 2d4d46fd9..6dc9462af 100755 --- a/features/scripts/generate_xcode_project.sh +++ b/features/scripts/generate_xcode_project.sh @@ -1,12 +1,20 @@ #!/usr/bin/env bash -if [ -z "$UNITY_PATH" ] +if [ -z "$UNITY_VERSION" ] then - echo "UNITY_PATH must be set, to e.g. /Applications/Unity/Hub/Editor/2018.4.36f1/Unity.app/Contents/MacOS" + echo "UNITY_VERSION must be set" exit 1 fi -echo "\`which Unity\`=`which Unity`" +if [ -z "$1" ] +then + echo "Build type must be specified: 'release' or 'dev'" + exit 1 +fi + +BUILD_TYPE=$1 + +UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS" pushd "${0%/*}" script_path=`pwd` @@ -18,8 +26,17 @@ DEFAULT_CLI_ARGS="-quit -nographics -batchmode -logFile unity.log" project_path=`pwd`/maze_runner +if [ "$BUILD_TYPE" == "dev" ]; then + BUILD_METHOD="Builder.IosDev" +elif [ "$BUILD_TYPE" == "release" ]; then + BUILD_METHOD="Builder.IosRelease" +else + echo "Invalid build type specified: 'release' or 'dev' only" + exit 1 +fi + # Generate the Xcode project for iOS -$UNITY_PATH/Unity $DEFAULT_CLI_ARGS -projectPath $project_path -executeMethod Builder.IosBuild +$UNITY_PATH/Unity $DEFAULT_CLI_ARGS -projectPath $project_path -executeMethod $BUILD_METHOD RESULT=$? if [ $RESULT -ne 0 ]; then exit $RESULT; fi @@ -27,6 +44,6 @@ if [ $RESULT -ne 0 ]; then exit $RESULT; fi # a clean build. Building the project twice is a temporary workaround that circumnavigates what # appears to be a platform bug. # For further context see https://answers.unity.com/questions/1610105/how-to-add-compiler-or-linker-flags-for-il2cpp-inv.html -$UNITY_PATH/Unity $DEFAULT_CLI_ARGS -projectPath $project_path -executeMethod Builder.IosBuild +$UNITY_PATH/Unity $DEFAULT_CLI_ARGS -projectPath $project_path -executeMethod $BUILD_METHOD RESULT=$? if [ $RESULT -ne 0 ]; then exit $RESULT; fi diff --git a/features/scripts/prepare_fixture.sh b/features/scripts/prepare_fixture.sh index 458e224bf..fd8679bfe 100755 --- a/features/scripts/prepare_fixture.sh +++ b/features/scripts/prepare_fixture.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -if [ -z "$UNITY_PATH" ] +if [ -z "$UNITY_VERSION" ] then - echo "UNITY_PATH must be set, to e.g. /Applications/Unity/Hub/Editor/2018.4.36f1/Unity.app/Contents/MacOS" + echo "UNITY_VERSION must be set" exit 1 fi -echo "\`Unity\` executable = $UNITY_PATH/Unity" +UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS" pushd "${0%/*}" script_path=`pwd` diff --git a/features/steps/unity_steps.rb b/features/steps/unity_steps.rb index 3502876a2..aaf3c9ce2 100644 --- a/features/steps/unity_steps.rb +++ b/features/steps/unity_steps.rb @@ -1,7 +1,7 @@ require 'cgi' When('On Mobile I relaunch the app') do - next unless %w[android ios].include? Maze::Helper.get_current_platform + next unless %w[android ios].include? Maze::Helper.get_current_platform Maze.driver.launch_app sleep 3 end @@ -67,14 +67,14 @@ def execute_command(action, scenario_name = '') case platform when 'macos' # Call executable directly rather than use open, which flakes on CI - log = File.join(Dir.pwd, 'mazerunner.log') - command = "#{Maze.config.app}/Contents/MacOS/Mazerunner" + log = File.join(Dir.pwd, "#{state}-mazerunner.log") + command = "#{Maze.config.app}/Contents/MacOS/Mazerunner --args -logfile #{log} > /dev/null" Maze::Runner.run_command(command, blocking: false) execute_command('run_scenario', state) when 'windows' - win_log = File.join(Dir.pwd, 'mazerunner.log') + win_log = File.join(Dir.pwd, "#{state}-mazerunner.log") command = "#{Maze.config.app} --args -logfile #{win_log}" Maze::Runner.run_command(command, blocking: false) @@ -136,18 +136,17 @@ def check_error_reporting_api(notifier_name) Maze.config.os end - notifier_name = case os - when 'ios' - 'Unity Bugsnag Notifier' - when 'android' - 'Android Bugsnag Notifier' - else - 'Unity Bugsnag Notifier' - end + notifier_name = 'Unity Bugsnag Notifier' check_error_reporting_api notifier_name end +Then('the event "breadcrumbs.1.metaData.status" has failed') do + status = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], 'events.0.breadcrumbs.1.metaData.status') + # 500 may be returned due to browser CORs + Maze.check.true(status == 0 || status == 500, "Expected an error status of 0 or 500 but got #{status}") +end + Then('the stack frame methods should match:') do |expected_values| stacktrace = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], 'events.0.exceptions.0.stacktrace') expected_frame_values = expected_values.raw @@ -303,7 +302,7 @@ def check_error_reporting_api(notifier_name) And the event "device.totalMemory" is not null And the event "metaData.device.screenDensity" is not null And the event "metaData.device.screenResolution" is not null - And the event "metaData.device.osLanguage" equals "English" + And the event "metaData.device.osLanguage" is not null And the event "metaData.device.graphicsDeviceVersion" is not null And the event "metaData.device.graphicsMemorySize" is not null And the event "metaData.device.processorType" is not null diff --git a/features/support/env.rb b/features/support/env.rb index 9e1ee373a..f3d75ae48 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -28,6 +28,10 @@ end +Before('@ios_only') do |_scenario| + skip_this_scenario('Skipping scenario') unless Maze::Helper.get_current_platform == 'ios' +end + Before('@cocoa_only') do |_scenario| skip_this_scenario('Skipping scenario') unless Maze.config.os == 'macos' || Maze::Helper.get_current_platform == 'ios' end @@ -53,11 +57,13 @@ skip_this_scenario("Skipping scenario") if Maze::Helper.get_current_platform == 'android' end +Before('@android_only') do |_scenario| + skip_this_scenario('Skipping scenario') unless Maze::Helper.get_current_platform == 'android' +end + BeforeAll do $api_key = 'a35a2a72bd230ac0aa0f52715bbdc6aa' - Maze.config.enforce_bugsnag_integrity = false - if Maze.config.os&.downcase == 'macos' # The default macOS Crash Reporter "#{app_name} quit unexpectedly" alert grabs focus which can cause tests to flake. # This option, which appears to have been introduced in macOS 10.11, displays a notification instead of the alert. @@ -66,7 +72,20 @@ # Allow the necessary environment variables to be passed from Ubuntu (under WSL) to the Windows test fixture ENV['WSLENV'] = 'BUGSNAG_SCENARIO:BUGSNAG_APIKEY:MAZE_ENDPOINT' elsif Maze.config.browser != nil # WebGL - Maze.config.document_server_root = 'features/fixtures/maze_runner/build/WebGL/Mazerunner' + + release_path = 'features/fixtures/maze_runner/build/WebGL/Mazerunner' + dev_path = 'features/fixtures/maze_runner/build/WebGL/Mazerunner_dev' + + if File.exist?(release_path) && File.exist?(dev_path) + raise "Both webgl builds exist: #{release_path} and #{dev_path}" + elsif File.exist?(release_path) + Maze.config.document_server_root = release_path + elsif File.exist?(dev_path) + Maze.config.document_server_root = dev_path + else + raise "Neither webgl build exists: #{release_path} or #{dev_path}" + end + elsif Maze.config.os&.downcase == 'switch' maze_ip = ENV['SWITCH_MAZE_IP'] raise 'SWITCH_MAZE_IP must be set' unless maze_ip @@ -105,6 +124,14 @@ end end +Before do |scenario| + # Detect if we're running the webgl tests + if Maze.config.farm.to_s.eql?('local') + # Allows each scenario to auto retry once due to instability in the local browser + scenario.tags << Cucumber::Core::Test::Tag.new(nil, '@retry') + end +end + After do |scenario| next if scenario.status == :skipped @@ -119,6 +146,28 @@ end end +device_logs = [] +After do |scenario| + if Maze.driver && Maze.driver.is_a?(Maze::Driver::Appium) + log_file = Maze::Api::Appium::FileManager.new.read_app_file('mazerunner-unity.log') + device_logs << { + file: log_file, + scenario: scenario.name + } + end +end + +AfterAll do + maze_output = File.join(Dir.pwd, 'maze_output') + device_logs_folder = File.join(maze_output, 'device_logs') + FileUtils.makedirs(device_logs_folder) + device_logs.each do |log| + File.open(File.join(device_logs_folder, "#{log[:scenario]}.log"), 'w') do |f| + f.write(log[:file]) + end + end +end + AfterAll do case Maze::Helper.get_current_platform when 'macos' diff --git a/features/switch/switch.feature b/features/switch/switch.feature index 9152c7920..79b695aae 100644 --- a/features/switch/switch.feature +++ b/features/switch/switch.feature @@ -1,7 +1,7 @@ Feature: Switch Specific Tests Scenario: SwitchCacheType set to None - When I set the HTTP status code for the next requests to "408" + When I set the HTTP status code for the next request to 408 And I run the game in the "SwitchPersistEvent" state And I wait to receive an error And I wait for requests to persist @@ -15,7 +15,7 @@ Feature: Switch Specific Tests Then I should receive no requests Scenario: Max Cache Size - When I set the HTTP status code for the next requests to "408" + When I set the HTTP status code for the next request to 408 And I run the game in the "MaxSwitchCacheSize" state And I wait to receive 2 errors And I wait for requests to persist @@ -34,4 +34,4 @@ Feature: Switch Specific Tests And the event "app.type" equals "nintendo-switch" And the event "device.osName" equals "Nintendo Switch" And the event "device.model" equals "Switch" - And the event "device.manufacturer" equals "Nintendo" \ No newline at end of file + And the event "device.manufacturer" equals "Nintendo" diff --git a/scripts/ci-build-macos-fixture.sh b/scripts/ci-build-macos-fixture.sh new file mode 100755 index 000000000..29f6cbe00 --- /dev/null +++ b/scripts/ci-build-macos-fixture.sh @@ -0,0 +1,29 @@ +#!/bin/bash -e + +if [ -z "$UNITY_VERSION" ]; then + echo "UNITY_VERSION must be set, to e.g. 2018.4.36f1" + exit 1 +fi + +if [[ $# != 1 ]]; then + echo "Build type (release/dev) must be passed as a parameter" + exit 2 +fi + +BUILD_TYPE=$1 + +# Build the MacOS and WebGL fixtures +./features/scripts/build_maze_runner.sh $BUILD_TYPE macos + +pushd features/fixtures/maze_runner/build + zip -r MacOS-${UNITY_VERSION:0:4}.zip MacOS +popd + + +pushd features/fixtures/maze_runner/build + if [ "$BUILD_TYPE" == "release" ]; then + zip -r MacOS-release-${UNITY_VERSION:0:4}.zip MacOS + else + zip -r MacOS-dev-${UNITY_VERSION:0:4}.zip MacOS + fi +popd diff --git a/scripts/ci-build-macos-packages.sh b/scripts/ci-build-macos-packages.sh deleted file mode 100755 index b047d8a30..000000000 --- a/scripts/ci-build-macos-packages.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -e - -# Build the MacOS and WebGL fixtures -./features/scripts/build_maze_runner.sh macos -./features/scripts/build_maze_runner.sh webgl - -pushd features/fixtures/maze_runner/build - zip -r MacOS-$UNITY_VERSION.zip MacOS - zip -r WebGL-$UNITY_VERSION.zip WebGL -popd diff --git a/scripts/ci-build-webgl-fixture.sh b/scripts/ci-build-webgl-fixture.sh new file mode 100755 index 000000000..7445f41c4 --- /dev/null +++ b/scripts/ci-build-webgl-fixture.sh @@ -0,0 +1,24 @@ +#!/bin/bash -e + +if [ -z "$UNITY_VERSION" ]; then + echo "UNITY_VERSION must be set, to e.g. 2018.4.36f1" + exit 1 +fi + +if [[ $# != 1 ]]; then + echo "Build type (release/dev) must be passed as a parameter" + exit 2 +fi + +BUILD_TYPE=$1 + +# Build the WebGL fixture +./features/scripts/build_maze_runner.sh $BUILD_TYPE webgl + +pushd features/fixtures/maze_runner/build + if [ "$BUILD_TYPE" == "release" ]; then + zip -r WebGL-release-${UNITY_VERSION:0:4}.zip WebGL + else + zip -r WebGL-dev-${UNITY_VERSION:0:4}.zip WebGL + fi +popd diff --git a/scripts/ci-build-windows-fixture-wsl.sh b/scripts/ci-build-windows-fixture-wsl.sh old mode 100644 new mode 100755 index 9c4ad8cb1..63e6292e2 --- a/scripts/ci-build-windows-fixture-wsl.sh +++ b/scripts/ci-build-windows-fixture-wsl.sh @@ -1,5 +1,23 @@ #!/bin/bash -e + +if [ -z "$UNITY_VERSION" ]; then + echo "UNITY_VERSION must be set, to e.g. 2018.4.36f1" + exit 1 +fi + +if [[ $# != 1 ]]; then + echo "Build type (release/dev) must be passed as a parameter" + exit 2 +fi + +BUILD_TYPE=$1 + cd features/scripts -./build_maze_runner.sh wsl +./build_maze_runner.sh $BUILD_TYPE wsl cd ../fixtures/maze_runner/build -zip -r Windows-$UNITY_VERSION.zip Windows + +if [ "$BUILD_TYPE" == "release" ]; then + zip -r Windows-release-${UNITY_VERSION:0:4}.zip Windows +else + zip -r Windows-dev-${UNITY_VERSION:0:4}.zip Windows +fi diff --git a/scripts/ci-run-macos-tests-csharp.sh b/scripts/ci-run-macos-tests-csharp.sh deleted file mode 100644 index e59214ab6..000000000 --- a/scripts/ci-run-macos-tests-csharp.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -e -pushd features/fixtures/maze_runner/build - unzip MacOS-$UNITY_VERSION.zip -popd - -bundle install -bundle exec maze-runner --app=features/fixtures/maze_runner/build/MacOS/Mazerunner.app --os=macos features/macos features/csharp diff --git a/scripts/ci-run-macos-tests.sh b/scripts/ci-run-macos-tests.sh old mode 100644 new mode 100755 index e8a9465f4..924448cb5 --- a/scripts/ci-run-macos-tests.sh +++ b/scripts/ci-run-macos-tests.sh @@ -1,7 +1,26 @@ #!/bin/bash -e + +if [ -z "$UNITY_VERSION" ]; then + echo "UNITY_VERSION must be set, to e.g. 2018.4.36f1" + exit 1 +fi + +if [[ $# != 1 ]]; then + echo "Build type (release/dev) must be passed as a parameter" + exit 2 +fi + +BUILD_TYPE=$1 + pushd features/fixtures/maze_runner/build - unzip MacOS-$UNITY_VERSION.zip + if [ "$BUILD_TYPE" == "release" ]; then + unzip MacOS-release-${UNITY_VERSION:0:4}.zip + APP_PATH="features/fixtures/maze_runner/build/MacOS/Mazerunner.app" + else + unzip MacOS-dev-${UNITY_VERSION:0:4}.zip + APP_PATH="features/fixtures/maze_runner/build/MacOS/Mazerunner_dev.app" + fi popd bundle install -bundle exec maze-runner --app=features/fixtures/maze_runner/build/MacOS/Mazerunner.app --os=macos features/desktop +bundle exec maze-runner --app=$APP_PATH --os=macos features/macos features/csharp diff --git a/scripts/ci-run-webgl-tests.sh b/scripts/ci-run-webgl-tests.sh old mode 100644 new mode 100755 index 82fee7db1..03da2bde1 --- a/scripts/ci-run-webgl-tests.sh +++ b/scripts/ci-run-webgl-tests.sh @@ -1,7 +1,23 @@ #!/bin/bash -e +if [ -z "$UNITY_VERSION" ]; then + echo "UNITY_VERSION must be set, to e.g. 2018.4.36f1" + exit 1 +fi + +if [[ $# != 1 ]]; then + echo "Build type (release/dev) must be passed as a parameter" + exit 2 +fi + +BUILD_TYPE=$1 + pushd features/fixtures/maze_runner/build - unzip WebGL-$UNITY_VERSION.zip + if [ "$BUILD_TYPE" == "release" ]; then + unzip WebGL-release-${UNITY_VERSION:0:4}.zip + else + unzip WebGL-dev-${UNITY_VERSION:0:4}.zip + fi popd bundle install diff --git a/scripts/ci-run-windows-tests-wsl.sh b/scripts/ci-run-windows-tests-wsl.sh old mode 100644 new mode 100755 index 3caec9501..f5bdf34ce --- a/scripts/ci-run-windows-tests-wsl.sh +++ b/scripts/ci-run-windows-tests-wsl.sh @@ -1,6 +1,26 @@ #!/bin/bash -e + +if [ -z "$UNITY_VERSION" ]; then + echo "UNITY_VERSION must be set, to e.g. 2018.4.36f1" + exit 1 +fi + +if [[ $# != 1 ]]; then + echo "Build type (release/dev) must be passed as a parameter" + exit 2 +fi + +BUILD_TYPE=$1 + cd features/fixtures/maze_runner/build -unzip Windows-$UNITY_VERSION.zip +if [ "$BUILD_TYPE" == "release" ]; then + unzip Windows-release-${UNITY_VERSION:0:4}.zip + APP_PATH="features/fixtures/maze_runner/build/Windows/Mazerunner.exe" +else + unzip Windows-dev-${UNITY_VERSION:0:4}.zip + APP_PATH="features/fixtures/maze_runner/build/Windows/Mazerunner_dev.exe" +fi cd ../../../.. + bundle install -bundle exec maze-runner --app=features/fixtures/maze_runner/build/Windows/Mazerunner.exe --os=windows features/csharp +bundle exec maze-runner --app=$APP_PATH --os=windows features/csharp diff --git a/src/Assets/Bugsnag/Editor/BugsnagAddScriptingSymbol.cs b/src/Assets/Bugsnag/Editor/BugsnagAddScriptingSymbol.cs new file mode 100644 index 000000000..9f2474ce4 --- /dev/null +++ b/src/Assets/Bugsnag/Editor/BugsnagAddScriptingSymbol.cs @@ -0,0 +1,38 @@ +using UnityEditor; +using UnityEngine; +[InitializeOnLoad] +public class BugsnagAddScriptingSymbol : MonoBehaviour +{ + private const string DEFINE_SYMBOL = "BUGSNAG_UNITY_WEB_REQUEST"; + + private static BuildTargetGroup[] _supportedPlatforms = { BuildTargetGroup.Android, BuildTargetGroup.Standalone, BuildTargetGroup.iOS, BuildTargetGroup.WebGL }; + + static BugsnagAddScriptingSymbol() + { + foreach (var target in _supportedPlatforms) + { + try + { + SetScriptingSymbol(target); + } + catch + { + // Some users might not have a platform installed, in that case ignore the error + } + } + } + + static void SetScriptingSymbol(BuildTargetGroup buildTargetGroup) + { + var existingSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTargetGroup); + if (string.IsNullOrEmpty(existingSymbols)) + { + existingSymbols = DEFINE_SYMBOL; + } + else if (!existingSymbols.Contains(DEFINE_SYMBOL)) + { + existingSymbols += ";" + DEFINE_SYMBOL; + } + PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, existingSymbols); + } +} diff --git a/src/Assets/Bugsnag/Editor/BugsnagAddScriptingSymbol.cs.meta b/src/Assets/Bugsnag/Editor/BugsnagAddScriptingSymbol.cs.meta new file mode 100644 index 000000000..671526312 --- /dev/null +++ b/src/Assets/Bugsnag/Editor/BugsnagAddScriptingSymbol.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8e3c9a6b6e3c84299b5a658c6849d7ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Assets/Bugsnag/Editor/BugsnagEditor.EDM.cs b/src/Assets/Bugsnag/Editor/BugsnagEditor.EDM.cs index 04ab5e72b..47aef9c77 100644 --- a/src/Assets/Bugsnag/Editor/BugsnagEditor.EDM.cs +++ b/src/Assets/Bugsnag/Editor/BugsnagEditor.EDM.cs @@ -36,7 +36,7 @@ private static void ToggleEDM() [MenuItem(EDM_MENU_ITEM, true)] private static bool ToggleEDMValidate() { - Menu.SetChecked(EDM_MENU_ITEM, IsEDMEnabled()); + UnityEditor.Menu.SetChecked(EDM_MENU_ITEM, IsEDMEnabled()); return true; } diff --git a/src/Assets/Bugsnag/Editor/BugsnagEditor.cs b/src/Assets/Bugsnag/Editor/BugsnagEditor.cs index 4fa32982a..dc070068b 100644 --- a/src/Assets/Bugsnag/Editor/BugsnagEditor.cs +++ b/src/Assets/Bugsnag/Editor/BugsnagEditor.cs @@ -78,6 +78,9 @@ private void DrawSettingsEditorWindow() var settings = GetSettingsObject(); var so = new SerializedObject(settings); + var assemblyName = BugsnagUnity.Configuration.GetAssemblyName(); + var version = assemblyName.Version; + EditorGUILayout.LabelField($"BugSnag Unity version {version.Major}.{version.Minor}.{version.Build}"); _showBasicConfig = EditorGUILayout.Foldout(_showBasicConfig, "Basic Configuration", true); if (_showBasicConfig) @@ -164,6 +167,7 @@ private void DrawAdvancedSettings(SerializedObject so, BugsnagSettingsObject set } EditorGUILayout.PropertyField(so.FindProperty("AutoDetectErrors")); EditorGUILayout.PropertyField(so.FindProperty("AutoTrackSessions")); + EditorGUILayout.PropertyField(so.FindProperty("GenerateAnonymousId")); EditorGUILayout.PropertyField(so.FindProperty("BreadcrumbLogLevel")); EditorGUILayout.PropertyField(so.FindProperty("Context")); EditorGUILayout.PropertyField(so.FindProperty("DiscardClasses")); diff --git a/src/Assets/Bugsnag/Scripts/BugsnagSettingsObject.cs b/src/Assets/Bugsnag/Scripts/BugsnagSettingsObject.cs index 6d53316de..dbf1f9b91 100644 --- a/src/Assets/Bugsnag/Scripts/BugsnagSettingsObject.cs +++ b/src/Assets/Bugsnag/Scripts/BugsnagSettingsObject.cs @@ -34,7 +34,7 @@ public class BugsnagSettingsObject : ScriptableObject public bool PersistUser = true; public string SessionEndpoint = "https://sessions.bugsnag.com"; public ThreadSendPolicy SendThreads = ThreadSendPolicy.UnhandledOnly; - public string[] RedactedKeys = new string[] { "password" }; + public string[] RedactedKeys = new string[] { ".*password.*" }; public string ReleaseStage; public bool ReportExceptionLogsAsHandled = true; public bool SendLaunchCrashesSynchronously = true; @@ -42,6 +42,7 @@ public class BugsnagSettingsObject : ScriptableObject public List Telemetry = new List { TelemetryType.InternalErrors, TelemetryType.Usage }; public int VersionCode = -1; + public bool GenerateAnonymousId = true; public SwitchCacheType SwitchCacheType = SwitchCacheType.R; public string SwitchCacheMountName = "BugsnagCache"; public int SwitchCacheIndex = 0; @@ -79,7 +80,16 @@ public Configuration GetConfig() config.BreadcrumbLogLevel = GetLogTypeFromLogLevel( BreadcrumbLogLevel ); config.Context = Context; - config.DiscardClasses = DiscardClasses; + foreach(string discardedClass in DiscardClasses){ + try + { + config.DiscardClasses.Add(new System.Text.RegularExpressions.Regex(discardedClass)); + } + catch (ArgumentException e) + { + Debug.LogError("Invalid Regex pattern for discard class: " + e.Message); + } + } if (EnabledReleaseStages != null && EnabledReleaseStages.Length > 0) { config.EnabledReleaseStages = EnabledReleaseStages; @@ -98,7 +108,17 @@ public Configuration GetConfig() { config.Endpoints = new EndpointConfiguration(NotifyEndpoint, SessionEndpoint); } - config.RedactedKeys = RedactedKeys; + foreach(string key in RedactedKeys) + { + try + { + config.RedactedKeys.Add(new System.Text.RegularExpressions.Regex(key)); + } + catch (ArgumentException e) + { + Debug.LogError("Invalid Regex pattern for redacted key: " + e.Message); + } + } if (string.IsNullOrEmpty(ReleaseStage)) { config.ReleaseStage = Debug.isDebugBuild ? "development" : "production"; @@ -113,7 +133,7 @@ public Configuration GetConfig() config.SecondsPerUniqueLog = TimeSpan.FromSeconds(SecondsPerUniqueLog); config.Telemetry = Telemetry; config.VersionCode = VersionCode; - + config.GenerateAnonymousId = GenerateAnonymousId; config.SwitchCacheType = SwitchCacheType; config.SwitchCacheIndex = SwitchCacheIndex; config.SwitchCacheMaxSize = SwitchCacheMaxSize; diff --git a/src/BugsnagUnity.m b/src/BugsnagUnity.m index 593291ddf..4098596a5 100644 --- a/src/BugsnagUnity.m +++ b/src/BugsnagUnity.m @@ -390,6 +390,12 @@ void bugsnag_markLaunchCompleted() { [Bugsnag markLaunchCompleted]; } +void bugsnag_registerForSessionCallbacksAfterStart(bool (*callback)(void *session)){ + [Bugsnag addOnSessionBlock:^BOOL (BugsnagSession *session) { + return callback((__bridge void *)session); + }]; +} + void *bugsnag_createConfiguration(char *apiKey) { return (void *)CFBridgingRetain([[BugsnagConfiguration alloc] initWithApiKey:@(apiKey)]); } @@ -726,13 +732,26 @@ void bugsnag_retrieveBreadcrumbs(const void *managedBreadcrumbs, void (*breadcru char * bugsnag_retrieveAppData() { BugsnagAppWithState *app = [Bugsnag.client generateAppWithState:BSGGetSystemInfo()]; - NSDictionary *appDictionary = [NSDictionary dictionaryWithObjectsAndKeys: - app.bundleVersion, @"bundleVersion", - app.id, @"id", - app.isLaunching ? @"true" : @"false", @"isLaunching", - app.type, @"type", - app.version, @"version", - nil]; + if (app == nil) { + return NULL; + } + + NSMutableDictionary *appDictionary = [NSMutableDictionary dictionary]; + + if (app.bundleVersion != nil) { + [appDictionary setObject:app.bundleVersion forKey:@"bundleVersion"]; + } + if (app.id != nil) { + [appDictionary setObject:app.id forKey:@"id"]; + } + [appDictionary setObject:(app.isLaunching ? @"true" : @"false") forKey:@"isLaunching"]; + if (app.type != nil) { + [appDictionary setObject:app.type forKey:@"type"]; + } + if (app.version != nil) { + [appDictionary setObject:app.version forKey:@"version"]; + } + return getJson(appDictionary); } @@ -748,22 +767,28 @@ void bugsnag_retrieveLastRunInfo(const void *lastRuninfo, void (*callback)(const char * bugsnag_retrieveDeviceData(const void *deviceData, void (*callback)(const void *instance, const char *key, const char *value)) { BugsnagDeviceWithState *device = [Bugsnag.client generateDeviceWithState:BSGGetSystemInfo()]; - NSDictionary *deviceDictionary = [NSDictionary dictionaryWithObjectsAndKeys: - device.freeDisk, @"freeDisk", - device.freeMemory, @"freeMemory", - device.id, @"id", - device.jailbroken ? @"true" : @"false", @"jailbroken", - device.locale, @"locale", - device.manufacturer, @"manufacturer", - device.model, @"model", - device.modelNumber, @"modelNumber", - device.runtimeVersions[@"osBuild"], @"osBuild", - device.osName, @"osName", - device.osVersion,@ "osVersion", - nil]; + NSMutableDictionary *deviceDictionary = [[NSMutableDictionary alloc] init]; + + if (device.freeDisk != nil) [deviceDictionary setObject:device.freeDisk forKey:@"freeDisk"]; + if (device.freeMemory != nil) [deviceDictionary setObject:device.freeMemory forKey:@"freeMemory"]; + if (device.id != nil) [deviceDictionary setObject:device.id forKey:@"id"]; + if (device.jailbroken) { + [deviceDictionary setObject:@"true" forKey:@"jailbroken"]; + } else { + [deviceDictionary setObject:@"false" forKey:@"jailbroken"]; + } + if (device.locale != nil) [deviceDictionary setObject:device.locale forKey:@"locale"]; + if (device.manufacturer != nil) [deviceDictionary setObject:device.manufacturer forKey:@"manufacturer"]; + if (device.model != nil) [deviceDictionary setObject:device.model forKey:@"model"]; + if (device.modelNumber != nil) [deviceDictionary setObject:device.modelNumber forKey:@"modelNumber"]; + if (device.runtimeVersions[@"osBuild"] != nil) [deviceDictionary setObject:device.runtimeVersions[@"osBuild"] forKey:@"osBuild"]; + if (device.osName != nil) [deviceDictionary setObject:device.osName forKey:@"osName"]; + if (device.osVersion != nil) [deviceDictionary setObject:device.osVersion forKey:@"osVersion"]; + return getJson(deviceDictionary); } + void bugsnag_populateUser(struct bugsnag_user *user) { user->user_id = BSGGetDefaultDeviceId().UTF8String; } diff --git a/src/BugsnagUnity/Bugsnag.cs b/src/BugsnagUnity/Bugsnag.cs index 215eece35..34622f97a 100644 --- a/src/BugsnagUnity/Bugsnag.cs +++ b/src/BugsnagUnity/Bugsnag.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using BugsnagUnity.Payload; +using UnityEngine.Networking; namespace BugsnagUnity { @@ -34,30 +35,29 @@ public static void Start(Configuration configuration) } } + public static bool IsStarted() + { + return InternalClient != null; + } + private static Client InternalClient { get; set; } private static IClient Client => InternalClient; - public static void Notify(string name, string message, string stackTrace) => InternalClient.Notify(name, message, stackTrace, null); - - public static void Notify(string name, string message, string stackTrace, Func callback) => InternalClient.Notify(name, message, stackTrace, callback); - - public static void Notify(System.Exception exception) => InternalClient.Notify(exception, 3); - - public static void Notify(System.Exception exception, string stacktrace) => InternalClient.Notify(exception, stacktrace, null); + public static void Notify(string name, string message, string stackTrace, Func callback = null) => InternalClient.Notify(name, message, stackTrace, callback); - public static void Notify(System.Exception exception, string stacktrace, Func callback) => InternalClient.Notify(exception, stacktrace, callback); + public static void Notify(System.Exception exception, string stacktrace, Func callback = null) => InternalClient.Notify(exception, stacktrace, callback); - public static void Notify(System.Exception exception, Func callback) => InternalClient.Notify(exception, callback, 3); + public static void Notify(System.Exception exception, Func callback = null) => InternalClient.Notify(exception, callback); - public static void Notify(System.Exception exception, Severity severity) => InternalClient.Notify(exception, severity, 3); - - public static void Notify(System.Exception exception, Severity severity, Func callback) => InternalClient.Notify(exception, severity, callback, 3); + public static void Notify(System.Exception exception, Severity severity, Func callback = null) => InternalClient.Notify(exception, severity, callback); public static List Breadcrumbs => Client.Breadcrumbs.Retrieve(); public static void LeaveBreadcrumb(string message, Dictionary metadata = null, BreadcrumbType type = BreadcrumbType.Manual ) => InternalClient.Breadcrumbs.Leave(message, metadata, type); + public static void LeaveBreadcrumb(UnityWebRequest request, TimeSpan? duration) => InternalClient.LeaveNetworkBreadcrumb(request, duration); + public static User GetUser() => Client.GetUser(); public static void SetUser(string id, string email, string name) => Client.SetUser(id, email, name); @@ -74,7 +74,13 @@ public static void Start(Configuration configuration) /// the tracking of in foreground time for the application. /// /// - public static void SetApplicationState(bool inFocus) => Client.SetApplicationState(inFocus); + public static void SetApplicationState(bool inFocus) + { + if(Client != null) + { + Client.SetApplicationState(inFocus); + } + } /// /// Bugsnag uses the concept of contexts to help display and group your errors. diff --git a/src/BugsnagUnity/BugsnagUnity.Android.csproj b/src/BugsnagUnity/BugsnagUnity.Android.csproj index 72daf8300..6c23bd57b 100644 --- a/src/BugsnagUnity/BugsnagUnity.Android.csproj +++ b/src/BugsnagUnity/BugsnagUnity.Android.csproj @@ -1,10 +1,4 @@  - - 8.0 - - - 8.0 - diff --git a/src/BugsnagUnity/BugsnagUnity.MacOS.csproj b/src/BugsnagUnity/BugsnagUnity.MacOS.csproj index fe487fd79..e5b42f661 100644 --- a/src/BugsnagUnity/BugsnagUnity.MacOS.csproj +++ b/src/BugsnagUnity/BugsnagUnity.MacOS.csproj @@ -1,10 +1,4 @@  - - 8.0 - - - 8.0 - diff --git a/src/BugsnagUnity/BugsnagUnity.Windows.csproj b/src/BugsnagUnity/BugsnagUnity.Windows.csproj index 5affa4e2e..6bc61eba4 100644 --- a/src/BugsnagUnity/BugsnagUnity.Windows.csproj +++ b/src/BugsnagUnity/BugsnagUnity.Windows.csproj @@ -1,10 +1,4 @@  - - 8.0 - - - 8.0 - diff --git a/src/BugsnagUnity/BugsnagUnity.csproj b/src/BugsnagUnity/BugsnagUnity.csproj index da5512f68..a673b40e5 100644 --- a/src/BugsnagUnity/BugsnagUnity.csproj +++ b/src/BugsnagUnity/BugsnagUnity.csproj @@ -1,10 +1,4 @@  - - 8.0 - - - 8.0 - diff --git a/src/BugsnagUnity/BugsnagUnity.iOS.csproj b/src/BugsnagUnity/BugsnagUnity.iOS.csproj index cc06c2cec..066893974 100644 --- a/src/BugsnagUnity/BugsnagUnity.iOS.csproj +++ b/src/BugsnagUnity/BugsnagUnity.iOS.csproj @@ -1,10 +1,4 @@  - - 8.0 - - - 8.0 - diff --git a/src/BugsnagUnity/BugsnagUnityWebRequest b/src/BugsnagUnity/BugsnagUnityWebRequest new file mode 160000 index 000000000..7fcd78f89 --- /dev/null +++ b/src/BugsnagUnity/BugsnagUnityWebRequest @@ -0,0 +1 @@ +Subproject commit 7fcd78f89d1f999f10d9245c4e7e3d8f8e224a5a diff --git a/src/BugsnagUnity/Client.cs b/src/BugsnagUnity/Client.cs index 9246d50e0..93911c05c 100644 --- a/src/BugsnagUnity/Client.cs +++ b/src/BugsnagUnity/Client.cs @@ -3,12 +3,13 @@ using System.Collections.Specialized; using System.Diagnostics; using System.Linq; -using System.ComponentModel; using System.Threading; using UnityEngine; using UnityEngine.SceneManagement; using System; using System.Collections; +using BugsnagNetworking; +using UnityEngine.Networking; namespace BugsnagUnity { @@ -73,6 +74,10 @@ public BugsnagLogHandler(ILogHandler oldLogHandler, Client client) public void LogException(System.Exception exception, UnityEngine.Object context) { + if (exception == null) + { + return; + } if (_config.AutoDetectErrors && LogType.Exception.IsGreaterThanOrEqualTo(_config.NotifyLogLevel)) { var unityLogMessage = new UnityLogMessage(exception); @@ -82,7 +87,7 @@ public void LogException(System.Exception exception, UnityEngine.Object context) if (shouldSend) { var handledState = _config.ReportExceptionLogsAsHandled ? HandledState.ForLoggedException() : HandledState.ForUnhandledException(); - _client.Notify(exception, handledState, null, 3); + _client.Notify(exception, handledState, null); } } if (_oldLogHandler != null) @@ -112,7 +117,7 @@ public Client(INativeClient nativeClient) NativeClient = nativeClient; CacheManager = new CacheManager(Configuration); PayloadManager = new PayloadManager(CacheManager); - _delivery = new Delivery(this, Configuration,CacheManager,PayloadManager); + _delivery = new Delivery(this, Configuration, CacheManager, PayloadManager); MainThread = Thread.CurrentThread; SessionTracking = new SessionTracker(this); _isUnity2019OrHigher = IsUnity2019OrHigher(); @@ -126,11 +131,12 @@ public Client(INativeClient nativeClient) SetupAdvancedExceptionInterceptor(); } InitTimingTracker(); - StartInitialSession(); + StartInitialSession(); CheckForMisconfiguredEndpointsWarning(); AddBugsnagLoadedBreadcrumb(); _delivery.StartDeliveringCachedPayloads(); ListenForSceneLoad(); + SetupNetworkListeners(); InitLogHandlers(); } @@ -180,7 +186,7 @@ private void InitTimingTracker() private void InitLogHandlers() { Application.logMessageReceivedThreaded += MultiThreadedNotify; - Application.logMessageReceived += Notify; + Application.logMessageReceived += NotifyFromUnityLog; } private void InitCounters() @@ -200,6 +206,8 @@ private void InitStopwatches() { _foregroundStopwatch = new Stopwatch(); _backgroundStopwatch = new Stopwatch(); + // Required in case the focus event is not recieved (if Bugsnag is started after it is sent) + _foregroundStopwatch.Start(); } private void InitUserObject() @@ -254,14 +262,15 @@ public bool IsUsingFallback() private void ListenForSceneLoad() { - SceneManager.sceneLoaded += (Scene scene, LoadSceneMode loadSceneMode) => { + SceneManager.sceneLoaded += (Scene scene, LoadSceneMode loadSceneMode) => + { if (Configuration.IsBreadcrumbTypeEnabled(BreadcrumbType.Navigation)) { Breadcrumbs.Leave("Scene Loaded", new Dictionary { { "sceneName", scene.name } }, BreadcrumbType.Navigation); } - _storedMetadata.AddMetadata("app", "lastLoadedUnityScene",scene.name); + _storedMetadata.AddMetadata("app", "lastLoadedUnityScene", scene.name); }; - } + } public void Send(IPayload payload) { @@ -277,19 +286,11 @@ void MultiThreadedNotify(string condition, string stackTrace, LogType logType) // Discard messages from the main thread as they will be reported separately if (!ReferenceEquals(Thread.CurrentThread, MainThread)) { - Notify(condition, stackTrace, logType); + NotifyFromUnityLog(condition, stackTrace, logType); } } - /// - /// Notify a Unity log message if it the client has been configured to - /// notify at the specified level, if not leave a breadcrumb with the log - /// message. - /// - /// - /// - /// - void Notify(string condition, string stackTrace, LogType logType) + private void NotifyFromUnityLog(string condition, string stackTrace, LogType logType) { if (!Configuration.EnabledErrorTypes.UnityLog) { @@ -299,6 +300,10 @@ void Notify(string condition, string stackTrace, LogType logType) { return; } + if (condition.StartsWith("BUGSNAG_MAZERUNNER_LOG")) + { + return; + } if (Configuration.AutoDetectErrors && logType.IsGreaterThanOrEqualTo(Configuration.NotifyLogLevel)) { var logMessage = new UnityLogMessage(condition, stackTrace, logType); @@ -320,7 +325,7 @@ void Notify(string condition, string stackTrace, LogType logType) { {"logLevel" , logType.ToString() } }; - Breadcrumbs.Leave(condition, metadata, BreadcrumbType.Log ); + Breadcrumbs.Leave(condition, metadata, BreadcrumbType.Log); } } @@ -336,52 +341,22 @@ public void Notify(System.Exception exception, string stacktrace, Func callback) { - Notify(exception, callback, 3); - } - - internal void Notify(System.Exception exception, Func callback, int level) - { - Notify(exception, HandledState.ForHandledException(), callback, level); - } - - public void Notify(System.Exception exception, Severity severity) - { - Notify(exception, severity, 3); - } - - internal void Notify(System.Exception exception, Severity severity, int level) - { - Notify(exception, HandledState.ForUserSpecifiedSeverity(severity), null, level); + Notify(exception, HandledState.ForHandledException(), callback); } public void Notify(System.Exception exception, Severity severity, Func callback) { - Notify(exception, severity, callback, 3); - } - - internal void Notify(System.Exception exception, Severity severity, Func callback, int level) - { - Notify(exception, HandledState.ForUserSpecifiedSeverity(severity), callback, level); + Notify(exception, HandledState.ForUserSpecifiedSeverity(severity), callback); } - void Notify(System.Exception exception, HandledState handledState, Func callback, int level) + void Notify(System.Exception exception, HandledState handledState, Func callback) { // we need to generate a substitute stacktrace here as if we are not able // to generate one from the exception that we are given then we are not able // to do this inside of the IEnumerator generator code - var substitute = new System.Diagnostics.StackTrace(level, true).GetFrames(); + var substitute = new System.Diagnostics.StackTrace(true).GetFrames(); var errors = new Errors(exception, substitute).ToArray(); foreach (var error in errors) { @@ -393,7 +368,7 @@ void Notify(System.Exception exception, HandledState handledState, Func callback, LogType? logType) + private void Notify(Error[] exceptions, HandledState handledState, Func callback, LogType? logType) { if (!ShouldSendRequests() || EventContainsDiscardedClass(exceptions) || !Configuration.Endpoints.IsValid) { @@ -401,7 +376,7 @@ void Notify(Error[] exceptions, HandledState handledState, Func ca } - if (!object.ReferenceEquals(Thread.CurrentThread, MainThread)) + if (!ReferenceEquals(Thread.CurrentThread, MainThread)) { try { @@ -416,8 +391,8 @@ void Notify(Error[] exceptions, HandledState handledState, Func ca else { NotifyOnMainThread(exceptions, handledState, callback, logType); - } - + } + } private void NotifyOnMainThread(Error[] exceptions, HandledState handledState, Func callback, LogType? logType) @@ -437,7 +412,7 @@ private void NotifyOnMainThread(Error[] exceptions, HandledState handledState, F NativeClient.PopulateAppWithState(app); - var device = new DeviceWithState(Configuration,CacheManager.GetCachedDeviceId()); + var device = new DeviceWithState(Configuration, CacheManager.GetCachedDeviceId()); NativeClient.PopulateDeviceWithState(device); @@ -517,7 +492,7 @@ private void NotifyOnMainThread(Error[] exceptions, HandledState handledState, F if (!report.Ignored) { //if serialisation fails, then we ignore the event - if (PayloadManager.AddPendingPayload(report)) + if (PayloadManager.AddPendingPayload(report)) { Send(report); if (Configuration.IsBreadcrumbTypeEnabled(BreadcrumbType.Error)) @@ -529,7 +504,7 @@ private void NotifyOnMainThread(Error[] exceptions, HandledState handledState, F } } - + private bool ShouldAddProjectPackagesToEvent(Payload.Event theEvent) { return Application.platform.Equals(RuntimePlatform.Android) @@ -606,27 +581,31 @@ public void SetContext(string context) public string GetContext() { return Configuration.Context; - } + } public void MarkLaunchCompleted() => NativeClient.MarkLaunchCompleted(); - + public void AddOnError(Func bugsnagCallback) => Configuration.AddOnError(bugsnagCallback); public void RemoveOnError(Func bugsnagCallback) => Configuration.RemoveOnError(bugsnagCallback); - public void AddOnSession(Func callback) => Configuration.AddOnSession(callback); + public void AddOnSession(Func callback) + { + Configuration.AddOnSession(callback); + NativeClient.RegisterForOnSessionCallbacks(); + } public void RemoveOnSession(Func callback) => Configuration.RemoveOnSession(callback); public void AddMetadata(string section, string key, object value) => _storedMetadata.AddMetadata(section, key, value); - public void AddMetadata(string section, IDictionary metadata) => _storedMetadata.AddMetadata(section,metadata); + public void AddMetadata(string section, IDictionary metadata) => _storedMetadata.AddMetadata(section, metadata); public void ClearMetadata(string section) => _storedMetadata.ClearMetadata(section); public void ClearMetadata(string section, string key) => _storedMetadata.ClearMetadata(section, key); - public IDictionary GetMetadata(string section) => _storedMetadata.GetMetadata(section); + public IDictionary GetMetadata(string section) => _storedMetadata.GetMetadata(section); public object GetMetadata(string section, string key) => _storedMetadata.GetMetadata(section, key); @@ -653,7 +632,7 @@ public void AddFeatureFlags(FeatureFlag[] featureFlags) { AddFeatureFlag(flag.Name, flag.Variant); } - } + } public void ClearFeatureFlag(string name) { @@ -666,5 +645,99 @@ public void ClearFeatureFlags() _featureFlags.Clear(); NativeClient.ClearFeatureFlags(); } + + private void SetupNetworkListeners() + { + // Currently network breadcrumb are the only feature using the web events. + // If we add more features that use web request events, we will need to move this check + if (!Configuration.IsBreadcrumbTypeEnabled(BreadcrumbType.Request)) + { + return; + } + BugsnagUnityWebRequest.OnSend.AddListener(OnWebRequestSend); + BugsnagUnityWebRequest.OnComplete.AddListener(OnWebRequestComplete); + BugsnagUnityWebRequest.OnAbort.AddListener(OnWebRequestAbort); + } + + private readonly Dictionary _requestStartTimes = new Dictionary(); + + + private void OnWebRequestComplete(BugsnagUnityWebRequest request) + { + if (_requestStartTimes.TryGetValue(request, out DateTimeOffset startTime)) + { + TimeSpan duration = DateTimeOffset.UtcNow - startTime; + LeaveNetworkBreadcrumb(request.UnityWebRequest, duration); + _requestStartTimes.Remove(request); + } + else + { + LeaveNetworkBreadcrumb(request.UnityWebRequest, null); + } + } + + private void OnWebRequestSend(BugsnagUnityWebRequest request) + { + _requestStartTimes[request] = DateTimeOffset.UtcNow; + } + + private void OnWebRequestAbort(BugsnagUnityWebRequest request) + { + if (_requestStartTimes.ContainsKey(request)) + { + _requestStartTimes.Remove(request); + } + } + + public void LeaveNetworkBreadcrumb(UnityWebRequest request, TimeSpan? duration) + { + string statusMessage = request.result == UnityWebRequest.Result.Success ? "succeeded" : "failed"; + string fullMessage = $"UnityWebRequest {statusMessage}"; + var metadata = new Dictionary(); + metadata["status"] = request.responseCode; + metadata["method"] = request.method; + metadata["url"] = request.url; + var urlParams = ExtractUrlParams(request.uri); + if (urlParams.Count > 0) + { + metadata["urlParams"] = urlParams; + } + metadata["duration"] = duration?.TotalMilliseconds; + if (request.uploadHandler != null && request.uploadHandler.data != null) + { + metadata["requestContentLength"] = request.uploadHandler.data.Length; + } + if (request.downloadHandler != null && request.downloadHandler.data != null) + { + metadata["responseContentLength"] = request.downloadHandler.data.Length; + } + Breadcrumbs.Leave(fullMessage, metadata, BreadcrumbType.Request); + } + + private Dictionary ExtractUrlParams(Uri uri) + { + var queryParams = new Dictionary(); + var querySegments = uri.Query.TrimStart('?').Split('&'); + + foreach (var segment in querySegments) + { + var parts = segment.Split('='); + if (parts.Length == 2) + { + if (Configuration.KeyIsRedacted(parts[0])) + { + queryParams[parts[0]] = "[REDACTED]"; + } + else + { + queryParams[parts[0]] = parts[1]; + } + } + } + + return queryParams; + } + + } } diff --git a/src/BugsnagUnity/Configuration.cs b/src/BugsnagUnity/Configuration.cs index 63f3a4921..7fb87127a 100644 --- a/src/BugsnagUnity/Configuration.cs +++ b/src/BugsnagUnity/Configuration.cs @@ -1,9 +1,11 @@ using System; +using System.Reflection; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using BugsnagUnity.Payload; using UnityEngine; +using System.Text.RegularExpressions; namespace BugsnagUnity { @@ -32,7 +34,7 @@ public class Configuration : IMetadataEditor, IFeatureFlagStore public string BundleVersion; - public string[] RedactedKeys = new string[] { "password" }; + public int VersionCode = -1; @@ -54,15 +56,35 @@ public class Configuration : IMetadataEditor, IFeatureFlagStore internal OrderedDictionary FeatureFlags = new OrderedDictionary(); + + public List RedactedKeys = new List{new Regex(".*password.*",RegexOptions.IgnoreCase)}; public bool KeyIsRedacted(string key) { - if (RedactedKeys == null || RedactedKeys.Length == 0) + if (RedactedKeys == null) { return false; } - foreach (var redactedKey in RedactedKeys) + foreach (var regex in RedactedKeys) { - if (key.ToLower() == redactedKey.ToLower()) + if (regex.IsMatch(key)) + { + return true; + } + } + return false; + } + + public List DiscardClasses = new List(); + + internal bool ErrorClassIsDiscarded(string className) + { + if (DiscardClasses == null) + { + return false; + } + foreach (var regex in DiscardClasses) + { + if (regex.IsMatch(className)) { return true; } @@ -188,19 +210,12 @@ public ulong AppHangThresholdMillis } } - public string[] DiscardClasses; - public int MaxPersistedEvents = 32; public int MaxPersistedSessions = 128; public int MaxStringValueLength = 10000; - internal bool ErrorClassIsDiscarded(string className) - { - return DiscardClasses != null && DiscardClasses.Contains(className); - } - private bool IsRunningInEditor() { return Application.platform == RuntimePlatform.OSXEditor @@ -208,55 +223,86 @@ private bool IsRunningInEditor() || Application.platform == RuntimePlatform.LinuxEditor; } + // Thread-safe collections with locks + private readonly object _onErrorLock = new object(); private List> _onErrorCallbacks = new List>(); + private readonly object _onSendErrorLock = new object(); + private List> _onSendErrorCallbacks = new List>(); + + private readonly object _onSessionLock = new object(); + private List> _onSessionCallbacks = new List>(); + public void AddOnError(Func callback) { - _onErrorCallbacks.Add(callback); + lock (_onErrorLock) + { + _onErrorCallbacks.Add(callback); + } } internal List> GetOnErrorCallbacks() { - return _onErrorCallbacks; + lock (_onErrorLock) + { + return _onErrorCallbacks.ToList(); + } } public void RemoveOnError(Func callback) { - _onErrorCallbacks.Remove(callback); + lock (_onErrorLock) + { + _onErrorCallbacks.Remove(callback); + } } - private List> _onSendErrorCallbacks = new List>(); - public void AddOnSendError(Func callback) { - _onSendErrorCallbacks.Add(callback); + lock (_onSendErrorLock) + { + _onSendErrorCallbacks.Add(callback); + } } internal List> GetOnSendErrorCallbacks() { - return _onSendErrorCallbacks; + lock (_onSendErrorLock) + { + return _onSendErrorCallbacks.ToList(); + } } public void RemoveOnSendError(Func callback) { - _onSendErrorCallbacks.Remove(callback); + lock (_onSendErrorLock) + { + _onSendErrorCallbacks.Remove(callback); + } } - private List> _onSessionCallbacks = new List>(); - public void AddOnSession(Func callback) { - _onSessionCallbacks.Add(callback); + lock (_onSessionLock) + { + _onSessionCallbacks.Add(callback); + } } public void RemoveOnSession(Func callback) { - _onSessionCallbacks.Remove(callback); + lock (_onSessionLock) + { + _onSessionCallbacks.Remove(callback); + } } internal List> GetOnSessionCallbacks() { - return _onSessionCallbacks; + lock (_onSessionLock) + { + return _onSessionCallbacks.ToList(); + } } public List Telemetry = new List { TelemetryType.InternalErrors, TelemetryType.Usage }; @@ -316,6 +362,10 @@ public void ClearFeatureFlags() { FeatureFlags.Clear(); } + + public static AssemblyName GetAssemblyName() { + return typeof(Configuration).Assembly.GetName(); + } } [Serializable] diff --git a/src/BugsnagUnity/Delivery.cs b/src/BugsnagUnity/Delivery.cs index c25dbdbf8..55b8601fd 100644 --- a/src/BugsnagUnity/Delivery.cs +++ b/src/BugsnagUnity/Delivery.cs @@ -9,6 +9,7 @@ using BugsnagUnity.Payload; using UnityEngine; using UnityEngine.Networking; +using System.Security.Cryptography; namespace BugsnagUnity { @@ -187,6 +188,8 @@ IEnumerator PushToServer(IPayload payload) { req.SetRequestHeader("Content-Type", "application/json"); req.SetRequestHeader("Bugsnag-Sent-At", DateTimeOffset.Now.ToString("o", CultureInfo.InvariantCulture)); + req.SetRequestHeader("Bugsnag-Integrity", "sha1 " + Hash(body)); + foreach (var header in payload.Headers) { req.SetRequestHeader(header.Key, header.Value); @@ -278,6 +281,20 @@ private byte[] PrepareEventBodySimple(IPayload payload) return serialisedPayload; } + private string Hash(byte[] input) + { + using (SHA1Managed sha1 = new SHA1Managed()) + { + var hash = sha1.ComputeHash(input); + var sb = new StringBuilder(hash.Length * 2); + foreach (byte b in hash) + { + sb.Append(b.ToString("x2")); + } + return sb.ToString(); + } + } + private bool TruncateBreadcrumbs(Dictionary @event, int bytesToRemove) { var breadcrumbsList = (@event[EVENT_KEY_BREADCRUMBS] as Dictionary[]).ToList(); @@ -501,39 +518,79 @@ public void StartDeliveringCachedPayloads() private IEnumerator DeliverCachedPayloads() { - var cachedSessionIds = _cacheManager.GetCachedSessionIds(); - if (cachedSessionIds != null) + yield return ProcessCachedItems(typeof(SessionReport)); + yield return ProcessCachedItems(typeof(Report)); + _cacheDeliveryInProcess = false; + } + + private IEnumerator ProcessCachedItems(Type t) + { + bool isSession = t.Equals(typeof(SessionReport)); + var cachedPayloads = isSession ? _cacheManager.GetCachedSessionIds() : _cacheManager.GetCachedEventIds(); + if (cachedPayloads != null) { - foreach (var sessionId in cachedSessionIds) + foreach (var id in cachedPayloads) { - var sessionJson = _cacheManager.GetCachedSession(sessionId); - if (string.IsNullOrEmpty(sessionJson)) + var payloadJson = isSession ? _cacheManager.GetCachedSession(id) : _cacheManager.GetCachedEvent(id); + if (string.IsNullOrEmpty(payloadJson)) { continue; } - var sessionReport = new SessionReport(_configuration, ((JsonObject)SimpleJson.DeserializeObject(sessionJson)).GetDictionary()); - Deliver(sessionReport); - yield return new WaitUntil(() => CachedPayloadProcessed(sessionReport.Id)); - } - } - var cachedEvents = _cacheManager.GetCachedEventIds(); - if (cachedEvents != null) - { - foreach (var eventId in cachedEvents) - { - var eventJson = _cacheManager.GetCachedEvent(eventId); - if (string.IsNullOrEmpty(eventJson)) + Dictionary payloadDictionary = null; + + try { + // if something goes wrong at this stage then we silently discard the file as it's most likely that the file wasn't fully serialised to disk + payloadDictionary = ((JsonObject)SimpleJson.DeserializeObject(payloadJson)).GetDictionary(); + } + catch + { + if (isSession) + { + _cacheManager.RemoveCachedSession(id); + } + else + { + _cacheManager.RemoveCachedEvent(id); + } continue; } - var eventReport = new Report(_configuration, ((JsonObject)SimpleJson.DeserializeObject(eventJson)).GetDictionary()); - Deliver(eventReport); - yield return new WaitUntil(() => CachedPayloadProcessed(eventReport.Id)); + + if (isSession) + { + SessionReport sessionReport = null; + try + { + sessionReport = new SessionReport(_configuration, payloadDictionary); + } + catch + { + // this will be internally reported in a future update + _cacheManager.RemoveCachedSession(id); + continue; + } + Deliver(sessionReport); + } + else + { + Report report = null; + try + { + report = new Report(_configuration, payloadDictionary); + } + catch + { + // this will be internally reported in a future update + _cacheManager.RemoveCachedEvent(id); + continue; + } + Deliver(report); + } + + yield return new WaitUntil(() => CachedPayloadProcessed(id)); } } - - _cacheDeliveryInProcess = false; } private bool CachedPayloadProcessed(string id) diff --git a/src/BugsnagUnity/IClient.cs b/src/BugsnagUnity/IClient.cs index c213fb81e..1c8522c5d 100644 --- a/src/BugsnagUnity/IClient.cs +++ b/src/BugsnagUnity/IClient.cs @@ -17,12 +17,8 @@ internal interface IClient : IMetadataEditor, IFeatureFlagStore void Send(IPayload payload); - void Notify(System.Exception exception); - void Notify(System.Exception exception, Func callback); - void Notify(System.Exception exception, Severity severity); - void Notify(System.Exception exception, Severity severity, Func callback); void Notify(System.Exception exception, string stacktrace, Func callback); diff --git a/src/BugsnagUnity/INativeClient.cs b/src/BugsnagUnity/INativeClient.cs index 59e19188b..c2f7a6f6d 100644 --- a/src/BugsnagUnity/INativeClient.cs +++ b/src/BugsnagUnity/INativeClient.cs @@ -104,5 +104,10 @@ interface INativeClient : IFeatureFlagStore bool ShouldAttemptDelivery(); + /// + /// Subscribes the Unity layer for session callbacks. Not many users use session callbacks, so we are only subscribing to the native side if necessary as an optimisation. + /// + void RegisterForOnSessionCallbacks(); + } } diff --git a/src/BugsnagUnity/MaximumLogTypeCounter.cs b/src/BugsnagUnity/MaximumLogTypeCounter.cs index de6cc0864..480795662 100644 --- a/src/BugsnagUnity/MaximumLogTypeCounter.cs +++ b/src/BugsnagUnity/MaximumLogTypeCounter.cs @@ -10,19 +10,26 @@ public class MaximumLogTypeCounter private Dictionary CurrentCounts { get; } - private DateTimeOffset FlushAt { get; set; } + private double FlushAt { get; set; } = -1; - private TimeSpan MaximumLogsTimePeriod => Configuration.MaximumLogsTimePeriod; + private double MaximumLogsTimePeriod => Configuration.MaximumLogsTimePeriod.TotalSeconds; private Dictionary MaximumTypePerTimePeriod => Configuration.MaximumTypePerTimePeriod; private readonly object _lock = new object(); + private void EnsureFlushTimeIsSet() + { + if (FlushAt < 0) + { + FlushAt = Time.ElapsedSeconds + MaximumLogsTimePeriod; + } + } + public MaximumLogTypeCounter(Configuration configuration) { Configuration = configuration; CurrentCounts = new Dictionary(); - FlushAt = DateTimeOffset.Now.Add(Configuration.MaximumLogsTimePeriod); } public bool ShouldSend(UnityLogMessage unityLogMessage) @@ -31,6 +38,8 @@ public bool ShouldSend(UnityLogMessage unityLogMessage) lock (_lock) { + EnsureFlushTimeIsSet(); + if (MaximumTypePerTimePeriod.ContainsKey(type)) { if (CurrentCounts.ContainsKey(type)) @@ -47,7 +56,7 @@ public bool ShouldSend(UnityLogMessage unityLogMessage) if (unityLogMessage.CreatedAt > FlushAt) { CurrentCounts.Clear(); - FlushAt = DateTimeOffset.Now.Add(MaximumLogsTimePeriod); + FlushAt = Time.ElapsedSeconds + MaximumLogsTimePeriod; return true; } return false; diff --git a/src/BugsnagUnity/Native/Android/NativeClient.cs b/src/BugsnagUnity/Native/Android/NativeClient.cs index c225ae0f5..183bdec64 100644 --- a/src/BugsnagUnity/Native/Android/NativeClient.cs +++ b/src/BugsnagUnity/Native/Android/NativeClient.cs @@ -156,6 +156,11 @@ public bool ShouldAttemptDelivery() { return true; } + + public void RegisterForOnSessionCallbacks() + { + NativeInterface.RegisterForOnSessionCallbacks(); + } } } diff --git a/src/BugsnagUnity/Native/Android/NativeEvent.cs b/src/BugsnagUnity/Native/Android/NativeEvent.cs index 8885c2991..222270029 100644 --- a/src/BugsnagUnity/Native/Android/NativeEvent.cs +++ b/src/BugsnagUnity/Native/Android/NativeEvent.cs @@ -28,7 +28,7 @@ public NativeEvent(AndroidJavaObject androidJavaObject) : base (androidJavaObjec public List Threads => GetThreads(); - public bool? Unhandled { get => NativePointer.Call("isUnhandled"); set => NativePointer.Call("setUnhandled", (bool)value); } + public bool Unhandled { get => NativePointer.Call("isUnhandled"); set => NativePointer.Call("setUnhandled", (bool)value); } private Severity GetSeverity() { diff --git a/src/BugsnagUnity/Native/Android/NativeInterface.cs b/src/BugsnagUnity/Native/Android/NativeInterface.cs index 10f0dc72d..007b08602 100644 --- a/src/BugsnagUnity/Native/Android/NativeInterface.cs +++ b/src/BugsnagUnity/Native/Android/NativeInterface.cs @@ -9,6 +9,27 @@ namespace BugsnagUnity { + internal class DisposableContainer : IDisposable + { + private List _disposables = new List(); + + public void Add(IDisposable disposable) + { + _disposables.Add(disposable); + } + + public void Dispose() + { + for (int i = _disposables.Count - 1; i >= 0; i--) + { + if (_disposables[i] != null) + { + _disposables[i].Dispose(); + } + } + } + } + class NativeInterface { private IntPtr BugsnagNativeInterface; @@ -64,13 +85,15 @@ class NativeInterface - + private Configuration _configuration; private bool CanRunOnBackgroundThread; private static bool Unity2019OrNewer; private Thread MainThread; + private bool _registeredForSessionCallbacks; + private class OnSessionCallback : AndroidJavaProxy { @@ -135,7 +158,9 @@ public bool onSend(AndroidJavaObject @event) public NativeInterface(Configuration cfg) { + _configuration = cfg; AndroidJavaObject config = CreateNativeConfig(cfg); + ConfigureNotifierInfo(config); Unity2019OrNewer = IsUnity2019OrNewer(); MainThread = Thread.CurrentThread; using (AndroidJavaClass system = new AndroidJavaClass("java.lang.System")) @@ -288,10 +313,9 @@ public NativeInterface(Configuration cfg) activityName = AndroidJNI.GetStringUTFChars(activityNameObject.GetRawObject()); } } - sessionTracker.Call("updateForegroundTracker", activityName, true, 0L); + sessionTracker.Call("updateContext", activityName, true); } - ConfigureNotifierInfo(client); } } @@ -322,7 +346,7 @@ AndroidJavaObject CreateNativeConfig(Configuration config) obj.Call("setSendLaunchCrashesSynchronously", config.SendLaunchCrashesSynchronously); obj.Call("setMaxReportedThreads", config.MaxReportedThreads); obj.Call("setMaxStringValueLength", config.MaxStringValueLength); - + obj.Call("setGenerateAnonymousId", config.GenerateAnonymousId); if (config.GetUser() != null) { @@ -331,9 +355,15 @@ AndroidJavaObject CreateNativeConfig(Configuration config) } //Register for callbacks - obj.Call("addOnSession", new OnSessionCallback(config)); - obj.Call("addOnSend", new OnSendErrorCallback(config)); - + if (config.GetOnSessionCallbacks() != null && config.GetOnSessionCallbacks().Count > 0) + { + obj.Call("addOnSession", new OnSessionCallback(config)); + _registeredForSessionCallbacks = true; + } + if (config.GetOnSendErrorCallbacks() != null && config.GetOnSendErrorCallbacks().Count > 0) + { + obj.Call("addOnSend", new OnSendErrorCallback(config)); + } // set endpoints var notify = config.Endpoints.Notify.ToString(); @@ -424,9 +454,15 @@ AndroidJavaObject CreateNativeConfig(Configuration config) } // set DiscardedClasses - if (config.DiscardClasses != null && config.DiscardClasses.Length > 0) + if (config.DiscardClasses != null && config.DiscardClasses.Count > 0) { - obj.Call("setDiscardClasses", GetAndroidStringSetFromArray(config.DiscardClasses)); + var patternsAsStrings = new string[config.DiscardClasses.Count]; + foreach (var pattern in config.DiscardClasses) + { + patternsAsStrings[config.DiscardClasses.IndexOf(pattern)] = pattern.ToString(); + } + + obj.Call("setDiscardClasses", GetAndroidRegexPatternSetFromArray(patternsAsStrings)); } // set ProjectPackages @@ -436,9 +472,14 @@ AndroidJavaObject CreateNativeConfig(Configuration config) } // set redacted keys - if (config.RedactedKeys != null && config.RedactedKeys.Length > 0) + if (config.RedactedKeys != null && config.RedactedKeys.Count > 0) { - obj.Call("setRedactedKeys", GetAndroidStringSetFromArray(config.RedactedKeys)); + var patternsAsStrings = new string[config.RedactedKeys.Count]; + foreach (var key in config.RedactedKeys) + { + patternsAsStrings[config.RedactedKeys.IndexOf(key)] = key.ToString(); + } + obj.Call("setRedactedKeys", GetAndroidRegexPatternSetFromArray(patternsAsStrings)); } // add unity event callback @@ -478,11 +519,31 @@ private AndroidJavaObject GetAndroidStringSetFromArray(string[] array) return set; } - private void ConfigureNotifierInfo(AndroidJavaObject client) + private AndroidJavaObject GetAndroidRegexPatternSetFromArray(string[] array) { - using (AndroidJavaObject notifier = client.Get("notifier")) + AndroidJavaObject set = new AndroidJavaObject("java.util.HashSet"); + AndroidJavaClass patternClass = new AndroidJavaClass("java.util.regex.Pattern"); + + foreach (var item in array) { + try + { + AndroidJavaObject pattern = patternClass.CallStatic("compile", item); + set.Call("add", pattern); + } + catch (AndroidJavaException e) + { + Debug.LogWarning("Failed to compile regex pattern: " + item + " " + e.Message); + } + } + return set; + } + + private void ConfigureNotifierInfo(AndroidJavaObject config) + { + using (AndroidJavaObject notifier = config.Call("getNotifier")) + { AndroidJavaObject androidNotifier = new AndroidJavaObject("com.bugsnag.android.Notifier"); androidNotifier.Call("setUrl", androidNotifier.Get("url")); androidNotifier.Call("setName", androidNotifier.Get("name")); @@ -649,19 +710,26 @@ public void AddMetadata(string section, IDictionary metadata) { return; } - CallNativeVoidMethod("addMetadata", "(Ljava/lang/String;Ljava/util/Map;)V", - new object[] { section, DictionaryToJavaMap(metadata) }); + using (var disposableContainer = new DisposableContainer()) + { + CallNativeVoidMethod("addMetadata", "(Ljava/lang/String;Ljava/util/Map;)V", + new object[] { section, DictionaryToJavaMap(metadata, disposableContainer) }); + } } - internal static AndroidJavaObject DictionaryToJavaMap(IDictionary inputDict) + + + internal static AndroidJavaObject DictionaryToJavaMap(IDictionary inputDict, DisposableContainer disposables) { AndroidJavaObject map = new AndroidJavaObject("java.util.HashMap"); + disposables.Add(map); if (inputDict != null) { foreach (var entry in inputDict) { + var key = new AndroidJavaObject("java.lang.String", entry.Key); - + disposables.Add(key); if (entry.Value == null) { map.Call("put", key, null); @@ -670,24 +738,24 @@ internal static AndroidJavaObject DictionaryToJavaMap(IDictionary dictionary) { - map.Call("put", key, DictionaryToJavaMap(dictionary)); + map.Call("put", key, DictionaryToJavaMap(dictionary, disposables)); } else { var convertedDictionary = ConvertIfPoss(entry.Value); if (convertedDictionary != null) { - map.Call("put", key, DictionaryToJavaMap(convertedDictionary)); + map.Call("put", key, DictionaryToJavaMap(convertedDictionary, disposables)); } } } else if (IsListOrArray(entry.Value)) { - map.Call("put", key, GetJavaArrayListFromCollection(entry.Value)); + map.Call("put", key, GetJavaArrayListFromCollection(entry.Value, disposables)); } else { - map.Call("put", key, GetAndroidObjectFromBasicObject(entry.Value)); + map.Call("put", key, GetAndroidObjectFromBasicObject(entry.Value, disposables)); } } } @@ -722,18 +790,19 @@ private static bool IsListOrArray(object theObject) return (oType.IsGenericType && oType.GetGenericTypeDefinition() == typeof(List<>)) || oType.IsArray; } - private static AndroidJavaObject GetJavaArrayListFromCollection(object theObject) + private static AndroidJavaObject GetJavaArrayListFromCollection(object theObject, DisposableContainer disposableContainer) { var collection = (IEnumerable)theObject; var arrayList = new AndroidJavaObject("java.util.ArrayList"); + disposableContainer.Add(arrayList); foreach (var item in collection) { - arrayList.Call("add", GetAndroidObjectFromBasicObject(item)); + arrayList.Call("add", GetAndroidObjectFromBasicObject(item, disposableContainer)); } return arrayList; } - private static AndroidJavaObject GetAndroidObjectFromBasicObject(object theObject) + private static AndroidJavaObject GetAndroidObjectFromBasicObject(object theObject, DisposableContainer disposableContainer) { if (theObject == null) { @@ -766,11 +835,13 @@ private static AndroidJavaObject GetAndroidObjectFromBasicObject(object theObjec } else { - return new AndroidJavaObject("java.lang.String", theObject.ToString()); + var stringObj = new AndroidJavaObject("java.lang.String", theObject.ToString()); + disposableContainer.Add(stringObj); + return stringObj; } - - return new AndroidJavaObject(nativeClass, theObject); - + var androidObj = new AndroidJavaObject(nativeClass, theObject); + disposableContainer.Add(androidObj); + return androidObj; } public void LeaveBreadcrumb(string name, string type, IDictionary metadata) @@ -786,10 +857,11 @@ public void LeaveBreadcrumb(string name, string type, IDictionary GetNativeMetadataSection(string key, string se public void SetNativeDictionary(string key,IDictionary dict) { - using (var map = NativeInterface.DictionaryToJavaMap(dict)) + using (var disposeableContainer = new DisposableContainer()) { - NativePointer.Call(key,map); + var map = NativeInterface.DictionaryToJavaMap(dict, disposeableContainer); + NativePointer.Call(key, map); } } public void SetNativeMetadataSection(string key, string section, IDictionary dict) { - using (var map = NativeInterface.DictionaryToJavaMap(dict)) + using (var disposeableContainer = new DisposableContainer()) { + var map = NativeInterface.DictionaryToJavaMap(dict, disposeableContainer); NativePointer.Call(key, section, map); } } diff --git a/src/BugsnagUnity/Native/Android/NativeThread.cs b/src/BugsnagUnity/Native/Android/NativeThread.cs index 743c23be8..4b79b01aa 100644 --- a/src/BugsnagUnity/Native/Android/NativeThread.cs +++ b/src/BugsnagUnity/Native/Android/NativeThread.cs @@ -9,7 +9,7 @@ internal class NativeThread : NativePayloadClassWrapper, IThread { public NativeThread(AndroidJavaObject androidJavaObject) : base(androidJavaObject){} - public string Id { get => GetNativeLong("getId").ToString(); set => SetNativeLong("setId",long.Parse(value)); } + public string Id { get => GetNativeString("getId"); set => SetNativeString("setId",value); } public bool? ErrorReportingThread => GetNativeBool("getErrorReportingThread"); diff --git a/src/BugsnagUnity/Native/Cocoa/NativeClient.cs b/src/BugsnagUnity/Native/Cocoa/NativeClient.cs index 353252b02..7651db39c 100644 --- a/src/BugsnagUnity/Native/Cocoa/NativeClient.cs +++ b/src/BugsnagUnity/Native/Cocoa/NativeClient.cs @@ -16,6 +16,7 @@ class NativeClient : INativeClient private static Session _nativeSession; IntPtr NativeConfiguration { get; } private static NativeClient _instance; + private bool _registeredForSessionCallbacks; public NativeClient(Configuration configuration) { @@ -49,8 +50,21 @@ IntPtr CreateNativeConfig(Configuration config) NativeCode.bugsnag_setAutoTrackSessions(obj, config.AutoTrackSessions); NativeCode.bugsnag_setLaunchDurationMillis(obj, (ulong)config.LaunchDurationMillis); NativeCode.bugsnag_setSendLaunchCrashesSynchronously(obj,config.SendLaunchCrashesSynchronously); - NativeCode.bugsnag_registerForOnSendCallbacks(obj, HandleOnSendCallbacks); - NativeCode.bugsnag_registerForSessionCallbacks(obj, HandleSessionCallbacks); + + if (config.GetOnSendErrorCallbacks() != null && config.GetOnSendErrorCallbacks().Count > 0) + { + NativeCode.bugsnag_registerForOnSendCallbacks(obj, HandleOnSendCallbacks); + } + + if (config.GetOnSessionCallbacks() != null && config.GetOnSessionCallbacks().Count > 0) + { + _registeredForSessionCallbacks = true; + NativeCode.bugsnag_registerForSessionCallbacks(obj, HandleSessionCallbacks); + } + + + + NativeCode.bugsnag_setAppHangThresholdMillis(obj, config.AppHangThresholdMillis); NativeCode.bugsnag_setMaxStringValueLength(obj, config.MaxStringValueLength); AddFeatureFlagsToConfig(obj,config); @@ -59,13 +73,23 @@ IntPtr CreateNativeConfig(Configuration config) var user = config.GetUser(); NativeCode.bugsnag_setUserInConfig(obj, user.Id, user.Email, user.Name); } - if (config.DiscardClasses != null && config.DiscardClasses.Length > 0) + if (config.DiscardClasses != null && config.DiscardClasses.Count > 0) { - NativeCode.bugsnag_setDiscardClasses(obj, config.DiscardClasses, config.DiscardClasses.Length); + var patternsAsStrings = new string[config.DiscardClasses.Count]; + foreach (var key in config.DiscardClasses) + { + patternsAsStrings[config.DiscardClasses.IndexOf(key)] = key.ToString(); + } + NativeCode.bugsnag_setDiscardClasses(obj, patternsAsStrings, patternsAsStrings.Length); } - if (config.RedactedKeys != null && config.RedactedKeys.Length > 0) + if (config.RedactedKeys != null && config.RedactedKeys.Count > 0) { - NativeCode.bugsnag_setRedactedKeys(obj, config.RedactedKeys, config.RedactedKeys.Length); + var patternsAsStrings = new string[config.RedactedKeys.Count]; + foreach (var key in config.RedactedKeys) + { + patternsAsStrings[config.RedactedKeys.IndexOf(key)] = key.ToString(); + } + NativeCode.bugsnag_setRedactedKeys(obj, patternsAsStrings, patternsAsStrings.Length); } SetEnabledTelemetryTypes(obj,config); @@ -449,5 +473,15 @@ public bool ShouldAttemptDelivery() { return true; } + + public void RegisterForOnSessionCallbacks() + { + if (_registeredForSessionCallbacks) + { + return; + } + _registeredForSessionCallbacks = true; + NativeCode.bugsnag_registerForSessionCallbacksAfterStart(HandleSessionCallbacks); + } } } diff --git a/src/BugsnagUnity/Native/Cocoa/NativeCode.cs b/src/BugsnagUnity/Native/Cocoa/NativeCode.cs index 65756db84..f004f292b 100644 --- a/src/BugsnagUnity/Native/Cocoa/NativeCode.cs +++ b/src/BugsnagUnity/Native/Cocoa/NativeCode.cs @@ -37,6 +37,9 @@ partial class NativeCode [DllImport(Import)] internal static extern void bugsnag_registerForSessionCallbacks(IntPtr configuration, Func callback); + [DllImport(Import)] + internal static extern void bugsnag_registerForSessionCallbacksAfterStart(Func callback); + internal delegate void SessionInformation(IntPtr instance, string sessionId, string startedAt, int handled, int unhandled); [DllImport(Import)] internal static extern void bugsnag_retrieveCurrentSession(IntPtr instance, SessionInformation callback); diff --git a/src/BugsnagUnity/Native/Cocoa/NativeDevice.cs b/src/BugsnagUnity/Native/Cocoa/NativeDevice.cs index 9848669ce..aac369c67 100644 --- a/src/BugsnagUnity/Native/Cocoa/NativeDevice.cs +++ b/src/BugsnagUnity/Native/Cocoa/NativeDevice.cs @@ -14,6 +14,8 @@ public class NativeDevice : IDevice private const string MODEL_KEY = "model"; private const string OS_NAME_KEY = "osName"; private const string OS_VERSION_KEY = "osVersion"; + private const string MODEL_NUMBER_KEY = "modelNumber"; + private const string TOTAL_MEMORY_KEY = "totalMemory"; internal NativePayloadClassWrapper NativeWrapper; @@ -25,11 +27,9 @@ public NativeDevice(IntPtr nativeDevice) public string BrowserName { get; set; } public string BrowserVersion { get; set; } public string[] CpuAbi { get; set; } - public long? TotalMemory { get; set; } + public long? TotalMemory {get => NativeWrapper.GetNativeLong(TOTAL_MEMORY_KEY); set => NativeWrapper.SetNativeLong(TOTAL_MEMORY_KEY, value); } public string UserAgent { get; set; } - public string ModelNumber { get; set; } - - + public string ModelNumber { get => NativeWrapper.GetNativeString(MODEL_NUMBER_KEY); set => NativeWrapper.SetNativeString(MODEL_NUMBER_KEY,value); } public string Id { get => NativeWrapper.GetNativeString(ID_KEY); set => NativeWrapper.SetNativeString(ID_KEY,value); } public bool? Jailbroken { get => NativeWrapper.GetNativeBool(JAIL_BROKEN_KEY); set => NativeWrapper.SetNativeBool(JAIL_BROKEN_KEY, value); } diff --git a/src/BugsnagUnity/Native/Cocoa/NativeEvent.cs b/src/BugsnagUnity/Native/Cocoa/NativeEvent.cs index 010141b9f..dc4c12f17 100644 --- a/src/BugsnagUnity/Native/Cocoa/NativeEvent.cs +++ b/src/BugsnagUnity/Native/Cocoa/NativeEvent.cs @@ -28,7 +28,13 @@ public class NativeEvent : NativePayloadClassWrapper, IEvent public string GroupingHash { get => GetNativeString(GROUPING_HASH_KEY); set => SetNativeString(GROUPING_HASH_KEY, value); } - public bool? Unhandled { get => GetNativeBool(UNHANDLED_KEY); set => SetNativeBool(UNHANDLED_KEY, value); } + public bool Unhandled { + get { + var nativeBool = GetNativeBool(UNHANDLED_KEY); + return nativeBool.HasValue ? nativeBool.Value : false; + } + set => SetNativeBool(UNHANDLED_KEY, value); + } private List _breadcrumbs = new List(); diff --git a/src/BugsnagUnity/Native/Fallback/CacheManager.cs b/src/BugsnagUnity/Native/Fallback/CacheManager.cs index 9abcec45f..ee44eb663 100644 --- a/src/BugsnagUnity/Native/Fallback/CacheManager.cs +++ b/src/BugsnagUnity/Native/Fallback/CacheManager.cs @@ -70,19 +70,23 @@ private string[] GetFilesBySuffix(string path, string suffix) public string GetCachedDeviceId() { + + if (!_configuration.GenerateAnonymousId) + { + return string.Empty; + } try { - var deviceId = string.Empty; if (File.Exists(_deviceIdFile)) { - deviceId = File.ReadAllText(_deviceIdFile); + // return existing cached device id + return File.ReadAllText(_deviceIdFile); } - if (string.IsNullOrEmpty(deviceId) && _configuration.GenerateAnonymousId) - { - deviceId = Guid.NewGuid().ToString(); - SaveDeviceIdToCache(deviceId); - } - return deviceId; + + // create and cache new random device id + var newDeviceId = Guid.NewGuid().ToString(); + SaveDeviceIdToCache(newDeviceId); + return newDeviceId; } catch { @@ -184,9 +188,13 @@ private void DeleteFile(string path) private void WriteFile(string path, string data) { + // not using File.WriteAllText to avoid under the hood buffering. We want the file to be written immediately to avoid truncation in case of a crash try { - File.WriteAllText(path, data); + var file = File.Create(path); + file.Write(System.Text.Encoding.UTF8.GetBytes(data), 0, data.Length); + file.Flush(); + file.Close(); }catch { } } diff --git a/src/BugsnagUnity/Native/Fallback/NativeClient.cs b/src/BugsnagUnity/Native/Fallback/NativeClient.cs index 89cac8ce3..fad9b85e7 100644 --- a/src/BugsnagUnity/Native/Fallback/NativeClient.cs +++ b/src/BugsnagUnity/Native/Fallback/NativeClient.cs @@ -50,7 +50,7 @@ private void AddIsLaunching(AppWithState app) } else { - isLaunching = app.DurationInForeground?.TotalMilliseconds < Configuration.LaunchDurationMillis; + isLaunching = app.Duration?.TotalMilliseconds < Configuration.LaunchDurationMillis; } app.IsLaunching = isLaunching; } @@ -164,5 +164,10 @@ public bool ShouldAttemptDelivery() { return true; } + + public void RegisterForOnSessionCallbacks() + { + // Not Used on this platform + } } } diff --git a/src/BugsnagUnity/Native/Windows/NativeClient.cs b/src/BugsnagUnity/Native/Windows/NativeClient.cs index cdbf16e47..4a62868e7 100644 --- a/src/BugsnagUnity/Native/Windows/NativeClient.cs +++ b/src/BugsnagUnity/Native/Windows/NativeClient.cs @@ -44,7 +44,7 @@ private void AddIsLaunching(AppWithState app) } else { - isLaunching = app.DurationInForeground?.TotalMilliseconds < Configuration.LaunchDurationMillis; + isLaunching = app.Duration?.TotalMilliseconds < Configuration.LaunchDurationMillis; } app.IsLaunching = isLaunching; } @@ -211,5 +211,10 @@ public bool ShouldAttemptDelivery() { return true; } + + public void RegisterForOnSessionCallbacks() + { + // Not Used on this platform + } } } diff --git a/src/BugsnagUnity/Payload/AppWithState.cs b/src/BugsnagUnity/Payload/AppWithState.cs index defb1788c..cd2929c07 100644 --- a/src/BugsnagUnity/Payload/AppWithState.cs +++ b/src/BugsnagUnity/Payload/AppWithState.cs @@ -56,7 +56,7 @@ internal AppWithState(Dictionary cachedData) : base(cachedData){ internal AppWithState(Configuration configuration) : base(configuration) { - Duration = TimeSpan.FromSeconds(Time.realtimeSinceStartup); + Duration = TimeSpan.FromSeconds(UnityEngine.Time.realtimeSinceStartup); } } diff --git a/src/BugsnagUnity/Payload/Error.cs b/src/BugsnagUnity/Payload/Error.cs index b194feb13..e5711a405 100644 --- a/src/BugsnagUnity/Payload/Error.cs +++ b/src/BugsnagUnity/Payload/Error.cs @@ -144,7 +144,7 @@ internal static Error FromSystemException(System.Exception exception, System.Dia var androidErrorData = ProcessAndroidError(exception.Message); var androidErrorClass = androidErrorData[0]; var androidErrorMessage = androidErrorData[1]; - var lines = new StackTrace(exception.StackTrace, StackTraceFormat.AndroidJava).ToArray(); + var lines = new StackTrace(exception.StackTrace, StackTraceFormat.AndroidJava).StackTraceLines; return new Error(androidErrorClass, androidErrorMessage, lines, HandledState.ForUnhandledException(), true); } else @@ -152,11 +152,11 @@ internal static Error FromSystemException(System.Exception exception, System.Dia StackTraceLine[] lines; if (!string.IsNullOrEmpty(exception.StackTrace)) { - lines = new StackTrace(exception.StackTrace).ToArray(); + lines = new StackTrace(exception.StackTrace).StackTraceLines; } else { - lines = new StackTrace(alternativeStackTrace).ToArray(); + lines = new StackTrace(alternativeStackTrace).StackTraceLines; } return new Error(errorClass, exception.Message, lines); } @@ -165,14 +165,14 @@ internal static Error FromSystemException(System.Exception exception, System.Dia internal static Error FromStringInfo(string name, string message, string stacktrace) { - var stackFrames = new StackTrace(stacktrace).ToArray(); + var stackFrames = new StackTrace(stacktrace).StackTraceLines; return new Error(name, message, stackFrames); } internal static Error FromSystemException(System.Exception exception, string stackTrace) { var errorClass = exception.GetType().Name; - var lines = new StackTrace(stackTrace).ToArray(); + var lines = new StackTrace(stackTrace).StackTraceLines; return new Error(errorClass, exception.Message, lines); } @@ -209,10 +209,10 @@ public static Error FromUnityLogMessage(UnityLogMessage logMessage, System.Diagn { var match = Regex.Match(logMessage.Condition, ERROR_CLASS_MESSAGE_PATTERN, RegexOptions.Singleline); - var lines = new StackTrace(logMessage.StackTrace).ToArray(); + var lines = new StackTrace(logMessage.StackTrace).StackTraceLines; if (lines.Length == 0) { - lines = new StackTrace(fallbackStackFrames).ToArray(); + lines = new StackTrace(fallbackStackFrames).StackTraceLines; } var handledState = forceUnhandled @@ -231,7 +231,7 @@ public static Error FromUnityLogMessage(UnityLogMessage logMessage, System.Diagn var androidErrorData = ProcessAndroidError(message); errorClass = androidErrorData[0]; message = androidErrorData[1]; - lines = new StackTrace(logMessage.StackTrace, StackTraceFormat.AndroidJava).ToArray(); + lines = new StackTrace(logMessage.StackTrace, StackTraceFormat.AndroidJava).StackTraceLines; handledState = HandledState.ForUnhandledException(); } return new Error(errorClass, message, lines, handledState, isAndroidJavaException); diff --git a/src/BugsnagUnity/Payload/Event.cs b/src/BugsnagUnity/Payload/Event.cs index bfde88c2b..e1e845123 100644 --- a/src/BugsnagUnity/Payload/Event.cs +++ b/src/BugsnagUnity/Payload/Event.cs @@ -61,6 +61,11 @@ internal Event(Dictionary serialisedPayload) { Add("unhandled", eventObject["unhandled"]); } + else + { + Add("unhandled", false); + } + if (eventObject["severity"] != null) { Add("severity", eventObject["severity"]); @@ -190,7 +195,17 @@ internal void AddAndroidProjectPackagesToEvent(string[] packages) internal LogType? LogType { get; } - public bool? Unhandled { get => (bool)Get("unhandled"); set => Add("unhandled",value); } + public bool Unhandled { + get { + var currentValue = Get("unhandled"); + if (currentValue == null) + { + return false; + } + return (bool)currentValue; + } + set => Add("unhandled",value); + } internal bool IsHandled { diff --git a/src/BugsnagUnity/Payload/IEvent.cs b/src/BugsnagUnity/Payload/IEvent.cs index 86bd9c668..95b9c33e6 100644 --- a/src/BugsnagUnity/Payload/IEvent.cs +++ b/src/BugsnagUnity/Payload/IEvent.cs @@ -27,6 +27,6 @@ public interface IEvent: IMetadataEditor, IUserEditor, IFeatureFlagStore List Threads { get; } - bool? Unhandled { get; set; } + bool Unhandled { get; set; } } } diff --git a/src/BugsnagUnity/Payload/StackTraceLine.cs b/src/BugsnagUnity/Payload/StackTraceLine.cs index 76a3fe4c6..d98bd02f4 100644 --- a/src/BugsnagUnity/Payload/StackTraceLine.cs +++ b/src/BugsnagUnity/Payload/StackTraceLine.cs @@ -16,7 +16,7 @@ internal enum StackTraceFormat { Standard, AndroidJava }; /// class StackTrace : IEnumerable { - private StackTraceLine[] StackTraceLines { get; } + public StackTraceLine[] StackTraceLines { get; private set; } internal StackTrace(StackFrame[] stackFrames) { @@ -43,12 +43,9 @@ internal StackTrace(string stackTrace, StackTraceFormat format) var frame = format == StackTraceFormat.AndroidJava ? StackTraceLine.FromAndroidJavaMessage(lines[i]) : StackTraceLine.FromLogMessage(lines[i]); + if (frame != null) { - if (frame.Method.StartsWith("at ")) - { - frame.Method = frame.Method.TrimStart('a', 't', ' '); - } frames.Add(frame); } } @@ -74,8 +71,9 @@ IEnumerator IEnumerable.GetEnumerator() /// public class StackTraceLine : Dictionary, IStackframe { - private static Regex StackTraceLineRegex { get; } = new Regex(@"(?[^()]+)(?\([^()]*?\))(?:\s(?:\[.*\]\s*in\s|\(at\s*\s*)(?.*):(?\d+))?"); - private static Regex StackTraceAndroidJavaLineRegex { get; } = new Regex(@"^\s*(?[a-z][^()]+)\((?[^:]*)?(?::(?\d+))?\)"); + private static Regex StackTraceLineRegex { get; } = new Regex(@"(?:\s*at\s)?(?(?:\(.*\)\s)?[^()]+)(?\([^()]*?\))(?:\s(?:\[.*\]\s*in\s|\(at\s*\s*)(?.*):(?\d+))?"); + private static Regex StackTraceAndroidJavaLineRegex { get; } = new Regex(@"^\s*(?:at\s)?(?[a-z][^()]+)\((?[^:]*)?(?::(?\d+))?\)"); + public static StackTraceLine FromLogMessage(string message) { diff --git a/src/BugsnagUnity/Time.cs b/src/BugsnagUnity/Time.cs new file mode 100644 index 000000000..1cd66d703 --- /dev/null +++ b/src/BugsnagUnity/Time.cs @@ -0,0 +1,36 @@ +using System; +using System.Diagnostics; + +namespace BugsnagUnity +{ + // A simple timer used internally to avoid thread complications when using the unity Time API + internal class Time + { + + private static object _swLock = new object(); + + private static Stopwatch _sw; + + internal static Stopwatch Timer + { + get + { + if (_sw == null) + { + lock (_swLock) + { + if (_sw == null) + { + _sw = Stopwatch.StartNew(); + } + } + } + return _sw; + } + } + + internal static double ElapsedSeconds => Timer.Elapsed.TotalSeconds; + + } +} + diff --git a/src/BugsnagUnity/UniqueLogThrottle.cs b/src/BugsnagUnity/UniqueLogThrottle.cs index 0bc052ed7..102ff73d4 100644 --- a/src/BugsnagUnity/UniqueLogThrottle.cs +++ b/src/BugsnagUnity/UniqueLogThrottle.cs @@ -3,51 +3,36 @@ namespace BugsnagUnity { - /// - /// Applies the configured unique log throttling rules. - /// public class UniqueLogThrottle { private readonly object _lock = new object(); - - /// - /// Used to track the unique messages received. - /// private Dictionary Counter { get; } - - /// - /// Used to track when the counter should be flushed next - /// - private DateTime FlushAt { get; set; } - - /// - /// The configuration for unique log counts and times - /// + private double FlushAt { get; set; } = -1; private Configuration Configuration { get; } - private TimeSpan UniqueLogsTimePeriod => Configuration.SecondsPerUniqueLog; + private double UniqueLogsTimePeriod => Configuration.SecondsPerUniqueLog.TotalSeconds; + + private void EnsureFlushTimeIsSet() + { + if (FlushAt < 0) + { + FlushAt = Time.ElapsedSeconds + UniqueLogsTimePeriod; + } + } public UniqueLogThrottle(Configuration configuration) { Configuration = configuration; Counter = new Dictionary(new UnityLogMessageEqualityComparer()); - FlushAt = DateTime.UtcNow.Add(Configuration.SecondsPerUniqueLog); } - /// - /// Determines if this log message should be sent to Bugsnag based on the - /// configured rules around unique log messages with a time period. - /// - /// - /// public bool ShouldSend(UnityLogMessage unityLogMessage) { bool shouldSend; - lock (_lock) { + EnsureFlushTimeIsSet(); shouldSend = !Counter.ContainsKey(unityLogMessage); - if (shouldSend) { Counter.Add(unityLogMessage, 0); @@ -57,30 +42,24 @@ public bool ShouldSend(UnityLogMessage unityLogMessage) if (unityLogMessage.CreatedAt > FlushAt) { Counter.Clear(); - FlushAt = DateTime.UtcNow.Add(UniqueLogsTimePeriod); + FlushAt = Time.ElapsedSeconds + UniqueLogsTimePeriod; shouldSend = true; } } } - return shouldSend; } - /// - /// Used to determine if log messages are unique. - /// class UnityLogMessageEqualityComparer : EqualityComparer { public override bool Equals(UnityLogMessage x, UnityLogMessage y) { - return x.Condition == y.Condition - && x.StackTrace == y.StackTrace - && x.Type == y.Type; + return x.Condition == y.Condition && x.StackTrace == y.StackTrace && x.Type == y.Type; } public override int GetHashCode(UnityLogMessage obj) { - unchecked // Overflow is fine, just wrap + unchecked { int hash = 17; hash = hash * 23 + obj.Condition.GetHashCode(); diff --git a/src/BugsnagUnity/UnityLogMessage.cs b/src/BugsnagUnity/UnityLogMessage.cs index 3471e4f05..832f8712d 100644 --- a/src/BugsnagUnity/UnityLogMessage.cs +++ b/src/BugsnagUnity/UnityLogMessage.cs @@ -10,7 +10,7 @@ public class UnityLogMessage { public UnityLogMessage(string condition, string stackTrace, LogType type) { - CreatedAt = DateTime.UtcNow; + CreatedAt = Time.ElapsedSeconds; Condition = condition; StackTrace = stackTrace; Type = type; @@ -18,7 +18,7 @@ public UnityLogMessage(string condition, string stackTrace, LogType type) public UnityLogMessage(Exception exception) { - CreatedAt = DateTime.UtcNow; + CreatedAt = Time.ElapsedSeconds; Condition = exception.Message == null ? string.Empty : exception.Message; StackTrace = exception.StackTrace == null ? string.Empty : exception.StackTrace; Type = LogType.Exception; @@ -30,7 +30,7 @@ public UnityLogMessage(Exception exception) public LogType Type { get; } - public DateTime CreatedAt { get; } + public double CreatedAt { get; } } diff --git a/src/Directory.build.props b/src/Directory.build.props index 511b079f3..c4391e71a 100644 --- a/src/Directory.build.props +++ b/src/Directory.build.props @@ -1,18 +1,16 @@  - net35 - 7.1 - C:\Program Files\Unity\Editor\Data\Managed - \Applications\Unity\Unity.app\Contents\Managed + netstandard2.0 + 8.0 1.0.0 - $(UnityDir)\UnityEngine.dll + /Applications/Unity/Hub/Editor/$(UNITY_VERSION)/Unity.app/Contents/Managed/UnityEngine.dll false - $(UnityDir)\UnityEditor.dll + /Applications/Unity/Hub/Editor/$(UNITY_VERSION)/Unity.app/Contents/Managed/UnityEditor.dll false diff --git a/tests/BugsnagUnity.Tests/BugsnagUnity.Tests.csproj b/tests/BugsnagUnity.Tests/BugsnagUnity.Tests.csproj index 7418792b5..ca2ff1f7f 100644 --- a/tests/BugsnagUnity.Tests/BugsnagUnity.Tests.csproj +++ b/tests/BugsnagUnity.Tests/BugsnagUnity.Tests.csproj @@ -1,18 +1,7 @@  - net35 - 7.1 + net8.0 - - 8.0 - - - 8.0 - - - - - @@ -22,4 +11,9 @@ Always + + + + + diff --git a/tests/BugsnagUnity.Tests/ConfigurationTests.cs b/tests/BugsnagUnity.Tests/ConfigurationTests.cs index 3551fa9be..2d02978fc 100644 --- a/tests/BugsnagUnity.Tests/ConfigurationTests.cs +++ b/tests/BugsnagUnity.Tests/ConfigurationTests.cs @@ -1,14 +1,16 @@ -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; using System.Linq; +using System.Text.RegularExpressions; using System.Threading; -using UnityEngine; namespace BugsnagUnity.Payload.Tests { - [TestFixture] - class ConfigurationTests + [TestClass] + public class ConfigurationTests { - [Test] + [TestMethod] public void DefaultConfigurationValues() { var config = new Configuration("foo"); @@ -21,60 +23,57 @@ public void DefaultConfigurationValues() Assert.AreEqual("foo", config.ApiKey); } - - [Test] + [TestMethod] public void MaxBreadcrumbsLimit() { var config = new Configuration("foo"); config.MaximumBreadcrumbs = 501; - Assert.AreEqual(config.MaximumBreadcrumbs, 100); + Assert.AreEqual(100, config.MaximumBreadcrumbs); config.MaximumBreadcrumbs = -1; - Assert.AreEqual(config.MaximumBreadcrumbs, 100); + Assert.AreEqual(100, config.MaximumBreadcrumbs); config.MaximumBreadcrumbs = 20; - Assert.AreEqual(config.MaximumBreadcrumbs, 20); + Assert.AreEqual(20, config.MaximumBreadcrumbs); } - [Test] + [TestMethod] public void CloneTest() { var original = new Configuration("foo"); original.MaximumBreadcrumbs = 1; original.ReleaseStage = "1"; - original.SetUser("1","1","1"); + original.SetUser("1", "1", "1"); var clone = original.Clone(); - //int check + // int check Assert.AreEqual(original.MaximumBreadcrumbs, clone.MaximumBreadcrumbs); clone.MaximumBreadcrumbs = 2; Assert.AreEqual(1, original.MaximumBreadcrumbs); - Assert.AreEqual( 2, clone.MaximumBreadcrumbs); + Assert.AreEqual(2, clone.MaximumBreadcrumbs); - //string check + // string check clone.ReleaseStage = "2"; Assert.AreNotEqual(original.ReleaseStage, clone.ReleaseStage); - - //user check + // user check clone.SetUser("2", "2", "2"); Assert.AreEqual("1", original.GetUser().Name); Assert.AreEqual("2", clone.GetUser().Name); } - - [Test] + [TestMethod] public void EndpointValidation() { var config = new Configuration("foo"); Assert.IsTrue(config.Endpoints.IsValid); - config.Endpoints.Notify = new System.Uri("https://www.richIsCool.com/"); + config.Endpoints.Notify = new Uri("https://www.richIsCool.com/"); Assert.IsFalse(config.Endpoints.IsValid); - config.Endpoints.Session = new System.Uri("https://www.richIsSuperCool.com/"); + config.Endpoints.Session = new Uri("https://www.richIsSuperCool.com/"); Assert.IsTrue(config.Endpoints.IsValid); @@ -82,5 +81,125 @@ public void EndpointValidation() Assert.IsFalse(config.Endpoints.IsValid); } + + [TestMethod] + public void RedactedKeysTest() + { + var config = new Configuration("foo"); + + // Default redacted keys + Assert.IsTrue(config.KeyIsRedacted("user-password")); + Assert.IsFalse(config.KeyIsRedacted("username")); + + var config2 = new Configuration("foo"); + + // Custom redacted keys + config2.RedactedKeys.Add(new Regex(".*secret.*", RegexOptions.IgnoreCase)); + config2.RedactedKeys.Add(new Regex(".*token.*", RegexOptions.IgnoreCase)); + Assert.IsTrue(config2.KeyIsRedacted("secret")); + Assert.IsTrue(config2.KeyIsRedacted("token")); + Assert.IsTrue(config2.KeyIsRedacted("password")); + Assert.IsFalse(config2.KeyIsRedacted("app_id")); + } + + [TestMethod] + public void DiscardedClassesTest() + { + var config = new Configuration("foo"); + + // No discard classes by default + Assert.IsFalse(config.ErrorClassIsDiscarded("System.Exception")); + + var config2 = new Configuration("foo"); + + // Adding discard classes + config2.DiscardClasses.Add(new Regex("^System\\.Exception$", RegexOptions.IgnoreCase)); + config2.DiscardClasses.Add(new Regex("^System\\.NullReferenceException$", RegexOptions.IgnoreCase)); + Assert.IsTrue(config2.ErrorClassIsDiscarded("System.Exception")); + Assert.IsTrue(config2.ErrorClassIsDiscarded("System.NullReferenceException")); + Assert.IsFalse(config2.ErrorClassIsDiscarded("System.ArgumentException")); + } + + [TestMethod] + public void ThreadSafeCallbacksTest() + { + var config = new Configuration("foo"); + + // Define a simple callback function + Func callback1 = (e) => true; + Func callback2 = (e) => false; + Func sessionCallback = (s) => true; + + // We will use these lists to store the results from multiple threads + List onErrorResults = new List(); + List onSendErrorResults = new List(); + List onSessionResults = new List(); + + // Adding callbacks in multiple threads + Thread addThread1 = new Thread(() => + { + for (int i = 0; i < 50; i++) + { + config.AddOnError(callback1); + config.AddOnSendError(callback2); + config.AddOnSession(sessionCallback); + } + }); + + Thread addThread2 = new Thread(() => + { + for (int i = 0; i < 50; i++) + { + config.AddOnError(callback2); + config.AddOnSendError(callback1); + config.AddOnSession(sessionCallback); + } + }); + + // Removing callbacks in multiple threads + Thread removeThread1 = new Thread(() => + { + for (int i = 0; i < 25; i++) + { + config.RemoveOnError(callback1); + config.RemoveOnSendError(callback2); + config.RemoveOnSession(sessionCallback); + } + }); + + Thread removeThread2 = new Thread(() => + { + for (int i = 0; i < 25; i++) + { + config.RemoveOnError(callback2); + config.RemoveOnSendError(callback1); + config.RemoveOnSession(sessionCallback); + } + }); + + // Start all threads + addThread1.Start(); + addThread2.Start(); + removeThread1.Start(); + removeThread2.Start(); + + // Wait for all threads to complete + addThread1.Join(); + addThread2.Join(); + removeThread1.Join(); + removeThread2.Join(); + + // Verify the state of the callback lists + // The exact number might vary depending on the execution order, + // but there should be no exceptions thrown and the list should not be empty + Assert.IsTrue(config.GetOnErrorCallbacks().Count > 0, "OnErrorCallbacks should have entries."); + Assert.IsTrue(config.GetOnSendErrorCallbacks().Count > 0, "OnSendErrorCallbacks should have entries."); + Assert.IsTrue(config.GetOnSessionCallbacks().Count > 0, "OnSessionCallbacks should have entries."); + + // Check if the remaining callbacks are as expected + Assert.IsTrue(config.GetOnErrorCallbacks().Contains(callback1) || config.GetOnErrorCallbacks().Contains(callback2), "Callback1 or Callback2 should be in OnErrorCallbacks."); + Assert.IsTrue(config.GetOnSendErrorCallbacks().Contains(callback1) || config.GetOnSendErrorCallbacks().Contains(callback2), "Callback1 or Callback2 should be in OnSendErrorCallbacks."); + Assert.IsTrue(config.GetOnSessionCallbacks().Contains(sessionCallback), "SessionCallback should be in OnSessionCallbacks."); + } } } diff --git a/tests/BugsnagUnity.Tests/ExceptionTests.cs b/tests/BugsnagUnity.Tests/ExceptionTests.cs index 8033a51eb..10a61fe09 100644 --- a/tests/BugsnagUnity.Tests/ExceptionTests.cs +++ b/tests/BugsnagUnity.Tests/ExceptionTests.cs @@ -1,14 +1,14 @@ -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Linq; using System.Threading; using UnityEngine; namespace BugsnagUnity.Payload.Tests { - [TestFixture] - class ExceptionTests + [TestClass] + public class ExceptionTests { - [Test] + [TestMethod] public void ParseExceptionFromLogMessage() { string condition = "IndexOutOfRangeException: Array index is out of range."; @@ -21,7 +21,7 @@ public void ParseExceptionFromLogMessage() UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) [0x00000] in :0"; var logType = UnityEngine.LogType.Error; var log = new UnityLogMessage(condition, stacktrace, logType); - Assert.True(Error.ShouldSend(log)); + Assert.IsTrue(Error.ShouldSend(log)); var exception = Error.FromUnityLogMessage(log, new System.Diagnostics.StackFrame[] { }, Severity.Info); var stack = exception.Stacktrace.ToList(); @@ -51,7 +51,7 @@ public void ParseExceptionFromLogMessage() Assert.AreEqual(0, stack[6].LineNumber); } - [Test] + [TestMethod] public void ParseDuplicateAndroidExceptionFromLogMessage() { string condition = "AndroidJavaException: java.lang.Error"; @@ -61,10 +61,10 @@ public void ParseDuplicateAndroidExceptionFromLogMessage() app_process64.000d1b11(Unknown:-2)"; var logType = UnityEngine.LogType.Error; var log = new UnityLogMessage(condition, stacktrace, logType); - Assert.False(Error.ShouldSend(log)); + Assert.IsFalse(Error.ShouldSend(log)); } - [Test] + [TestMethod] public void ParseAndroidExceptionFromLogMessage() { string condition = "AndroidJavaException: java.lang.IllegalArgumentException"; @@ -73,11 +73,11 @@ public void ParseAndroidExceptionFromLogMessage() com.unity3d.player.UnityPlayer.nativeRender(Native Method)"; var logType = UnityEngine.LogType.Error; var log = new UnityLogMessage(condition, stacktrace, logType); - Assert.True(Error.ShouldSend(log)); + Assert.IsTrue(Error.ShouldSend(log)); var exception = Error.FromUnityLogMessage(log, new System.Diagnostics.StackFrame[] { }, Severity.Warning); var stack = exception.Stacktrace.ToList(); Assert.AreEqual("java.lang.IllegalArgumentException", exception.ErrorClass); - Assert.True(System.String.IsNullOrEmpty(exception.ErrorMessage)); + Assert.IsTrue(System.String.IsNullOrEmpty(exception.ErrorMessage)); Assert.AreEqual(2, stack.Count); Assert.AreEqual("com.example.bugsnagcrashplugin.CrashHelper.UnhandledCrash()", stack[0].Method); Assert.AreEqual("CrashHelper.java", stack[0].File); @@ -87,7 +87,7 @@ public void ParseAndroidExceptionFromLogMessage() Assert.AreEqual(null, stack[1].LineNumber); } - [Test] + [TestMethod] public void ParseAndroidExceptionAndMessageFromLogMessage() { string condition = "AndroidJavaException: java.lang.ArrayIndexOutOfBoundsException: length=2; index=2"; @@ -107,7 +107,7 @@ public void ParseAndroidExceptionAndMessageFromLogMessage() UnityEngine.EventSystems.EventSystem:Update()"; var logType = UnityEngine.LogType.Error; var log = new UnityLogMessage(condition, stacktrace, logType); - Assert.True(Error.ShouldSend(log)); + Assert.IsTrue(Error.ShouldSend(log)); var exception = Error.FromUnityLogMessage(log, new System.Diagnostics.StackFrame[] { }, Severity.Warning); var stack = exception.Stacktrace.ToList(); @@ -156,4 +156,3 @@ public void ParseAndroidExceptionAndMessageFromLogMessage() } } } - diff --git a/tests/BugsnagUnity.Tests/MaximumLogTypeCounterTests.cs b/tests/BugsnagUnity.Tests/MaximumLogTypeCounterTests.cs index 747713525..3609a1e30 100644 --- a/tests/BugsnagUnity.Tests/MaximumLogTypeCounterTests.cs +++ b/tests/BugsnagUnity.Tests/MaximumLogTypeCounterTests.cs @@ -1,15 +1,15 @@ -using NUnit.Framework; -using System; +using System; using System.Collections.Generic; using System.Threading; using UnityEngine; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace BugsnagUnity.Tests { - [TestFixture] + [TestClass] public class MaximumLogTypeCounterTests { - [Test] + [TestMethod] public void SendsSingleMessage() { Dictionary maximumTypePerTimePeriod = @@ -22,12 +22,12 @@ public void SendsSingleMessage() var counter = new MaximumLogTypeCounter(configuration); - var message = new UnityLogMessage("", "", LogType.Error); + var message = new UnityLogMessage("", "", UnityEngine.LogType.Error); - Assert.True(counter.ShouldSend(message)); + Assert.IsTrue(counter.ShouldSend(message)); } - [Test] + [TestMethod] public void ShouldNotSendOverLimitMessages() { Dictionary maximumTypePerTimePeriod = @@ -44,10 +44,10 @@ public void ShouldNotSendOverLimitMessages() var message2 = new UnityLogMessage("", "", LogType.Error); counter.ShouldSend(message1); - Assert.False(counter.ShouldSend(message2)); + Assert.IsFalse(counter.ShouldSend(message2)); } - [Test] + [TestMethod] public void ShouldSendUnderTheLimit() { Dictionary maximumTypePerTimePeriod = @@ -66,14 +66,14 @@ public void ShouldSendUnderTheLimit() var message4 = new UnityLogMessage("", "", LogType.Error); var message5 = new UnityLogMessage("", "", LogType.Error); - Assert.True(counter.ShouldSend(message1)); - Assert.True(counter.ShouldSend(message2)); - Assert.True(counter.ShouldSend(message3)); - Assert.True(counter.ShouldSend(message4)); - Assert.True(counter.ShouldSend(message5)); + Assert.IsTrue(counter.ShouldSend(message1)); + Assert.IsTrue(counter.ShouldSend(message2)); + Assert.IsTrue(counter.ShouldSend(message3)); + Assert.IsTrue(counter.ShouldSend(message4)); + Assert.IsTrue(counter.ShouldSend(message5)); } - [Test] + [TestMethod] public void DontTrackCertainLogType() { Dictionary maximumTypePerTimePeriod = @@ -89,10 +89,10 @@ public void DontTrackCertainLogType() var message = new UnityLogMessage("", "", LogType.Error); - Assert.True(counter.ShouldSend(message)); + Assert.IsTrue(counter.ShouldSend(message)); } - [Test] + [TestMethod] public void FlushesCorrectly() { Dictionary maximumTypePerTimePeriod = @@ -114,7 +114,7 @@ public void FlushesCorrectly() message = new UnityLogMessage("", "", LogType.Error); - Assert.True(counter.ShouldSend(message)); + Assert.IsTrue(counter.ShouldSend(message)); } } } diff --git a/tests/BugsnagUnity.Tests/OverloadCheck.cs b/tests/BugsnagUnity.Tests/OverloadCheck.cs new file mode 100644 index 000000000..79ac13c25 --- /dev/null +++ b/tests/BugsnagUnity.Tests/OverloadCheck.cs @@ -0,0 +1,33 @@ +using System; +namespace BugsnagUnity.Tests +{ + public class OverloadCheck + { + + // this method never runs and is just used to check that no notify overides are accidentally broken during refactoring + // if one is broken then the notifier will not compile + private void Check() + { + Bugsnag.Notify("name", "message", "stacktrace"); + + Bugsnag.Notify("name", "message", "stacktrace", CallBack); + + Bugsnag.Notify(new Exception()); + + Bugsnag.Notify(new Exception(), "stacktrace"); + + Bugsnag.Notify(new Exception(), "stacktrace", CallBack); + + Bugsnag.Notify(new Exception(), CallBack); + + Bugsnag.Notify(new Exception(), Severity.Error); + + Bugsnag.Notify(new Exception(), Severity.Error, CallBack); + } + + private bool CallBack(IEvent e) + { + return true; + } + } +} diff --git a/tests/BugsnagUnity.Tests/PostProcessBuildTests.cs b/tests/BugsnagUnity.Tests/PostProcessBuildTests.cs index c7c06ec5d..2bae8dd07 100644 --- a/tests/BugsnagUnity.Tests/PostProcessBuildTests.cs +++ b/tests/BugsnagUnity.Tests/PostProcessBuildTests.cs @@ -2,16 +2,17 @@ using System.Collections.Generic; using System.IO; using System.Reflection; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace BugsnagUnity.Tests { - [TestFixture] + [TestClass] public class PostProcessBuildTests { - [TestCase("one")] - [TestCase("two")] - [TestCase("three")] + [DataTestMethod] + [DataRow("one")] + [DataRow("two")] + [DataRow("three")] public void Test(string fileIdentifier) { string directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); @@ -19,10 +20,9 @@ public void Test(string fileIdentifier) var input = new LinkedList(File.ReadAllLines(Path.Combine(directory, $"test_{fileIdentifier}_input.pbxproj"))); var output = new LinkedList(File.ReadAllLines(Path.Combine(directory, $"test_{fileIdentifier}_output.pbxproj"))); - PostProcessBuild.Apply(input, "186208CC13E64B42A13CCD74"); - Assert.AreEqual(output, input); + CollectionAssert.AreEqual(new List(output), new List(input)); } } } diff --git a/tests/BugsnagUnity.Tests/SessionTrackerTests.cs b/tests/BugsnagUnity.Tests/SessionTrackerTests.cs index 5d6f48e62..3ec5cd1bf 100644 --- a/tests/BugsnagUnity.Tests/SessionTrackerTests.cs +++ b/tests/BugsnagUnity.Tests/SessionTrackerTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Linq; using System.Threading; @@ -6,11 +6,10 @@ namespace BugsnagUnity.Payload.Tests { - [TestFixture] - class SessionTrackerTests + [TestClass] + public class SessionTrackerTests { - - public SessionTracker Tracker { get; set; } + private SessionTracker Tracker { get; set; } public SessionTrackerTests() { @@ -22,7 +21,7 @@ public SessionTrackerTests() /** * Verifies that a session can be resumed after it is stopped */ - [Test] + [TestMethod] public void ResumeFromStoppedSession() { Tracker.StartSession(); @@ -39,7 +38,7 @@ public void ResumeFromStoppedSession() /** * Verifies that the previous session is resumed when calling SessionTracker.ResumeSession */ - [Test] + [TestMethod] public void ResumeWithNoStoppedSession() { Tracker.StartSession(); @@ -51,7 +50,7 @@ public void ResumeWithNoStoppedSession() /** * Verifies that a new session can be created after the previous one is stopped */ - [Test] + [TestMethod] public void StartNewAfterStoppedSession() { Tracker.StartSession(); @@ -65,7 +64,7 @@ public void StartNewAfterStoppedSession() /** * Verifies that calling SessionTracker.ResumeSession multiple times only starts one session */ - [Test] + [TestMethod] public void MultipleResumesHaveNoEffect() { Tracker.StartSession(); @@ -74,16 +73,15 @@ public void MultipleResumesHaveNoEffect() Assert.IsTrue(Tracker.ResumeSession()); Assert.IsTrue(SessionsAreTheSame(original, Tracker.CurrentSession)); - + Assert.IsFalse(Tracker.ResumeSession()); Assert.IsTrue(SessionsAreTheSame(original, Tracker.CurrentSession)); - } /** * Verifies that calling SessionTracker.StopSession multiple times only stops one session */ - [Test] + [TestMethod] public void MultipleStopsHaveNoEffect() { Tracker.StartSession(); diff --git a/tests/BugsnagUnity.Tests/StackFrameParsingTests.cs b/tests/BugsnagUnity.Tests/StackFrameParsingTests.cs index 30afb03f6..bca19c09d 100644 --- a/tests/BugsnagUnity.Tests/StackFrameParsingTests.cs +++ b/tests/BugsnagUnity.Tests/StackFrameParsingTests.cs @@ -1,13 +1,22 @@ -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Threading; using UnityEngine; namespace BugsnagUnity.Payload.Tests { - [TestFixture] - class StackFrameParsingTests + [TestClass] + public class StackFrameParsingTests { - [Test] + [TestMethod] + public void ParseMethodWithAt() + { + var stackframe = Payload.StackTraceLine.FromLogMessage( + "at UnityEngine.Events.InvokableCall.Invoke () [0x00010] in /Users/bokken/build/output/unity/unity/Runtime/Export/UnityEvent/UnityEvent.cs:178" + ); + Assert.AreEqual("UnityEngine.Events.InvokableCall.Invoke()", stackframe.Method); + } + + [TestMethod] public void ParseMethodNameWithColon() { var stackframe = Payload.StackTraceLine.FromLogMessage( @@ -18,18 +27,18 @@ public void ParseMethodNameWithColon() Assert.AreEqual("/Users/gameserver/parky/Assets/ReporterBehavior.cs", stackframe.File); } - [Test] + [TestMethod] public void ParseMethodNameWithColonWithoutFileInfo() { var stackframe = Payload.StackTraceLine.FromLogMessage( "UnityEngine.EventSystems.EventSystem:Update()" ); Assert.AreEqual("UnityEngine.EventSystems.EventSystem:Update()", stackframe.Method); - Assert.AreEqual(null, stackframe.LineNumber); - Assert.AreEqual(null, stackframe.File); + Assert.IsNull(stackframe.LineNumber); + Assert.IsNull(stackframe.File); } - [Test] + [TestMethod] public void ParseMethodNameWithSpace() { var stackframe = Payload.StackTraceLine.FromLogMessage( @@ -40,7 +49,7 @@ public void ParseMethodNameWithSpace() Assert.AreEqual("/Users/gameserver/parky/Assets/ReporterBehavior.cs", stackframe.File); } - [Test] + [TestMethod] public void ParseFilePathWithSpace() { var stackframe = Payload.StackTraceLine.FromLogMessage( @@ -51,7 +60,7 @@ public void ParseFilePathWithSpace() Assert.AreEqual("/Users/game server/parky/Assets/ReporterBehavior.cs", stackframe.File); } - [Test] + [TestMethod] public void ParseMethodArgument() { var stackframe = Payload.StackTraceLine.FromLogMessage( @@ -62,7 +71,7 @@ public void ParseMethodArgument() Assert.AreEqual("/Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs", stackframe.File); } - [Test] + [TestMethod] public void ParseMultipleMethodArguments() { var stackframe = Payload.StackTraceLine.FromLogMessage( @@ -73,7 +82,7 @@ public void ParseMultipleMethodArguments() Assert.AreEqual("/Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs", stackframe.File); } - [Test] + [TestMethod] public void ParseInterfaceMethod() { var stackframe = Payload.StackTraceLine.FromLogMessage( @@ -84,15 +93,34 @@ public void ParseInterfaceMethod() Assert.AreEqual("/Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs", stackframe.File); } - [Test] + [TestMethod] public void ParseGenericMethod() { var stackframe = Payload.StackTraceLine.FromLogMessage( "UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1].Invoke (.T1 handler, UnityEngine.EventSystems.BaseEventData eventData)" ); Assert.AreEqual("UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1].Invoke(.T1 handler, UnityEngine.EventSystems.BaseEventData eventData)", stackframe.Method); - Assert.AreEqual(null, stackframe.LineNumber); - Assert.AreEqual(null, stackframe.File); + Assert.IsNull(stackframe.LineNumber); + Assert.IsNull(stackframe.File); + } + + [TestMethod] + public void ParseUnknownManagedToNative() + { + var stackframe = Payload.StackTraceLine.FromLogMessage("at (wrapper managed-to-native) Program.NativeMethod(Program/StructToMarshal)"); + Assert.AreEqual("(wrapper managed-to-native) Program.NativeMethod(Program/StructToMarshal)", stackframe.Method); + + stackframe = Payload.StackTraceLine.FromLogMessage("at (wrapper scoop-de-woop) SomeClass.SomeMethod(Program / Something else)"); + Assert.AreEqual("(wrapper scoop-de-woop) SomeClass.SomeMethod(Program / Something else)", stackframe.Method); + } + + [TestMethod] + public void ParseAndroidMethod() + { + var stackframe = Payload.StackTraceLine.FromAndroidJavaMessage("at com.example.lib.BugsnagCrash.throwJvmException(BugsnagCrash.java:14)"); + Assert.AreEqual("com.example.lib.BugsnagCrash.throwJvmException()", stackframe.Method); + Assert.AreEqual("BugsnagCrash.java", stackframe.File); + Assert.AreEqual(14, stackframe.LineNumber); } } } diff --git a/tests/BugsnagUnity.Tests/UniqueLogCounterTests.cs b/tests/BugsnagUnity.Tests/UniqueLogCounterTests.cs index d7b321198..61406f9b1 100644 --- a/tests/BugsnagUnity.Tests/UniqueLogCounterTests.cs +++ b/tests/BugsnagUnity.Tests/UniqueLogCounterTests.cs @@ -1,13 +1,13 @@ -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Threading; using UnityEngine; namespace BugsnagUnity.Tests { - [TestFixture] + [TestClass] public class UniqueLogCounterTests { - [Test] + [TestMethod] public void ShouldNotSendDuplicateMessages() { var counter = new UniqueLogThrottle(new Configuration("foo")); @@ -16,20 +16,20 @@ public void ShouldNotSendDuplicateMessages() var message2 = new UnityLogMessage("", "", LogType.Error); counter.ShouldSend(message1); - Assert.False(counter.ShouldSend(message2)); + Assert.IsFalse(counter.ShouldSend(message2)); } - [Test] + [TestMethod] public void SendsSingleMessage() { var counter = new UniqueLogThrottle(new Configuration("foo")); var message = new UnityLogMessage("", "", LogType.Error); - Assert.True(counter.ShouldSend(message)); + Assert.IsTrue(counter.ShouldSend(message)); } - [Test] + [TestMethod] public void FlushesCorrectly() { var configuration = new Configuration("foo"); @@ -43,7 +43,7 @@ public void FlushesCorrectly() message = new UnityLogMessage("", "", LogType.Error); - Assert.True(counter.ShouldSend(message)); + Assert.IsTrue(counter.ShouldSend(message)); } } } diff --git a/tests/UnityEngine/Time.cs b/tests/UnityEngine/Time.cs index d0184aa83..ea5c43acb 100644 --- a/tests/UnityEngine/Time.cs +++ b/tests/UnityEngine/Time.cs @@ -1,10 +1,9 @@ -using System; -namespace UnityEngine +namespace UnityEngine { public class Time { public static float realtimeSinceStartup { get; set; } - + } -} +} \ No newline at end of file diff --git a/tests/UnityEngine/UnityAction.cs b/tests/UnityEngine/UnityAction.cs index 9ae339a36..6173ac000 100644 --- a/tests/UnityEngine/UnityAction.cs +++ b/tests/UnityEngine/UnityAction.cs @@ -7,7 +7,10 @@ public void AddListener(UnityAction action) { } public void Invoke() { } } - + public class UnityEvent { + public void AddListener(UnityAction action) { } + public void Invoke(T0 arg0) { } + } public delegate void UnityAction(); public delegate void UnityAction(T0 arg0); diff --git a/tests/UnityEngine/UnityEngine.csproj b/tests/UnityEngine/UnityEngine.csproj index de20ab24c..30cd5a42e 100644 --- a/tests/UnityEngine/UnityEngine.csproj +++ b/tests/UnityEngine/UnityEngine.csproj @@ -1,14 +1,8 @@  - net35 - 7.1 + netstandard2.0 - - 8.0 - - - 8.0 - + diff --git a/unity/PackageProject/Packages/manifest.json b/unity/PackageProject/Packages/manifest.json index 349d31879..953b0c6fe 100644 --- a/unity/PackageProject/Packages/manifest.json +++ b/unity/PackageProject/Packages/manifest.json @@ -1,12 +1,21 @@ { "dependencies": { - "com.unity.ads": "2.0.8", - "com.unity.analytics": "3.2.3", - "com.unity.collab-proxy": "1.2.15", - "com.unity.package-manager-ui": "2.0.13", - "com.unity.purchasing": "2.2.1", - "com.unity.textmeshpro": "1.4.1", + "com.unity.2d.sprite": "1.0.0", + "com.unity.2d.tilemap": "1.0.0", + "com.unity.ads": "4.4.2", + "com.unity.analytics": "3.6.12", + "com.unity.collab-proxy": "2.2.0", + "com.unity.ide.rider": "3.0.27", + "com.unity.ide.visualstudio": "2.0.22", + "com.unity.ide.vscode": "1.2.5", + "com.unity.purchasing": "4.9.3", + "com.unity.test-framework": "1.1.33", + "com.unity.textmeshpro": "3.0.6", + "com.unity.timeline": "1.6.5", + "com.unity.ugui": "1.0.0", + "com.unity.xr.legacyinputhelpers": "2.1.10", "com.unity.modules.ai": "1.0.0", + "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.audio": "1.0.0", diff --git a/upm-tools/AssemblyDefinitions/BugsnagEditor.asmdef b/upm-tools/AssemblyDefinitions/BugsnagEditor.asmdef index 3781e890b..921042cbf 100644 --- a/upm-tools/AssemblyDefinitions/BugsnagEditor.asmdef +++ b/upm-tools/AssemblyDefinitions/BugsnagEditor.asmdef @@ -1,5 +1,5 @@ { - "name": "BugSnagEditor", + "name": "BugsnagEditor", "references": [ "Bugsnag" ], diff --git a/upm-tools/build-upm-package.sh b/upm-tools/build-upm-package.sh index 88e0735fc..7fa5c334b 100755 --- a/upm-tools/build-upm-package.sh +++ b/upm-tools/build-upm-package.sh @@ -7,7 +7,7 @@ PROJECT_PATH=`pwd`/UPMImportProject SCRIPT_PATH=`pwd` PACKAGE_DIR=../upm-package -# Check for unity version +# Check for release version if [ -z "$1" ] then echo "ERROR: No Version Set, please pass a version string as the first argument" @@ -16,13 +16,25 @@ fi VERSION=$1 -#check for the unity path -if [ -z "$UNITY_PATH" ] +if [ -z "$UNITY_UPM_VERSION" ] then - echo "UNITY_PATH must be set, to e.g. /Applications/Unity/Hub/Editor/2018.4.36f1/Unity.app/Contents/MacOS" + echo "UNITY_UPM_VERSION must be set" exit 1 fi +#There is a bug in some versions of unity 2020, 2021 and 2022 where macos bundles will not be imported as a single plugin file. +#In which case all sub dirs and files must have .meta files to work with UPM. +#Building the UPM package with unity 2019 ensures that the meta files are created + +if [[ "$UNITY_UPM_VERSION" != *"2019"* ]]; then + echo "ERROR: UNITY_UPM_VERSION must be a version of Unity 2019. See script comments for details." + exit 1 +fi + +UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_UPM_VERSION/Unity.app/Contents/MacOS" + + + #Check for the release package echo "Checking for the release package" @@ -69,4 +81,4 @@ sed -i '' "s/VERSION_STRING/$VERSION/g" "$PACKAGE_DIR/package.json" sed -i '' "s/VERSION_STRING/v$VERSION/g" "$PACKAGE_DIR/README.md" -echo "complete, ready to deploy" +echo "complete, ready to deploy" \ No newline at end of file