Skip to content

Commit

Permalink
Merge pull request #246 from rollbar/consolidate_dep
Browse files Browse the repository at this point in the history
Remove RollbarPLCrashReporter library.
  • Loading branch information
matux committed Jan 12, 2023
2 parents b06f373 + 40f2be7 commit b448c69
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 450 deletions.
7 changes: 0 additions & 7 deletions Demos/iosAppObjC/iosAppObjC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

/* Begin PBXBuildFile section */
3BDB825A292D67900093AC9D /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BDB8258292D67900093AC9D /* SceneDelegate.m */; };
5533980A2627F4670031D02C /* RollbarPLCrashReporter in Frameworks */ = {isa = PBXBuildFile; productRef = 553398092627F4670031D02C /* RollbarPLCrashReporter */; };
55684F702553B4C400F82F34 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 55684F6F2553B4C400F82F34 /* AppDelegate.m */; };
55684F762553B4C400F82F34 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55684F752553B4C400F82F34 /* ViewController.m */; };
55684F792553B4C400F82F34 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 55684F772553B4C400F82F34 /* Main.storyboard */; };
Expand Down Expand Up @@ -45,7 +44,6 @@
files = (
55684F912553B7EE00F82F34 /* RollbarNotifier in Frameworks */,
55684F9D2553BD1C00F82F34 /* NetworkExtension.framework in Frameworks */,
5533980A2627F4670031D02C /* RollbarPLCrashReporter in Frameworks */,
55684F8D2553B7E100F82F34 /* RollbarDeploys in Frameworks */,
55684F8F2553B7E800F82F34 /* RollbarKSCrash in Frameworks */,
);
Expand Down Expand Up @@ -118,7 +116,6 @@
55684F8C2553B7E100F82F34 /* RollbarDeploys */,
55684F8E2553B7E800F82F34 /* RollbarKSCrash */,
55684F902553B7EE00F82F34 /* RollbarNotifier */,
553398092627F4670031D02C /* RollbarPLCrashReporter */,
);
productName = iosAppObjC;
productReference = 55684F6B2553B4C400F82F34 /* iosAppObjC.app */;
Expand Down Expand Up @@ -400,10 +397,6 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
553398092627F4670031D02C /* RollbarPLCrashReporter */ = {
isa = XCSwiftPackageProductDependency;
productName = RollbarPLCrashReporter;
};
55684F8C2553B7E100F82F34 /* RollbarDeploys */ = {
isa = XCSwiftPackageProductDependency;
productName = RollbarDeploys;
Expand Down
4 changes: 2 additions & 2 deletions Demos/iosAppObjC/iosAppObjC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
config.telemetry.memoryStatsAutocollectionInterval = 0.5;
config.telemetry.enabled = YES;

//id<RollbarCrashCollector> crashCollector = [[RollbarKSCrashCollector alloc] init];
id<RollbarCrashCollector> crashCollector = [[RollbarPLCrashCollector alloc] init];
id<RollbarCrashCollector> crashCollector = [[RollbarKSCrashCollector alloc] init];
//id<RollbarCrashCollector> crashCollector = [[RollbarPLCrashCollector alloc] init];

[Rollbar initWithConfiguration:config
crashCollector:crashCollector];
Expand Down
21 changes: 11 additions & 10 deletions Demos/iosAppSwift/iosAppSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
objects = {

/* Begin PBXBuildFile section */
3B3C439029704BDD0026266C /* RollbarKSCrash in Frameworks */ = {isa = PBXBuildFile; productRef = 3B3C438F29704BDD0026266C /* RollbarKSCrash */; };
3BDB8240292D2DCE0093AC9D /* iosAppSwiftApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BDB823F292D2DCE0093AC9D /* iosAppSwiftApp.swift */; };
3BDB8242292D2DCE0093AC9D /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BDB8241292D2DCE0093AC9D /* ContentView.swift */; };
3BDB8244292D2DCF0093AC9D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3BDB8243292D2DCF0093AC9D /* Assets.xcassets */; };
3BDB8247292D2DCF0093AC9D /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3BDB8246292D2DCF0093AC9D /* Preview Assets.xcassets */; };
3BDB824F292D2E4B0093AC9D /* RollbarAUL in Frameworks */ = {isa = PBXBuildFile; productRef = 3BDB824E292D2E4B0093AC9D /* RollbarAUL */; };
3BDB8251292D2E4B0093AC9D /* RollbarCommon in Frameworks */ = {isa = PBXBuildFile; productRef = 3BDB8250292D2E4B0093AC9D /* RollbarCommon */; };
3BDB8253292D2E4B0093AC9D /* RollbarNotifier in Frameworks */ = {isa = PBXBuildFile; productRef = 3BDB8252292D2E4B0093AC9D /* RollbarNotifier */; };
3BDB8255292D2E4B0093AC9D /* RollbarPLCrashReporter in Frameworks */ = {isa = PBXBuildFile; productRef = 3BDB8254292D2E4B0093AC9D /* RollbarPLCrashReporter */; };
3BDB8257292D2E4B0093AC9D /* RollbarSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 3BDB8256292D2E4B0093AC9D /* RollbarSwift */; };
/* End PBXBuildFile section */

