Skip to content

Commit 3dce02e

Browse files
authored
Merge pull request #1061 from stephencelis/fix-spm
Fix swift package build
2 parents 7989455 + 4ddcb1c commit 3dce02e

File tree

4 files changed

+58
-60
lines changed

4 files changed

+58
-60
lines changed

Package.swift

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,50 @@ import PackageDescription
44
let package = Package(
55
name: "SQLite.swift",
66
products: [
7-
.library(
8-
name: "SQLite",
9-
targets: ["SQLite"]
10-
)
11-
],
7+
.library(
8+
name: "SQLite",
9+
targets: ["SQLite"]
10+
)
11+
],
1212
targets: [
1313
.target(
14-
name: "SQLite",
15-
dependencies: ["SQLiteObjc"],
16-
exclude: [
17-
"Info.plist"
18-
]
19-
),
14+
name: "SQLite",
15+
dependencies: ["SQLiteObjc"],
16+
exclude: [
17+
"Info.plist"
18+
]
19+
),
2020
.target(
21-
name: "SQLiteObjc",
22-
dependencies: [],
23-
exclude: [
24-
"SQLiteObjc.h",
25-
"fts3_tokenizer.h",
26-
"include/README.md"
27-
]
28-
),
21+
name: "SQLiteObjc",
22+
dependencies: [],
23+
exclude: [
24+
"fts3_tokenizer.h"
25+
]
26+
),
2927
.testTarget(
30-
name: "SQLiteTests",
31-
dependencies: [
32-
"SQLite"
33-
],
34-
path: "Tests/SQLiteTests",
35-
exclude: [
36-
"Info.plist"
37-
],
38-
resources: [
39-
.copy("fixtures/encrypted-3.x.sqlite"),
40-
.copy("fixtures/encrypted-4.x.sqlite")
41-
]
42-
)
28+
name: "SQLiteTests",
29+
dependencies: [
30+
"SQLite"
31+
],
32+
path: "Tests/SQLiteTests",
33+
exclude: [
34+
"Info.plist"
35+
],
36+
resources: [
37+
.copy("fixtures/encrypted-3.x.sqlite"),
38+
.copy("fixtures/encrypted-4.x.sqlite")
39+
]
40+
)
4341
]
4442
)
4543

4644
#if os(Linux)
47-
package.dependencies = [.package(url: "https://github.com/stephencelis/CSQLite.git", from: "0.0.3")]
48-
package.targets = [
49-
.target(name: "SQLite", exclude: ["Extensions/FTS4.swift", "Extensions/FTS5.swift"]),
50-
.testTarget(name: "SQLiteTests", dependencies: ["SQLite"], path: "Tests/SQLiteTests", exclude: [
51-
"FTS4Tests.swift",
52-
"FTS5Tests.swift"
53-
])
54-
]
45+
package.dependencies = [.package(url: "https://github.com/stephencelis/CSQLite.git", from: "0.0.3")]
46+
package.targets = [
47+
.target(name: "SQLite", exclude: ["Extensions/FTS4.swift", "Extensions/FTS5.swift"]),
48+
.testTarget(name: "SQLiteTests", dependencies: ["SQLite"], path: "Tests/SQLiteTests", exclude: [
49+
"FTS4Tests.swift",
50+
"FTS5Tests.swift"
51+
])
52+
]
5553
#endif

