-
Notifications
You must be signed in to change notification settings - Fork 68
/
BUCK
264 lines (246 loc) · 9.19 KB
/
BUCK
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
load("//Config:buck_rule_macros.bzl", "apple_third_party_lib", "apple_cxx_third_party_library")
load("//Config:configs.bzl", "airbnb_info_plist_substitutions", "build_type")
apple_third_party_lib(
name = "CryptoSwift",
srcs = glob([
"CryptoSwift/**/*.swift",
]),
)
apple_third_party_lib(
name = "PromiseKit",
visibility = ["PUBLIC"],
exported_headers = glob([
"PromiseKit/**/*.h",
# We are excluding this header because a) it is not public and b) `PromiseKit` does not
# consider it to be a source in its `podspec`: https://github.com/mxcl/PromiseKit/blob/a20df65b74b3eec290e524abb9839412542328b6/PromiseKit.podspec#L114
], exclude = [
"PromiseKit/AnyPromise+Private.h",
]),
srcs = glob([
"PromiseKit/**/*.m",
"PromiseKit/**/*.swift",
# We are excluding the below sources since `PromiseKit` does not consider them sources in its
# `podspec`: https://github.com/mxcl/PromiseKit/blob/a20df65b74b3eec290e524abb9839412542328b6/PromiseKit.podspec#L114
], exclude = [
"PromiseKit/Sources/PMKCallVariadicBlock.m",
"PromiseKit/Sources/NSMethodSignatureForBlock.m",
]),
)
apple_cxx_third_party_library(
name = "Bugsnag",
exported_headers = glob([
"Bugsnag/**/BSG_KSCrashReportWriter.h",
"Bugsnag/**/Bugsnag.h",
"Bugsnag/**/BugsnagBreadcrumb.h",
"Bugsnag/**/BugsnagConfiguration.h",
"Bugsnag/**/BugsnagCrashReport.h",
"Bugsnag/**/BugsnagMetaData.h",
]),
headers = glob([
"Bugsnag/**/*.h",
]),
srcs = glob([
"Bugsnag/**/*.c",
"Bugsnag/**/*.m",
"Bugsnag/**/*.mm",
]),
)
apple_third_party_lib(
name = "Quick",
swift_version = "5",
visibility = ["PUBLIC"],
compiler_flags = ["-fapplication-extension"],
swift_compiler_flags = ["-application-extension"],
exported_headers = glob([
"Quick/**/*.h",
]),
srcs = glob([
"Quick/**/*.m",
"Quick/**/*.swift",
]),
frameworks = [
"$PLATFORM_DIR/Developer/Library/Frameworks/XCTest.framework",
]
)
apple_third_party_lib(
name = 'Nimble',
exported_headers = glob([
"Nimble/**/*.h",
],
exclude = [
"Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/Posix/CwlPreconditionTesting_POSIX.h"
]),
srcs = glob([
"Nimble/**/*.swift",
"Nimble/**/*.m",
"Nimble/**/*.c"
], exclude = [
"Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstructionPosix.swift"
]),
compiler_flags = ["-fapplication-extension", "-weak-lswiftXCTest", "-Xlinker", "-no_application_extension"],
swift_compiler_flags = ["-DPRODUCT_NAME=Nimble/Nimble", "-application-extension"],
frameworks = [
'$PLATFORM_DIR/Developer/Library/Frameworks/XCTest.framework'
]
)
apple_third_party_lib(
name = "Braintree",
visibility = ["PUBLIC"],
exported_headers = glob([
"Braintree/**/Public/**/*.h",
"Braintree/BraintreePayPal/PayPalDataCollector/Risk/PPRMOCMagnesResult.h",
]),
headers = glob([
"Braintree/**/*.h",
]),
srcs = glob([
"Braintree/**/*.m",
]),
deps = [
# buildifier: keep sorted
":BTDeviceCollectorLibrary",
":BTPPRiskComponent",
":Braintree-Drop-In-Localization-Resource",
":Braintree-UI-Localization-Resource",
":CardinalMobile",
],
)
genrule(
name = "CardinalMobileFramework",
srcs = glob([
"Braintree/Frameworks/CardinalMobile.framework/**",
]),
bash = """
cp -L -R ${SRCDIR}/Braintree/Frameworks/CardinalMobile.framework ${OUT}
""" + ("" if build_type() == "Debug" else """
lipo ${OUT}/CardinalMobile -remove i386 -remove x86_64 -output ${OUT}/CardinalMobile
"""),
out = "CardinalMobile.framework",
)
prebuilt_apple_framework(
name = "CardinalMobile",
framework = ":CardinalMobileFramework",
preferred_linkage = "shared",
visibility = ["PUBLIC"],
)
prebuilt_cxx_library(
name = "BTDeviceCollectorLibrary",
static_lib = "Braintree/BraintreeDataCollector/Kount/libDeviceCollectorLibrary.a",
)
prebuilt_cxx_library(
name = "BTPPRiskComponent",
static_lib = "Braintree/BraintreePayPal/PayPalDataCollector/Risk/libPPRiskMagnesOC.a",
)
apple_resource(
name = "Braintree-Drop-In-Localization",
visibility = ["PUBLIC"],
# TODO: Use glob() with `exclude_directories = False` once we move to Skylark.
dirs = [
"Braintree/BraintreeUI/Drop-In/Localization/da.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/de.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/en.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/en_AU.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/en_CA.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/en_GB.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/es.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/es_ES.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/fr.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/fr_CA.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/fr_FR.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/he.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/it.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/nb.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/nl.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/pl.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/pt.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/ru.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/sv.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/tr.lproj",
"Braintree/BraintreeUI/Drop-In/Localization/zh-Hans.lproj",
],
)
apple_third_party_lib(
name = "Braintree-Drop-In-Localization-Bundle-Library",
visibility = ["PUBLIC"],
modular = False,
deps = [
":Braintree-Drop-In-Localization",
],
)
apple_bundle(
name = "Braintree-Drop-In-Localization-Bundle",
visibility = ["PUBLIC"],
product_name = "Braintree-Drop-In-Localization",
extension = "bundle",
binary = ":Braintree-Drop-In-Localization-Bundle-Library#static",
info_plist = "Target Support Files/Braintree/ResourceBundle-Braintree-Drop-In-Localization-Info.plist",
info_plist_substitutions = airbnb_info_plist_substitutions("Braintree", "Braintree-Drop-In-Localization", "com.airbnb.app"),
)
# BUCK doesn't include bundles created via apple_bundle() in the main app
# We need to wrap it inside a apple_resource() for it to be included
apple_resource(
name = "Braintree-Drop-In-Localization-Resource",
visibility = ["PUBLIC"],
files = [],
dirs = [
# buildifier: keep sorted
":Braintree-Drop-In-Localization-Bundle",
],
)
apple_resource(
name = "Braintree-UI-Localization",
visibility = ["PUBLIC"],
# TODO: Use glob() with `exclude_directories = False` once we move to Skylark.
dirs = [
"Braintree/BraintreeUI/Localization/da.lproj",
"Braintree/BraintreeUI/Localization/de.lproj",
"Braintree/BraintreeUI/Localization/en.lproj",
"Braintree/BraintreeUI/Localization/en_AU.lproj",
"Braintree/BraintreeUI/Localization/en_CA.lproj",
"Braintree/BraintreeUI/Localization/en_GB.lproj",
"Braintree/BraintreeUI/Localization/es.lproj",
"Braintree/BraintreeUI/Localization/es_ES.lproj",
"Braintree/BraintreeUI/Localization/fr.lproj",
"Braintree/BraintreeUI/Localization/fr_CA.lproj",
"Braintree/BraintreeUI/Localization/fr_FR.lproj",
"Braintree/BraintreeUI/Localization/he.lproj",
"Braintree/BraintreeUI/Localization/it.lproj",
"Braintree/BraintreeUI/Localization/nb.lproj",
"Braintree/BraintreeUI/Localization/nl.lproj",
"Braintree/BraintreeUI/Localization/pl.lproj",
"Braintree/BraintreeUI/Localization/pt.lproj",
"Braintree/BraintreeUI/Localization/ru.lproj",
"Braintree/BraintreeUI/Localization/sv.lproj",
"Braintree/BraintreeUI/Localization/tr.lproj",
"Braintree/BraintreeUI/Localization/zh-Hans.lproj",
],
)
apple_third_party_lib(
name = "Braintree-UI-Localization-Bundle-Library",
visibility = ["PUBLIC"],
modular = False,
deps = [
# buildifier: keep sorted
":Braintree-UI-Localization",
],
)
apple_bundle(
name = "Braintree-UI-Localization-Bundle",
visibility = ["PUBLIC"],
product_name = "Braintree-UI-Localization-Bundle-Library",
extension = "bundle",
binary = ":Braintree-UI-Localization-Bundle-Library#static",
info_plist = "Target Support Files/Braintree/ResourceBundle-Braintree-UI-Localization-Info.plist",
info_plist_substitutions = airbnb_info_plist_substitutions("Braintree", "Braintree-UI-Localization-Bundle", "com.airbnb.app"),
)
# BUCK doesn't include bundles created via apple_bundle() in the main app
# We need to wrap it inside a apple_resource() for it to be included
apple_resource(
name = "Braintree-UI-Localization-Resource",
visibility = ["PUBLIC"],
files = [],
dirs = [
# buildifier: keep sorted
":Braintree-UI-Localization-Bundle",
],
)