-
-
Notifications
You must be signed in to change notification settings - Fork 721
/
Package.swift
87 lines (82 loc) · 3.01 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
// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import Foundation
import PackageDescription
var swiftSettings: [SwiftSetting] = [
.define("SQLITE_ENABLE_FTS5"),
]
var cSettings: [CSetting] = []
var dependencies: [PackageDescription.Package.Dependency] = []
// Don't rely on those environment variables. They are ONLY testing conveniences:
// $ SQLITE_ENABLE_PREUPDATE_HOOK=1 make test_SPM
if ProcessInfo.processInfo.environment["SQLITE_ENABLE_PREUPDATE_HOOK"] == "1" {
swiftSettings.append(.define("SQLITE_ENABLE_PREUPDATE_HOOK"))
cSettings.append(.define("GRDB_SQLITE_ENABLE_PREUPDATE_HOOK"))
}
// The SPI_BUILDER environment variable enables documentation building
// on <https://swiftpackageindex.com/groue/GRDB.swift>. See
// <https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/2122>
// for more information.
//
// SPI_BUILDER also enables the `make docs-localhost` command.
if ProcessInfo.processInfo.environment["SPI_BUILDER"] == "1" {
dependencies.append(.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"))
}
let package = Package(
name: "GRDB",
defaultLocalization: "en", // for tests
platforms: [
.iOS(.v13),
.macOS(.v10_15),
.tvOS(.v13),
.watchOS(.v7),
],
products: [
.library(name: "GRDBSQLite", targets: ["GRDBSQLite"]),
.library(name: "GRDB", targets: ["GRDB"]),
.library(name: "GRDB-dynamic", type: .dynamic, targets: ["GRDB"]),
],
dependencies: dependencies,
targets: [
.systemLibrary(
name: "GRDBSQLite",
providers: [.apt(["libsqlite3-dev"])]),
.target(
name: "GRDB",
dependencies: ["GRDBSQLite"],
path: "GRDB",
resources: [.copy("PrivacyInfo.xcprivacy")],
cSettings: cSettings,
swiftSettings: swiftSettings),
.testTarget(
name: "GRDBTests",
dependencies: ["GRDB"],
path: "Tests",
exclude: [
"CocoaPods",
"Crash",
"CustomSQLite",
"GRDBManualInstall",
"GRDBTests/getThreadsCount.c",
"Info.plist",
"Performance",
"SPM",
"Swift6Migration",
"generatePerformanceReport.rb",
"parsePerformanceTests.rb",
],
resources: [
.copy("GRDBTests/Betty.jpeg"),
.copy("GRDBTests/InflectionsTests.json"),
.copy("GRDBTests/Issue1383.sqlite"),
],
cSettings: cSettings,
swiftSettings: swiftSettings + [
// Tests still use the Swift 5 language mode.
.swiftLanguageMode(.v5),
.enableUpcomingFeature("InferSendableFromCaptures"),
.enableUpcomingFeature("GlobalActorIsolatedTypesUsability"),
])
],
swiftLanguageModes: [.v6]
)