forked from MailCore/mailcore2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
355 lines (348 loc) · 14.6 KB
/
Package.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
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let exclude = [
"bin",
"build-android",
"build-linux",
"build-mac",
"build-windows",
"cocoapods",
"deps",
"example",
"scripts",
]
let baseCSettings: [CSetting] = [
.headerSearchPath("include"),
.headerSearchPath("src"),
.headerSearchPath("src/async"),
.headerSearchPath("src/async/imap"),
.headerSearchPath("src/async/pop"),
.headerSearchPath("src/async/nntp"),
.headerSearchPath("src/async/smtp"),
.headerSearchPath("src/core"),
.headerSearchPath("src/core/renderer"),
.headerSearchPath("src/core/abstract"),
.headerSearchPath("src/core/imap"),
.headerSearchPath("src/core/pop"),
.headerSearchPath("src/core/rfc822"),
.headerSearchPath("src/core/nntp"),
.headerSearchPath("src/core/smtp"),
.headerSearchPath("src/core/provider"),
.headerSearchPath("src/core/security"),
.headerSearchPath("src/core/basetypes"),
.headerSearchPath("src/core/basetypes/icu-ucsdet"),
.headerSearchPath("src/core/basetypes/icu-ucsdet/include"),
.headerSearchPath("src/core/zip"),
.headerSearchPath("src/core/zip/MiniZip"),
.define("HAVE_CFNETWORK", to: "1")
]
let objCSettings: [CSetting] = [
.headerSearchPath("src/objc/abstract"),
.headerSearchPath("src/objc/imap"),
.headerSearchPath("src/objc/nntp"),
.headerSearchPath("src/objc/pop"),
.headerSearchPath("src/objc/provider"),
.headerSearchPath("src/objc/rfc822"),
.headerSearchPath("src/objc/smtp"),
.headerSearchPath("src/objc/utils"),
]
let cSources = [
"src/async/imap/MCIMAPAsyncConnection.cpp",
"src/async/imap/MCIMAPAsyncSession.cpp",
"src/async/imap/MCIMAPOperation.cpp",
"src/async/imap/MCIMAPCheckAccountOperation.cpp",
"src/async/imap/MCIMAPConnectOperation.cpp",
"src/async/imap/MCIMAPFetchFoldersOperation.cpp",
"src/async/imap/MCIMAPCustomCommandOperation.cpp",
"src/async/imap/MCIMAPRenameFolderOperation.cpp",
"src/async/imap/MCIMAPDeleteFolderOperation.cpp",
"src/async/imap/MCIMAPCreateFolderOperation.cpp",
"src/async/imap/MCIMAPSubscribeFolderOperation.cpp",
"src/async/imap/MCIMAPAppendMessageOperation.cpp",
"src/async/imap/MCIMAPCopyMessagesOperation.cpp",
"src/async/imap/MCIMAPMoveMessagesOperation.cpp",
"src/async/imap/MCIMAPExpungeOperation.cpp",
"src/async/imap/MCIMAPFetchMessagesOperation.cpp",
"src/async/imap/MCIMAPFetchContentOperation.cpp",
"src/async/imap/MCIMAPFetchContentToFileOperation.cpp",
"src/async/imap/MCIMAPFetchParsedContentOperation.cpp",
"src/async/imap/MCIMAPStoreFlagsOperation.cpp",
"src/async/imap/MCIMAPStoreLabelsOperation.cpp",
"src/async/imap/MCIMAPSearchOperation.cpp",
"src/async/imap/MCIMAPIdleOperation.cpp",
"src/async/imap/MCIMAPFetchNamespaceOperation.cpp",
"src/async/imap/MCIMAPIdentityOperation.cpp",
"src/async/imap/MCIMAPFolderInfoOperation.cpp",
"src/async/imap/MCIMAPFolderInfo.cpp",
"src/async/imap/MCIMAPCapabilityOperation.cpp",
"src/async/imap/MCIMAPQuotaOperation.cpp",
"src/async/imap/MCIMAPFolderStatusOperation.cpp",
"src/async/imap/MCIMAPDisconnectOperation.cpp",
"src/async/imap/MCIMAPMessageRenderingOperation.cpp",
"src/async/imap/MCIMAPNoopOperation.cpp",
"src/async/imap/MCIMAPMultiDisconnectOperation.cpp",
"src/async/pop/MCPOPAsyncSession.cpp",
"src/async/pop/MCPOPFetchHeaderOperation.cpp",
"src/async/pop/MCPOPFetchMessageOperation.cpp",
"src/async/pop/MCPOPDeleteMessagesOperation.cpp",
"src/async/pop/MCPOPFetchMessagesOperation.cpp",
"src/async/pop/MCPOPCheckAccountOperation.cpp",
"src/async/pop/MCPOPNoopOperation.cpp",
"src/async/pop/MCPOPOperation.cpp",
"src/async/nntp/MCNNTPAsyncSession.cpp",
"src/async/nntp/MCNNTPFetchHeaderOperation.cpp",
"src/async/nntp/MCNNTPFetchArticleOperation.cpp",
"src/async/nntp/MCNNTPListNewsgroupsOperation.cpp",
"src/async/nntp/MCNNTPFetchOverviewOperation.cpp",
"src/async/nntp/MCNNTPFetchAllArticlesOperation.cpp",
"src/async/nntp/MCNNTPFetchServerTimeOperation.cpp",
"src/async/nntp/MCNNTPCheckAccountOperation.cpp",
"src/async/nntp/MCNNTPDisconnectOperation.cpp",
"src/async/nntp/MCNNTPOperation.cpp",
"src/async/nntp/MCNNTPPostOperation.cpp",
"src/async/smtp/MCSMTPAsyncSession.cpp",
"src/async/smtp/MCSMTPLoginOperation.cpp",
"src/async/smtp/MCSMTPSendWithDataOperation.cpp",
"src/async/smtp/MCSMTPDisconnectOperation.cpp",
"src/async/smtp/MCSMTPNoopOperation.cpp",
"src/async/smtp/MCSMTPOperation.cpp",
"src/async/smtp/MCSMTPCheckAccountOperation.cpp",
"src/core/security/MCCertificateUtils.cpp",
"src/core/zip/MCZip.cpp",
"src/core/zip/MiniZip/ioapi.c",
"src/core/zip/MiniZip/unzip.c",
"src/core/zip/MiniZip/zip.c",
"src/core/abstract/MCErrorMessage.cpp",
"src/core/abstract/MCAbstractMessage.cpp",
"src/core/abstract/MCAbstractMessagePart.cpp",
"src/core/abstract/MCAbstractMultipart.cpp",
"src/core/abstract/MCAbstractPart.cpp",
"src/core/abstract/MCAddress.cpp",
"src/core/abstract/MCMessageHeader.cpp",
"src/core/basetypes/icu-ucsdet/cmemory.c",
"src/core/basetypes/icu-ucsdet/csdetect.cpp",
"src/core/basetypes/icu-ucsdet/csmatch.cpp",
"src/core/basetypes/icu-ucsdet/csr2022.cpp",
"src/core/basetypes/icu-ucsdet/csrecog.cpp",
"src/core/basetypes/icu-ucsdet/csrmbcs.cpp",
"src/core/basetypes/icu-ucsdet/csrsbcs.cpp",
"src/core/basetypes/icu-ucsdet/csrucode.cpp",
"src/core/basetypes/icu-ucsdet/csrutf8.cpp",
"src/core/basetypes/icu-ucsdet/cstring.c",
"src/core/basetypes/icu-ucsdet/inputext.cpp",
"src/core/basetypes/icu-ucsdet/uarrsort.c",
"src/core/basetypes/icu-ucsdet/ucln_cmn.cpp",
"src/core/basetypes/icu-ucsdet/ucln_in.cpp",
"src/core/basetypes/icu-ucsdet/ucsdet.cpp",
"src/core/basetypes/icu-ucsdet/udataswp.c",
"src/core/basetypes/icu-ucsdet/uenum.c",
"src/core/basetypes/icu-ucsdet/uinvchar.c",
"src/core/basetypes/icu-ucsdet/umutex.cpp",
"src/core/basetypes/icu-ucsdet/uobject.cpp",
"src/core/basetypes/icu-ucsdet/ustring.cpp",
"src/core/basetypes/icu-ucsdet/utrace.c",
"src/core/basetypes/ConvertUTF.c",
"src/core/basetypes/MCArray.cpp",
"src/core/basetypes/MCAssert.c",
"src/core/basetypes/MCAutoreleasePool.cpp",
"src/core/basetypes/MCBase64.c",
"src/core/basetypes/MCConnectionLoggerUtils.cpp",
"src/core/basetypes/MCData.cpp",
"src/core/basetypes/MCDataDecoderUtils.cpp",
"src/core/basetypes/MCDataStreamDecoder.cpp",
"src/core/basetypes/MCHash.cpp",
"src/core/basetypes/MCHashMap.cpp",
"src/core/basetypes/MCHTMLCleaner.cpp",
"src/core/basetypes/MCIndexSet.cpp",
"src/core/basetypes/MCJSON.cpp",
"src/core/basetypes/MCJSONParser.cpp",
"src/core/basetypes/MCLibetpan.cpp",
"src/core/basetypes/MCLog.cpp",
"src/core/basetypes/MCMD5.cpp",
"src/core/basetypes/MCNull.cpp",
"src/core/basetypes/MCObject.cpp",
"src/core/basetypes/MCOperation.cpp",
"src/core/basetypes/MCOperationQueue.cpp",
"src/core/basetypes/MCRange.cpp",
"src/core/basetypes/MCSet.cpp",
"src/core/basetypes/MCString.cpp",
"src/core/basetypes/MCValue.cpp",
"src/core/imap/MCIMAPFolder.cpp",
"src/core/imap/MCIMAPMessage.cpp",
"src/core/imap/MCIMAPMessagePart.cpp",
"src/core/imap/MCIMAPMultipart.cpp",
"src/core/imap/MCIMAPNamespace.cpp",
"src/core/imap/MCIMAPNamespaceItem.cpp",
"src/core/imap/MCIMAPPart.cpp",
"src/core/imap/MCIMAPSearchExpression.cpp",
"src/core/imap/MCIMAPSession.cpp",
"src/core/imap/MCIMAPSyncResult.cpp",
"src/core/imap/MCIMAPFolderStatus.cpp",
"src/core/imap/MCIMAPIdentity.cpp",
"src/core/pop/MCPOPMessageInfo.cpp",
"src/core/pop/MCPOPSession.cpp",
"src/core/nntp/MCNNTPGroupInfo.cpp",
"src/core/nntp/MCNNTPSession.cpp",
"src/core/renderer/MCAddressDisplay.cpp",
"src/core/renderer/MCDateFormatter.cpp",
"src/core/renderer/MCSizeFormatter.cpp",
"src/core/renderer/MCHTMLRenderer.cpp",
"src/core/renderer/MCHTMLRendererCallback.cpp",
"src/core/renderer/MCHTMLBodyRendererTemplateCallback.cpp",
"src/core/renderer/MCHTMLRendererIMAPDataCallback.cpp",
"src/core/rfc822/MCAttachment.cpp",
"src/core/rfc822/MCMessageBuilder.cpp",
"src/core/rfc822/MCMessageParser.cpp",
"src/core/rfc822/MCMessagePart.cpp",
"src/core/rfc822/MCMultipart.cpp",
"src/core/smtp/MCSMTPSession.cpp",
"src/core/provider/MCMXRecordResolverOperation.cpp",
"src/core/provider/MCAccountValidator.cpp",
"src/core/provider/MCMailProvider.cpp",
"src/core/provider/MCMailProvidersManager.cpp",
"src/core/provider/MCNetService.cpp",
]
let objCSources = [
"src/objc/pop/MCOPOPSession.mm",
"src/objc/pop/MCOPOPOperation.mm",
"src/objc/pop/MCOPOPFetchHeaderOperation.mm",
"src/objc/pop/MCOPOPFetchMessageOperation.mm",
"src/objc/pop/MCOPOPFetchMessagesOperation.mm",
"src/objc/pop/MCOPOPNoopOperation.mm",
"src/objc/pop/MCOPOPMessageInfo.mm",
"src/objc/smtp/MCOSMTPSession.mm",
"src/objc/smtp/MCOSMTPLoginOperation.mm",
"src/objc/smtp/MCOSMTPSendOperation.mm",
"src/objc/smtp/MCOSMTPNoopOperation.mm",
"src/objc/smtp/MCOSMTPOperation.mm",
"src/objc/nntp/MCONNTPSession.mm",
"src/objc/nntp/MCONNTPOperation.mm",
"src/objc/nntp/MCONNTPFetchHeaderOperation.mm",
"src/objc/nntp/MCONNTPFetchArticleOperation.mm",
"src/objc/nntp/MCONNTPListNewsgroupsOperation.mm",
"src/objc/nntp/MCONNTPFetchOverviewOperation.mm",
"src/objc/nntp/MCONNTPFetchAllArticlesOperation.mm",
"src/objc/nntp/MCONNTPFetchServerTimeOperation.mm",
"src/objc/nntp/MCONNTPDisconnectOperation.mm",
"src/objc/nntp/MCONNTPGroupInfo.mm",
"src/objc/nntp/MCONNTPPostOperation.mm",
"src/objc/abstract/MCOAbstractMessage.mm",
"src/objc/abstract/MCOAbstractMessagePart.mm",
"src/objc/abstract/MCOAbstractMultipart.mm",
"src/objc/abstract/MCOAbstractPart.mm",
"src/objc/abstract/MCOAddress.mm",
"src/objc/abstract/MCOMessageHeader.mm",
"src/objc/abstract/MCOAbstractMessageRendererCallback.mm",
"src/objc/imap/MCOIMAPSession.mm",
"src/objc/imap/MCOIMAPFolder.mm",
"src/objc/imap/MCOIMAPMessage.mm",
"src/objc/imap/MCOIMAPMessagePart.mm",
"src/objc/imap/MCOIMAPMultipart.mm",
"src/objc/imap/MCOIMAPNamespace.mm",
"src/objc/imap/MCOIMAPNamespaceItem.mm",
"src/objc/imap/MCOIMAPPart.mm",
"src/objc/imap/MCOIMAPFolderInfo.mm",
"src/objc/imap/MCOIMAPFetchFoldersOperation.mm",
"src/objc/imap/MCOIMAPOperation.mm",
"src/objc/imap/MCOIMAPFolderInfoOperation.mm",
"src/objc/imap/MCOIMAPBaseOperation.mm",
"src/objc/imap/MCOIMAPAppendMessageOperation.mm",
"src/objc/imap/MCOIMAPCopyMessagesOperation.mm",
"src/objc/imap/MCOIMAPMoveMessagesOperation.mm",
"src/objc/imap/MCOIMAPFetchMessagesOperation.mm",
"src/objc/imap/MCOIMAPFetchContentOperation.mm",
"src/objc/imap/MCOIMAPFetchContentToFileOperation.mm",
"src/objc/imap/MCOIMAPFetchParsedContentOperation.mm",
"src/objc/imap/MCOIMAPSearchOperation.mm",
"src/objc/imap/MCOIMAPIdleOperation.mm",
"src/objc/imap/MCOIMAPFetchNamespaceOperation.mm",
"src/objc/imap/MCOIMAPIdentityOperation.mm",
"src/objc/imap/MCOIMAPCapabilityOperation.mm",
"src/objc/imap/MCOIMAPQuotaOperation.mm",
"src/objc/imap/MCOIMAPSearchExpression.mm",
"src/objc/imap/MCOIMAPFolderStatus.mm",
"src/objc/imap/MCOIMAPFolderStatusOperation.mm",
"src/objc/imap/MCOIMAPMessageRenderingOperation.mm",
"src/objc/imap/MCOIMAPNoopOperation.mm",
"src/objc/imap/MCOIMAPIdentity.mm",
"src/objc/imap/MCOIMAPMultiDisconnectOperation.mm",
"src/objc/imap/MCOIMAPCustomCommandOperation.mm",
"src/objc/imap/MCOIMAPCheckAccountOperation.mm",
"src/objc/rfc822/MCOAttachment.mm",
"src/objc/rfc822/MCOMessageBuilder.mm",
"src/objc/rfc822/MCOMessageParser.mm",
"src/objc/rfc822/MCOMessagePart.mm",
"src/objc/rfc822/MCOMultipart.mm",
"src/objc/utils/MCOObjectWrapper.mm",
"src/objc/utils/MCOOperation.mm",
"src/objc/utils/NSArray+MCO.mm",
"src/objc/utils/NSData+MCO.mm",
"src/objc/utils/NSDictionary+MCO.mm",
"src/objc/utils/NSError+MCO.mm",
"src/objc/utils/NSObject+MCO.mm",
"src/objc/utils/NSString+MCO.mm",
"src/objc/utils/NSValue+MCO.mm",
"src/objc/utils/MCOIndexSet.mm",
"src/objc/utils/MCORange.mm",
"src/objc/utils/NSSet+MCO.mm",
"src/objc/provider/MCOAccountValidator.mm",
"src/objc/provider/MCOMailProvider.mm",
"src/objc/provider/MCOMailProvidersManager.mm",
"src/objc/provider/MCONetService.mm",
"src/core/zip/MCZipMac.mm",
"src/core/basetypes/MCAutoreleasePoolMac.mm",
"src/core/basetypes/MCDataMac.mm",
"src/core/basetypes/MCMainThreadMac.mm",
"src/core/basetypes/MCObjectMac.mm",
"src/core/rfc822/MCMessageParserMac.mm",
]
// MARK: Package
let package = Package(
name: "MailCore2",
defaultLocalization: "en",
platforms: [
.iOS(.v12), .macOS(.v10_13)
],
products: [
.library(
name: "MailCore2",
targets: ["MailCore"]),
],
dependencies: [
.package(url: "https://github.com/jsflax/libetpan/", branch: "master"),
.package(url: "https://github.com/jsflax/tidy-html5/", branch: "master"),
.package(url: "https://github.com/jsflax/ctemplate/", branch: "master")
],
targets: [
.target(name: "MailCore",
dependencies: [
"libetpan",
.product(name: "tidy", package: "tidy-html5"),
"ctemplate"
],
path: ".",
exclude: exclude,
sources: cSources + objCSources,
publicHeadersPath: "include",
cSettings: baseCSettings + objCSettings,
cxxSettings: [.unsafeFlags(["-fno-objc-arc"])],
linkerSettings: [
.linkedLibrary("c++"),
.linkedLibrary("z"),
.linkedLibrary("iconv"),
.linkedLibrary("xml2"),
.linkedLibrary("resolv"),
.linkedLibrary("sasl2", .when(platforms: [.macOS])),
.linkedFramework("Security"),
.linkedFramework("CFNetwork"),
.linkedFramework("Foundation"),
.linkedFramework("SystemConfiguration")
]),
.testTarget(name: "unittest",
dependencies: ["MailCore"],
path: "unittest")
],
cLanguageStandard: .gnu11,
cxxLanguageStandard: .gnucxx20
)