Skip to content

Commit

Permalink
[Feature] Firebase추가 (#362)
Browse files Browse the repository at this point in the history
* feat: 이전 버전 커밋

* feat: FirebaseCrashlytics 연결

* feat: Script 변경

* feat: analatics 조건 추가

* feat: gitignore 수정
  • Loading branch information
MaraMincho authored Jul 26, 2024
1 parent dcb84ee commit 456a8fb
Show file tree
Hide file tree
Showing 18 changed files with 230 additions and 54 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,5 @@ iOSInjectionProject/

# Custom
XCConfig/**
**FakeToken**
**FakeToken**
**/GoogleService-Info.plist
2 changes: 1 addition & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tools]
tuist = "4.9.0"
tuist = "latest"
2 changes: 1 addition & 1 deletion .tuist-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.9.0
4.21.2
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generate:
tuist install
TUIST_ROOT_DIR=${PWD} TUIST_SCHEME=DEBUG tuist generate
TUIST_ROOT_DIR=${PWD} FIREBASE_TARGET_NAME={SSFirebase} TUIST_SCHEME=DEBUG tuist generate

feature:
python3 Scripts/TuistScript.py feature
Expand Down
4 changes: 3 additions & 1 deletion Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ let project = Project.makeModule(
"CFBundleVersion": "2024072313",
"UIUserInterfaceStyle": "Light",
"ITSAppUsesNonExemptEncryption": "No",
"GOOGLE_ANALYTICS_REGISTRATION_WITH_AD_NETWORK_ENABLED" : "No", // FireBaseAnalytics settings
"UISupportedInterfaceOrientations": .array([
"UIInterfaceOrientationPortrait",
]),
Expand All @@ -51,6 +52,7 @@ let project = Project.makeModule(
]),
]),
"NATIVE_APP_KEY": "${NATIVE_APP_KEY}",
]
],
additionalScripts: [.firebase]
)
)
2 changes: 2 additions & 0 deletions Projects/App/Sources/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Designsystem
import FirebaseCore
import SwiftUI
import UIKit

Expand All @@ -16,6 +17,7 @@ class MyAppDelegate: NSObject, UIApplicationDelegate {
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
Font.registerFont()
FirebaseApp.configure()
return true
}

Expand Down
1 change: 1 addition & 0 deletions Projects/Core/CoreLayers/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let project = Project.makeModule(
.core(.sSInterceptor),
.core(.featureAction),
.core(.sSRegexManager),
.core(.sSFirebase),
]
)
)
16 changes: 16 additions & 0 deletions Projects/Core/SSFirebase/Project.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

import ProjectDescription
import ProjectDescriptionHelpers

