-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProject.swift
More file actions
112 lines (107 loc) · 3.83 KB
/
Project.swift
File metadata and controls
112 lines (107 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import ProjectDescription
import Foundation
let project = Project(
name: "MeokPT",
options: .options(
defaultKnownRegions: ["ko"],
developmentRegion: "ko"
),
settings: .settings(
base: [
"DEVELOPMENT_TEAM": "59FP2PXRXK",
],
configurations: [
.debug(
name: "Debug",
xcconfig: .relativeToRoot("Configurations/App/App-Debug.xcconfig")
),
.release(
name: "Release",
xcconfig: .relativeToRoot("Configurations/App/App-Release.xcconfig")
)
]
),
targets: [
.target(
name: "MeokPT",
destinations: .iOS,
product: .app,
bundleId: "kr.co.codegrove.MeokPTApp",
infoPlist: .extendingDefault(
with: [
"UILaunchScreen": [
"UIColorName": "",
"UIImageName": "",
],
"NSAppTransportSecurity": [
"NSAllowsArbitraryLoads": true
],
"LSApplicationQueriesSchemes": [
"kakaokompassauth": true
],
"CFBundleURLTypes": [
[
"CFBundleURLSchemes": ["kakao\(String(describing: (loadKakaoKey())))"]
]
],
"NSCameraUsageDescription": "바코드를 스캔하여 식품 정보를 조회하기 위해 카메라 권한이 필요합니다.",
"KAKAO_SDK_KEY": .string(loadKakaoKey())
]
),
sources: ["MeokPT/Sources/**"],
resources: ["MeokPT/Resources/**"],
entitlements: .file(path: "MeokPT.entitlements"),
dependencies: [
.external(name: "ComposableArchitecture"),
.external(name: "FirebaseCore"),
.external(name: "FirebaseFirestore"),
.external(name: "FirebaseAuth"),
.external(name: "FirebaseStorage"),
.external(name: "Kingfisher"),
.external(name: "FirebaseAI"),
.external(name: "MarkdownUI"),
.external(name: "KakaoSDKAuth"),
.external(name: "KakaoSDKUser"),
.external(name: "AlertToast")
]
),
.target(
name: "MeokPTTests",
destinations: .iOS,
product: .unitTests,
bundleId: "kr.co.codegrove.MeokPTAppTests",
infoPlist: .default,
sources: ["MeokPT/Tests/**"],
resources: [],
dependencies: [.target(name: "MeokPT")]
),
],
schemes: [
Scheme.scheme(
name: "MeokPT-Preview",
shared: true,
hidden: false,
buildAction: BuildAction.buildAction(targets: ["MeokPT"]),
runAction: RunAction.runAction(configuration: "Debug")
),
Scheme.scheme(
name: "MeokPT",
shared: true,
hidden: false,
buildAction: BuildAction.buildAction(targets: ["MeokPT"]),
runAction: RunAction.runAction(configuration: "Release"),
archiveAction: ArchiveAction.archiveAction(configuration: "Release")
)
]
)
private func loadKakaoKey() -> String {
let fileURL = URL(fileURLWithPath: #filePath)
.deletingLastPathComponent()
.appendingPathComponent(".tuist-env")
guard let content = try? String(contentsOf: fileURL, encoding: .utf8),
let line = content.components(separatedBy: .newlines)
.first(where: { $0.hasPrefix("KAKAO_SDK_KEY=") }) else {
return ""
}
return String(line.dropFirst("KAKAO_SDK_KEY=".count))
}