I want to try out a new type that uses the secret sorted collections from the Swift Collection library. I get errors that “SortedSet cannot be found in scope.” I just tweaked the Package.swift that was initially generated. I guess I messed up referencing the package with a different compile-time flag.
let package = Package(
name: "XXX",
products: [
// Products define the executables and libraries a package produces,
// making them visible to other packages.
.library(
name: "XXX",
targets: ["XXX"]
)
],
dependencies: [
.package(
url: "https://github.com/apple/swift-collections.git",
.upToNextMajor(from: "1.3.0")
)
],
targets: [
// Targets are the basic building blocks of a package,
// defining a module or a test suite.
// Targets can depend on other targets in this package and
// products from dependencies.
.target(
name: "XXX",
dependencies: [
.product(name: "Collections", package: "swift-collections")
],
swiftSettings: [
// Gain access to the in-beta "SortedSet" collection type.
.define("COLLECTIONS_UNSTABLE_SORTED_COLLECTIONS")
]
),
.testTarget(
name: "XXXTests",
dependencies: ["XXX"]
),
]
)
I can substitute the always-available Deque type just fine.