-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathPackage.swift
105 lines (103 loc) · 3.57 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
// swift-tools-version:5.10
import PackageDescription
let package = Package(
name: "swiftly",
platforms: [
.macOS(.v13),
],
products: [
.executable(
name: "swiftly",
targets: ["Swiftly"]
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.3.0"),
.package(url: "https://github.com/swift-server/async-http-client", from: "1.21.2"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.64.0"),
.package(url: "https://github.com/apple/swift-tools-support-core.git", from: "0.7.2"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"),
// This dependency provides the correct version of the formatter so that you can run `swift run swiftformat Package.swift Plugins/ Sources/ Tests/`
.package(url: "https://github.com/nicklockwood/SwiftFormat", exact: "0.49.18"),
],
targets: [
.executableTarget(
name: "Swiftly",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.target(name: "SwiftlyCore"),
.target(name: "LinuxPlatform", condition: .when(platforms: [.linux])),
.target(name: "MacOSPlatform", condition: .when(platforms: [.macOS])),
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
]
),
.target(
name: "SwiftlyCore",
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
]
),
.target(
name: "SwiftlyDocs",
path: "Documentation"
),
.plugin(
name: "GenerateDocsReference",
capability: .command(
intent: .custom(
verb: "generate-docs-reference",
description: "Generate a documentation reference for swiftly."
),
permissions: [
.writeToPackageDirectory(reason: "This command generates documentation."),
]
),
dependencies: ["generate-docs-reference"]
),
.executableTarget(
name: "generate-docs-reference",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
path: "Tools/generate-docs-reference"
),
.executableTarget(
name: "build-swiftly-release",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
path: "Tools/build-swiftly-release"
),
.target(
name: "LinuxPlatform",
dependencies: [
"SwiftlyCore",
"CLibArchive",
],
linkerSettings: [
.linkedLibrary("z"),
]
),
.target(
name: "MacOSPlatform",
dependencies: [
"SwiftlyCore",
]
),
.systemLibrary(
name: "CLibArchive",
pkgConfig: "libarchive",
providers: [
.apt(["libarchive-dev"]),
]
),
.testTarget(
name: "SwiftlyTests",
dependencies: ["Swiftly"],
resources: [
.embedInCode("mock-signing-key-private.pgp"),
]
),
]
)