This repository has been archived by the owner on Oct 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Project.swift
144 lines (130 loc) · 3.52 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//
// Project.swift
// Tempura
//
// Copyright © 2021 Bending Spoons.
// Distributed under the MIT License.
// See the LICENSE file for more information.
import ProjectDescription
let iOSTargetVersion = "11.0"
// MARK: - Actions
let actions: [TargetAction] = [
.pre(
tool: "swiftlint",
arguments: ["--lenient"],
name: "SwiftLint"
),
.pre(
tool: "swiftformat",
arguments: ["."],
name: "SwiftFormat"
),
]
// MARK: - Tempura
let tempuraMainTarget = Target(
name: "Tempura",
platform: .iOS,
product: .framework,
bundleId: "com.bendingspoonsapps.Tempura",
deploymentTarget: .iOS(targetVersion: iOSTargetVersion, devices: [.iphone, .ipad]),
infoPlist: .default,
sources: ["Tempura/Sources/**"],
actions: actions,
dependencies: [
.cocoapods(path: "."),
]
)
let tempuraTestsTarget = Target(
name: "TempuraTests",
platform: .iOS,
product: .unitTests,
bundleId: "com.bendingspoonsapps.Tempura.Tests",
deploymentTarget: .iOS(targetVersion: iOSTargetVersion, devices: [.iphone, .ipad]),
infoPlist: .default,
sources: ["Tempura/Tests/**"],
actions: actions,
dependencies: [
.target(name: tempuraMainTarget.name),
]
)
// MARK: - TempuraTesting
let tempuraTestingTarget = Target(
name: "TempuraTesting",
platform: .iOS,
product: .staticLibrary,
bundleId: "com.bendingspoonsapps.TempuraTesting",
deploymentTarget: .iOS(targetVersion: iOSTargetVersion, devices: [.iphone, .ipad]),
infoPlist: .default,
sources: ["TempuraTesting/Sources/**"],
actions: actions,
dependencies: [
.cocoapods(path: "."),
.target(name: tempuraMainTarget.name),
],
settings: Settings(base: [
"ENABLE_TESTING_SEARCH_PATHS": "YES",
"OTHER_LDFLAGS": "$(inherited)",
])
)
// MARK: - Demo
let demoTarget = Target(
name: "Demo",
platform: .iOS,
product: .app,
bundleId: "com.bendingspoonsapps.Tempura.Demo",
deploymentTarget: .iOS(targetVersion: iOSTargetVersion, devices: [.iphone, .ipad]),
infoPlist: .extendingDefault(with: [
"UI_TEST_DIR": "$(SOURCE_ROOT)/Demo/UITests/Screenshots",
]),
sources: ["Demo/Sources/**"],
actions: actions,
dependencies: [
.cocoapods(path: "."),
.target(name: tempuraMainTarget.name),
]
)
let demoUITestTarget = Target(
name: "DemoUITests",
platform: .iOS,
product: .unitTests,
bundleId: "com.bendingspoonsapps.Tempura.Demo.UITests",
deploymentTarget: .iOS(targetVersion: iOSTargetVersion, devices: [.iphone, .ipad]),
infoPlist: .default,
sources: ["Demo/UITests/**"],
actions: actions,
dependencies: [
.cocoapods(path: "."),
.target(name: demoTarget.name),
.target(name: tempuraTestingTarget.name),
]
)
// MARK: - Project Definition
let project = Project(
name: "Tempura",
organizationName: "BendingSpoons",
targets: [
tempuraMainTarget,
tempuraTestsTarget,
tempuraTestingTarget,
demoTarget,
demoUITestTarget,
],
schemes: [
.init(
name: "Demo",
buildAction: .init(targets: [.init(stringLiteral: demoTarget.name)]),
testAction: .init(targets: [.init(stringLiteral: demoUITestTarget.name)]),
runAction: .init(executable: "\(demoTarget.name)")
),
.init(
name: "Tempura",
buildAction: .init(targets: [.init(stringLiteral: tempuraMainTarget.name)]),
testAction: .init(targets: [.init(stringLiteral: tempuraTestsTarget.name)]),
runAction: .init(executable: "\(demoTarget.name)")
),
.init(
name: "TempuraTesting",
buildAction: .init(targets: [.init(stringLiteral: tempuraTestingTarget.name)])
),
]
)