Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 40 additions & 29 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
// swift-tools-version:5.9
import PackageDescription

let deps: [Package.Dependency] = [
.github("swiftlang/swift-toolchain-sqlite", exact: "1.0.4")
]

let targets: [Target] = [
.target(
name: "SQLite",
dependencies: [
.product(name: "SwiftToolchainCSQLite", package: "swift-toolchain-sqlite", condition: .when(platforms: [.linux, .windows]))
],
exclude: [
"Info.plist"
]
)
]

let testTargets: [Target] = [
.testTarget(
name: "SQLiteTests",
dependencies: [
"SQLite"
],
path: "Tests/SQLiteTests",
exclude: [
"Info.plist"
],
resources: [
.copy("Resources")
]
)
]

let package = Package(
name: "SQLite.swift",
platforms: [
Expand All @@ -16,34 +48,13 @@ let package = Package(
targets: ["SQLite"]
)
],
targets: [
.target(
name: "SQLite",
exclude: [
"Info.plist"
]
),
.testTarget(
name: "SQLiteTests",
dependencies: [
"SQLite"
],
path: "Tests/SQLiteTests",
exclude: [
"Info.plist"
],
resources: [
.copy("Resources")
]
)
]
dependencies: deps,
targets: targets + testTargets
)

#if os(Linux)
package.dependencies = [
.package(url: "https://github.com/stephencelis/CSQLite.git", from: "0.0.3")
]
package.targets.first?.dependencies += [
.product(name: "CSQLite", package: "CSQLite")
]
#endif
extension Package.Dependency {

static func github(_ repo: String, exact ver: Version) -> Package.Dependency {
.package(url: "https://github.com/\(repo)", exact: ver)
}
}
2 changes: 1 addition & 1 deletion Sources/SQLite/Core/Backup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Core/Connection+Aggregation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Core/Connection+Attach.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Core/Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Core/Result.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Core/Statement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteTests/Core/Connection+AttachTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteTests/Core/Connection+PragmaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteTests/Core/ConnectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteTests/Core/ResultTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteTests/Core/StatementTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteTests/Extensions/FTSIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteTests/Typed/CustomAggregationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteTests/Typed/QueryIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteTests/Typed/QueryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sqlite3
#elseif SQLITE_SWIFT_SQLCIPHER
import SQLCipher
#elseif os(Linux)
import CSQLite
import SwiftToolchainCSQLite
#else
import SQLite3
#endif
Expand Down