-
Notifications
You must be signed in to change notification settings - Fork 26
/
Project.swift
93 lines (85 loc) · 3.14 KB
/
Project.swift
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
import ProjectDescription
let name = "Sensei"
let project = Project(
name: name,
organizationName: "nixzhu",
targets: [
.init(
name: name,
platform: .macOS,
product: .app,
bundleId: {
let bundleIDPrefix = Environment.bundleIDPrefix.getString(default: "")
if bundleIDPrefix.isEmpty {
return "io.tuist.\(name)"
} else {
return "\(bundleIDPrefix).\(name)"
}
}(),
deploymentTarget: .macOS(targetVersion: "13.0"),
infoPlist: .extendingDefault(with: [
"CFBundleShortVersionString": .string(
{
let string = Environment.version.getString(default: "")
if string.isEmpty {
return "0.3.0"
} else {
return string
}
}()
),
"CFBundleVersion": .string(
{
let string = Environment.build.getString(default: "")
if string.isEmpty {
return "9"
} else {
return string
}
}()
),
"NSMainStoryboardFile": "",
"UILaunchStoryboardName": "LaunchScreen",
"NSHumanReadableCopyright": "Copyright @nixzhu. All rights reserved.",
]),
sources: ["Targets/\(name)/Sources/**"],
resources: ["Targets/\(name)/Resources/**"],
dependencies: [
.external(name: "Ananda"),
.external(name: "ComposableArchitecture"),
.external(name: "CustomDump"),
.external(name: "Tagged"),
.external(name: "MarkdownUI"),
.external(name: "GRDB"),
],
settings: .settings(
base: .init()
.swiftStrictConcurrency(.complete)
.otherSwiftFlags( // https://www.fline.dev/preparing-for-swift-6/
"""
-enable-upcoming-feature BareSlashRegexLiterals
-enable-upcoming-feature ConciseMagicFile
-enable-upcoming-feature ExistentialAny
-enable-upcoming-feature ImplicitOpenExistentials
-enable-upcoming-feature StrictConcurrency
-warn-concurrency
-enable-actor-data-race-checks
"""
),
defaultSettings: .recommended
)
),
]
)
extension SettingsDictionary {
enum SwiftStrictConcurrency: String {
case minimal
case targeted
case complete
}
func swiftStrictConcurrency(_ value: SwiftStrictConcurrency) -> SettingsDictionary {
var info = self
info["SWIFT_STRICT_CONCURRENCY"] = .string(value.rawValue)
return info
}
}