Skip to content

Commit 4863f4b

Browse files
committed
- adjusted package swift
1 parent 652ea2d commit 4863f4b

File tree

1 file changed

+25
-41
lines changed

1 file changed

+25
-41
lines changed

Package.swift

+25-41
Original file line numberDiff line numberDiff line change
@@ -4,76 +4,60 @@
44
import CompilerPluginSupport
55
import PackageDescription
66

7+
let name = "Columnifier"
8+
79
let package = Package(
8-
name: "Columnifier",
10+
name: name,
911
platforms: [.macOS(.v12), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .macCatalyst(.v13)],
1012
products: [
1113
// Products define the executables and libraries a package produces, making them visible to other packages.
1214
.library(
13-
name: "Columnifier",
14-
targets: ["Columnifier"]
15-
),
16-
.executable(
17-
name: "ColumnifierClient",
18-
targets: ["ColumnifierClient"]
15+
name: name,
16+
targets: [name]
1917
)
2018
],
2119
dependencies: [
22-
.package(path: "../MacroTester"),
20+
.package(url: "git@github.com:num42/swift-macrotester.git",from: "1.0.0"),
2321
// Depend on the Swift 5.9 release of SwiftSyntax
2422
.package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0"),
25-
.package(url: "https://github.com/groue/GRDB.swift.git", from: "6.18.0")
26-
// .package(
27-
// url: "https://github.com/realm/SwiftLint",
28-
// from: "0.53.0"
29-
// )
23+
.package(url: "https://github.com/groue/GRDB.swift.git", from: "6.18.0"),
24+
.package(url: "https://github.com/realm/SwiftLint", from: "0.54.0")
3025
],
3126
targets: [
3227
// Targets are the basic building blocks of a package, defining a module or a test suite.
3328
// Targets can depend on other targets in this package and products from dependencies.
3429
// Macro implementation that performs the source transformation of a macro.
3530
.macro(
36-
name: "ColumnifierMacros",
31+
name: "\(name)Macros",
3732
dependencies: [
3833
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
3934
.product(name: "SwiftCompilerPlugin", package: "swift-syntax")
4035
]
4136
),
42-
4337
// Library that exposes a macro as part of its API, which is used in client programs.
4438
.target(
45-
name: "Columnifier",
39+
name: name,
4640
dependencies: [
47-
"ColumnifierMacros",
41+
.target(name: "\(name)Macros"),
4842
.product(name: "GRDB", package: "GRDB.swift"),
4943
.product(name: "CSQLite", package: "GRDB.swift")
5044
]
5145
),
52-
53-
// A client of the library, which is able to use the macro in its own code.
54-
.executableTarget(
55-
name: "ColumnifierClient",
56-
dependencies: [
57-
"Columnifier",
58-
.product(name: "GRDB", package: "GRDB.swift")
59-
]
60-
) // ,
61-
6246
// A test target used to develop the macro implementation.
63-
// .testTarget(
64-
// name: "ColumnifierTests",
65-
// dependencies: [
66-
// "ColumnifierMacros",
67-
// .product(name: "MacroTester", package: "MacroTester"),
68-
// .product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax")
69-
// ]
47+
.testTarget(
48+
name: "\(name)Tests",
49+
dependencies: [
50+
.target(name: "\(name)Macros"),
51+
.product(name: "MacroTester", package: "swift-macrotester"),
52+
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax")
53+
],
7054
// Copying Resources somehow breaks codesigning
71-
// resources: [
72-
// // Copy Tests/ExampleTests/Resources directories as-is.
73-
// // Use to retain directory structure.
74-
// // Will be at top level in bundle.
75-
// .copy("Resources")
76-
// ]
77-
// )
55+
resources: [
56+
// Copy Tests/ExampleTests/Resources directories as-is.
57+
// Use to retain directory structure.
58+
// Will be at top level in bundle.
59+
.copy("Resources")
60+
]
61+
)
7862
]
7963
)

0 commit comments

Comments
 (0)