-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
69 lines (67 loc) · 2.33 KB
/
Copy pathPackage.swift
File metadata and controls
69 lines (67 loc) · 2.33 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
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "SwiftStyleGuide",
platforms: [.macOS(.v13)],
products: [
.executable(name: "swiftstyle", targets: ["swiftstyle"]),
.plugin(name: "FormatSwift", targets: ["FormatSwiftCommand"]),
.plugin(name: "FormatSwiftBuildPlugin", targets: ["FormatSwiftBuildPlugin"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.3")
],
targets: [
.executableTarget(
name: "swiftstyle",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser")
],
resources: [
.process("Resources")
]
),
.plugin(
name: "FormatSwiftCommand",
capability: .command(
intent: .custom(
verb: "format",
description: "Formats Swift source files according to the Swift Style Guide"
),
permissions: [
.writeToPackageDirectory(reason: "Format Swift source files")
]
),
dependencies: [
.target(name: "SwiftStyleBinary", condition: .when(platforms: [.macOS])),
.target(name: "SwiftLintBinary"),
.target(name: "swiftformat")
]
),
.plugin(
name: "FormatSwiftBuildPlugin",
capability: .buildTool(),
dependencies: [
.target(name: "SwiftStyleBinary", condition: .when(platforms: [.macOS])),
.target(name: "SwiftLintBinary"),
.target(name: "swiftformat")
]
),
.binaryTarget(
name: "swiftformat",
url: "https://github.com/nicklockwood/SwiftFormat/releases/download/0.51.2/swiftformat.artifactbundle.zip",
checksum: "d8954ff40cf39d8e343eabd83e730bd8c85a27463e356e66cd51808ca3badcc7"
),
.binaryTarget(
name: "SwiftLintBinary",
url: "https://github.com/realm/SwiftLint/releases/download/0.50.3/SwiftLintBinary-macos.artifactbundle.zip",
checksum: "abe7c0bb505d26c232b565c3b1b4a01a8d1a38d86846e788c4d02f0b1042a904"
),
.binaryTarget(
name: "SwiftStyleBinary",
url: "https://github.com/andrelouw/SwiftStyleGuide/releases/download/0.0.10/swiftstyle.artifactbundle.zip",
checksum: "9d98b277a1319b3537913f76d13ae4df43c013a8ffe57631ec30bf464324d584"
)
]
)