-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPackage.swift
More file actions
88 lines (87 loc) · 2.75 KB
/
Copy pathPackage.swift
File metadata and controls
88 lines (87 loc) · 2.75 KB
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
// swift-tools-version: 5.9
import PackageDescription
import CompilerPluginSupport
let package = Package(
name: "InstantDB",
platforms: [
.iOS(.v15),
.macOS(.v10_15),
.tvOS(.v15),
.watchOS(.v8),
],
products: [
.library(
name: "InstantDB",
targets: ["InstantDB"]
),
.plugin(
name: "GenerateSchemaPlugin",
targets: ["GenerateSchemaPlugin"]
),
],
dependencies: [
.package(url: "https://github.com/google/GoogleSignIn-iOS", from: "9.0.0"),
.package(url: "https://github.com/swiftlang/swift-syntax.git", "600.0.0"..<"606.0.0"),
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.3.2"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.3.0"),
.package(url: "https://github.com/groue/GRDB.swift", from: "7.0.0")
],
targets: [
.macro(
name: "InstantDBMacros",
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")
]
),
.target(
name: "InstantDB",
dependencies: [
"InstantDBMacros",
.product(name: "GoogleSignIn", package: "GoogleSignIn-iOS", condition: .when(platforms: [.iOS, .macOS])),
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "GRDB", package: "GRDB.swift")
],
path: "Sources/InstantDB"
),
.testTarget(
name: "InstantDBTests",
dependencies: ["InstantDB"],
path: "Tests/InstantDBTests"
),
.testTarget(
name: "InstantDBMacrosTests",
dependencies: [
"InstantDBMacros",
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax")
]
),
.executableTarget(
name: "instant-schema",
dependencies: [
"InstantDB",
.product(name: "ArgumentParser", package: "swift-argument-parser")
],
path: "Sources/InstantSchemaCLI"
),
.executableTarget(
name: "InstantSchemaGenerator",
dependencies: [
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftParser", package: "swift-syntax")
],
path: "Sources/InstantSchemaGenerator"
),
.plugin(
name: "GenerateSchemaPlugin",
capability: .command(
intent: .custom(verb: "generate-schema", description: "Generate instant.schema.json from Swift schema"),
permissions: [.writeToPackageDirectory(reason: "To write instant.schema.json")]
),
dependencies: ["InstantSchemaGenerator"],
path: "Plugins/GenerateSchemaPlugin"
)
]
)