Skip to content

Commit 1b3d7bf

Browse files
committed
Uses symlinks for shared support code
Using the same technique as swift-docc-plugin to share code between plugins, this allows to share code between a macro and a target.
1 parent 2d9f1d9 commit 1b3d7bf

File tree

14 files changed

+21
-21
lines changed

14 files changed

+21
-21
lines changed

Package.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ let package = Package(
4949
.target(
5050
name: "StructuredQueriesCore",
5151
dependencies: [
52-
"StructuredQueriesSupport",
5352
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
5453
.product(
5554
name: "Tagged",
5655
package: "swift-tagged",
5756
condition: .when(traits: ["StructuredQueriesTagged"])
5857
),
59-
]
58+
],
59+
exclude: ["Symbolic Links/README.md"]
6060
),
6161
.target(
6262
name: "StructuredQueries",
@@ -68,10 +68,10 @@ let package = Package(
6868
.macro(
6969
name: "StructuredQueriesMacros",
7070
dependencies: [
71-
"StructuredQueriesSupport",
7271
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
7372
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
74-
]
73+
],
74+
exclude: ["Symbolic Links/README.md"]
7575
),
7676
.target(
7777
name: "StructuredQueriesSQLite",
@@ -107,8 +107,6 @@ let package = Package(
107107
.product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"),
108108
]
109109
),
110-
111-
.target(name: "StructuredQueriesSupport"),
112110
],
113111
swiftLanguageModes: [.v6]
114112
)

[email protected]

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ let package = Package(
4141
.target(
4242
name: "StructuredQueriesCore",
4343
dependencies: [
44-
"StructuredQueriesSupport",
4544
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
46-
]
45+
],
46+
exclude: ["Symbolic Links/README.md"]
4747
),
4848
.target(
4949
name: "StructuredQueries",
@@ -55,10 +55,10 @@ let package = Package(
5555
.macro(
5656
name: "StructuredQueriesMacros",
5757
dependencies: [
58-
"StructuredQueriesSupport",
5958
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
6059
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
61-
]
60+
],
61+
exclude: ["Symbolic Links/README.md"]
6262
),
6363
.target(
6464
name: "StructuredQueriesSQLite",
@@ -94,8 +94,6 @@ let package = Package(
9494
.product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"),
9595
]
9696
),
97-
98-
.target(name: "StructuredQueriesSupport"),
9997
],
10098
swiftLanguageModes: [.v6]
10199
)

Sources/StructuredQueriesCore/Exports.swift

Lines changed: 0 additions & 1 deletion
This file was deleted.

Sources/StructuredQueriesCore/QueryBinding.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Foundation
2-
import StructuredQueriesSupport
32

43
/// A type that enumerates the values that can be bound to the parameters of a SQL statement.
54
public enum QueryBinding: Hashable, Sendable {

Sources/StructuredQueriesCore/QueryFragment.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import StructuredQueriesSupport
2-
31
/// A type representing a SQL string and its bindings.
42
///
53
/// You will typically create instances of this type using string literals, where bindings are

Sources/StructuredQueriesCore/SQLite/JSONFunctions.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Foundation
2-
import StructuredQueriesSupport
32

43
extension QueryExpression {
54
/// Passes this expression and the given one to the `json_patch` function.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Symbolic Links
2+
3+
This directory contains symbolic links to shared source code used
4+
by the StructuredQueriesCore target. This is a workaround until
5+
SwiftPM has native support for sharing code between macros and targets.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../StructuredQueriesSupport

Sources/StructuredQueriesCore/TableAlias.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Foundation
2-
import StructuredQueriesSupport
32

43
/// A type identifying a table alias.
54
///

Sources/StructuredQueriesMacros/SelectionMacro.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import StructuredQueriesSupport
21
import SwiftBasicFormat
32
import SwiftDiagnostics
43
import SwiftSyntax

0 commit comments

Comments
 (0)