-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathPackage.swift
115 lines (103 loc) · 2.95 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
111
112
113
114
115
// swift-tools-version: 5.9
import PackageDescription
import CompilerPluginSupport
let package = Package(
name: "extensions-swift-tools",
platforms: [
.macOS(.v12)
],
products: [
.library(
name: "RaycastSwiftMacros",
targets: ["RaycastSwiftMacros"]
),
.plugin(
name: "RaycastSwiftPlugin",
targets: ["RaycastSwiftPlugin"]
),
.plugin(
name: "RaycastTypeScriptPlugin",
targets: ["RaycastTypeScriptPlugin"]
)
],
dependencies: [
.package(url: "https://github.com/apple/swift-syntax.git", from: "509.1.1"),
],
targets: [
// Swift macros
.target(
name: "RaycastSwiftMacros",
dependencies: [
.target(name: "MacrosImplementation")
],
path: "SwiftMacros/Interface"
// swiftSettings: .swiftSettings
),
.testTarget(
name: "RaycastSwiftMacrosTests",
dependencies: [
.target(name: "RaycastSwiftMacros"),
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax")
],
path: "SwiftMacros/Tests"
// swiftSettings: .swiftSettings
),
.macro(
name: "MacrosImplementation",
dependencies: [
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
],
path: "SwiftMacros/Implementation",
packageAccess: true
// swiftSettings: .swiftSettings
),
// Swift plugin
.plugin(
name: "RaycastSwiftPlugin",
capability: .buildTool(),
dependencies: [
.target(name: "SwiftCodeGenerator")
],
path: "SwiftPlugin/Interface"
),
.executableTarget(
name: "SwiftCodeGenerator",
path: "SwiftPlugin/Implementation"
// swiftSettings: .swiftSettings
),
// TypeScript plugin
.plugin(
name: "RaycastTypeScriptPlugin",
capability: .buildTool(),
dependencies: [
.target(name: "TypeScriptCodeGenerator")
],
path: "TypeScriptPlugin/Interface"
),
.executableTarget(
name: "TypeScriptCodeGenerator",
dependencies: [
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftParser", package: "swift-syntax"),
],
path: "TypeScriptPlugin/Implementation"
// swiftSettings: .swiftSettings
)
],
swiftLanguageVersions: [.v5]
)
// private extension Array<SwiftSetting> {
// static var swiftSettings: Self {
// [
// .enableUpcomingFeature("ConciseMagicFile"),
// .enableUpcomingFeature("DisableOutwardActorInference"),
// .enableUpcomingFeature("ExistentialAny"),
// .enableUpcomingFeature("ForwardTrailingClosures"),
// .enableUpcomingFeature("StrictConcurrency"),
// .unsafeFlags(["-warn-concurrency", "-enable-actor-data-race-checks"]),
// ]
// }
// }