-
Notifications
You must be signed in to change notification settings - Fork 329
/
Copy pathPackage.swift
54 lines (49 loc) · 1.76 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
// swift-tools-version: 5.6
import PackageDescription
let package = Package(
name: "AirbnbSwift",
platforms: [.macOS(.v10_13)],
products: [
.plugin(name: "FormatSwift", targets: ["FormatSwift"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.3"),
],
targets: [
.plugin(
name: "FormatSwift",
capability: .command(
intent: .custom(
verb: "format",
description: "Formats Swift source files according to the Airbnb Swift Style Guide"),
permissions: [
.writeToPackageDirectory(reason: "Format Swift source files"),
]),
dependencies: [
"AirbnbSwiftFormatTool",
"SwiftFormat",
"SwiftLintBinary",
]),
.executableTarget(
name: "AirbnbSwiftFormatTool",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
resources: [
.process("airbnb.swiftformat"),
.process("swiftlint.yml"),
]),
.binaryTarget(
name: "SwiftFormat",
url: "https://github.com/calda/SwiftFormat/releases/download/0.51-beta-3/SwiftFormat.artifactbundle.zip",
checksum: "4b0516d911258b55c3960949f4a516a246f35a1dc7647a6440c66e1f1fe1a32e"),
.binaryTarget(
name: "SwiftLintBinary",
url: "https://github.com/realm/SwiftLint/releases/download/0.48.0/SwiftLintBinary-macos.artifactbundle.zip",
checksum: "9c255e797260054296f9e4e4cd7e1339a15093d75f7c4227b9568d63edddba50"),
])
// Emit an error on Linux, so Swift Package Manager's platform support detection doesn't say this package supports Linux
// https://github.com/airbnb/swift/discussions/197#discussioncomment-4055303
#if os(Linux)
#error("Linux is currently not supported")
#endif