Skip to content

Commit 4e86daa

Browse files
authored
Merge pull request #308 from bugsnag/versionNumberChangeForRelease
release v5.1.0
2 parents cd3a0b2 + dbb6e94 commit 4e86daa

File tree

116 files changed

+6537
-5434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+6537
-5434
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@
44
[submodule "bugsnag-android"]
55
path = bugsnag-android
66
url = https://github.com/bugsnag/bugsnag-android
7-
[submodule "bugsnag-js"]
8-
path = bugsnag-js
9-
url = https://github.com/bugsnag/bugsnag-js

BugsnagUnity.sln

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,13 @@ Global
6464
GlobalSection(ExtensibilityGlobals) = postSolution
6565
SolutionGuid = {1CE8CC5B-0DF2-4EB7-B9DA-0DBC2E0389DA}
6666
EndGlobalSection
67+
GlobalSection(MonoDevelopProperties) = preSolution
68+
Policies = $0
69+
$0.TextStylePolicy = $1
70+
$1.FileWidth = 80
71+
$1.TabsToSpaces = True
72+
$1.scope = text/x-csharp
73+
$0.CSharpFormattingPolicy = $2
74+
$2.scope = text/x-csharp
75+
EndGlobalSection
6776
EndGlobal

CHANGELOG.md

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,74 @@
11
# Changelog
22