SQLite.xcodeproj/project.pbxproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
03A65E721C6BB2D30062603F /* SQLite.h in Headers */ = {isa = PBXBuildFile; fileRef = EE247AD61C3F04ED00AE3E12 /* SQLite.h */; settings = {ATTRIBUTES = (Public, ); }; };
1212
03A65E731C6BB2D80062603F /* Foundation.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE247AF71C3F06E900AE3E12 /* Foundation.swift */; };
1313
03A65E741C6BB2DA0062603F /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE247AF81C3F06E900AE3E12 /* Helpers.swift */; };
14-
03A65E751C6BB2DF0062603F /* SQLiteObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = EE91808D1C46E5230038162A /* SQLiteObjc.h */; settings = {ATTRIBUTES = (Public, ); }; };
1514
03A65E761C6BB2E60062603F /* Blob.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE247AEE1C3F06E900AE3E12 /* Blob.swift */; };
1615
03A65E771C6BB2E60062603F /* Connection.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE247AEF1C3F06E900AE3E12 /* Connection.swift */; };
1716
03A65E781C6BB2EA0062603F /* fts3_tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = EE247AF01C3F06E900AE3E12 /* fts3_tokenizer.h */; };
@@ -101,9 +100,12 @@
101100
3D67B3F71DB246D700A4F4C6 /* Foundation.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE247AF71C3F06E900AE3E12 /* Foundation.swift */; };
102101
3D67B3F81DB246D700A4F4C6 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE247AF81C3F06E900AE3E12 /* Helpers.swift */; };
103102
3D67B3F91DB246E700A4F4C6 /* SQLiteObjc.m in Sources */ = {isa = PBXBuildFile; fileRef = EE247AF11C3F06E900AE3E12 /* SQLiteObjc.m */; };
104-
3D67B3FB1DB2470600A4F4C6 /* SQLiteObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = EE91808D1C46E5230038162A /* SQLiteObjc.h */; settings = {ATTRIBUTES = (Public, ); }; };
105103
3D67B3FC1DB2471B00A4F4C6 /* SQLite.h in Headers */ = {isa = PBXBuildFile; fileRef = EE247AD61C3F04ED00AE3E12 /* SQLite.h */; settings = {ATTRIBUTES = (Public, ); }; };
106104
3D67B3FD1DB2472D00A4F4C6 /* fts3_tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = EE247AF01C3F06E900AE3E12 /* fts3_tokenizer.h */; };
105+
3DDC112F26CDBA0200CE369F /* SQLiteObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DDC112E26CDBA0200CE369F /* SQLiteObjc.h */; settings = {ATTRIBUTES = (Public, ); }; };
106+
3DDC113626CDBE1900CE369F /* SQLiteObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DDC112E26CDBA0200CE369F /* SQLiteObjc.h */; settings = {ATTRIBUTES = (Public, ); }; };
107+
3DDC113726CDBE1900CE369F /* SQLiteObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DDC112E26CDBA0200CE369F /* SQLiteObjc.h */; settings = {ATTRIBUTES = (Public, ); }; };
108+
3DDC113826CDBE1C00CE369F /* SQLiteObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DDC112E26CDBA0200CE369F /* SQLiteObjc.h */; settings = {ATTRIBUTES = (Public, ); }; };
107109
49EB68C41F7B3CB400D89D40 /* Coding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49EB68C31F7B3CB400D89D40 /* Coding.swift */; };
108110
49EB68C51F7B3CB400D89D40 /* Coding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49EB68C31F7B3CB400D89D40 /* Coding.swift */; };
109111
49EB68C61F7B3CB400D89D40 /* Coding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49EB68C31F7B3CB400D89D40 /* Coding.swift */; };
@@ -183,8 +185,6 @@
183185
EE247B731C3F3FEC00AE3E12 /* Query.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE247B001C3F06E900AE3E12 /* Query.swift */; };
184186
EE247B741C3F3FEC00AE3E12 /* Schema.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE247B011C3F06E900AE3E12 /* Schema.swift */; };
185187
EE247B751C3F3FEC00AE3E12 /* Setter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE247B021C3F06E900AE3E12 /* Setter.swift */; };
186-
EE91808E1C46E5230038162A /* SQLiteObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = EE91808D1C46E5230038162A /* SQLiteObjc.h */; settings = {ATTRIBUTES = (Public, ); }; };
187-
EE91808F1C46E76D0038162A /* SQLiteObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = EE91808D1C46E5230038162A /* SQLiteObjc.h */; settings = {ATTRIBUTES = (Public, ); }; };
188188
EE9180941C46EA210038162A /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = EE9180931C46EA210038162A /* libsqlite3.tbd */; };
189189
EE9180951C46EBCC0038162A /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = EE9180911C46E9D30038162A /* libsqlite3.tbd */; };
190190
/* End PBXBuildFile section */
@@ -229,6 +229,7 @@
229229
19A17BA55DABB480F9020C8A /* DateAndTimeFunctions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateAndTimeFunctions.swift; sourceTree = "<group>"; };
230230
19A17E2695737FAB5D6086E3 /* fixtures */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = folder; path = fixtures; sourceTree = "<group>"; };
231231
3D67B3E51DB2469200A4F4C6 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/usr/lib/libsqlite3.tbd; sourceTree = DEVELOPER_DIR; };
232+
3DDC112E26CDBA0200CE369F /* SQLiteObjc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SQLiteObjc.h; path = ../SQLiteObjc/include/SQLiteObjc.h; sourceTree = "<group>"; };
232233
49EB68C31F7B3CB400D89D40 /* Coding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Coding.swift; sourceTree = "<group>"; };
233234
A121AC451CA35C79005A31D1 /* SQLite.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SQLite.framework; sourceTree = BUILT_PRODUCTS_DIR; };
234235
D4DB368A20C09C9B00D5A58E /* SelectTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectTests.swift; sourceTree = "<group>"; };
@@ -280,7 +281,6 @@
280281
EE247B911C3F822500AE3E12 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
281282
EE247B921C3F822600AE3E12 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
282283
EE247B931C3F826100AE3E12 /* SQLite.swift.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; path = SQLite.swift.podspec; sourceTree = "<group>"; };
283-
EE91808D1C46E5230038162A /* SQLiteObjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SQLiteObjc.h; path = ../../SQLiteObjc/SQLiteObjc.h; sourceTree = "<group>"; };
284284
EE9180911C46E9D30038162A /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib/libsqlite3.tbd; sourceTree = DEVELOPER_DIR; };
285285
EE9180931C46EA210038162A /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
286286
/* End PBXFileReference section */
@@ -384,6 +384,7 @@
384384
isa = PBXGroup;
385385
children = (
386386
EE247AD61C3F04ED00AE3E12 /* SQLite.h */,
387+
3DDC112E26CDBA0200CE369F /* SQLiteObjc.h */,
387388
EE247AF71C3F06E900AE3E12 /* Foundation.swift */,
388389
EE247AF81C3F06E900AE3E12 /* Helpers.swift */,
389390
EE247AD81C3F04ED00AE3E12 /* Info.plist */,
@@ -430,7 +431,6 @@
430431
EE247AED1C3F06E900AE3E12 /* Core */ = {
431432
isa = PBXGroup;
432433
children = (
433-
EE91808D1C46E5230038162A /* SQLiteObjc.h */,
434434
EE247AEE1C3F06E900AE3E12 /* Blob.swift */,
435435
EE247AEF1C3F06E900AE3E12 /* Connection.swift */,
436436
EE247AF01C3F06E900AE3E12 /* fts3_tokenizer.h */,
@@ -512,7 +512,7 @@
512512
buildActionMask = 2147483647;
513513
files = (
514514
03A65E781C6BB2EA0062603F /* fts3_tokenizer.h in Headers */,
515-
03A65E751C6BB2DF0062603F /* SQLiteObjc.h in Headers */,
515+
3DDC113626CDBE1900CE369F /* SQLiteObjc.h in Headers */,
516516
03A65E721C6BB2D30062603F /* SQLite.h in Headers */,
517517
);
518518
runOnlyForDeploymentPostprocessing = 0;
@@ -521,8 +521,8 @@
521521
isa = PBXHeadersBuildPhase;
522522
buildActionMask = 2147483647;
523523
files = (
524-
3D67B3FB1DB2470600A4F4C6 /* SQLiteObjc.h in Headers */,
525524
3D67B3FC1DB2471B00A4F4C6 /* SQLite.h in Headers */,
525+
3DDC113726CDBE1900CE369F /* SQLiteObjc.h in Headers */,
526526
3D67B3FD1DB2472D00A4F4C6 /* fts3_tokenizer.h in Headers */,
527527
);
528528
runOnlyForDeploymentPostprocessing = 0;
@@ -531,8 +531,8 @@
531531
isa = PBXHeadersBuildPhase;
532532
buildActionMask = 2147483647;
533533
files = (
534-
EE91808E1C46E5230038162A /* SQLiteObjc.h in Headers */,
535534
EE247B051C3F06E900AE3E12 /* fts3_tokenizer.h in Headers */,
535+
3DDC113826CDBE1C00CE369F /* SQLiteObjc.h in Headers */,
536536
EE247AD71C3F04ED00AE3E12 /* SQLite.h in Headers */,
537537
);
538538
runOnlyForDeploymentPostprocessing = 0;
@@ -542,8 +542,8 @@
542542
buildActionMask = 2147483647;
543543
files = (
544544
EE247B671C3F3FEC00AE3E12 /* fts3_tokenizer.h in Headers */,
545+
3DDC112F26CDBA0200CE369F /* SQLiteObjc.h in Headers */,
545546
EE247B621C3F3FDB00AE3E12 /* SQLite.h in Headers */,
546-
EE91808F1C46E76D0038162A /* SQLiteObjc.h in Headers */,
547547
);
548548
runOnlyForDeploymentPostprocessing = 0;
549549
};

Tests/SQLiteTests/QueryTests.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class QueryIntegrationTests : SQLiteTestCase {
397397
let id = Expression<Int64>("id")
398398
let email = Expression<String>("email")
399399
let age = Expression<Int>("age")
400-
400+
401401
override func setUp() {
402402
super.setUp()
403403

@@ -509,16 +509,16 @@ class QueryIntegrationTests : SQLiteTestCase {
509509
let fetchAge = { () throws -> Int? in
510510
return try self.db.pluck(self.users.filter(self.email == "[email protected]")).flatMap { $0[self.age] }
511511
}
512-
512+
513513
let id = try db.run(users.upsert(email <- "[email protected]", age <- 30, onConflictOf: email))
514514
XCTAssertEqual(1, id)
515515
XCTAssertEqual(30, try fetchAge())
516-
516+
517517
let nextId = try db.run(users.upsert(email <- "[email protected]", age <- 42, onConflictOf: email))
518518
XCTAssertEqual(1, nextId)
519519
XCTAssertEqual(42, try fetchAge())
520520
}
521-
521+
522522
func test_update() {
523523
let changes = try! db.run(users.update(email <- "[email protected]"))
524524
XCTAssertEqual(0, changes)
@@ -528,24 +528,24 @@ class QueryIntegrationTests : SQLiteTestCase {
528528
let changes = try! db.run(users.delete())
529529
XCTAssertEqual(0, changes)
530530
}
531-
531+
532532
func test_union() throws {
533533
let expectedIDs = [
534534
try db.run(users.insert(email <- "[email protected]")),
535535
try db.run(users.insert(email <- "[email protected]"))
536536
]
537-
537+
538538
let query1 = users.filter(email == "[email protected]")
539539
let query2 = users.filter(email == "[email protected]")
540-
540+
541541
let actualIDs = try db.prepare(query1.union(query2)).map { $0[id] }
542542
XCTAssertEqual(expectedIDs, actualIDs)
543-
543+
544544
let query3 = users.select(users[*], Expression<Int>(literal: "1 AS weight")).filter(email == "[email protected]")
545545
let query4 = users.select(users[*], Expression<Int>(literal: "2 AS weight")).filter(email == "[email protected]")
546-
546+
547547
print(query3.union(query4).order(Expression<Int>(literal: "weight")).asSQL())
548-
548+
549549
let orderedIDs = try db.prepare(query3.union(query4).order(Expression<Int>(literal: "weight"), email)).map { $0[id] }
550550
XCTAssertEqual(Array(expectedIDs.reversed()), orderedIDs)
551551
}

0 commit comments

Comments
 (0)