forked from olxbr/desafio-mobile-platform
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProject.swift
120 lines (96 loc) · 3.18 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
import ProjectDescription
// MARK: - Constants
let appName = "desafio"
let organizationName = "OLX"
let bundleIdPrefix = "br.com.olx."
let deploymentVersion = "14.4"
// MARK: - Build Settings
let settings: Settings = .settings()
// MARK: - Deployment Target
let deploymentTarget: DeploymentTarget = .iOS(targetVersion: deploymentVersion, devices: [.iphone, .ipad])
// MARK: - Actions
let buildAction: BuildAction = .buildAction(targets: [.init(stringLiteral: "\(appName)")])
let testAction: TestAction = .targets(
[
.init(stringLiteral: "\(appName)Tests"),
.init(stringLiteral: "\(appName)UITests")
],
configuration: .debug
)
let runAction: RunAction = .runAction(configuration: .debug)
let archiveAction: ArchiveAction = .archiveAction(configuration: .release)
let profileAction: ProfileAction = .profileAction(configuration: .release)
let analyzeAction: AnalyzeAction = .analyzeAction(configuration: .debug)
// MARK: - Build Schemes
let schemes: [Scheme] = [
Scheme(
name: appName,
shared: true,
buildAction: buildAction,
testAction: testAction,
runAction: runAction,
archiveAction: archiveAction,
profileAction: profileAction,
analyzeAction: analyzeAction
)
]
// MARK: - Resources
let appResources: ResourceFileElements =
[
.folderReference(path: "Sources/\(appName)/Resources/Assets/Assets.xcassets"),
.glob(pattern: "Sources/\(appName)/**/*.xib"),
.glob(pattern: "Sources/\(appName)/**/*.storyboard")
]
let testResources: ResourceFileElements = [
.glob(pattern: "Sources/\(appName)Tests/Resources/**/*.json")
]
// MARK: - Dependencies
let appDependencies: [TargetDependency] = [
.project(target: "NetworkLayer", path: "Modules/NetworkLayer")
]
// MARK: - Build Phases
let appRunScripts: [TargetScript] = [
.pre(path: "Scripts/swiftlint.sh", name: "SwiftLint Script")
]
// MARK: - Targets
let targets: [Target] = [
Target(
name: appName,
platform: .iOS,
product: .app,
bundleId: "\(bundleIdPrefix)\(appName)",
deploymentTarget: deploymentTarget,
infoPlist: .file(path: "Sources/\(appName)/Resources/Properties/Info.plist"),
sources: ["Sources/\(appName)/**/*.swift"],
resources: appResources,
scripts: appRunScripts,
dependencies: appDependencies
),
Target(
name: "\(appName)Tests",
platform: .iOS,
product: .unitTests,
bundleId: "\(bundleIdPrefix)\(appName)Tests",
infoPlist: .file(path: "Sources/\(appName)Tests/Info.plist"),
sources: ["Sources/\(appName)Tests/**"],
resources: testResources,
dependencies: [.target(name: appName)]
),
Target(
name: "\(appName)UITests",
platform: .iOS,
product: .uiTests,
bundleId: "\(bundleIdPrefix)\(appName)UITests",
infoPlist: .file(path: "Sources/\(appName)UITests/Info.plist"),
sources: ["Sources/\(appName)UITests/**"],
dependencies: [.target(name: appName)]
)
]
// MARK: - Project
let project = Project(
name: appName,
organizationName: organizationName,
settings: settings,
targets: targets,
schemes: schemes
)