Skip to content

Commit

Permalink
Merge pull request #474 from ianyh/crashlytics
Browse files Browse the repository at this point in the history
Add Crashlytics back in as opt-in configuration option
  • Loading branch information
ianyh committed Jul 26, 2016
2 parents d1ad550 + 8e5da43 commit 148832a
Show file tree
Hide file tree
Showing 37 changed files with 106 additions and 1,062 deletions.
2 changes: 1 addition & 1 deletion Amethyst.xcodeproj/project.pbxproj
Expand Up @@ -583,7 +583,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "source ./bin/CrashlyticsKeys.sh\nif [ -n \"$CRASHLYTICS_API_KEY\" -a -n \"$CRASHLYTICS_APP_KEY\" ]; then\n ./Fabric.framework/run $CRASHLYTICS_API_KEY $CRASHLYTICS_APP_KEY\n /usr/libexec/PlistBuddy -c \"Delete Fabric:APIKey\" Amethyst/Amethyst-Info.plist\nfi\n";
shellScript = "source ./bin/CrashlyticsKeys.sh\nif [ -n \"$CRASHLYTICS_API_KEY\" -a -n \"$CRASHLYTICS_APP_KEY\" ]; then\n ${PODS_ROOT}/Fabric/run $CRASHLYTICS_API_KEY $CRASHLYTICS_APP_KEY\n /usr/libexec/PlistBuddy -c \"Delete Fabric:APIKey\" Amethyst/Amethyst-Info.plist\nfi\n";
};
5D538A7AD98DDD09209924DA /* 📦 Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
14 changes: 8 additions & 6 deletions Amethyst/AppDelegate.swift
Expand Up @@ -68,12 +68,14 @@ public class AppDelegate: NSObject, NSApplicationDelegate {
self?.statusItem?.image = statusItemImage
}

let crashlyticsAPIKey = NSBundle.mainBundle().infoDictionary?["AMCrashlyticsAPIKey"]
if crashlyticsAPIKey != nil {
Fabric.with([Crashlytics.self])
#if DEBUG
Crashlytics.sharedInstance().debugMode = true
#endif
if let fabricData = NSBundle.mainBundle().infoDictionary?["Fabric"] as? [String: AnyObject] where fabricData["APIKey"] != nil {
if UserConfiguration.sharedConfiguration.shouldSendCrashReports() {
LogManager.log?.info("Crash reporting enabled")
Fabric.with([Crashlytics.self])
#if DEBUG
Crashlytics.sharedInstance().debugMode = true
#endif
}
}

preferencesWindowController = CCNPreferencesWindowController()
Expand Down
111 changes: 77 additions & 34 deletions Amethyst/Preferences/GeneralPreferencesViewController.xib

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion Amethyst/Preferences/UserConfiguration.swift
Expand Up @@ -40,6 +40,7 @@ internal enum ConfigurationKey: String {
case LayoutHUDOnSpaceChange = "enables-layout-hud-on-space-change"
case UseCanaryBuild = "use-canary-build"
case NewWindowsToMain = "new-windows-to-main"
case SendCrashReports = "send-crash-reports"

static var defaultsKeys: [ConfigurationKey] {
return [
Expand All @@ -53,7 +54,8 @@ internal enum ConfigurationKey: String {
.LayoutHUDOnSpaceChange,
.UseCanaryBuild,
.WindowMargins,
.WindowMarginSize
.WindowMarginSize,
.SendCrashReports
]
}
}
Expand Down Expand Up @@ -345,4 +347,8 @@ public class UserConfiguration: NSObject {
public func sendNewWindowsToMainPane() -> Bool {
return storage.boolForKey(ConfigurationKey.NewWindowsToMain.rawValue)
}

public func shouldSendCrashReports() -> Bool {
return storage.boolForKey(ConfigurationKey.SendCrashReports.rawValue)
}
}
3 changes: 2 additions & 1 deletion Amethyst/default.amethyst
Expand Up @@ -195,5 +195,6 @@
"window-margins": false,
"ignore-menu-bar": false,
"use-canary-build": false,
"new-windows-to-main": false
"new-windows-to-main": false,
"send-crash-reports": false
}
1 change: 0 additions & 1 deletion Crashlytics.framework/Crashlytics

This file was deleted.

1 change: 0 additions & 1 deletion Crashlytics.framework/Headers

This file was deleted.

1 change: 0 additions & 1 deletion Crashlytics.framework/Modules

This file was deleted.

1 change: 0 additions & 1 deletion Crashlytics.framework/Resources

This file was deleted.

Binary file removed Crashlytics.framework/Versions/A/Crashlytics
Binary file not shown.
31 changes: 0 additions & 31 deletions Crashlytics.framework/Versions/A/Headers/ANSCompatibility.h

This file was deleted.

206 changes: 0 additions & 206 deletions Crashlytics.framework/Versions/A/Headers/Answers.h

This file was deleted.

33 changes: 0 additions & 33 deletions Crashlytics.framework/Versions/A/Headers/CLSAttributes.h

This file was deleted.

0 comments on commit 148832a

Please sign in to comment.