-
Notifications
You must be signed in to change notification settings - Fork 0
/
Project.Struct.swift
102 lines (65 loc) · 2.7 KB
/
Project.Struct.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
import XCEProjectGenerator
//===
let Params =
(
repoName: "AssociatedStorage",
deploymentTarget: "8.0",
companyIdentifier: "io.XCEssentials",
companyPrefix: "XCE"
)
let BundleId =
(
fwk: "\(Params.companyIdentifier).\(Params.repoName)",
tst: "\(Params.companyIdentifier).\(Params.repoName).Tst"
)
//===
let specFormat = Spec.Format.v2_1_0
let project = Project("Main") { project in
project.configurations.all.override(
"IPHONEOS_DEPLOYMENT_TARGET" <<< Params.deploymentTarget, // bug wokraround
"SWIFT_VERSION" <<< "3.0",
"VERSIONING_SYSTEM" <<< "apple-generic",
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" <<< ""
)
project.configurations.debug.override(
"SWIFT_OPTIMIZATION_LEVEL" <<< "-Onone"
)
//---
project.target("Fwk", .iOS, .framework) { target in
target.include("Sources")
//---
target.configurations.all.override(
"PRODUCT_NAME" <<< "\(Params.companyPrefix)\(Params.repoName)",
"IPHONEOS_DEPLOYMENT_TARGET" <<< Params.deploymentTarget, // bug wokraround
"PRODUCT_BUNDLE_IDENTIFIER" <<< BundleId.fwk,
"INFOPLIST_FILE" <<< "Info/Fwk.plist",
//--- iOS related:
"SDKROOT" <<< "iphoneos",
"TARGETED_DEVICE_FAMILY" <<< DeviceFamily.iOS.universal,
//--- Framework related:
"DEFINES_MODULE" <<< "NO",
"SKIP_INSTALL" <<< "YES"
)
target.configurations.debug.override(
"MTL_ENABLE_DEBUG_INFO" <<< true
)
//---
target.unitTests { unitTests in
unitTests.include("Tests")
//---
unitTests.configurations.all.override(
// very important for unit tests,
// prevents the error when unit test do not start at all
"LD_RUNPATH_SEARCH_PATHS" <<<
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks",
"IPHONEOS_DEPLOYMENT_TARGET" <<< Params.deploymentTarget, // bug wokraround
"PRODUCT_BUNDLE_IDENTIFIER" <<< BundleId.tst,
"INFOPLIST_FILE" <<< "Info/Tst.plist",
"FRAMEWORK_SEARCH_PATHS" <<< "$(inherited) $(BUILT_PRODUCTS_DIR)"
)
unitTests.configurations.debug.override(
"MTL_ENABLE_DEBUG_INFO" <<< true
)
}
}
}