-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
108 lines (104 loc) · 3.16 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
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let isDevelop = true
let package = Package(
name: "BuildConfig.swift",
platforms: [.macOS(.v14)],
products: [
.executable(
name: "buildconfigswift",
targets: ["buildconfigswift"]
),
.plugin(
name: "BuildConfigSwiftGenerate",
targets: ["BuildConfigSwiftGenerate"]
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"),
.package(url: "https://github.com/behrang/YamlSwift.git", from: "3.4.4"),
.package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.36.0"),
.package(url: "https://github.com/kylef/PathKit.git", from: "1.0.1"),
.package(url: "https://github.com/SwiftGen/StencilSwiftKit.git", from: "2.10.1"),
.package(url: "https://github.com/Kuniwak/MirrorDiffKit.git", from: "6.0.0"),
],
targets: [
.executableTarget(
name: "buildconfigswift",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"Core"
]
),
.target(
name: "Core",
dependencies: [
"Common",
"Parser",
"Generator"
]
),
.target(
name: "Common",
dependencies: [
"PathKit",
.product(name: "SourceKittenFramework", package: "SourceKitten"),
]
),
.target(
name: "Parser",
dependencies: [
"Common",
.product(name: "Yaml", package: "YamlSwift"),
]
),
.target(
name: "Generator",
dependencies: [
"Common",
"StencilSwiftKit"
]
),
.testTarget(
name: "buildconfigswiftTests",
dependencies: [
"buildconfigswift",
// "MirrorDiffKit"
],
resources: [.copy("Resources")]
),
.testTarget(
name: "ParserTests",
dependencies: [
"Parser",
"MirrorDiffKit"
],
resources: [.copy("Resources")]
),
.testTarget(
name: "GeneratorTests",
dependencies: [
"Generator",
"MirrorDiffKit"
],
resources: [.copy("Resources")]
),
.plugin(
name: "BuildConfigSwiftGenerate",
capability: .buildTool(),
dependencies: ["buildconfigswift"]
),
],
swiftLanguageVersions: [.v5]
)
if isDevelop {
package.dependencies += [
.package(url: "https://github.com/realm/SwiftLint.git", from: "0.55.0"),
]
package.targets.filter { $0.type == .regular }.forEach { target in
target.plugins = (target.plugins ?? []) + [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
]
}
}