diff --git a/.buildkite/block.full.yml b/.buildkite/block.full.yml index 88c22efae..8eb74d563 100644 --- a/.buildkite/block.full.yml +++ b/.buildkite/block.full.yml @@ -5,8 +5,10 @@ steps: - label: 'Upload the full test pipeline' depends_on: 'trigger-full-build' 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 +# 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.linux.full.yml && +# echo "Waiting on https://smartbear.atlassian.net/browse/PLAT-12563 buildkite-agent pipeline upload .buildkite/pipeline.linux.full.yml" && +# buildkite-agent pipeline upload .buildkite/pipeline.webgl.full.yml diff --git a/.buildkite/pipeline.linux.full.yml b/.buildkite/pipeline.linux.full.yml new file mode 100644 index 000000000..48ccad5df --- /dev/null +++ b/.buildkite/pipeline.linux.full.yml @@ -0,0 +1,214 @@ +aliases: + - &2020 "2020.3.48f1" + - &2021 "2021.3.36f1" + - &2022 "2022.3.22f1" + - &2023 "2023.2.19f1" + +# Waiting on https://smartbear.atlassian.net/browse/PLAT-12563 +agents: + queue: macos-14 + +timeout_in_minutes: 60 + +steps: + # + # Build Linux test fixtures + # + +# Skipped - PLAT-12628 +# - label: Build Unity 2020 Linux test fixture +# timeout_in_minutes: 30 +# key: "linux-2020-fixture" +# depends_on: "build-artifacts" +# env: +# UNITY_VERSION: *2020 +# plugins: +# artifacts#v1.9.0: +# download: +# - Bugsnag.unitypackage +# upload: +# - unity.log +# - features/fixtures/maze_runner/build/linux-release-2020.zip +# commands: +# - scripts/ci-build-linux-fixture.sh release +# retry: +# automatic: +# - exit_status: "*" +# limit: 1 + + - label: Build Unity 2021 linux test fixture + timeout_in_minutes: 30 + key: "linux-2021-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2021 + commands: + - scripts/ci-build-linux-fixture.sh release + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - unity.log + - unity_import.log + - features/fixtures/maze_runner/build/linux-release-2021.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + +# Skipped - PLAT-12629 +# - label: Build Unity 2021 linux DEV test fixture +# timeout_in_minutes: 30 +# key: "linux-2021-dev-fixture" +# depends_on: "build-artifacts" +# env: +# UNITY_VERSION: *2021 +# commands: +# - scripts/ci-build-linux-fixture.sh dev +# plugins: +# artifacts#v1.9.0: +# download: +# - Bugsnag.unitypackage +# upload: +# - unity.log +# - unity_import.log +# - features/fixtures/maze_runner/build/linux-dev-2021.zip +# retry: +# automatic: +# - exit_status: "*" +# limit: 1 + + - label: Build Unity 2022 linux test fixture + timeout_in_minutes: 30 + key: "linux-2022-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2022 + commands: + - scripts/ci-build-linux-fixture.sh release + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - unity.log + - unity_import.log + - features/fixtures/maze_runner/build/linux-release-2022.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + - label: Build Unity 2023 linux test fixture + timeout_in_minutes: 30 + key: "linux-2023-fixture" + depends_on: "build-artifacts" + env: + UNITY_VERSION: *2023 + commands: + - scripts/ci-build-linux-fixture.sh release + plugins: + artifacts#v1.9.0: + download: + - Bugsnag.unitypackage + upload: + - unity.log + - unity_import.log + - features/fixtures/maze_runner/build/linux-release-2023.zip + retry: + automatic: + - exit_status: "*" + limit: 1 + + # + # Run linux e2e tests + # + +# Skipped - PLAT-12628 +# - label: Run linux e2e tests for Unity 2020 +# timeout_in_minutes: 30 +# depends_on: "linux-2020-fixture" +# env: +# UNITY_VERSION: *2020 +# agents: +# queue: "opensource-ubuntu-1804-unity" +# plugins: +# artifacts#v1.9.0: +# download: +# - features/fixtures/maze_runner/build/linux-release-2020.zip +# upload: +# - maze_output/**/* +# - maze_output/metrics.csv +# command: +# - scripts/ci-run-linux-tests.sh release + + - label: Run linux e2e tests for Unity 2021 + timeout_in_minutes: 30 + depends_on: "linux-2021-fixture" + env: + UNITY_VERSION: *2021 + DEBUG: "true" + agents: + queue: "opensource-ubuntu-1804-unity" + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/linux-release-2021.zip + upload: + - maze_output/**/* + - maze_output/metrics.csv + commands: + - scripts/ci-run-linux-tests.sh release + + - label: Run linux e2e DEV tests for Unity 2021 + timeout_in_minutes: 30 + depends_on: "linux-2021-dev-fixture" + env: + UNITY_VERSION: *2021 + agents: + queue: "opensource-ubuntu-1804-unity" + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/linux-dev-2021.zip + upload: + - maze_output/**/* + - maze_output/metrics.csv + commands: + - scripts/ci-run-linux-tests.sh dev + +# Skipped - PLAT-12629 +# - label: Run linux e2e tests for Unity 2022 +# timeout_in_minutes: 30 +# depends_on: "linux-2022-fixture" +# env: +# UNITY_VERSION: *2022 +# agents: +# queue: "opensource-ubuntu-1804-unity" +# plugins: +# artifacts#v1.9.0: +# download: +# - features/fixtures/maze_runner/build/linux-release-2022.zip +# upload: +# - maze_output/**/* +# - maze_output/metrics.csv +# commands: +# - scripts/ci-run-linux-tests.sh release + + - label: Run linux e2e tests for Unity 2023 + timeout_in_minutes: 30 + depends_on: "linux-2023-fixture" + env: + UNITY_VERSION: *2023 + agents: + queue: "opensource-ubuntu-1804-unity" + plugins: + artifacts#v1.9.0: + download: + - features/fixtures/maze_runner/build/linux-release-2023.zip + upload: + - maze_output/**/* + - maze_output/metrics.csv + commands: + - scripts/ci-run-linux-tests.sh release diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 5b5012273..0eeb9593d 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -76,8 +76,6 @@ steps: - exit_status: "*" limit: 1 - - # - label: ':android: Build Android EDM test fixture for Unity 2021' # timeout_in_minutes: 30 # key: 'build-edm-fixture-2021' diff --git a/.buildkite/pipeline_trigger.sh b/.buildkite/pipeline_trigger.sh index 8be39d688..40d254266 100755 --- a/.buildkite/pipeline_trigger.sh +++ b/.buildkite/pipeline_trigger.sh @@ -6,11 +6,12 @@ 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.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 +# 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.linux.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/.gitignore b/.gitignore index fb9b9d51e..bc09cc022 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +Gemfile.lock build .DS_store .gradle diff --git a/BugsnagUnity.sln b/BugsnagUnity.sln index a94adf20e..1a378f5e5 100644 --- a/BugsnagUnity.sln +++ b/BugsnagUnity.sln @@ -22,6 +22,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BugsnagUnity.MacOS", "src\B EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BugsnagUnity.Windows", "src\BugsnagUnity\BugsnagUnity.Windows.csproj", "{B8C265A4-657B-4378-8726-0BEC774108D1}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BugsnagUnity.Linux", "src\BugsnagUnity\BugsnagUnity.Linux.csproj", "{B8C265A4-657B-4378-8726-0BEC774108D2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -56,6 +58,10 @@ Global {B8C265A4-657B-4378-8726-0BEC774108D1}.Debug|Any CPU.Build.0 = Debug|Any CPU {B8C265A4-657B-4378-8726-0BEC774108D1}.Release|Any CPU.ActiveCfg = Release|Any CPU {B8C265A4-657B-4378-8726-0BEC774108D1}.Release|Any CPU.Build.0 = Release|Any CPU + {B8C265A4-657B-4378-8726-0BEC774108D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B8C265A4-657B-4378-8726-0BEC774108D2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8C265A4-657B-4378-8726-0BEC774108D2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B8C265A4-657B-4378-8726-0BEC774108D2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 36fe23181..48852b7ed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,11 +9,13 @@ ## Set up a development environment -- Clone the repo including submodules +Clone the repo including submodules - ``` - git clone --recursive git@github.com:bugsnag/bugsnag-unity - ``` +``` +git clone --recursive git@github.com:bugsnag/bugsnag-unity +``` + +### OSX - Install Unity - Set up your Xcode (requires being a member of the Apple Developer Program) @@ -21,6 +23,30 @@ - Open the example app in Unity - You can build the app for iPhone or Android using the custom Build menu. +### Ubuntu 22.04 + +- Set up Unity + - Download Unity Hub with the custom repository using https://docs.unity3d.com/hub/manual/InstallHub.html. Note that Ubuntu 24.04 doesn't work currently. + - Install a Unity version. + - Set the `UNITY_VERSION` environment variables based on the Unity version; for example: + ``` + export UNITY_VERSION=2021.3.40f1 + ``` + - Install the required libssl version with https://stackoverflow.com/a/72137153 +- Install .NET with `sudo apt install dotnet-sdk-8.0`. The snap release doesn't work. +- Install Ruby 3.3.4 and bundler via https://stackoverflow.com/a/37956249. The snap release doesn't work. +- Setup Android + - `sudo apt-get install openjdk-11-jdk` + - `sudo snap install android-studio --classic` + - Use Android Studio open any project, click the hamburger menu -> Tools -> SDK -> SDK Tools. Then select and download NDK (side by side) and Android SDK Command-line Tools. + - Set `ANDROID_SDK_ROOT` to the path from Android Studio's hamburger menu -> Tools -> SDK -> Path. For example: + ``` + export ANDROID_SDK_ROOT=/home/username/Android/Sdk + ``` +- `bundle install` +- `bundle exec rake plugin:export` + + ## Installing and using multiple versions of Unity You can install as many versions of Unity as you like on the same computer. On a Mac the installer creates a folder @@ -72,6 +98,11 @@ The plugin can be built with a cache using `rake plugin:quick_export`. bundle exec rake plugin:rebuild ``` +To compile and export without the Android and iOS plugins (which is much faster), use: +``` +bundle exec rake plugin:export_minimal +`` + List available tasks using `rake -T`. ## Building Example diff --git a/Gemfile b/Gemfile index ef58191c0..01e899971 100644 --- a/Gemfile +++ b/Gemfile @@ -4,14 +4,13 @@ gem 'rake' gem 'xcpretty' gem 'xcodeproj' gem 'cocoapods' -gem 'rake' unless Gem.win_platform? # Use official Maze Runner release 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: 'main' # Use a local copy of Maze Runner for development purposes #gem 'bugsnag-maze-runner', path: '../maze-runner' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index a6eda2cae..000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,115 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.6) - rexml - activesupport (7.1.3.4) - base64 - bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) - connection_pool (>= 2.2.5) - drb - i18n (>= 1.6, < 2) - minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) - algoliasearch (1.27.5) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - atomos (0.1.3) - base64 (0.2.0) - bigdecimal (3.1.8) - claide (1.1.0) - cocoapods (1.15.2) - addressable (~> 2.8) - claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.15.2) - cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 2.1, < 3.0) - cocoapods-plugins (>= 1.0.0, < 2.0) - cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.6.0, < 2.0) - cocoapods-try (>= 1.1.0, < 2.0) - colored2 (~> 3.1) - escape (~> 0.0.4) - fourflusher (>= 2.3.0, < 3.0) - gh_inspector (~> 1.0) - molinillo (~> 0.8.0) - nap (~> 1.0) - ruby-macho (>= 2.3.0, < 3.0) - xcodeproj (>= 1.23.0, < 2.0) - cocoapods-core (1.15.2) - activesupport (>= 5.0, < 8) - addressable (~> 2.8) - algoliasearch (~> 1.0) - concurrent-ruby (~> 1.1) - fuzzy_match (~> 2.0.4) - nap (~> 1.0) - netrc (~> 0.11) - public_suffix (~> 4.0) - typhoeus (~> 1.0) - cocoapods-deintegrate (1.0.5) - cocoapods-downloader (2.1) - cocoapods-plugins (1.0.0) - nap - cocoapods-search (1.0.1) - cocoapods-trunk (1.6.0) - nap (>= 0.8, < 2.0) - netrc (~> 0.11) - cocoapods-try (1.2.0) - colored2 (3.1.2) - concurrent-ruby (1.3.3) - connection_pool (2.4.1) - drb (2.2.1) - escape (0.0.4) - ethon (0.16.0) - ffi (>= 1.15.0) - ffi (1.17.0-x64-mingw-ucrt) - ffi (1.17.0-x86_64-darwin) - fourflusher (2.3.1) - fuzzy_match (2.0.4) - gh_inspector (1.1.3) - httpclient (2.8.3) - i18n (1.14.5) - concurrent-ruby (~> 1.0) - json (2.7.2) - minitest (5.24.1) - molinillo (0.8.0) - mutex_m (0.2.0) - nanaimo (0.3.0) - nap (1.1.0) - netrc (0.11.0) - public_suffix (4.0.7) - rake (12.3.3) - rexml (3.2.6) - rouge (2.0.7) - ruby-macho (2.5.1) - typhoeus (1.4.1) - ethon (>= 0.9.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - xcodeproj (1.23.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) - xcpretty (0.3.0) - rouge (~> 2.0.7) - -PLATFORMS - x64-mingw-ucrt - x86_64-darwin-19 - x86_64-darwin-20 - -DEPENDENCIES - cocoapods - rake - xcodeproj - xcpretty - -BUNDLED WITH - 2.4.8 diff --git a/Rakefile b/Rakefile index 456c7a2fb..61bea8f90 100644 --- a/Rakefile +++ b/Rakefile @@ -12,6 +12,7 @@ end HOST_OS = RbConfig::CONFIG['host_os'] def is_mac?; HOST_OS =~ /darwin/i; end def is_windows?; HOST_OS =~ /mingw|mswin|windows/i; end +def is_linux?; HOST_OS.strip =~ /linux/i; end ## # @@ -26,6 +27,8 @@ def unity_directory "/Applications/Unity/Hub/Editor/#{ENV['UNITY_VERSION']}" elsif is_windows? "C:\\Program Files\\Unity\\Hub\\Editor\\#{ENV['UNITY_VERSION']}" + elsif is_linux? + "#{ENV['HOME']}/Unity/Hub/Editor/#{ENV['UNITY_VERSION']}" end else raise 'No unity version set - use $UNITY_VERSION' @@ -266,6 +269,7 @@ namespace :plugin do task all: [:assets, :cocoa, :android, :csharp, ] task all_android64: [:assets, :cocoa, :android_64bit, :csharp ] end + task minimal: [:assets, :csharp] desc "Delete all build artifacts" @@ -437,6 +441,9 @@ namespace :plugin 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 + linux_dir = File.join(assets_path, "Linux") + FileUtils.mkpath linux_dir + FileUtils.cp File.realpath("BugsnagUnity.Linux.dll"), linux_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") @@ -459,6 +466,11 @@ namespace :plugin do export_package("Bugsnag.unitypackage") end + task export_minimal: ["plugin:build:minimal"] do + Rake::Task["plugin:build:minimal"].invoke + export_package("Bugsnag.unitypackage") + end + desc "Generate release artifacts from cache (using Android 64-bit)" task :quick_export do Rake::Task["plugin:build:all_android64"].invoke diff --git a/TESTING.md b/TESTING.md index 3ff5bfbc6..29910fc3e 100644 --- a/TESTING.md +++ b/TESTING.md @@ -102,7 +102,7 @@ This will generate the following file: #### MacOS -1. `UNITY_VERSION=2018.4.36f1 ./features/scripts/build_maze_runner.sh macos` +1. `UNITY_VERSION=2018.4.36f1 ./features/scripts/build_maze_runner.sh release macos` Where `UNITY_VERSION` corresponds to the Unity installation path, e.g: ``` @@ -119,7 +119,7 @@ This will generate the test fixture app: Building the test fixture on Windows requires a Git bash terminal. In a Git bash terminal: -1. `UNITY_VERSION=2018.4.36f1 ./features/scripts/build_maze_runner.sh windows` +1. `UNITY_VERSION=2018.4.36f1 ./features/scripts/build_maze_runner.sh release windows` Where `UNITY_VERSION` corresponds to the Unity installation path, e.g: ``` @@ -132,6 +132,20 @@ dependencies: ./features/fixtures/maze_runner/build/Windows ``` +#### Linux + +1. `UNITY_VERSION=2021.3.40f1 ./features/scripts/build_maze_runner.sh release linux` + +Where `UNITY_VERSION` corresponds to the Unity installation path, e.g: +``` +$HOME/Unity/Hub/Editor/$UNITY_VERSION/Editor/Unity +``` +This will generate a build folder containing the test fixture executable, together with the UnityPlayer.so and other +dependencies: +``` +./features/fixtures/maze_runner/build/linux +``` + ### Running an end-to-end test #### MacOS @@ -155,6 +169,15 @@ In the Ubuntu terminal: bundle exec maze-runner --app=features/fixtures/maze_runner/build/Windows/Mazerunner.exe --os=windows ``` +#### Linux + +1. Check the contents of `Gemfile` to select the version of `maze-runner` to use +1. Run `bundle install` if you haven't run end-to-end tests before +1. To run the tests: + ```shell script + bundle exec maze-runner --app=features/fixtures/maze_runner/build/linux/Mazerunner --os=linux + ``` + #### WebGL The WebGL e2e tests depend on Chrome and `chromedriver` (available from Homebrew). diff --git a/UPGRADING.md b/UPGRADING.md index 9430c9daa..09bf4769a 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -65,6 +65,7 @@ If you wish to do it manually, please remove the following directories and files - File: `Assets/Plugins/OSX/BugsnagUnity.MacOS.dll` - File: `Assets/Plugins/tvOS/BugsnagUnity.iOS.dll` - File: `Assets/Plugins/Windows/BugsnagUnity.Windows.dll` +- File: `Assets/Plugins/Windows/BugsnagUnity.Linux.dll` - Directory: `Assets/Plugins/iOS/Bugsnag` - Directory: `Assets/Plugins/OSX/Bugsnag` - Directory: `Assets/Plugins/tvOS/Bugsnag` diff --git a/bugsnag-android b/bugsnag-android index d1d2eeeb4..2f5a9518c 160000 --- a/bugsnag-android +++ b/bugsnag-android @@ -1 +1 @@ -Subproject commit d1d2eeeb426b896c8fb4e0229651378ac8f8d302 +Subproject commit 2f5a9518cafba8664a942cec415f4ba08b9c0e7e diff --git a/bugsnag-cocoa b/bugsnag-cocoa index cd3a27c2d..b29cdabec 160000 --- a/bugsnag-cocoa +++ b/bugsnag-cocoa @@ -1 +1 @@ -Subproject commit cd3a27c2d7ad344c102bd7ec168c0584939ab7b1 +Subproject commit b29cdabec2f0d396a6a80ca1cfe7ee0bfdf04992 diff --git a/build.ps1 b/build.ps1 index 89f0c1706..815eff94d 100644 --- a/build.ps1 +++ b/build.ps1 @@ -36,6 +36,7 @@ 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" +dotnet restore "src/BugsnagUnity/BugsnagUnity.Linux.csproj" if ($LASTEXITCODE -ne 0) { Write-Output "An error occurred while restoring NuGet packages." diff --git a/build.sh b/build.sh index 9b618e661..a02e7d774 100755 --- a/build.sh +++ b/build.sh @@ -25,6 +25,7 @@ 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 +dotnet restore src/BugsnagUnity/BugsnagUnity.Linux.csproj if [ $? -ne 0 ]; then echo "An error occurred while restoring NuGet packages." diff --git a/features/csharp/csharp_config.feature b/features/csharp/csharp_config.feature index 5954f26d0..b592eb346 100644 --- a/features/csharp/csharp_config.feature +++ b/features/csharp/csharp_config.feature @@ -27,7 +27,7 @@ Feature: csharp events And the exception "message" equals "Error 2" And the event "app.isLaunching" is false - @skip_cocoa @skip_windows @skip_webgl # PLAT-9061 + @skip_cocoa @skip_windows @skip_linux @skip_webgl # PLAT-9061 Scenario: Set long launch time When I run the game in the "LongLaunchTime" state And I wait to receive 2 errors @@ -39,7 +39,7 @@ Feature: csharp events And the exception "message" equals "Error 2" And the event "app.isLaunching" is false - @skip_cocoa @skip_windows @skip_webgl # PLAT-9061 + @skip_cocoa @skip_windows @skip_linux @skip_webgl # PLAT-9061 Scenario: Set short launch time When I run the game in the "ShortLaunchTime" state And I wait to receive 2 errors diff --git a/features/csharp/csharp_persistence.feature b/features/csharp/csharp_persistence.feature index c56f2e2ad..8cf1b7acb 100644 --- a/features/csharp/csharp_persistence.feature +++ b/features/csharp/csharp_persistence.feature @@ -3,7 +3,7 @@ Feature: Unity Persistence Background: Given I clear the Bugsnag cache - @skip_windows @skip_webgl @skip_cocoa @skip_android #pending PLAT-8632 + @skip_windows @skip_linux @skip_webgl @skip_cocoa @skip_android #pending PLAT-8632 Scenario: Receive a persisted session When I set the HTTP status code for the next request to 408 And I run the game in the "PersistSession" state diff --git a/features/csharp/csharp_sessions.feature b/features/csharp/csharp_sessions.feature index ac5e29d9c..a9fac573b 100644 --- a/features/csharp/csharp_sessions.feature +++ b/features/csharp/csharp_sessions.feature @@ -37,6 +37,7 @@ Feature: Session Tracking And the session payload field "app.type" equals the platform-dependent string: | macos | MacOS | | windows | Windows | + | linux | Linux | | switch | nintendo-switch | | browser | WebGL | | android | android | @@ -45,6 +46,7 @@ Feature: Session Tracking And the session payload field "device.osName" equals the platform-dependent string: | macos | Mac OS | | windows | Microsoft Windows NT | + | linux | Unix | | switch | Nintendo Switch | | browser | Unix | | android | android | @@ -53,6 +55,7 @@ Feature: Session Tracking And the session payload field "device.manufacturer" equals the platform-dependent string: | macos | Apple | | windows | PC | + | linux | @skip | | switch | Nintendo | | browser | @skip | | android | @skip | @@ -72,6 +75,7 @@ Feature: Session Tracking And the session payload field "app.type" equals the platform-dependent string: | macos | MacOS | | windows | Windows | + | linux | Linux | | switch | nintendo-switch | | browser | WebGL | | android | android | @@ -80,6 +84,7 @@ Feature: Session Tracking And the session payload field "device.osName" equals the platform-dependent string: | macos | Mac OS | | windows | Microsoft Windows NT | + | linux | Unix | | switch | Nintendo Switch | | browser | Unix | | android | android | @@ -88,6 +93,7 @@ Feature: Session Tracking And the session payload field "device.manufacturer" equals the platform-dependent string: | macos | Apple | | windows | PC | + | linux | @skip | | switch | Nintendo | | browser | @skip | | android | @skip | diff --git a/features/fixtures/maze_runner/Assets/Editor/Builder.cs b/features/fixtures/maze_runner/Assets/Editor/Builder.cs index 59eea7505..147ca731f 100644 --- a/features/fixtures/maze_runner/Assets/Editor/Builder.cs +++ b/features/fixtures/maze_runner/Assets/Editor/Builder.cs @@ -31,6 +31,11 @@ public static void Win64Release() Win64(false); } + public static void Linux64Release() + { + Linux64(false); + } + public static void WebGLRelease() { WebGL(false); @@ -46,6 +51,11 @@ public static void Win64Dev() Win64(true); } + public static void Linux64Dev() + { + Linux64(true); + } + public static void WebGLDev() { WebGL(true); @@ -61,6 +71,11 @@ static void Win64(bool dev) BuildStandalone(dev ? "build/Windows/Mazerunner_dev.exe" : "build/Windows/Mazerunner.exe", BuildTarget.StandaloneWindows64, dev); } + static void Linux64(bool dev) + { + BuildStandalone(dev ? "build/linux/Mazerunner_dev" : "build/linux/Mazerunner", BuildTarget.StandaloneLinux64, dev); + } + static void WebGL(bool dev) { BuildStandalone("build/WebGL/Mazerunner" + (dev ? "_dev" : ""), BuildTarget.WebGL, dev); diff --git a/features/fixtures/maze_runner/ProjectSettings/ProjectSettings.asset b/features/fixtures/maze_runner/ProjectSettings/ProjectSettings.asset index 13a273ae4..fda147625 100644 --- a/features/fixtures/maze_runner/ProjectSettings/ProjectSettings.asset +++ b/features/fixtures/maze_runner/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 18 + serializedVersion: 23 productGUID: 8f85d0b19dedd455facc164ff33e8123 AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 @@ -17,7 +17,7 @@ PlayerSettings: defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} - m_ShowUnitySplashScreen: 0 + m_ShowUnitySplashScreen: 1 m_ShowUnitySplashLogo: 1 m_SplashScreenOverlayOpacity: 1 m_SplashScreenAnimation: 1 @@ -49,10 +49,11 @@ PlayerSettings: m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 - displayResolutionDialog: 0 iosUseCustomAppBackgroundBehavior: 0 iosAllowHTTPDownload: 1 allowedAutorotateToPortrait: 1 @@ -65,7 +66,14 @@ PlayerSettings: disableDepthAndStencilBuffers: 0 androidStartInFullscreen: 1 androidRenderOutsideSafeArea: 0 + androidUseSwappy: 0 androidBlitType: 0 + androidResizableWindow: 0 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 defaultIsNativeResolution: 1 macRetinaSupport: 1 runInBackground: 1 @@ -79,11 +87,11 @@ PlayerSettings: usePlayerLog: 1 bakeCollisionMeshes: 0 forceSingleInstance: 0 + useFlipModelSwapchain: 1 resizableWindow: 0 useMacAppStoreValidation: 0 macAppStoreCategory: public.app-category.games gpuSkinning: 0 - graphicsJobs: 0 xboxPIXTextureCapture: 0 xboxEnableAvatar: 0 xboxEnableKinect: 0 @@ -91,7 +99,6 @@ PlayerSettings: xboxEnableFitness: 0 visibleInBackground: 1 allowFullscreenSwitch: 1 - graphicsJobMode: 0 fullscreenMode: 0 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 @@ -114,7 +121,13 @@ PlayerSettings: 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 @@ -128,45 +141,29 @@ PlayerSettings: m_HolographicPauseOnTrackingLoss: 1 xboxOneDisableKinectGpuReservation: 0 xboxOneEnable7thCore: 0 - isWsaHolographicRemotingEnabled: 0 vrSettings: - cardboard: - depthFormat: 0 - enableTransitionView: 0 - daydream: - depthFormat: 0 - useSustainedPerformanceMode: 0 - enableVideoLayer: 0 - useProtectedVideoMemory: 0 - minimumSupportedHeadTracking: 0 - maximumSupportedHeadTracking: 1 - hololens: - depthFormat: 1 - depthBufferSharingEnabled: 0 - oculus: - sharedDepthBuffer: 0 - dashSupport: 0 - lowOverheadMode: 0 - protectedContext: 0 - v2Signing: 0 enable360StereoCapture: 0 - protectGraphicsMemory: 0 + isWsaHolographicRemotingEnabled: 0 enableFrameTimingStats: 0 useHDRDisplay: 0 + D3DHDRBitDepth: 0 m_ColorGamuts: 00000000 targetPixelDensity: 30 resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 applicationIdentifier: Android: com.bugsnag.fixtures.unity.notifier.android - iOS: com.bugsnag.fixtures.unity.notifier.ios + Standalone: com.bugsnag.Mazerunner iPhone: com.bugsnag.fixtures.unity.notifier.ios buildNumber: Standalone: 111 - iOS: 333 + iPhone: 333 + tvOS: 0 + overrideDefaultApplicationIdentifier: 0 AndroidBundleVersionCode: 444 - AndroidMinSdkVersion: 16 + AndroidMinSdkVersion: 19 AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 aotOptions: @@ -181,28 +178,16 @@ PlayerSettings: StripUnusedMeshComponents: 0 VertexChannelCompressionMask: 4054 iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 9.0 + iOSTargetOSVersionString: 11.0 tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: 9.0 + tvOSTargetOSVersionString: 11.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 uIStatusBarHidden: 1 uIExitOnSuspend: 0 uIStatusBarStyle: 0 - iPhoneSplashScreen: {fileID: 0} - iPhoneHighResSplashScreen: {fileID: 0} - iPhoneTallHighResSplashScreen: {fileID: 0} - iPhone47inSplashScreen: {fileID: 0} - iPhone55inPortraitSplashScreen: {fileID: 0} - iPhone55inLandscapeSplashScreen: {fileID: 0} - iPhone58inPortraitSplashScreen: {fileID: 0} - iPhone58inLandscapeSplashScreen: {fileID: 0} - iPadPortraitSplashScreen: {fileID: 0} - iPadHighResPortraitSplashScreen: {fileID: 0} - iPadLandscapeSplashScreen: {fileID: 0} - iPadHighResLandscapeSplashScreen: {fileID: 0} appleTVSplashScreen: {fileID: 0} appleTVSplashScreen2x: {fileID: 0} tvOSSmallIconLayers: [] @@ -230,8 +215,8 @@ PlayerSettings: iOSLaunchScreeniPadFillPct: 100 iOSLaunchScreeniPadSize: 100 iOSLaunchScreeniPadCustomXibPath: - iOSUseLaunchScreenStoryboard: 0 iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: iOSDeviceRequirements: [] iOSURLSchemes: [] iOSBackgroundModes: 0 @@ -249,10 +234,19 @@ PlayerSettings: iOSRequireARKit: 0 iOSAutomaticallyDetectAndAddCapabilities: 1 appleEnableProMotion: 0 + shaderPrecisionModel: 0 clonedFromGUID: 00000000000000000000000000000000 templatePackageId: templateDefaultScene: + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomProguardFile: 0 AndroidTargetArchitectures: 7 + AndroidTargetDevices: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} AndroidKeystoreName: @@ -263,12 +257,18 @@ PlayerSettings: AndroidEnableTango: 0 androidEnableBanner: 1 androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 m_AndroidBanners: - width: 320 height: 180 banner: {fileID: 0} androidGamepadSupportLevel: 0 - resolutionDialogBanner: {fileID: 0} + chromeosInputEmulation: 1 + AndroidMinifyWithR8: 0 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 150 m_BuildTargetIcons: [] m_BuildTargetPlatformIcons: - m_BuildTarget: Android @@ -364,11 +364,54 @@ PlayerSettings: m_Kind: 1 m_SubKind: m_BuildTargetBatching: [] - m_BuildTargetGraphicsAPIs: [] + m_BuildTargetGraphicsJobs: + - m_BuildTarget: GameCoreScarlettSupport + m_GraphicsJobs: 0 + - m_BuildTarget: Switch + m_GraphicsJobs: 0 + - m_BuildTarget: iOSSupport + m_GraphicsJobs: 0 + - m_BuildTarget: LuminSupport + m_GraphicsJobs: 0 + - m_BuildTarget: MacStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: PS5Player + m_GraphicsJobs: 0 + - m_BuildTarget: WebGLSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AppleTVSupport + m_GraphicsJobs: 0 + - m_BuildTarget: GameCoreXboxOneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: CloudRendering + m_GraphicsJobs: 0 + - m_BuildTarget: WindowsStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: PS4Player + m_GraphicsJobs: 0 + - m_BuildTarget: MetroSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AndroidPlayer + m_GraphicsJobs: 0 + - m_BuildTarget: BJMSupport + m_GraphicsJobs: 0 + - m_BuildTarget: LinuxStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobs: 0 + m_BuildTargetGraphicsJobMode: + - m_BuildTarget: PS4Player + m_GraphicsJobMode: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobMode: 0 + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: iOSSupport + m_APIs: 10000000 + m_Automatic: 1 m_BuildTargetVRSettings: [] - m_BuildTargetEnableVuforiaSettings: [] openGLRequireES31: 0 openGLRequireES31AEP: 0 + openGLRequireES32: 0 m_TemplateCustomTags: {} mobileMTRendering: Android: 1 @@ -376,6 +419,7 @@ PlayerSettings: tvOS: 1 m_BuildTargetGroupLightmapEncodingQuality: [] m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetNormalMapEncoding: [] playModeTestRunnerEnabled: 0 runPlayModeTestAsEditModeTest: 0 actionOnDotNetUnhandledException: 1 @@ -385,6 +429,7 @@ PlayerSettings: cameraUsageDescription: locationUsageDescription: microphoneUsageDescription: + bluetoothUsageDescription: switchNMETAOverride: Application.aarch64.lp64.nmeta switchNetLibKey: switchSocketMemoryPoolSize: 6144 @@ -392,6 +437,7 @@ PlayerSettings: switchSocketConcurrencyLimit: 14 switchScreenResolutionBehavior: 2 switchUseCPUProfiler: 0 + switchUseGOLDLinker: 0 switchApplicationID: 0x01004b9000490000 switchNSODependencies: switchTitleNames_0: @@ -520,6 +566,12 @@ PlayerSettings: switchSocketInitializeEnabled: 1 switchNetworkInterfaceManagerInitializeEnabled: 1 switchPlayerConnectionEnabled: 1 + switchUseNewStyleFilepaths: 0 + switchUseLegacyFmodPriorities: 1 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -559,6 +611,7 @@ PlayerSettings: ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 ps4Passcode: 5PN2qmWqBlQ9wQj99nsQzldVI5ZuGXbE ps4pnSessions: 1 ps4pnPresence: 1 @@ -571,6 +624,7 @@ PlayerSettings: ps4UseResolutionFallback: 0 ps4ReprojectionSupport: 0 ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 ps4SocialScreenEnabled: 0 ps4ScriptOptimizationLevel: 0 ps4Audio3dVirtualSpeakerCount: 14 @@ -588,12 +642,15 @@ PlayerSettings: 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: 256 webGLExceptionSupport: 3 @@ -606,20 +663,31 @@ PlayerSettings: webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 webGLCompressionFormat: 2 + webGLWasmArithmeticExceptions: 0 webGLLinkerTarget: 1 webGLThreadsSupport: 0 + webGLDecompressionFallback: 0 scriptingDefineSymbols: 4: UNITY_ASSERTIONS 7: UNITY_ASSERTIONS + additionalCompilerArguments: {} platformArchitecture: {} scriptingBackend: Android: 1 + Standalone: 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 @@ -650,7 +718,7 @@ PlayerSettings: metroFTAName: metroFTAFileTypes: [] metroProtocolName: - metroCompilationOverrides: 1 + vcxProjDefaultLanguage: XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -669,18 +737,16 @@ PlayerSettings: XboxOneCapability: [] XboxOneGameRating: {} XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 XboxOneEnableGPUVariability: 0 XboxOneSockets: {} XboxOneSplashScreen: {fileID: 0} XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 XboxOneXTitleMemory: 8 - xboxOneScriptCompiler: 0 XboxOneOverrideIdentityName: - vrEditorSettings: - daydream: - daydreamIconForeground: {fileID: 0} - daydreamIconBackground: {fileID: 0} + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} cloudServicesEnabled: {} luminIcon: m_Name: @@ -688,24 +754,19 @@ PlayerSettings: m_PortalFolderPath: luminCert: m_CertPath: - m_PrivateKeyPath: + m_SignPackage: 1 luminIsChannelApp: 0 luminVersion: m_VersionCode: 1 m_VersionName: - facebookSdkVersion: 7.9.4 - facebookAppId: - facebookCookies: 1 - facebookLogging: 1 - facebookStatus: 1 - facebookXfbml: 0 - facebookFrictionlessRequests: 1 apiCompatibilityLevel: 3 + activeInputHandler: 0 + windowsGamepadBackendHint: 0 cloudProjectId: framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] projectName: organizationId: cloudEnabled: 0 - enableNativePlatformBackendsForNewInputSystem: 0 - disableOldInputManagerSupport: 0 legacyClampBlendShapeWeights: 1 + virtualTexturingSupportEnabled: 0 diff --git a/features/scripts/build_maze_runner.sh b/features/scripts/build_maze_runner.sh index 6bcce3ac4..8a70d0155 100755 --- a/features/scripts/build_maze_runner.sh +++ b/features/scripts/build_maze_runner.sh @@ -6,7 +6,7 @@ if [ -z "$UNITY_VERSION" ]; then fi if [[ $# != 2 ]]; then - echo "Build type (release/dev) and platform (macos/webgl/windows/wsl) must be passed as parameters" + echo "Build type (release/dev) and platform (macos/webgl/windows/wsl/linux) must be passed as parameters" exit 2 fi @@ -36,6 +36,14 @@ elif [ "$PLATFORM_TYPE" == "wsl" ]; then fi set -m UNITY_PATH="/mnt/c/Program Files/Unity/Hub/Editor/$UNITY_VERSION/Editor/Unity.exe" +elif [ "$PLATFORM_TYPE" == "linux" ]; then + if [ "$BUILD_TYPE" == "release" ]; then + PLATFORM="Linux64Release" + else + PLATFORM="Linux64Dev" + fi + set -m + UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity" elif [ "$PLATFORM_TYPE" == "webgl" ]; then if [ "$BUILD_TYPE" == "release" ]; then PLATFORM="WebGLRelease" diff --git a/features/steps/unity_steps.rb b/features/steps/unity_steps.rb index aaf3c9ce2..33454bb21 100644 --- a/features/steps/unity_steps.rb +++ b/features/steps/unity_steps.rb @@ -34,6 +34,12 @@ def execute_command(action, scenario_name = '') Maze::Runner.run_command(command, blocking: false) execute_command('clear_cache') + when 'linux' + log = File.join(Dir.pwd, 'mazerunner.log') + command = "#{Maze.config.app} --args -logfile #{log} > /dev/null" + Maze::Runner.run_command(command, blocking: false) + execute_command('clear_cache') + when 'android', 'ios' execute_command('clear_cache') when 'browser' @@ -80,6 +86,13 @@ def execute_command(action, scenario_name = '') execute_command('run_scenario', state) + when 'linux' + log = File.join(Dir.pwd, "#{state}-mazerunner.log") + command = "#{Maze.config.app} --args -logfile #{log} > /dev/null" + Maze::Runner.run_command(command, blocking: false) + + execute_command('run_scenario', state) + when 'android', 'ios' execute_command('run_scenario', state) diff --git a/features/support/env.rb b/features/support/env.rb index f3d75ae48..0a58cc211 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -48,6 +48,13 @@ skip_this_scenario("Skipping scenario") if Maze.config.os == 'windows' end +Before('@linux_only') do |_scenario| + skip_this_scenario('Skipping scenario') unless Maze.config.os == 'linux' +end +Before('@skip_linux') do |_scenario| + skip_this_scenario("Skipping scenario") if Maze.config.os == 'linux' +end + Before('@switch_only') do |_scenario| skip_this_scenario('Skipping scenario') unless Maze.config.os == 'switch' @@ -71,6 +78,7 @@ elsif Maze.config.os&.downcase == 'windows' # 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.os&.downcase == 'linux' elsif Maze.config.browser != nil # WebGL release_path = 'features/fixtures/maze_runner/build/WebGL/Mazerunner' @@ -138,6 +146,8 @@ case Maze::Helper.get_current_platform when 'macos' `killall Mazerunner` + when 'linux' + `killall Mazerunner` when 'webgl','windows' execute_command('close_application') when 'switch' diff --git a/scripts/ci-build-linux-fixture.sh b/scripts/ci-build-linux-fixture.sh new file mode 100755 index 000000000..cfacd014c --- /dev/null +++ b/scripts/ci-build-linux-fixture.sh @@ -0,0 +1,33 @@ +#!/bin/bash -e + +set -x + +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 Linux fixture +./features/scripts/build_maze_runner.sh $BUILD_TYPE linux + +pwd + +pushd features/fixtures/maze_runner/build + zip -r linux-${UNITY_VERSION:0:4}.zip linux +popd + + +pushd features/fixtures/maze_runner/build + if [ "$BUILD_TYPE" == "release" ]; then + zip -r linux-release-${UNITY_VERSION:0:4}.zip linux + else + zip -r linux-dev-${UNITY_VERSION:0:4}.zip linux + fi +popd diff --git a/scripts/ci-run-linux-tests.sh b/scripts/ci-run-linux-tests.sh new file mode 100755 index 000000000..ee35d719b --- /dev/null +++ b/scripts/ci-run-linux-tests.sh @@ -0,0 +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 + if [ "$BUILD_TYPE" == "release" ]; then + unzip linux-release-${UNITY_VERSION:0:4}.zip + APP_PATH="features/fixtures/maze_runner/build/linux/Mazerunner" + else + unzip linux-dev-${UNITY_VERSION:0:4}.zip + APP_PATH="features/fixtures/maze_runner/build/linux/Mazerunner_dev" + fi +popd + +bundle install +bundle exec maze-runner --app=$APP_PATH --os=linux features/csharp diff --git a/src/BugsnagUnity/BugsnagUnity.Linux.csproj b/src/BugsnagUnity/BugsnagUnity.Linux.csproj new file mode 100644 index 000000000..e148e7851 --- /dev/null +++ b/src/BugsnagUnity/BugsnagUnity.Linux.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/BugsnagUnity/Native/Linux/NativeClient.cs b/src/BugsnagUnity/Native/Linux/NativeClient.cs new file mode 100644 index 000000000..e2aee56e9 --- /dev/null +++ b/src/BugsnagUnity/Native/Linux/NativeClient.cs @@ -0,0 +1,238 @@ +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using BugsnagUnity.Payload; +using UnityEngine; +using System.Collections.Specialized; + +namespace BugsnagUnity +{ + class NativeClient : INativeClient + { + public Configuration Configuration { get; } + + public IBreadcrumbs Breadcrumbs { get; } + + private bool _launchMarkedAsCompleted = false; + + private bool _hasReceivedLowMemoryWarning = false; + + private Metadata _metadata = new Metadata(); + private OrderedDictionary _featureFlags = new OrderedDictionary(); + + public NativeClient(Configuration configuration) + { + Configuration = configuration; + Breadcrumbs = new Breadcrumbs(configuration); + Application.lowMemory += () => { _hasReceivedLowMemoryWarning = true; }; + if (configuration.FeatureFlags != null) + { + _featureFlags = configuration.FeatureFlags; + } + } + + public void PopulateApp(App app) + { + } + + public void PopulateAppWithState(AppWithState app) + { + AddIsLaunching(app); + app.Add("lowMemory", _hasReceivedLowMemoryWarning); + } + + private void AddIsLaunching(AppWithState app) + { + bool isLaunching; + if (Configuration.LaunchDurationMillis == 0) + { + isLaunching = !_launchMarkedAsCompleted; + } + else + { + isLaunching = app.Duration?.TotalMilliseconds < Configuration.LaunchDurationMillis; + } + app.IsLaunching = isLaunching; + } + + public void PopulateDevice(Device device) + { + device.Manufacturer = "Linux"; + device.Model = SystemInfo.deviceModel; + } + + // Struct based on https://man7.org/linux/man-pages/man3/statvfs.3.html + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + private class StatvfsBuffer + { + + public ulong f_bsize; + public ulong f_frsize; + public ulong f_blocks; + public ulong f_bfree; + public ulong f_bavailable; + + public ulong f_files; + public ulong f_ffree; + public ulong f_favail; + + public ulong f_fsid; + public ulong f_flag; + public ulong f_namemax; + + } + + [return: MarshalAs(UnmanagedType.SysInt)] + [DllImport("libc", CharSet = CharSet.Auto, SetLastError = true)] + static extern int statvfs(string path, [In, Out] StatvfsBuffer lpBuffer); + + public void PopulateDeviceWithState(DeviceWithState device) + { + PopulateDevice(device); + if (Application.platform != RuntimePlatform.LinuxPlayer) + { + return; + } + + // See https://man7.org/linux/man-pages/man5/proc_meminfo.5.html + StreamReader sr = new StreamReader("/proc/meminfo"); + string line; + while ((line = sr.ReadLine()) != null) + { + // Values are listed in kibibytes + if (line.StartsWith("MemFree")) + { + device.FreeMemory = long.Parse(new string(line.Where(c => char.IsNumber(c)).ToArray())) * 1024; + } + if (line.StartsWith("MemTotal")) + { + device.TotalMemory = long.Parse(new string(line.Where(c => char.IsNumber(c)).ToArray())) * 1024; + } + } + sr.Close(); + + // See https://man7.org/linux/man-pages/man3/statvfs.3.html + StatvfsBuffer buffer = new StatvfsBuffer(); + if (statvfs(Environment.CurrentDirectory, buffer) == 0) { + device.FreeDisk = (long)buffer.f_bavailable * (long)buffer.f_bsize; + } + } + + public void PopulateMetadata(Metadata metadata) + { + } + + public void PopulateUser(User user) + { + } + + public void SetMetadata(string section, Dictionary metadata) + { + } + + public void SetSession(Session session) + { + } + + public void SetUser(User user) + { + } + public void SetContext(string context) + { + } + public void SetAutoDetectErrors(bool autoDetectErrors) + { + } + + public void SetAutoDetectAnrs(bool autoDetectAnrs) + { + } + + public void StartSession() + { + } + + public void PauseSession() + { + } + + public bool ResumeSession() + { + return false; + } + + public void UpdateSession(Session session) + { + } + + public Session GetCurrentSession() + { + return null; + } + + public void MarkLaunchCompleted() + { + _launchMarkedAsCompleted = true; + } + + public LastRunInfo GetLastRunInfo() + { + return null; + } + + public void ClearNativeMetadata(string section) + { + _metadata.ClearMetadata(section); + } + + public void ClearNativeMetadata(string section, string key) + { + _metadata.ClearMetadata(section, key); + } + + public void AddNativeMetadata(string section, IDictionary data) + { + _metadata.AddMetadata(section, data); + } + + public IDictionary GetNativeMetadata() + { + return _metadata.Payload; + } + + public void AddFeatureFlag(string name, string variant = null) + { + _featureFlags[name] = variant; + } + + public void AddFeatureFlags(FeatureFlag[] featureFlags) + { + foreach (var flag in featureFlags) + { + _featureFlags[flag.Name] = flag.Variant; + } + } + + public void ClearFeatureFlag(string name) + { + _featureFlags.Remove(name); + } + + public void ClearFeatureFlags() + { + _featureFlags.Clear(); + } + + public bool ShouldAttemptDelivery() + { + return true; + } + + public void RegisterForOnSessionCallbacks() + { + // Not Used on this platform + } + } +} diff --git a/src/Directory.build.props b/src/Directory.Build.props similarity index 64% rename from src/Directory.build.props rename to src/Directory.Build.props index d7da6dba5..08d68adf0 100644 --- a/src/Directory.build.props +++ b/src/Directory.Build.props @@ -7,8 +7,9 @@ - true - true + true + true + true @@ -32,4 +33,15 @@ false + + + + $(HOME)/Unity/Hub/Editor/$(UNITY_VERSION)/Editor/Data/Managed/UnityEngine.dll + false + + + $(HOME)/Unity/Hub/Editor/$(UNITY_VERSION)/Editor/Data/Managed/UnityEditor.dll + false + + diff --git a/unity/PackageProject/Assets/Bugsnag/Plugins/BugsnagUnity.dll.meta b/unity/PackageProject/Assets/Bugsnag/Plugins/BugsnagUnity.dll.meta index 9116eba74..48b2b0c2a 100644 --- a/unity/PackageProject/Assets/Bugsnag/Plugins/BugsnagUnity.dll.meta +++ b/unity/PackageProject/Assets/Bugsnag/Plugins/BugsnagUnity.dll.meta @@ -12,15 +12,15 @@ PluginImporter: validateReferences: 1 platformData: - first: - '': Any + : Any second: enabled: 0 settings: Exclude Android: 1 Exclude Editor: 0 - Exclude Linux: 0 - Exclude Linux64: 0 - Exclude LinuxUniversal: 0 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 Exclude OSXUniversal: 1 Exclude WebGL: 0 Exclude Win: 1 @@ -61,19 +61,19 @@ PluginImporter: - first: Standalone: Linux second: - enabled: 1 + enabled: 0 settings: CPU: x86 - first: Standalone: Linux64 second: - enabled: 1 + enabled: 0 settings: - CPU: x86_64 + CPU: None - first: Standalone: LinuxUniversal second: - enabled: 1 + enabled: 0 settings: CPU: AnyCPU - first: diff --git a/unity/PackageProject/Assets/Bugsnag/Plugins/Linux.meta b/unity/PackageProject/Assets/Bugsnag/Plugins/Linux.meta new file mode 100644 index 000000000..d9d0b8d7a --- /dev/null +++ b/unity/PackageProject/Assets/Bugsnag/Plugins/Linux.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5b5dbe042d2cad8d2ac6b0507ee177bd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/unity/PackageProject/Assets/Bugsnag/Plugins/Linux/BugsnagUnity.Linux.dll.meta b/unity/PackageProject/Assets/Bugsnag/Plugins/Linux/BugsnagUnity.Linux.dll.meta new file mode 100644 index 000000000..7151303bb --- /dev/null +++ b/unity/PackageProject/Assets/Bugsnag/Plugins/Linux/BugsnagUnity.Linux.dll.meta @@ -0,0 +1,69 @@ +fileFormatVersion: 2 +guid: 14e3f25c468bdebc785bbd59d710836f +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 0 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: