Skip to content

Commit

Permalink
Merge pull request #169 from todaywhat/160-firebase-infoplist-configu…
Browse files Browse the repository at this point in the history
…ration-flow=
  • Loading branch information
baekteun authored Oct 19, 2024
2 parents 580a960 + 15a7c19 commit 63b67f9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ node_modules
.runtimeconfig.json
.firebase/
GoogleService-Info.plist
GoogleService-QA-Info.plist
# End of https://www.toptal.com/developers/gitignore/api/firebase

# Accio dependency management
Expand Down
16 changes: 16 additions & 0 deletions Tuist/ProjectDescriptionHelpers/Action/Action+Template.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,20 @@ public extension TargetScript {
path: .relativeToRoot("Scripts/LaunchAtLogin.sh"),
name: "Launch At Login Helper"
)

static let firebaseInfoByConfiguration = TargetScript.post(
script: """
case "${CONFIGURATION}" in
"Release" )
cp -r "$SRCROOT/Resources/GoogleService-Info.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
;;
*)
cp -r "$SRCROOT/Resources/GoogleService-QA-Info.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
;;
esac
""",
name: "Firebase Info copy by Configuration",
basedOnDependencyAnalysis: false
)
}
7 changes: 5 additions & 2 deletions Tuist/ProjectDescriptionHelpers/GenerateEnvironment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ public let generateEnvironment = GenerateEnvironment(rawValue: environment) ?? .
public extension GenerateEnvironment {
var scripts: [TargetScript] {
switch self {
case .ci, .cd:
case .ci:
return []

case .cd:
return [.firebaseInfoByConfiguration]

case .dev:
return [.swiftLint]
return [.swiftLint, .firebaseInfoByConfiguration]
}
}
}

0 comments on commit 63b67f9

Please sign in to comment.