Skip to content

Commit

Permalink
Merge pull request #812 from DroidKaigi/ios-crashlytics
Browse files Browse the repository at this point in the history
[iOS] Introduce Crashlytics
  • Loading branch information
ry-itto authored Oct 1, 2022
2 parents f3dbfc2 + d5865a5 commit 53ee85d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
8C1F600928C6500100B56B92 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8C1F600828C6500100B56B92 /* GoogleService-Info.plist */; };
8C541EE328B1313B00354E7B /* DroidKaigi2022App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C541ED328B1313800354E7B /* DroidKaigi2022App.swift */; };
8C541EE728B1313B00354E7B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8C541ED528B1313A00354E7B /* Assets.xcassets */; };
8CA8475628E60A1200B0A141 /* ci_post_xcodebuild.sh in Resources */ = {isa = PBXBuildFile; fileRef = 8CA8475528E60A1200B0A141 /* ci_post_xcodebuild.sh */; };
8CDF83C928B558CF00D4C570 /* AppFeature in Frameworks */ = {isa = PBXBuildFile; productRef = 8CDF83C828B558CF00D4C570 /* AppFeature */; };
E831922728C9DACE009FC9F6 /* ci_pre_xcodebuild.sh in Resources */ = {isa = PBXBuildFile; fileRef = E831922628C9DACE009FC9F6 /* ci_pre_xcodebuild.sh */; };
E831922928C9DDA5009FC9F6 /* ci_post_clone.sh in Resources */ = {isa = PBXBuildFile; fileRef = E831922828C9DDA5009FC9F6 /* ci_post_clone.sh */; };
Expand All @@ -21,6 +22,7 @@
8C541ED528B1313A00354E7B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8C541EDA28B1313B00354E7B /* DroidKaigi2022.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DroidKaigi2022.app; sourceTree = BUILT_PRODUCTS_DIR; };
8C541EF228B1315C00354E7B /* app-ios */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "app-ios"; path = ..; sourceTree = "<group>"; };
8CA8475528E60A1200B0A141 /* ci_post_xcodebuild.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = ci_post_xcodebuild.sh; sourceTree = "<group>"; };
E831922628C9DACE009FC9F6 /* ci_pre_xcodebuild.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = ci_pre_xcodebuild.sh; sourceTree = "<group>"; };
E831922828C9DDA5009FC9F6 /* ci_post_clone.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = ci_post_clone.sh; sourceTree = "<group>"; };
E831922A28CADE5F009FC9F6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -81,6 +83,7 @@
children = (
E831922628C9DACE009FC9F6 /* ci_pre_xcodebuild.sh */,
E831922828C9DDA5009FC9F6 /* ci_post_clone.sh */,
8CA8475528E60A1200B0A141 /* ci_post_xcodebuild.sh */,
);
path = ci_scripts;
sourceTree = "<group>";
Expand Down Expand Up @@ -162,6 +165,7 @@
8C541EE728B1313B00354E7B /* Assets.xcassets in Resources */,
E831922728C9DACE009FC9F6 /* ci_pre_xcodebuild.sh in Resources */,
E831922928C9DDA5009FC9F6 /* ci_post_clone.sh in Resources */,
8CA8475628E60A1200B0A141 /* ci_post_xcodebuild.sh in Resources */,
8C1F600928C6500100B56B92 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -335,7 +339,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.2;
PRODUCT_BUNDLE_IDENTIFIER = io.github.droidkaigi.DroidKaigi2022;
PRODUCT_NAME = DroidKaigi2022;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -368,7 +372,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.2;
PRODUCT_BUNDLE_IDENTIFIER = io.github.droidkaigi.DroidKaigi2022;
PRODUCT_NAME = DroidKaigi2022;
SDKROOT = iphoneos;
Expand Down
8 changes: 8 additions & 0 deletions app-ios/DroidKaigi2022/ci_scripts/ci_post_xcodebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/zsh

# Upload Symbols To Firebase
cd "$CI_WORKSPACE/app-ios"
./scripts/upload-symbols \
-gsp "DroidKaigi2022/Shared/GoogleService-Info.plist" \
-p "ios" \
"$CI_ARCHIVE_PATH/dSYMs/$CI_PRODUCT.app.dSYM"
8 changes: 8 additions & 0 deletions app-ios/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ var package = Package(
.target(name: "Auth"),
.target(name: "Container"),
.target(name: "ContributorFeature"),
.target(name: "Crashlytics"),
.target(name: "Event"),
.target(name: "MapFeature"),
.target(name: "SponsorFeature"),
Expand All @@ -77,6 +78,7 @@ var package = Package(
.target(name: "SessionFeature"),
.target(name: "StaffFeature"),
.target(name: "TimetableFeature"),
.product(name: "FirebaseCrashlytics", package: "firebase-ios-sdk"),
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
),
Expand Down Expand Up @@ -134,6 +136,12 @@ var package = Package(
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
),
.target(
name: "Crashlytics",
dependencies: [
.product(name: "FirebaseCrashlytics", package: "firebase-ios-sdk"),
]
),
.target(
name: "Event"
),
Expand Down
4 changes: 3 additions & 1 deletion app-ios/Sources/AppFeature/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Auth
import ComposableArchitecture
import Container
import Event
import Firebase
import MapFeature
import SearchFeature
import SessionFeature
Expand Down Expand Up @@ -87,7 +88,8 @@ public struct AppEnvironment {

public extension AppEnvironment {
static var client: Self {
let container = DIContainer(authenticator: Auth.Authenticator())
FirebaseApp.configure()
let container = DIContainer(authenticator: Authenticator())

return .init(
contributorsRepository: container.get(type: ContributorsRepository.self),
Expand Down
5 changes: 1 addition & 4 deletions app-ios/Sources/Auth/Authenticator.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import appioscombined
import Firebase
import FirebaseAuth

public class Authenticator: appioscombined.Authenticator {
public init() {
FirebaseApp.configure()
}
public init() {}

public func currentUser() async throws -> appioscombined.User? {
let idTokenResult = try await Auth.auth().currentUser?.getIDTokenResult()
Expand Down
1 change: 1 addition & 0 deletions app-ios/Sources/Crashlytics/Crashlytics.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import FirebaseCrashlytics
Binary file added app-ios/scripts/upload-symbols
Binary file not shown.

0 comments on commit 53ee85d

Please sign in to comment.