forked from mikeger/XcodeSelectiveTesting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
91 lines (86 loc) · 3.21 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
// swift-tools-version: 5.6
import PackageDescription
let sharedSettings: [SwiftSetting] = [
.unsafeFlags(["-warnings-as-errors"]),
]
let products: [PackageDescription.Product] = [
.executable(
name: "xcode-selective-test",
targets: ["xcode-selective-test"]
),
.plugin(
name: "XcodeSelectiveTest",
targets: ["SelectiveTestingPlugin"]
),
]
let targets: [PackageDescription.Target] = [
.executableTarget(
name: "xcode-selective-test",
dependencies: ["SelectiveTestingCore",
.product(name: "ArgumentParser", package: "swift-argument-parser")],
swiftSettings: sharedSettings
),
.target(name: "SelectiveTestingCore",
dependencies: ["DependencyCalculator",
"TestConfigurator",
"Git",
"PathKit",
"Rainbow",
"Yams"],
swiftSettings: sharedSettings),
.target(name: "DependencyCalculator",
dependencies: ["Workspace", "PathKit", "SelectiveTestLogger", "Git"],
swiftSettings: sharedSettings),
.target(name: "TestConfigurator",
dependencies: ["Workspace", "PathKit", "SelectiveTestLogger"],
swiftSettings: sharedSettings),
.target(name: "Workspace",
dependencies: ["XcodeProj", "SelectiveTestLogger"],
swiftSettings: sharedSettings),
.target(name: "Git",
dependencies: ["SelectiveTestShell", "SelectiveTestLogger", "PathKit"],
swiftSettings: sharedSettings),
.target(name: "SelectiveTestLogger",
dependencies: ["Rainbow"],
swiftSettings: sharedSettings),
.target(name: "SelectiveTestShell",
swiftSettings: sharedSettings),
.testTarget(
name: "SelectiveTestingTests",
dependencies: ["xcode-selective-test", "PathKit"],
resources: [.copy("ExampleProject")]
),
.testTarget(
name: "DependencyCalculatorTests",
dependencies: ["DependencyCalculator", "Workspace", "PathKit", "SelectiveTestingCore"],
resources: [.copy("ExamplePackages")]
),
.plugin(
name: "SelectiveTestingPlugin",
capability: .command(
intent: .custom(
verb: "xcode-selective-test",
description: "Configure test plan for current changeset"
),
permissions: [
.writeToPackageDirectory(reason: "Update test plan file"),
]
),
dependencies: ["xcode-selective-test"]
),
]
let package = Package(
name: "XcodeSelectiveTesting",
platforms: [
.macOS(.v12),
],
products: products,
dependencies: [
.package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.20.0")),
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMajor(from: "1.2.0")),
.package(url: "https://github.com/kylef/PathKit.git", .upToNextMinor(from: "1.0.0")),
.package(url: "https://github.com/onevcat/Rainbow", .upToNextMajor(from: "4.0.0")),
.package(url: "https://github.com/jpsim/Yams.git", from: "5.0.5"),
],
targets: targets
)