-
Notifications
You must be signed in to change notification settings - Fork 4
/
Package.swift
110 lines (106 loc) · 3.81 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
98
99
100
101
102
103
104
105
106
107
108
109
110
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import CompilerPluginSupport
import PackageDescription
let package = Package(
name: "SafeDI",
platforms: [
.macOS(.v10_15),
.iOS(.v13),
.tvOS(.v13),
.watchOS(.v6),
.macCatalyst(.v13),
.visionOS(.v1),
],
products: [
/// A library containing SafeDI macros, property wrappers, and types.
.library(
name: "SafeDI",
targets: ["SafeDI"]
),
/// A SafeDI plugin that must be run on the root source module in a project.
.plugin(
name: "SafeDIGenerator",
targets: ["SafeDIGenerator"]
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.0"),
.package(url: "https://github.com/apple/swift-collections.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-syntax.git", from: "510.0.0"),
.package(url: "https://github.com/michaeleisel/ZippyJSON.git", from: "1.2.0"),
.package(url: "https://github.com/pointfreeco/swift-macro-testing.git", from: "0.4.0"),
],
targets: [
// Macros
.target(
name: "SafeDI",
dependencies: ["SafeDIMacros"]
),
.testTarget(
name: "SafeDITests",
dependencies: [
"SafeDI",
"SafeDICore",
]
),
.macro(
name: "SafeDIMacros",
dependencies: [
"SafeDICore",
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
.product(name: "SwiftDiagnostics", package: "swift-syntax"),
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
]
),
.testTarget(
name: "SafeDIMacrosTests",
dependencies: [
"SafeDIMacros",
"SafeDICore",
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
.product(name: "MacroTesting", package: "swift-macro-testing"),
]
),
// Plugins
.plugin(
name: "SafeDIGenerator",
capability: .buildTool(),
dependencies: ["SafeDITool"]
),
.executableTarget(
name: "SafeDITool",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftParser", package: "swift-syntax"),
.byNameItem(name: "ZippyJSON", condition: .when(platforms: [.iOS, .tvOS, .macOS])),
"SafeDICore",
]
),
.testTarget(
name: "SafeDIToolTests",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.byNameItem(name: "ZippyJSON", condition: .when(platforms: [.iOS, .tvOS, .macOS])),
"SafeDITool",
]
),
// Core
.target(
name: "SafeDICore",
dependencies: [
.product(name: "Collections", package: "swift-collections"),
.product(name: "SwiftDiagnostics", package: "swift-syntax"),
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
]
),
.testTarget(
name: "SafeDICoreTests",
dependencies: ["SafeDICore"]
),
]
)