-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathPackage.swift
More file actions
69 lines (65 loc) · 2.44 KB
/
Package.swift
File metadata and controls
69 lines (65 loc) · 2.44 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
69
// swift-tools-version: 6.1
import PackageDescription
let applePlatforms: [PackageDescription.Platform] = [.iOS, .macOS, .watchOS, .tvOS, .visionOS]
let target: Target = .target(
name: "SQLite",
dependencies: [
.product(name: "SQLiteSwiftCSQLite",
package: "CSQLite",
condition: .when(traits: ["SQLiteSwiftCSQLite"])),
.product(name: "SQLCipher",
package: "SQLCipher.swift",
condition: .when(platforms: applePlatforms, traits: ["SQLCipher"]))
],
exclude: ["Info.plist"],
resources: [.copy("PrivacyInfo.xcprivacy")],
cSettings: [
.define("SQLITE_HAS_CODEC", .when(platforms: applePlatforms, traits: ["SQLCipher"]))
]
)
let testTarget: Target = .testTarget(
name: "SQLiteTests",
dependencies: ["SQLite"],
exclude: ["Info.plist"],
resources: [.copy("Resources")]
)
let defaultTraits: Set<String>
#if os(Linux)
defaultTraits = ["SQLiteSwiftCSQLite"]
#else
defaultTraits = ["SystemSQLite"]
#endif
let package = Package(
name: "SQLite.swift",
platforms: [
.iOS(.v12),
.macOS(.v10_13),
.watchOS(.v4),
.tvOS(.v12),
.visionOS(.v1)
],
products: [
.library(name: "SQLite", targets: ["SQLite"]),
.library(name: "SQLite-Dynamic", type: .dynamic, targets: ["SQLite"])
],
traits: [
.trait(name: "SystemSQLite",
description: "Uses the system-provided SQLite (on Apple platforms)"),
.trait(name: "SQLiteSwiftCSQLite",
description: "Include SQLite from SQLite.swift, based on the toolchain version"),
// this will note compile, just included for sake of completeness
.trait(name: "StandaloneSQLite",
description: "Assumes SQLite to be already available as 'sqlite3'"),
.trait(name: "SQLCipher",
description: "Enables SQLCipher encryption when a key is supplied to Connection"),
.trait(name: "FTS5",
description: "Enables FTS5 in the embedded SQLite (only supported by SQLiteSwiftCSQLite)"),
.default(enabledTraits: defaultTraits)
],
dependencies: [
.package(url: "https://github.com/stephencelis/CSQLite", from: "3.50.4", traits: [.trait(name: "FTS5", condition: .when(traits: ["FTS5"]))]),
.package(url: "https://github.com/sqlcipher/SQLCipher.swift", from: "4.11.0")
],
targets: [target, testTarget],
swiftLanguageModes: [.v5],
)