3+
## 5.1.0 (2021-06-24)
4+
5+
### Enhancements
6+
7+
* Add event metadata for CPU and graphics capabilities and migrated entries from the Unity tab to the device and app tabs, to better match other platforms [#297](https://github.com/bugsnag/bugsnag-unity/pull/297):
8+
* `unity.companyName` -> `app.companyName`
9+
* `unity.productName` -> `app.name`
10+
* `unity.version` -> `app.version`
11+
* `unity.platform` -> `app.type`
12+
* `unity.osLanguage` -> `device.osLanguage`
13+
* `unity.unityException` -> removed as a duplicate of the error class
14+
* `unity.unityLogType` -> removed as is contained in the error class for generic logs
15+
16+
* Add `EnabledBreadcrumbTypes` configuration option to enable/disable automatically recorded breadcrumbs [#301](https://github.com/bugsnag/bugsnag-unity/pull/301)
17+
* Add `MaxBreadcrumbs` configuration option to control the number of breadcrumbs collected on all platforms
18+
[#275](https://github.com/bugsnag/bugsnag-unity/pull/275)
19+
[#304](https://github.com/bugsnag/bugsnag-unity/pull/304)
20+
21+
* Update bugsnag-cocoa to v6.9.6:
22+
23+
* Improve accuracy of app hang event information to better reflect state at time of detection.
24+
[#1118](https://github.com/bugsnag/bugsnag-cocoa/pull/1118)
25+
26+
* Stop app hangs being reported if app is launched in the background.
27+
[#1112](https://github.com/bugsnag/bugsnag-cocoa/pull/1112)
28+
29+
* Stop session being reported if app is launched in the background.
30+
[#1107](https://github.com/bugsnag/bugsnag-cocoa/pull/1107)
31+
32+
* Fix KSCrash state storage for apps with no CFBundleName.
33+
[#1103](https://github.com/bugsnag/bugsnag-cocoa/pull/1103)
34+
35+
* Improve performance of `notify()`.
36+
[#1102](https://github.com/bugsnag/bugsnag-cocoa/pull/1102)
37+
[#1104](https://github.com/bugsnag/bugsnag-cocoa/pull/1104)
38+
[#1105](https://github.com/bugsnag/bugsnag-cocoa/pull/1105)
39+
40+
* Fix a crash in `-[BugsnagApp deserializeFromJson:]` if main Mach-O image could not be identified, and improve reliability of identification.
41+
[#1097](https://github.com/bugsnag/bugsnag-cocoa/issues/1097)
42+
[#1101](https://github.com/bugsnag/bugsnag-cocoa/pull/1101)
43+
44+
### Bug fixes
45+
46+
* Fix an issue where the Device.time of an event was missing the milliseconds
47+
[#298](https://github.com/bugsnag/bugsnag-unity/pull/298)
48+
49+
* Adjust post build script to support Unity 2021 builds
50+
[#289](https://github.com/bugsnag/bugsnag-unity/pull/289)
51+
52+
* Fix an issue where timestamps and other `:`-containing log message content was interpreted as the error class
53+
[#292](https://github.com/bugsnag/bugsnag-unity/pull/292)
54+
55+
* Correct Android session start times
56+
[#291](https://github.com/bugsnag/bugsnag-unity/pull/291)
57+
58+
* Fix duplicate events being sent for Android C/C++ crashes
59+
360
## 5.0.0 (2021-06-08)
461

562
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).
663

7-
Please see the [upgrade guide](UPGRADING.md) for details of all the changes and instructions on how to upgrade.
64+
Please see the [upgrade guide](./UPGRADING.md) for details of all the changes and instructions on how to upgrade.
865

966
### Bug fixes
10-
11-
* Stop scene changes overiding context when manually set
67+
68+
* Stop scene changes overrriding context when manually set
1269
[#255](https://github.com/bugsnag/bugsnag-unity/pull/255)
1370

14-
* Dont Destroy TimingTrackerObject, so it persists across scenes
71+
* Don't Destroy TimingTrackerObject, so it persists across scenes
1572
[#239](https://github.com/bugsnag/bugsnag-unity/pull/239)
1673

1774
## 4.8.8 (2021-04-21)
@@ -64,7 +121,7 @@ Please see the [upgrade guide](UPGRADING.md) for details of all the changes and
64121
[#637](https://github.com/bugsnag/bugsnag-cocoa/pull/637)
65122
[Naugladur](https://github.com/Naugladur)
66123

67-
* Fixed an issue where an app could deadlock during a crash if unfavourable
124+
* Fixed an issue where an app could deadlock during a crash if unfavourable
68125
timing caused DYLD lock contention.
69126
[#580](https://github.com/bugsnag/bugsnag-cocoa/pull/580)
70127
[#675](https://github.com/bugsnag/bugsnag-cocoa/pull/675)

CONTRIBUTING.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,26 @@ bundle exec maze-runner features/handled_errors.feature
113113
114114
#### Making the release
115115
116-
0. Set the version number in the change log and `build.cake`
117-
1. Commit the changelog and version updates:
116+
1. Checkout the `next` branch. Set the version number in the change log and `build.cake`.
117+
118+
2. Commit the changelog and version updates:
118119
119120
```
120121
git add CHANGELOG.md build.cake
121-
git commit -m "Release v4.x.x"
122+
git commit -m "Release v5.x.x"
122123
```
123-
2. Make a pull request to merge the changes
124-
3. Once merged, tag the new release version, pushing the tag to GitHub:
124+
3. Make a pull request to merge the changes into `master`
125+
126+
4. Once merged, tag the new release version, pushing the tag to GitHub:
125127
126128
```
127-
git tag v4.x.x
128-
git push origin v4.x.x
129+
git tag v5.x.x
130+
git push origin v5.x.x
129131
```
130-
4. Wait. The CI build will build the new package and create a draft release.
131-
Verify that the release looks good, copy in the changelog entry and publish
132-
the draft.
132+
133+
5. Wait. The CI build will build the new package and create a draft release.
134+
135+
6. Verify that the release looks good, upload the unity packages to the release, copy in the changelog entry into the release notes and publish the draft.
133136
134137
#### Post-release
135138

Rakefile

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ def unity_directory
1818
elsif ENV.has_key? "UNITY_DIR"
1919
ENV["UNITY_DIR"]
2020
else
21-
['/Applications/Unity', 'C:\Program Files\Unity'].find do |dir|
22-
File.exists? dir
23-
end
21+
raise 'No unity directory set - use $UNITY_DIR or $UNITY_VERSION'
2422
end
2523
end
2624

2725
##
2826
#
2927
# Find the Unity executable based on the unity directory.
3028
#
31-
def unity_executable
32-
[File.join(unity_directory, "Unity.app", "Contents", "MacOS", "Unity"), File.join(unity_directory, "Editor", "Unity.exe")].find do |unity|
29+
def unity_executable dir=unity_directory
30+
[File.join(dir, "Unity.app", "Contents", "MacOS", "Unity"),
31+
File.join(dir, "Editor", "Unity"),
32+
File.join(dir, "Editor", "Unity.exe")].find do |unity|
3333
File.exists? unity
3434
end
3535
end
@@ -40,6 +40,20 @@ def unity_dll_location
4040
end
4141
end
4242

43+
##
44+
# Get existing unity executable path or exit with error
45+
#
46+
# Returns pair containing unity path and executable
47+
def get_required_unity_paths
48+
dir = unity_directory
49+
exe = unity_executable(dir)
50+
raise "No unity executable found in '#{dir}'" if exe.nil?
51+
unless File.exists? exe
52+
raise "Unity not found at path '#{exe}' - set $UNITY_DIR (full path) or $UNITY_VERSION (loaded via hub) to customize"
53+
end
54+
[dir, exe]
55+
end
56+
4357
##
4458
#
4559
# Run a command with the unity executable and the default command line parameters
@@ -345,20 +359,11 @@ end
345359
namespace :test do
346360
namespace :android do
347361
task :build do
348-
349362
# Check that a Unity version has been selected and the path exists before calling the build script
350-
if ENV.has_key? 'UNITY_VERSION'
351-
unity_path = "/Applications/Unity/Hub/Editor/#{ENV['UNITY_VERSION']}/Unity.app/Contents/MacOS"
352-
else
353-
raise 'UNITY_VERSION must be set'
354-
end
355-
unity = File.join(unity_path, "Unity")
356-
unless File.exists? unity
357-
raise "Unity not found at path #{unity}"
358-
end
363+
unity_path, unity = get_required_unity_paths
359364

360365
# Prepare the test fixture project by importing the plugins
361-
env = { "UNITY_PATH" => unity_path }
366+
env = { "UNITY_PATH" => File.dirname(unity) }
362367
script = File.join("test", "mobile", "features", "scripts", "prepare_fixture.sh")
363368
unless system env, script
364369
raise 'Preparation of test fixture failed'
@@ -375,18 +380,10 @@ namespace :test do
375380
namespace :ios do
376381
task :generate_xcode do
377382
# Check that a Unity version has been selected and the path exists before calling the build script
378-
if ENV.has_key? 'UNITY_VERSION'
379-
unity_path = "/Applications/Unity/Hub/Editor/#{ENV['UNITY_VERSION']}/Unity.app/Contents/MacOS"
380-
else
381-
raise 'UNITY_VERSION must be set'
382-
end
383-
unity = File.join(unity_path, "Unity")
384-
unless File.exists? unity
385-
raise "Unity not found at path #{unity}"
386-
end
383+
unity_path, unity = get_required_unity_paths
387384

388385
# Prepare the test fixture project by importing the plugins
389-
env = { "UNITY_PATH" => unity_path }
386+
env = { "UNITY_PATH" => File.dirname(unity) }
390387
script = File.join("test", "mobile", "features", "scripts", "prepare_fixture.sh")
391388
unless system env, script
392389
raise 'Preparation of test fixture failed'

TESTING.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,48 @@ the following environment variables:
8787
bundle exec maze-runner --app=./features/fixtures/maze_runner/mazerunner_2018.4.34f1.ipa \
8888
--farm=bs \
8989
--device=IOS_14
90-
```
90+
```
91+
92+
## Desktop tests
93+
94+
### Building the test fixture
95+
96+
Building the mobile test fixtures currently assumes a macOS based Unity installation. To build any test fixture,
97+
from the root of the repository, first build the notifier:
98+
```
99+
rake plugin:export
100+
```
101+
This will generate the following files:
102+
* `Bugsnag.unitypackage`
103+
* `Bugsnag-with-android-64bit.unitypackage`
104+
105+
#### MacOS
106+
107+
1. `cd test/desktop`
108+
1. `UNITY_VERSION=2018.4.34f1 ./features/scripts/build_maze_runner.sh`
109+
110+
Where `UNITY_VERSION` corresponds to the Unity installation path, e.g:
111+
```
112+
/Applications/Unity/Hub/Editor/2018.4.34f1/Unity.app/Contents/MacOS/Unity
113+
```
114+
115+
This will generate a zip file containing the test fixture named according to the `UNITY_VERSION`, e.g:
116+
```
117+
./test/desktop/features/fixtures/Mazerunner_2018.4.34f1.app.zip
118+
```
119+
120+
This file will automatically be unzipped when running the tests, so no further action is required.
121+
122+
### Running an end-to-end test
123+
124+
#### MacOS
125+
126+
1. `cd test/desktop`
127+
1. Check the contents of `Gemfile` to select the version of `maze-runner` to use
128+
1. Run `bundle install` if you haven't run end-to-end tests before
129+
1. To run the tests:
130+
```shell script
131+
UNITY_VERSION=2018.4.34f1 bundle exec maze-runner --app=Mazerunner
132+
```
133+
134+
Where `UNITY_VERSION` corresponds to the Unity version used to build the test fixture initially.

bugsnag-android-unity/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ buildscript {
22
repositories {
33
google()
44
mavenCentral()
5-
jcenter()
65
}
76

87
dependencies {
9-
classpath "com.android.tools.build:gradle:4.1.2"
8+
classpath "com.android.tools.build:gradle:4.2.1"
109
}
1110
}
1211

1312
repositories {
1413
google()
1514
mavenCentral()
16-
jcenter()
1715
}
1816

1917
apply plugin: "com.android.library"
@@ -39,3 +37,7 @@ android {
3937
}
4038
}
4139
}
40+
41+
dependencies {
42+
api "com.bugsnag:bugsnag-android-core:5.9.4"
43+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
android.useAndroidX=true
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
11
package com.bugsnag.android.unity;
22

3+
import java.util.regex.Matcher;
4+
import java.util.regex.Pattern;
5+
6+
import com.bugsnag.android.Error;
7+
import com.bugsnag.android.Event;
8+
import com.bugsnag.android.OnErrorCallback;
9+
310
public class BugsnagUnity {
411
static {
512
System.loadLibrary("bugsnag-unity");
613
}
714

815
public static native boolean isJNIAttached();
16+
17+
public static OnErrorCallback getNativeCallback() {
18+
String discardedEventErrorClass = "java.lang.Error";
19+
Pattern pattern = Pattern.compile("signal \\d+ \\(SIG\\w+\\)", Pattern.CASE_INSENSITIVE);
20+
return new OnErrorCallback() {
21+
@Override
22+
// Discard any messages matching native Android events as they are captured (and more
23+
// accurate) via bugsnag-android. For Unity 2018.3+
24+
public boolean onError(Event event) {
25+
Error error = event.getErrors().get(0);
26+
String errorClass = error.getErrorClass();
27+
String message = error.getErrorMessage();
28+
if(discardedEventErrorClass.equals(errorClass)) {
29+
return message == null || !pattern.matcher(message).find();
30+
}
31+
return true;
32+
}
33+
};
34+
}
935
}

bugsnag-cocoa

Submodule bugsnag-cocoa updated 143 files

0 commit comments

Comments
 (0)