Skip to content

Commit

Permalink
Merge pull request #210 from czechboy0/hd/adding_crashlytics
Browse files Browse the repository at this point in the history
Adding Crashlytics
  • Loading branch information
czechboy0 committed Jan 28, 2016
2 parents aa43bfc + 943b505 commit a92f321
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 15 deletions.
16 changes: 16 additions & 0 deletions Buildasaur.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@
3A58B14E1A3B9604003E0266 /* Embed Frameworks */,
42B0EC7C6499F97F0D1A8F42 /* Embed Pods Frameworks */,
43AA8DD75DC7BE8FD9E910F5 /* Copy Pods Resources */,
3ABEF9741C4B1DD800ED983F /* Crashlytics */,
);
buildRules = (
);
Expand Down Expand Up @@ -1200,6 +1201,20 @@
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
3ABEF9741C4B1DD800ED983F /* Crashlytics */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = Crashlytics;
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "#if [ \"Release\" = \"${CONFIGURATION}\" ]; then\n if [[ $(whoami) == \"honzadvorsky\" ]] ; then\n source ~/.profile\n echo \"Running Crashlytics\"\n \"${PODS_ROOT}/Fabric/run\" $KEY_FABRIC_BUILDASAUR_PUBLIC $KEY_FABRIC_BUILDASAUR_PRIVATE\n fi\n#fi";
};
42B0EC7C6499F97F0D1A8F42 /* Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -1681,6 +1696,7 @@
baseConfigurationReference = 0D837FE44FBC9DCA51767650 /* Pods-Buildasaur.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application: Jan Dvorsky (7BJ2984YDK)";
COMBINE_HIDPI_IMAGES = YES;
ENABLE_NS_ASSERTIONS = YES;
INFOPLIST_FILE = Buildasaur/Info.plist;
Expand Down
21 changes: 14 additions & 7 deletions Buildasaur.xcodeproj/xcshareddata/xcschemes/Buildasaur.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
buildForAnalyzing = "YES"
hideIssues = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3A56876F1A3B93BD0066DB2B"
Expand All @@ -25,7 +26,8 @@
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
buildForAnalyzing = "YES"
hideIssues = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3A46A2D51B081EF400F0FA4B"
Expand All @@ -39,7 +41,8 @@
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
buildForAnalyzing = "YES"
hideIssues = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3A58B1391A3B9604003E0266"
Expand All @@ -53,7 +56,8 @@
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
buildForAnalyzing = "YES"
hideIssues = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3A15464A1B02A32C001EEB45"
Expand All @@ -67,7 +71,8 @@
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
buildForAnalyzing = "YES"
hideIssues = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3AAF6EA31A3CE54900C657FB"
Expand All @@ -81,7 +86,8 @@
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
buildForAnalyzing = "YES"
hideIssues = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3AAF6EC71A3CE57100C657FB"
Expand All @@ -95,7 +101,8 @@
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
buildForAnalyzing = "YES"
hideIssues = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3AAF6EED1A3CE5BA00C657FB"
Expand Down
16 changes: 16 additions & 0 deletions Buildasaur/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Also, you can find the log at ~/Library/Application Support/Buildasaur/Builda.lo
import BuildaUtils
import XcodeServerSDK
import BuildaKit
import Fabric
import Crashlytics

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
Expand Down Expand Up @@ -100,6 +102,20 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let loginItem = LoginItem()
let syncerManager = SyncerManager(storageManager: storageManager, factory: factory, loginItem: loginItem)
self.syncerManager = syncerManager

if let heartbeatOptOut = storageManager.config.value["crash_reporting_opt_out"] as? Bool where heartbeatOptOut {
Log.info("User opted out of crash reporting")
} else {
#if DEBUG
Log.info("Not starting Crashlytics in debug mode.")
#else
Log.info("Will send crashlogs to Crashlytics. To opt out add `\"crash_reporting_opt_out\" = true` to ~/Library/Application Support/Buildasaur/Config.json")
NSUserDefaults.standardUserDefaults().registerDefaults([
"NSApplicationCrashOnExceptions": true
])
Fabric.with([Crashlytics.self])
#endif
}
}

func createInitialViewController() -> DashboardViewController {
Expand Down
18 changes: 16 additions & 2 deletions Buildasaur/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,25 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.6.5</string>
<string>0.6.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>30</string>
<string>31</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>2d4be073b00aca9b29d639d82e1ccb80444e8c0c</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
</array>
</dict>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>LSUIElement</key>
Expand Down
3 changes: 2 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end

def also_xcode_pods
pods_for_errbody
pod 'XcodeServerSDK', '~> 0.5.4'
pod 'XcodeServerSDK', '~> 0.5.5'
pod 'ekgclient', '~> 0.3.0'
end

Expand All @@ -29,6 +29,7 @@ end

target 'Buildasaur' do
buildasaur_app_pods
pod 'Crashlytics'
end

target 'BuildaKit' do
Expand Down
16 changes: 11 additions & 5 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
PODS:
- Alamofire (2.0.0-beta.3)
- BuildaUtils (0.2.7):
- BuildaUtils (0.2.8):
- SwiftSafe (~> 0.1)
- Crashlytics (3.6.0):
- Fabric (~> 1.6.3)
- CryptoSwift (0.2.2)
- ekgclient (0.3.0):
- Alamofire (= 2.0.0-beta.3)
- Fabric (1.6.4)
- Ji (1.2.0):
- Ji/Ji (= 1.2.0)
- Ji/Ji (1.2.0):
Expand All @@ -24,28 +27,31 @@ PODS:
- Result (~> 1.0)
- Result (1.0.1)
- SwiftSafe (0.1)
- XcodeServerSDK (0.5.4):
- XcodeServerSDK (0.5.6):
- BuildaUtils (~> 0.2.3)

DEPENDENCIES:
- BuildaUtils (~> 0.2.7)
- Crashlytics
- CryptoSwift
- ekgclient (~> 0.3.0)
- Ji (~> 1.2.0)
- Nimble (~> 3.0.0)
- ReactiveCocoa (= 4.0.0-RC.1)
- XcodeServerSDK (~> 0.5.4)
- XcodeServerSDK (~> 0.5.5)

SPEC CHECKSUMS:
Alamofire: 39dddb7d3725d1771b1d2f7099c8bd45bd83ffbb
BuildaUtils: dacc580246b52c7b5029c993ff4732e025c633a8
BuildaUtils: 0974c128ace30916b9b9429e8585c1c6402593dd
Crashlytics: e4e8d02914f2608fbc7bf42b1a7af838b0db67a2
CryptoSwift: d382228d6301c09474132417878a741c2a2e68cd
ekgclient: 40f5d347e2ede450b3e50ac7c6bd84d96e7b84ad
Fabric: ed41fd62173c6bdea24ab02c9d7707161eabb750
Ji: ddebb22f9ac445db6e884b66f78ea74fb135fdb7
Nimble: 4c353d43735b38b545cbb4cb91504588eb5de926
ReactiveCocoa: 2b0f654beb7642b82cfd3fdb845205ae9889422c
Result: caef80340451e1f07492fa1e89117f83613bce24
SwiftSafe: 77ffd12b02678790bec1ef56a2d14ec5036f1fd6
XcodeServerSDK: 38c2bbdbc8e1387480adde299c0dc4455f0af11b
XcodeServerSDK: 6300badc4a799da9ad6e970b366eda18d4a47bda

COCOAPODS: 0.39.0
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ If, despite absolutely no identifiable data being sent, you still aren't comfort
---------------
If Builda crashes, you can find crash logs at `~/Library/Logs/DiagnosticReports/Buildasaur-*`. Please let me know if that happens and I'll take a look. Also, Builda logs (pretty verbosely) to `~/Library/Application Support/Buildasaur/Builda.log`, so this is another place to watch in case of any problems. You can find all persisted files that Buildasaur keeps around at `~/Library/Application Support/Buildasaur/`.

Version 0.7.0 adds Crashlytics, so I'll get crash reports in such cases. If you'd prefer to opt-out of crash reporting, you can do so by adding `{ "crash_reporting_opt_out" = true }` to `~/Library/Application Support/Buildasaur/Config.json`.

:arrow_right_hook: Looking for Xcode Server SDK?
----------------
The code to communicate with Xcode Server lives in the project called [XcodeServerSDK](https://github.com/czechboy0/XcodeServerSDK). Buildasaur is just one app that uses this SDK, but now you can build your own as well!
Expand Down

0 comments on commit a92f321

Please sign in to comment.