-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
97 lines (89 loc) · 2.34 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
88
89
90
91
92
93
94
95
96
97
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
import CompilerPluginSupport
let package = Package(
name: "Logs",
platforms: [
.macOS(.v13),
.iOS(.v16),
.tvOS(.v16),
.watchOS(.v9),
.macCatalyst(.v16),
.visionOS(.v1)
],
products: [
.library(
name: "Logs",
targets: ["Logs"]
),
.plugin(
name: "GenerateLogger",
targets: ["GenerateLogger"]
),
],
dependencies: [
.package(
url: "https://github.com/apple/swift-syntax.git",
.upToNextMajor(from: "510.0.1")
),
.package(
url: "https://github.com/apple/swift-argument-parser",
.upToNextMajor(from: "1.3.1")
),
],
targets: [
// MARK: Plugin
.plugin(
name: "GenerateLogger",
capability: .buildTool(),
dependencies: [
.target(name: "LoggerGenerator")
],
packageAccess: true
),
.executableTarget(
name: "LoggerGenerator",
dependencies: [
.product(
name: "ArgumentParser",
package: "swift-argument-parser"
),
]
),
// MARK: Macro
.target(
name: "Logs",
dependencies: ["LogsMacros"]
),
.macro(
name: "LogsMacros",
dependencies: [
.product(
name: "SwiftSyntaxMacros",
package: "swift-syntax"
),
.product(
name: "SwiftCompilerPlugin",
package: "swift-syntax"
)
]
),
.testTarget(
name: "LogsTests",
dependencies: [
"LogsMacros",
.product(
name: "SwiftSyntaxMacrosTestSupport",
package: "swift-syntax"
),
]
),
// MARK: Internal
.executableTarget(
name: "LoggerTestClient",
dependencies: ["Logs"],
plugins: ["GenerateLogger"]
)
]
)