let project = Project.makeModule(
name: "SSFirebase",
targets: .custom(
name: "SSFirebase",
product: .staticLibrary,
dependencies: [
.external(name: "FirebaseAnalytics"),
.external(name: "FirebaseCrashlytics"),
]
// additionalScripts: [.firebase]
)
)
1 change: 1 addition & 0 deletions Projects/Core/SSFirebase/Sources/KeepSources2.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Content of KeepSources.swift
9 changes: 0 additions & 9 deletions Projects/Feature/Sent/Sources/SentMainView/SentMainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,6 @@ struct SentMainView: View {
static let emptyEnvelopesText: String = "아직 보낸 봉투가 없습니다."
static let addNewEnvelopeButtonText: String = "보낸 봉투 추가하기"

static let latestButtonProperty: SSButtonProperty = .init(
size: .sh32,
status: .active,
style: .ghost,
color: .black,
leftIcon: .icon(SSImage.commonOrder),
buttonText: "최신순"
)

static let notSelectedFilterButtonProperty: SSButtonProperty = .init(
size: .sh32,
status: .active,
Expand Down
1 change: 0 additions & 1 deletion Projects/Share/Designsystem/Sources/SSLoadingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public struct SSLoadingModifierWithOverlay: ViewModifier {
}

public func body(content: Content) -> some View {

content
.allowsHitTesting(!isLoading)
.overlay {
Expand Down
117 changes: 117 additions & 0 deletions Tuist/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"pins" : [
{
"identity" : "abseil-cpp-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "748c7837511d0e6a507737353af268484e1745e2",
"version" : "1.2024011601.1"
}
},
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
Expand All @@ -9,6 +18,15 @@
"version" : "5.9.1"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "3b62f154d00019ae29a71e9738800bb6f18b236d",
"version" : "10.19.2"
}
},
{
"identity" : "combine-schedulers",
"kind" : "remoteSourceControl",
Expand All @@ -18,6 +36,69 @@
"version" : "1.0.0"
}
},
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "eca84fd638116dd6adb633b5a3f31cc7befcbb7d",
"version" : "10.29.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "fe727587518729046fc1465625b9afd80b5ab361",
"version" : "10.28.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "a637d318ae7ae246b02d7305121275bc75ed5565",
"version" : "9.4.0"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "57a1d307f42df690fdef2637f3e5b776da02aad6",
"version" : "7.13.3"
}
},
{
"identity" : "grpc-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "e9fad491d0673bdda7063a0341fb6b47a30c5359",
"version" : "1.62.2"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b",
"version" : "3.5.0"
}
},
{
"identity" : "interop-ios-for-google-sdks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/interop-ios-for-google-sdks.git",
"state" : {
"revision" : "2d12673670417654f08f5f90fdd62926dc3a2648",
"version" : "100.0.0"
}
},
{
"identity" : "kakao-ios-sdk",
"kind" : "remoteSourceControl",
Expand All @@ -27,6 +108,15 @@
"version" : "2.22.0"
}
},
{
"identity" : "leveldb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
"version" : "1.22.5"
}
},
{
"identity" : "lottie-spm",
"kind" : "remoteSourceControl",
Expand All @@ -45,6 +135,24 @@
"version" : "15.0.3"
}
},
{
"identity" : "nanopb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/nanopb.git",
"state" : {
"revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1",
"version" : "2.30910.0"
}
},
{
"identity" : "promises",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/promises.git",
"state" : {
"revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac",
"version" : "2.4.0"
}
},
{
"identity" : "reactiveswift",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -144,6 +252,15 @@
"version" : "1.1.7"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "e17d61f26df0f0e06f58f6977ba05a097a720106",
"version" : "1.27.1"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
Expand Down
3 changes: 2 additions & 1 deletion Tuist/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ import PackageDescription

let package = Package(
name: "IOS",
dependencies: [
dependencies: [
.package(url: "https://github.com/Moya/Moya.git", exact: "15.0.3"),
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", exact: "1.10.2"),
.package(url: "https://github.com/kakao/kakao-ios-sdk", exact: "2.22.0"),
.package(url: "https://github.com/airbnb/lottie-spm.git", from: "4.4.3"),
.package(url: "https://github.com/firebase/firebase-ios-sdk", exact: "10.29.0"),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public enum Core: String {
case sSInterceptor
case featureAction
case sSRegexManager
case sSFirebase
public var targetName: String {
return rawValue.prefix(1).capitalized + rawValue.dropFirst()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public enum ThirdParty: String, CaseIterable {
private var productType: Product {
switch self {
default:
return .framework
.framework
}
}

Expand Down
19 changes: 18 additions & 1 deletion Tuist/ProjectDescriptionHelpers/Scripts+Templates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public extension TargetScript {
name: "SwiftFormat Run Script",
basedOnDependencyAnalysis: false
)

static var swiftLint: Self = .post(
script: """
export PATH="$PATH:/opt/homebrew/bin"
Expand All @@ -51,4 +51,21 @@ public extension TargetScript {
name: "SwiftLint Run Script",
basedOnDependencyAnalysis: false
)
static let firebase: Self = .post(
script: """
if [ "${CONFIGURATION}" != "Debug" ]; then
ROOT_DIR=\(ProcessInfo.processInfo.environment["TUIST_ROOT_DIR"] ?? "")
"${ROOT_DIR}/Tuist/.build/checkouts/firebase-ios-sdk/Crashlytics/run"
fi
""",
name: "Firebase Crashlytics",
inputPaths: [
"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}",
"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}",
"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist",
"$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/GoogleService-Info.plist",
"$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)"
],
basedOnDependencyAnalysis: false
)
}
32 changes: 32 additions & 0 deletions Tuist/ProjectDescriptionHelpers/Target+Settings.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// Target+Settings.swift
// ProjectDescriptionHelpers
//
// Created by MaraMincho on 7/25/24.
//

import Foundation
import ProjectDescription


extension Settings {
static var `default`: Self {
.settings(
base: [
"DEVELOPMENT_TEAM": "2G5Z92682P",
"ENABLE_USER_SCRIPT_SANDBOXING": "No", // SandBoxingError
"ENABLE_MODULE_VERIFIER": "No", // Enable module Verifier
"MODULE_VERIFIER_SUPPORTED_LANGUAGES": "No",
"DEBUG_INFORMATION_FORMAT": "dwarf-with-dsym", // For Firebase
"OTHER_LDFLAGS": "$(inherited) -ObjC", // For Firebase ,
"LD_VERIFY_BITCODE" : "No"
// "CLANG_ENABLE_MODULES": "Yes"
],

configurations: [
.debug(name: .debug),
.release(name: .release),
]
)
}
}
Loading

0 comments on commit 456a8fb

Please sign in to comment.