Skip to content

Commit

Permalink
Merge pull request #187 from pietrocaselani/setup_crashlytics
Browse files Browse the repository at this point in the history
Setup crashlytics
  • Loading branch information
pietrocaselani committed May 1, 2019
2 parents 53fc242 + 9f39e33 commit 17d9285
Show file tree
Hide file tree
Showing 31 changed files with 120 additions and 175 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -50,3 +50,5 @@ Pods/
/vendor
.bundle
CouchTrackerApp/Utils/Secrets.swift
crashlytics.apikey
crashlytics.apisecret
125 changes: 16 additions & 109 deletions CouchTracker.xcodeproj/project.pbxproj
Expand Up @@ -513,6 +513,7 @@
82983F8B22336BB1003DDCF0 /* EpisodeEntity+Formatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82983F8922336BB1003DDCF0 /* EpisodeEntity+Formatter.swift */; };
829A590121B2404700B67753 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 829A590021B2404700B67753 /* Container.swift */; };
829A590221B2404700B67753 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = 829A590021B2404700B67753 /* Container.swift */; };
829D3A14227A25BF000D24FB /* CrashReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 829D3A13227A25BF000D24FB /* CrashReporter.swift */; };
82A1A78222067A2300EB50BB /* ObservableExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A1A78122067A2300EB50BB /* ObservableExtensions.swift */; };
82A1A78322067A2300EB50BB /* ObservableExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A1A78122067A2300EB50BB /* ObservableExtensions.swift */; };
82A67D502267DA7C007B3622 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 82A67D4F2267DA7C007B3622 /* Assets.xcassets */; };
Expand Down Expand Up @@ -1003,6 +1004,7 @@
8296594D21F3F98500DB1B4D /* ShowIdsMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowIdsMock.swift; sourceTree = "<group>"; };
82983F8922336BB1003DDCF0 /* EpisodeEntity+Formatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "EpisodeEntity+Formatter.swift"; sourceTree = "<group>"; };
829A590021B2404700B67753 /* Container.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Container.swift; sourceTree = "<group>"; };
829D3A13227A25BF000D24FB /* CrashReporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrashReporter.swift; sourceTree = "<group>"; };
82A1A78122067A2300EB50BB /* ObservableExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObservableExtensions.swift; sourceTree = "<group>"; };
82A67D4F2267DA7C007B3622 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
82AC56E221F12E2300DCF165 /* SyncState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncState.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2186,6 +2188,7 @@
82854F2621E2B41400F0BAEA /* TableViewCell.swift */,
822A02FC21D2352400440AF8 /* View.swift */,
82609F0E21D870C90038EB29 /* ViewCalculations.swift */,
829D3A13227A25BF000D24FB /* CrashReporter.swift */,
);
path = Core;
sourceTree = "<group>";
Expand Down Expand Up @@ -2353,8 +2356,6 @@
4F0F56F8203D5F4C00B86CB8 /* Frameworks */,
4F0F56F9203D5F4C00B86CB8 /* Headers */,
4F0F56FA203D5F4C00B86CB8 /* Resources */,
4F0F581C203D75FB00B86CB8 /* SwiftLint */,
4FAC4A91210F27F60096BCE0 /* SwiftFormat */,
);
buildRules = (
);
Expand Down Expand Up @@ -2398,8 +2399,6 @@
4F0F5854203D7A5B00B86CB8 /* Frameworks */,
4F0F5855203D7A5B00B86CB8 /* Headers */,
4F0F5856203D7A5B00B86CB8 /* Resources */,
4F0F5864203D7AEB00B86CB8 /* SwiftLint */,
4FAC4A94210FDD4B0096BCE0 /* SwiftFormat */,
);
buildRules = (
);
Expand Down Expand Up @@ -2432,13 +2431,15 @@
buildConfigurationList = 647632561F44824900F277F1 /* Build configuration list for PBXNativeTarget "CouchTracker" */;
buildPhases = (
EB6C6EE4FCE9F4239E708FE0 /* [CP] Check Pods Manifest.lock */,
829D3A12227A24D8000D24FB /* Export environment variables */,
647632351F44824900F277F1 /* Sources */,
647632361F44824900F277F1 /* Frameworks */,
647632371F44824900F277F1 /* Resources */,
6455BA751F45B862000660C6 /* SwiftLint */,
6405CA021F549BE90039D6E6 /* Embed Frameworks */,
4FAC4A93210F28310096BCE0 /* SwiftFormat */,
303657ACD85152B4015403F8 /* [CP] Embed Pods Frameworks */,
8214A3102279004000FD78F4 /* Crashlytics */,
);
buildRules = (
);
Expand Down Expand Up @@ -2495,8 +2496,6 @@
820406E921D0032000127F05 /* Sources */,
820406EA21D0032000127F05 /* Frameworks */,
820406EB21D0032000127F05 /* Resources */,
8204073B21D0074C00127F05 /* Swiftlint */,
8204073C21D0076D00127F05 /* SwiftFormat */,
);
buildRules = (
);
Expand All @@ -2518,8 +2517,6 @@
824A781A220F5C290001F3BF /* Sources */,
824A781B220F5C290001F3BF /* Frameworks */,
824A781C220F5C290001F3BF /* Resources */,
824A784C220F68830001F3BF /* SwiftLint */,
824A784D220F68960001F3BF /* Swiftformat */,
);
buildRules = (
);
Expand Down Expand Up @@ -2857,48 +2854,6 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CouchTracker/Pods-CouchTracker-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
4F0F581C203D75FB00B86CB8 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = SwiftLint;
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, using from Pods. Please download from https://github.com/realm/SwiftLint\"\n \"${PODS_ROOT}/SwiftLint/swiftlint\"\nfi\n\n";
};
4F0F5864203D7AEB00B86CB8 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = SwiftLint;
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, using from Pods. Please download from https://github.com/realm/SwiftLint\"\n \"${PODS_ROOT}/SwiftLint/swiftlint\"\nfi\n";
};
4FAC4A91210F27F60096BCE0 /* SwiftFormat */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = SwiftFormat;
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh $SRCROOT/build_phases/swiftformat\n";
};
4FAC4A92210F281D0096BCE0 /* SwiftFormat */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -2927,20 +2882,6 @@
shellPath = /bin/sh;
shellScript = "sh $SRCROOT/build_phases/swiftformat\n";
};
4FAC4A94210FDD4B0096BCE0 /* SwiftFormat */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = SwiftFormat;
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh $SRCROOT/build_phases/swiftformat\n";
};
6455BA751F45B862000660C6 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -2953,7 +2894,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, using from Pods. Please download from https://github.com/realm/SwiftLint\"\n \"${PODS_ROOT}/SwiftLint/swiftlint\"\nfi\n";
shellScript = "$SRCROOT/build_phases/swiftlint\n";
};
8043BB3547FC34DF79CC2A5C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -2991,49 +2932,32 @@
outputFileListPaths = (
);
outputPaths = (
$SRCROOT/GeneratedFiles/R.generated.swift,
"$SRCROOT/GeneratedFiles/R.generated.swift",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$PODS_ROOT/R.swift/rswift\" generate \"$SRCROOT/GeneratedFiles/R.generated.swift\"\n";
};
8204073B21D0074C00127F05 /* Swiftlint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = Swiftlint;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, using from Pods. Please download from https://github.com/realm/SwiftLint\"\n \"${PODS_ROOT}/SwiftLint/swiftlint\"\nfi\n";
};
8204073C21D0076D00127F05 /* SwiftFormat */ = {
8214A3102279004000FD78F4 /* Crashlytics */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)",
);
name = SwiftFormat;
name = Crashlytics;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh $SRCROOT/build_phases/swiftformat\n";
shellPath = /bin/bash;
shellScript = "${PODS_ROOT}/Fabric/run \"${CRASHLYTICS_API_KEY}\" \"${CRASHLYTICS_API_SECRET}\"\n";
};
824A784C220F68830001F3BF /* SwiftLint */ = {
829D3A12227A24D8000D24FB /* Export environment variables */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -3042,32 +2966,14 @@
);
inputPaths = (
);
name = SwiftLint;
name = "Export environment variables";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, using from Pods. Please download from https://github.com/realm/SwiftLint\"\n \"${PODS_ROOT}/SwiftLint/swiftlint\"\nfi\n";
};
824A784D220F68960001F3BF /* Swiftformat */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = Swiftformat;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sh $SRCROOT/build_phases/swiftformat\n";
shellScript = "export CRASHLYTICS_API_KEY=$(cat $SRCROOT/build_phases/crashlytics.apikey)\nexport CRASHLYTICS_API_SECRET=$(cat $SRCROOT/build_phases/crashlytics.apisecret)\n";
};
9C6F0D2340CF87135C62A2BE /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -3592,6 +3498,7 @@
files = (
8204070221D003F200127F05 /* Tabman+CouchTracker.swift in Sources */,
8204072021D0048900127F05 /* ShowsManageriOSCreator.swift in Sources */,
829D3A14227A25BF000D24FB /* CrashReporter.swift in Sources */,
820406FE21D003A500127F05 /* AppFlowiOSModuleDataSource.swift in Sources */,
82C6478021D7345200175B24 /* PosterAndTitleCell.swift in Sources */,
8204072121D0048900127F05 /* ShowsManagerModule.swift in Sources */,
Expand Down
2 changes: 2 additions & 0 deletions CouchTracker/AppDelegate.swift
Expand Up @@ -9,6 +9,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_: UIApplication,
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
CrashReporter.initialize()

UINavigationBar.appearance().barTintColor = Colors.NavigationBar.barTintColor
UINavigationBar.appearance().isTranslucent = false
UINavigationBar.appearance().tintColor = Colors.NavigationBar.tintColor
Expand Down
7 changes: 7 additions & 0 deletions CouchTrackerApp/Core/CrashReporter.swift
@@ -0,0 +1,7 @@
import Crashlytics

public enum CrashReporter {
public static func initialize() {
Crashlytics.start(withAPIKey: Secrets.Crashlytics.apiKey)
}
}
6 changes: 3 additions & 3 deletions CouchTrackerCore/AppFlow/AppFlowContract.swift
@@ -1,17 +1,17 @@
import RxSwift

public protocol AppFlowModuleDataSource: class {
public protocol AppFlowModuleDataSource: AnyObject {
var modulePages: [ModulePage] { get }
}

public protocol AppFlowPresenter: class {
public protocol AppFlowPresenter: AnyObject {
init(repository: AppFlowRepository, moduleDataSource: AppFlowModuleDataSource)

func observeViewState() -> Observable<AppFlowViewState>
func viewDidLoad()
func selectTab(index: Int)
}

public protocol AppFlowRepository: class {
public protocol AppFlowRepository: AnyObject {
var lastSelectedTab: Int { get set }
}
6 changes: 3 additions & 3 deletions CouchTrackerCore/AppState/AppStateContract.swift
Expand Up @@ -7,19 +7,19 @@ public enum AppStateViewState: Hashable {
case showing(configs: [AppStateViewModel])
}

public protocol AppStateDataHolder: class {
public protocol AppStateDataHolder: AnyObject {
func currentAppState() throws -> AppState
func save(appState: AppState) throws
}

public protocol AppStateRouter: class {
public protocol AppStateRouter: AnyObject {
func showTraktLogin()
func finishLogin()
func showExternal(url: URL)
func showError(message: String)
}

public protocol AppStatePresenter: class {
public protocol AppStatePresenter: AnyObject {
func viewDidLoad()
func observeViewState() -> Observable<AppStateViewState>
func select(configuration: AppConfigurationViewModel)
Expand Down
@@ -1,7 +1,7 @@
import RxSwift
import TMDBSwift

public protocol ConfigurationRepository: class {
public protocol ConfigurationRepository: AnyObject {
init(tmdbProvider: TMDBProvider)

func fetchConfiguration() -> Observable<Configuration>
Expand Down
2 changes: 1 addition & 1 deletion CouchTrackerCore/Core/BaseView.swift
@@ -1 +1 @@
public protocol BaseView: class {}
public protocol BaseView: AnyObject {}
4 changes: 1 addition & 3 deletions CouchTrackerCore/Core/BundleProvider.swift
Expand Up @@ -3,8 +3,6 @@ import Foundation
final class BundleProvider {
static let testing = NSClassFromString("XCTestCase") != nil

private static var testBundle = Bundle(identifier: "io.github.pietrocaselani.CouchTrackerCoreTests")!

private init() {
fatalError("No instances for you!")
}
Expand All @@ -14,6 +12,6 @@ final class BundleProvider {
return Bundle.main
}

return testBundle
return Bundle(identifier: "io.github.pietrocaselani.CouchTrackerCoreTests")!
}
}
2 changes: 1 addition & 1 deletion CouchTrackerCore/Core/Schedulers.swift
@@ -1,6 +1,6 @@
import RxSwift

public protocol Schedulers: class {
public protocol Schedulers: AnyObject {
var networkScheduler: SchedulerType { get }
var networkQueue: DispatchQueue { get }
var dataSourceScheduler: ImmediateSchedulerType { get }
Expand Down
6 changes: 3 additions & 3 deletions CouchTrackerCore/Images/ImageRepository.swift
@@ -1,16 +1,16 @@
import RxSwift

public protocol MovieImageRepository: class {
public protocol MovieImageRepository: AnyObject {
func fetchMovieImages(for movieId: Int, posterSize: PosterImageSize?,
backdropSize: BackdropImageSize?) -> Maybe<ImagesEntity>
}

public protocol ShowImageRepository: class {
public protocol ShowImageRepository: AnyObject {
func fetchShowImages(for showId: Int, posterSize: PosterImageSize?,
backdropSize: BackdropImageSize?) -> Maybe<ImagesEntity>
}

public protocol EpisodeImageRepository: class {
public protocol EpisodeImageRepository: AnyObject {
func fetchEpisodeImages(for episode: EpisodeImageInput, size: EpisodeImageSizes?) -> Maybe<URL>
}

Expand Down

0 comments on commit 17d9285

Please sign in to comment.