Repository navigation
Expand file tree
/
Copy pathPackage.swift
More file actions
68 lines (63 loc) · 2.37 KB
/
Copy pathPackage.swift
File metadata and controls
68 lines (63 loc) · 2.37 KB
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
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
import struct Foundation.URL
/// Reads optional compiler flags used while developing the fork locally.
var additionalCompilerFlags: [PackageDescription.SwiftSetting] = {
guard let config = try? String(
contentsOf: URL(fileURLWithPath: #filePath)
.deletingLastPathComponent()
.appendingPathComponent("Local.xcconfig")
) else {
return []
}
return config
.firstMatch(of: #/^SWIFT_ACTIVE_COMPILATION_CONDITIONS *= *(.*)$/#.anchorsMatchLineEndings())?
.output
.1
.split(whereSeparator: \.isWhitespace)
.filter { !$0.isEmpty && !$0.hasPrefix("$") }
.map { .define(String($0)) }
?? []
}()
var ciCompilerFlags: [PackageDescription.SwiftSetting] = [
// REPLACE_WITH_DEFINES_HERE
]
// See https://github.com/RevenueCat/purchases-ios/pull/2989
// #if os(visionOS) can't really be used in Xcode 13, so we use this instead.
let visionOSSetting: SwiftSetting = .define("VISION_OS", .when(platforms: [.visionOS]))
let package = Package(
name: "RevenueCat",
defaultLocalization: "en",
platforms: [
.macOS(.v10_15),
.watchOS("6.2"),
.tvOS(.v13),
.iOS(.v13),
.visionOS(.v1)
],
products: [
.library(name: "RevenueCat",
targets: ["RevenueCat"])
],
targets: [
.target(name: "RevenueCat",
path: "Sources",
resources: [
.copy("../Sources/PrivacyInfo.xcprivacy")
],
swiftSettings: [visionOSSetting]
+ ciCompilerFlags
+ additionalCompilerFlags
+ [.define("ENABLE_TRANSACTION_METADATA")]),
.testTarget(name: "RevenueCatConcurrencyTests",
dependencies: ["RevenueCat"],
path: "Tests/RevenueCatConcurrencyTests"),
.testTarget(name: "RevenueCatNetworkingTests",
dependencies: ["RevenueCat"],
path: "Tests/RevenueCatNetworkingTests",
resources: [.process("Fixtures")]),
.testTarget(name: "RevenueCatProxyAuthenticationTests", dependencies: ["RevenueCat"],
path: "Tests/ProxyAuthentication")
]
)