Skip to content

Commit

Permalink
Merge pull request #50 from backtrace-labs/develop
Browse files Browse the repository at this point in the history
Out of memory support
  • Loading branch information
krml19 authored Feb 18, 2021
2 parents 3a764f8 + a7a030a commit f9830d5
Show file tree
Hide file tree
Showing 37 changed files with 526 additions and 177 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy to Cocoapods

on:
push:
tags: '[0-9]+.[0-9]+.[0-9]+*'

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sh scripts/install.sh
- name: Run tests
run: sh scripts/test.sh
- name: Deploy to Cocoapods
run: sh scripts/deploy.sh
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Run tests

on:
pull_request:
branches:
- develop
- master

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sh scripts/install.sh
- name: Run tests
run: sh scripts/test.sh
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ force_try:
severity: warning # explicitly
# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length: 120
line_length: 130
# they can set both implicitly with an array
type_body_length:
- 300 # warning
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: swift
os: osx
osx_image: xcode11.6
osx_image: xcode12
script:
- sh scripts/install.sh
- sh scripts/test.sh
2 changes: 1 addition & 1 deletion Backtrace.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|

s.name = "Backtrace"
s.version = "1.5.6"
s.version = "1.6.0"
s.summary = "Backtrace's integration with iOS, macOS and tvOS"
s.description = "Reliable crash and hang reporting for iOS, macOS and tvOS."
s.homepage = "https://backtrace.io/"
Expand Down
8 changes: 8 additions & 0 deletions Backtrace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
0B6B4CFD25CD8331002DA15C /* BacktraceOomWatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B6B4CFC25CD8331002DA15C /* BacktraceOomWatcher.swift */; };
0B6B4CFE25CD8331002DA15C /* BacktraceOomWatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B6B4CFC25CD8331002DA15C /* BacktraceOomWatcher.swift */; };
0B6B4CFF25CD8331002DA15C /* BacktraceOomWatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B6B4CFC25CD8331002DA15C /* BacktraceOomWatcher.swift */; };
282C85E7223FD8E70014FE75 /* BacktraceCrashExceptionApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 282C85E6223FD8E70014FE75 /* BacktraceCrashExceptionApplication.swift */; };
282C85EA22419C560014FE75 /* BacktraceWatcherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 282C85E822419BB10014FE75 /* BacktraceWatcherTests.swift */; };
282C85EB22419C600014FE75 /* BacktraceWatcherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 282C85E822419BB10014FE75 /* BacktraceWatcherTests.swift */; };
Expand Down Expand Up @@ -305,6 +308,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0B6B4CFC25CD8331002DA15C /* BacktraceOomWatcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BacktraceOomWatcher.swift; sourceTree = "<group>"; };
0DFF5AC24C0AC4EF3E2F5307 /* Pods-Example-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-tvOS.release.xcconfig"; path = "Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS.release.xcconfig"; sourceTree = "<group>"; };
266E3F27CBA1D3CE7E2CCCB2 /* Pods_Backtrace_macOSTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Backtrace_macOSTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
282C85E6223FD8E70014FE75 /* BacktraceCrashExceptionApplication.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BacktraceCrashExceptionApplication.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -701,6 +705,7 @@
children = (
F28F164521E28441008E4B96 /* BacktraceReporter.swift */,
F28162F921EFD6AD00A12B7A /* BacktraceResponse.swift */,
0B6B4CFC25CD8331002DA15C /* BacktraceOomWatcher.swift */,
);
path = Client;
sourceTree = "<group>";
Expand Down Expand Up @@ -1779,6 +1784,7 @@
28F95BDB22526088003936E0 /* SignalContext.swift in Sources */,
28F95BD122526068003936E0 /* BacktraceResult.swift in Sources */,
28F95BE7225260B0003936E0 /* Attachment.swift in Sources */,
0B6B4CFF25CD8331002DA15C /* BacktraceOomWatcher.swift in Sources */,
28F95BCB22526045003936E0 /* Dispatching.swift in Sources */,
28F95BDD2252608E003936E0 /* BacktraceReportStatus.swift in Sources */,
28F95BDE22526091003936E0 /* ReportingPolicy.swift in Sources */,
Expand Down Expand Up @@ -1864,6 +1870,7 @@
F282075C21CEA37A0017367F /* Repository.swift in Sources */,
F26EBF3B23F21BC700A64218 /* BacktraceRateLimiter.swift in Sources */,
F28F165221E2A08F008E4B96 /* HttpMethod.swift in Sources */,
0B6B4CFE25CD8331002DA15C /* BacktraceOomWatcher.swift in Sources */,
F29CD78E21FC6BC700216C59 /* BacktraceFileManager.swift in Sources */,
F2D7122221F10C45002D2A26 /* BacktraceClientConfiguration.swift in Sources */,
F29CD79221FCC25600216C59 /* BacktraceWatcher.swift in Sources */,
Expand Down Expand Up @@ -1938,6 +1945,7 @@
F2D7122421F10E78002D2A26 /* BacktraceCredentials.swift in Sources */,
F28F164621E28441008E4B96 /* BacktraceReporter.swift in Sources */,
F21211A5222348AC000B3692 /* BacktraceCrashReporter.swift in Sources */,
0B6B4CFD25CD8331002DA15C /* BacktraceOomWatcher.swift in Sources */,
F2C1514221F7D8E30014F1B3 /* PersistentRepository.swift in Sources */,
F2D8BE3821BD7894007CFEFA /* BacktraceError.swift in Sources */,
F282075821CEA31F0017367F /* BacktraceReport.swift in Sources */,
Expand Down
4 changes: 3 additions & 1 deletion Brewfile
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
brew "fastlane"
brew "fastlane"
brew 'cocoapods'
brew 'swiftlint'
88 changes: 76 additions & 12 deletions Brewfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,78 @@
"entries": {
"brew": {
"fastlane": {
"version": "2.161.0",
"version": "2.174.0",
"bottle": {
"rebuild": 0,
"cellar": ":any",
"prefix": "/usr/local",
"root_url": "https://homebrew.bintray.com/bottles",
"files": {
"arm64_big_sur": {
"url": "https://homebrew.bintray.com/bottles/fastlane-2.174.0.arm64_big_sur.bottle.tar.gz",
"sha256": "f426b0fb779e80de18de67b52f9552ee666ae8b9d1eac2c0631be59a33429b1b"
},
"big_sur": {
"url": "https://homebrew.bintray.com/bottles/fastlane-2.174.0.big_sur.bottle.tar.gz",
"sha256": "4eac8c1706c541acbfa838b6aea84cf39b74c242e2aadefd0a09ac185a2f24c9"
},
"catalina": {
"url": "https://homebrew.bintray.com/bottles/fastlane-2.174.0.catalina.bottle.tar.gz",
"sha256": "35c4d2b53eda31363256febf927c9b7a305ec7c27173651cc87adf0b4dc5316e"
},
"mojave": {
"url": "https://homebrew.bintray.com/bottles/fastlane-2.174.0.mojave.bottle.tar.gz",
"sha256": "6047bf36c5cd07630d35ee2e12b79782f12550a1b5acdd22badf7c4fcc826cf4"
}
}
}
},
"cocoapods": {
"version": "1.10.1",
"bottle": {
"rebuild": 0,
"cellar": "/usr/local/Cellar",
"prefix": "/usr/local",
"root_url": "https://homebrew.bintray.com/bottles",
"files": {
"arm64_big_sur": {
"url": "https://homebrew.bintray.com/bottles/cocoapods-1.10.1.arm64_big_sur.bottle.tar.gz",
"sha256": "08794cfd260bf206eed3496805816661da367bffdf9af748cd812b1c40a0de75"
},
"big_sur": {
"url": "https://homebrew.bintray.com/bottles/cocoapods-1.10.1.big_sur.bottle.tar.gz",
"sha256": "0caa8953926c827f62d53f9767aed0a904604c0425ea0557b24d738240db809a"
},
"catalina": {
"url": "https://homebrew.bintray.com/bottles/fastlane-2.161.0.catalina.bottle.tar.gz",
"sha256": "fa9092e388bca3b32807eddcc1c6514e92f3e5e20da966f82bd7670c3e0d42d3"
"url": "https://homebrew.bintray.com/bottles/cocoapods-1.10.1.catalina.bottle.tar.gz",
"sha256": "3a05cecba1a15c8cad8baa04b4e6be6eef8159c061b37096012de75132e7cd74"
},
"mojave": {
"url": "https://homebrew.bintray.com/bottles/fastlane-2.161.0.mojave.bottle.tar.gz",
"sha256": "431e169597585884f93781f00c17c64fd779d6ea311602891567236146473c5f"
"url": "https://homebrew.bintray.com/bottles/cocoapods-1.10.1.mojave.bottle.tar.gz",
"sha256": "0883b18c75e7cade594eced3d828ccacefafbbb3ead61667bca21e1fbc94970d"
}
}
}
},
"swiftlint": {
"version": "0.42.0",
"bottle": {
"rebuild": 0,
"cellar": ":any_skip_relocation",
"prefix": "/usr/local",
"root_url": "https://homebrew.bintray.com/bottles",
"files": {
"arm64_big_sur": {
"url": "https://homebrew.bintray.com/bottles/swiftlint-0.42.0.arm64_big_sur.bottle.tar.gz",
"sha256": "a9cf09a414fd3b8a5cb3d94e682a725f654a4d1caef19497a500d6dbb926ba7c"
},
"big_sur": {
"url": "https://homebrew.bintray.com/bottles/swiftlint-0.42.0.big_sur.bottle.tar.gz",
"sha256": "1a0540f0ff6cac2da0a51672db7963aef71cc58954c34791e9b01dafd63c5898"
},
"high_sierra": {
"url": "https://homebrew.bintray.com/bottles/fastlane-2.161.0.high_sierra.bottle.tar.gz",
"sha256": "39bdfc80e896775b45617f1b7bb9f209cad91b91a5bb0a3cbeae0ed0080f45cc"
"catalina": {
"url": "https://homebrew.bintray.com/bottles/swiftlint-0.42.0.catalina.bottle.tar.gz",
"sha256": "e9023ed754eb8cb78a9f2b469a90875ca42a7afffd3e96f8142252e81d889793"
}
}
}
Expand All @@ -27,12 +83,20 @@
"system": {
"macos": {
"catalina": {
"HOMEBREW_VERSION": "2.5.2",
"HOMEBREW_VERSION": "2.7.7",
"HOMEBREW_PREFIX": "/usr/local",
"Homebrew/homebrew-core": "3cc2bc2196267adcdaa2e256cd8af6c30207c049",
"Homebrew/homebrew-core": "7c08a98e781448b9a80c9db887c5cb66839f12c8",
"CLT": "1103.0.32.62",
"Xcode": "11.7",
"macOS": "10.15.6"
"Xcode": "12.4",
"macOS": "10.15.7"
},
"big_sur": {
"HOMEBREW_VERSION": "3.0.1",
"HOMEBREW_PREFIX": "/usr/local",
"Homebrew/homebrew-core": "703451fe242d959d029d867909ffd92f0d522ffd",
"CLT": "12.4.0.0.1.1610135815",
"Xcode": "12.4",
"macOS": "11.2.1"
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions Gemfile

This file was deleted.

90 changes: 0 additions & 90 deletions Gemfile.lock

This file was deleted.

2 changes: 2 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source 'https://cdn.cocoapods.org/'

# Library

# Definitions
Expand Down
16 changes: 8 additions & 8 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PODS:
- Backtrace (1.5.6):
- Backtrace (1.6.0):
- Backtrace-PLCrashReporter
- Backtrace-PLCrashReporter (1.5.4)
- Nimble (8.1.2)
- Quick (3.0.0)
- Nimble (9.0.0)
- Quick (3.1.2)

DEPENDENCIES:
- Backtrace (from `./Backtrace.podspec`)
Expand All @@ -22,11 +22,11 @@ EXTERNAL SOURCES:
:path: "./Backtrace.podspec"

SPEC CHECKSUMS:
Backtrace: 90f5a8b6bc9d417a444ce62435bbda0c54fa8d89
Backtrace: 90e82b3be4a6bde054dcb4663511a37113c348a8
Backtrace-PLCrashReporter: 65b9aae5468bb6af6b55b88de22b49e031331054
Nimble: 3864815b4703c7ebffba875973c70e854489fbae
Quick: 6d9559f40647bc4d510103842ef2fdd882d753e2
Nimble: 3b4ec3fd40f1dc178058e0981107721c615643d8
Quick: 60f0ea3b8e0cfc0df3259a5c06a238ad8b3c46e0

PODFILE CHECKSUM: 62d8c592f7a14dbdbf06ce7cbf47810c1a25075e
PODFILE CHECKSUM: afc46274bf1938dc457973360b3e30ff7b342057

COCOAPODS: 1.9.3
COCOAPODS: 1.10.1
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ let backtraceCredentials = BacktraceCredentials(endpoint: URL(string: "https://b
let configuration = BacktraceClientConfiguration(credentials: backtraceCredentials,
dbSettings: BacktraceDatabaseSettings(),
reportsPerMin: 10,
allowsAttachingDebugger: false)
allowsAttachingDebugger: false,
detectOOM: true)
BacktraceClient.shared = try? BacktraceClient(configuration: configuration)
```

Expand All @@ -179,12 +180,19 @@ BacktraceClientConfiguration *configuration = [[BacktraceClientConfiguration all
initWithCredentials: credentials
dbSettings: [[BacktraceDatabaseSettings alloc] init]
reportsPerMin: 3
allowsAttachingDebugger: NO];
allowsAttachingDebugger: NO
detectOOM: TRUE];

BacktraceClient.shared = [[BacktraceClient alloc] initWithConfiguration: configuration error: nil];
```
**Note:** Backtrace library will *not* send any reports if the `allowsAttachingDebugger` flag is set to `false`.
**Note on parameters**
- `initWithCredentials` and `BacktraceCredentials` see [here](#documentation-client-initialization)
- `dbSettings` see [here](#documentation-database-settings)
- `reportsPerMin` indicates the upper limit of how many reports per minute should be sent to the Backtrace endpoint
- `allowsAttachingDebugger` if this flag is set to `false` (Swift) or `NO` (ObjC) the Backtrace library will *not* send any reports
- `detectOOM` indicates if detected Low Memory Warnings ([`applicationDidReceiveMemoryWarning`](https://developer.apple.com/documentation/uikit/app_and_environment/managing_your_app_s_life_cycle/responding_to_memory_warnings)) are a trigger for Backtrace to send a report. Backtrace will send reports generated by memory warning on application startup when application exited unexpectedly.
### Database settings <a name="documentation-database-settings"></a>
BacktraceClient allows you to customize the initialization of BacktraceDatabase for local storage of error reports by supplying a BacktraceDatabaseSettings parameter, as follows:
Expand Down
Loading

0 comments on commit f9830d5

Please sign in to comment.