Expand All @@ -31,9 +31,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3BDB8255292D2E4B0093AC9D /* RollbarPLCrashReporter in Frameworks */,
3BDB8253292D2E4B0093AC9D /* RollbarNotifier in Frameworks */,
3BDB8257292D2E4B0093AC9D /* RollbarSwift in Frameworks */,
3B3C439029704BDD0026266C /* RollbarKSCrash in Frameworks */,
3BDB8251292D2E4B0093AC9D /* RollbarCommon in Frameworks */,
3BDB824F292D2E4B0093AC9D /* RollbarAUL in Frameworks */,
);
Expand Down Expand Up @@ -105,8 +105,8 @@
3BDB824E292D2E4B0093AC9D /* RollbarAUL */,
3BDB8250292D2E4B0093AC9D /* RollbarCommon */,
3BDB8252292D2E4B0093AC9D /* RollbarNotifier */,
3BDB8254292D2E4B0093AC9D /* RollbarPLCrashReporter */,
3BDB8256292D2E4B0093AC9D /* RollbarSwift */,
3B3C438F29704BDD0026266C /* RollbarKSCrash */,
);
productName = iosAppSwift;
productReference = 3BDB823C292D2DCE0093AC9D /* iosAppSwift.app */;
Expand Down Expand Up @@ -202,7 +202,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -262,7 +262,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -294,6 +294,7 @@
DEVELOPMENT_ASSET_PATHS = "\"iosAppSwift/Preview Content\"";
DEVELOPMENT_TEAM = 6B5NER795L;
ENABLE_PREVIEWS = YES;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_CFBundleDisplayName = "Rollbar Demo";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
Expand Down Expand Up @@ -324,7 +325,7 @@
DEVELOPMENT_ASSET_PATHS = "\"iosAppSwift/Preview Content\"";
DEVELOPMENT_TEAM = 6B5NER795L;
ENABLE_PREVIEWS = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_CFBundleDisplayName = "Rollbar Demo";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
Expand Down Expand Up @@ -369,6 +370,10 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
3B3C438F29704BDD0026266C /* RollbarKSCrash */ = {
isa = XCSwiftPackageProductDependency;
productName = RollbarKSCrash;
};
3BDB824E292D2E4B0093AC9D /* RollbarAUL */ = {
isa = XCSwiftPackageProductDependency;
productName = RollbarAUL;
Expand All @@ -381,10 +386,6 @@
isa = XCSwiftPackageProductDependency;
productName = RollbarNotifier;
};
3BDB8254292D2E4B0093AC9D /* RollbarPLCrashReporter */ = {
isa = XCSwiftPackageProductDependency;
productName = RollbarPLCrashReporter;
};
3BDB8256292D2E4B0093AC9D /* RollbarSwift */ = {
isa = XCSwiftPackageProductDependency;
productName = RollbarSwift;
Expand Down
6 changes: 3 additions & 3 deletions Demos/iosAppSwift/iosAppSwift/iosAppSwiftApp.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftUI
import RollbarSwift
import RollbarNotifier
import RollbarPLCrashReporter
import RollbarKSCrash

@main
struct iosAppSwiftApp: App {
Expand All @@ -22,7 +22,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
) -> Bool {
// Dynamically read these settings from your config settings on
// application startup.
let accessToken = "YOUR-ROLLBAR-ACCESSTOKEN" // Rollbar post_client_item access token
let accessToken = "YOUR-ROLLBAR-TOKEN" // Rollbar post_client_item access token
let environment = "staging"
let codeVersion = "main" // Ideally codeVersion is commit SHA https://docs.rollbar.com/docs/versions

Expand Down Expand Up @@ -63,7 +63,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
// Initialize a Rollbar shared instance with a crash collector
Rollbar.initWithConfiguration(
config,
crashCollector: RollbarPLCrashCollector())
crashCollector: RollbarKSCrashCollector())

// Note the ability to add aditional key/value pairs to the occurrence data for extra context
Rollbar.infoMessage(
Expand Down
43 changes: 9 additions & 34 deletions RollbarKSCrash/Package.swift
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swift-tools-version:5.7.1

import PackageDescription

let package = Package(
name: "RollbarKSCrash",
platforms: [
// Oldest targeted platform versions that are supported by this product.
.macOS(.v10_15),
.iOS(.v13),
.tvOS(.v13),
.watchOS(.v7),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "RollbarKSCrash",
targets: ["RollbarKSCrash"]),
.library(name: "RollbarKSCrash", targets: ["RollbarKSCrash"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(name:"RollbarCommon",
path: "../RollbarCommon"
),
.package(name: "UnitTesting",
path: "../UnitTesting"
),
.package(name:"KSCrash",
url: "https://github.com/kstenerud/KSCrash.git",
from: "1.15.25" //Package.Dependency.Requirement.branch("master")
),
.package(name:"RollbarCommon", path: "../RollbarCommon"),
.package(name: "UnitTesting", path: "../UnitTesting"),
.package(url: "https://github.com/kstenerud/KSCrash.git", from: "1.15.26"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "RollbarKSCrash",
dependencies: ["RollbarCommon", "KSCrash"],
dependencies: [
"RollbarCommon",
"KSCrash"
],
publicHeadersPath: "include",
cSettings: [
.headerSearchPath("Sources/RollbarKSCrash/**"),
// .headerSearchPath("Sources/RollbarKSCrash"),
// .headerSearchPath("Sources/RollbarKSCrash/include"),
// .headerSearchPath("Sources/RollbarKSCrash/DTOs"),

// .define("DEFINES_MODULE"),
]
),
.testTarget(
Expand All @@ -60,17 +42,10 @@ let package = Package(
dependencies: ["RollbarKSCrash"],
cSettings: [
.headerSearchPath("Tests/RollbarKSCrashTests-ObjC/**"),
// .headerSearchPath("Sources/RollbarKSCrash"),
// .headerSearchPath("Sources/RollbarKSCrash/include"),
// .headerSearchPath("Sources/RollbarKSCrash/DTOs"),

// .define("DEFINES_MODULE"),
]
),
],
swiftLanguageVersions: [
SwiftVersion.v4,
SwiftVersion.v4_2,
SwiftVersion.v5,
]
)
14 changes: 3 additions & 11 deletions RollbarKSCrash/Sources/RollbarKSCrash/RollbarKSCrashCollector.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,20 @@
@implementation RollbarKSCrashCollector

+ (void)initialize {

if (self == [RollbarKSCrashCollector class]) {
RollbarKSCrashInstallation *installation = [RollbarKSCrashInstallation sharedInstance];
[installation install];
[[RollbarKSCrashInstallation sharedInstance] install];
}
}

- (void)collectCrashReportsWithObserver:(NSObject<RollbarCrashCollectorObserver> *)observer {

NSMutableArray<RollbarCrashReportData *> *crashReports = [[NSMutableArray alloc] init];

RollbarKSCrashInstallation *installation = [RollbarKSCrashInstallation sharedInstance];
[installation sendAllReportsWithCompletion:^(NSArray *filteredReports, BOOL completed, NSError *error) {
[[RollbarKSCrashInstallation sharedInstance] sendAllReportsWithCompletion:^(NSArray *filteredReports, BOOL completed, NSError *error) {
if (error) {
RollbarSdkLog(@"Could not enable crash reporter: %@", [error localizedDescription]);
} else if (completed) {
//[notifier processSavedItems];
for (NSString *crashReport in filteredReports) {

RollbarCrashReportData *crashReportData =
[[RollbarCrashReportData alloc] initWithCrashReport:crashReport];

RollbarCrashReportData *crashReportData = [[RollbarCrashReportData alloc] initWithCrashReport:crashReport];
[crashReports addObject:crashReportData];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ NS_ASSUME_NONNULL_BEGIN
/// The shared instance of this helper.
+ (instancetype)sharedInstance;

/// Sends all the discovered KSCrash reports.
- (void)sendAllReports;

@end

NS_ASSUME_NONNULL_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,16 @@ + (instancetype)sharedInstance {
dispatch_once(&onceToken, ^{
sharedInstance = [[RollbarKSCrashInstallation alloc] init];
});

return sharedInstance;
}

- (id)init {
return [super initWithRequiredProperties:[NSArray new]];
return [super initWithRequiredProperties:@[]];
}

- (id<KSCrashReportFilter>)sink {
RollbarKSCrashReportSink *sink = [[RollbarKSCrashReportSink alloc] init];
return [sink defaultFilterSet];
}

- (void)sendAllReports {
[self sendAllReportsWithCompletion:NULL];
return [[[RollbarKSCrashReportSink alloc] init] defaultFilterSet];
}

- (void)sendAllReportsWithCompletion:(KSCrashReportFilterCompletion)onCompletion {
Expand Down
19 changes: 3 additions & 16 deletions RollbarKSCrash/Sources/RollbarKSCrash/RollbarKSCrashReportSink.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,12 @@
@implementation RollbarKSCrashReportSink

- (id<KSCrashReportFilter>)defaultFilterSet {
/*
TODO: We can switch to the SideBySide type of Apple format:
KSAppleReportStyleSymbolicatedSideBySide
once the backend gets updated handle that type of crash report
*/

KSCrashReportFilterAppleFmt *format =
[KSCrashReportFilterAppleFmt filterWithReportStyle:KSAppleReportStylePartiallySymbolicated];
// other style alternatives:
// - KSAppleReportStyleSymbolicatedSideBySide
// - KSAppleReportStyleSymbolicated

KSCrashReportFilterPipeline *pipeline =
[KSCrashReportFilterPipeline filterWithFilters:format, self, nil];

KSCrashReportFilterAppleFmt *format = [KSCrashReportFilterAppleFmt filterWithReportStyle:KSAppleReportStyleSymbolicated];
KSCrashReportFilterPipeline *pipeline = [KSCrashReportFilterPipeline filterWithFilters:format, self, nil];
return pipeline;
}

- (void)filterReports:(NSArray*) reports onCompletion:(KSCrashReportFilterCompletion)onCompletion {
- (void)filterReports:(NSArray *)reports onCompletion:(KSCrashReportFilterCompletion)onCompletion {
for (NSString *report in reports) {
//[Rollbar logCrashReport:report];
}
Expand Down
5 changes: 0 additions & 5 deletions RollbarPLCrashReporter/.gitignore

This file was deleted.

Loading

0 comments on commit b448c69

Please sign in to comment.