-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…3005) Fixes #2998. See #2989 for why this is needed in the first place. This is now fixed in SPM: swiftlang/swift-package-manager#6794, but we need a workaround for now. Since `.custom` doesn't work properly (it gets evaluated in Xcode even outside of that platform), this splits `Package.swift` based on Xcode version. Thanks @neonichu for helping with this.
- Loading branch information
Showing
4 changed files
with
134 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// swift-tools-version:5.7 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
import class Foundation.ProcessInfo | ||
|
||
// Only add DocC Plugin when building docs, so that clients of this library won't | ||
// unnecessarily also get the DocC Plugin | ||
let environmentVariables = ProcessInfo.processInfo.environment | ||
let shouldIncludeDocCPlugin = environmentVariables["INCLUDE_DOCC_PLUGIN"] == "true" | ||
|
||
var dependencies: [Package.Dependency] = [ | ||
.package(url: "git@github.com:Quick/Nimble.git", from: "10.0.0") | ||
] | ||
if shouldIncludeDocCPlugin { | ||
dependencies.append(.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")) | ||
} | ||
|
||
let package = Package( | ||
name: "RevenueCat", | ||
platforms: [ | ||
.macOS(.v10_13), | ||
.watchOS("6.2"), | ||
.tvOS(.v11), | ||
.iOS(.v11) | ||
], | ||
products: [ | ||
.library(name: "RevenueCat", | ||
targets: ["RevenueCat"]), | ||
.library(name: "RevenueCat_CustomEntitlementComputation", | ||
targets: ["RevenueCat_CustomEntitlementComputation"]), | ||
.library(name: "ReceiptParser", | ||
targets: ["ReceiptParser"]) | ||
], | ||
dependencies: dependencies, | ||
targets: [ | ||
.target(name: "RevenueCat", | ||
path: "Sources", | ||
exclude: ["Info.plist", "LocalReceiptParsing/ReceiptParser-only-files"], | ||
resources: [ | ||
.copy("../Sources/PrivacyInfo.xcprivacy") | ||
]), | ||
.target(name: "RevenueCat_CustomEntitlementComputation", | ||
path: "CustomEntitlementComputation", | ||
exclude: ["Info.plist", "LocalReceiptParsing/ReceiptParser-only-files"], | ||
resources: [ | ||
.copy("PrivacyInfo.xcprivacy") | ||
], | ||
swiftSettings: [.define("ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION")]), | ||
.target(name: "ReceiptParser", | ||
path: "LocalReceiptParsing"), | ||
.testTarget(name: "ReceiptParserTests", | ||
dependencies: ["ReceiptParser", "Nimble"], | ||
exclude: ["ReceiptParserTests-Info.plist"]) | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// swift-tools-version:5.8 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
import class Foundation.ProcessInfo | ||
|
||
// Only add DocC Plugin when building docs, so that clients of this library won't | ||
// unnecessarily also get the DocC Plugin | ||
let environmentVariables = ProcessInfo.processInfo.environment | ||
let shouldIncludeDocCPlugin = environmentVariables["INCLUDE_DOCC_PLUGIN"] == "true" | ||
|
||
var dependencies: [Package.Dependency] = [ | ||
.package(url: "git@github.com:Quick/Nimble.git", from: "10.0.0") | ||
] | ||
if shouldIncludeDocCPlugin { | ||
dependencies.append(.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")) | ||
} | ||
|
||
let package = Package( | ||
name: "RevenueCat", | ||
platforms: [ | ||
.macOS(.v10_13), | ||
.watchOS("6.2"), | ||
.tvOS(.v11), | ||
.iOS(.v11) | ||
], | ||
products: [ | ||
.library(name: "RevenueCat", | ||
targets: ["RevenueCat"]), | ||
.library(name: "RevenueCat_CustomEntitlementComputation", | ||
targets: ["RevenueCat_CustomEntitlementComputation"]), | ||
.library(name: "ReceiptParser", | ||
targets: ["ReceiptParser"]) | ||
], | ||
dependencies: dependencies, | ||
targets: [ | ||
.target(name: "RevenueCat", | ||
path: "Sources", | ||
exclude: ["Info.plist", "LocalReceiptParsing/ReceiptParser-only-files"], | ||
resources: [ | ||
.copy("../Sources/PrivacyInfo.xcprivacy") | ||
]), | ||
.target(name: "RevenueCat_CustomEntitlementComputation", | ||
path: "CustomEntitlementComputation", | ||
exclude: ["Info.plist", "LocalReceiptParsing/ReceiptParser-only-files"], | ||
resources: [ | ||
.copy("PrivacyInfo.xcprivacy") | ||
], | ||
swiftSettings: [.define("ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION")]), | ||
.target(name: "ReceiptParser", | ||
path: "LocalReceiptParsing"), | ||
.testTarget(name: "ReceiptParserTests", | ||
dependencies: ["ReceiptParser", "Nimble"], | ||
exclude: ["ReceiptParserTests-Info.plist"]) | ||
] | ||
) |