-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
51 lines (44 loc) · 1.31 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
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
/// A module in the package.
struct Module {
/// The name of the module.
let name: String
/// The names of the modules that this module depends on.
let dependencies: [String]
}
/// The modules that are part of the package.
let modules: [Module] = [
.init(name: "CCompat", dependencies: []),
.init(name: "Linking", dependencies: []),
.init(name: "MachPort", dependencies: ["CCompat", "Linking"]),
.init(name: "MachMsg", dependencies: ["CCompat", "Linking", "MachPort"]),
]
/// The name of the package.
let name = "Kass"
/// The targets for the modules.
let moduleTargets = modules.map {
Target.target(
name: $0.name,
dependencies: $0.dependencies.map { Target.Dependency.target(name: $0) },
path: "Sources/\($0.name)"
)
}
/// The products for the modules.
let moduleProducts = modules.map {
Product.library(
name: $0.name,
targets: [$0.name])
}
let package = Package(
name: name,
platforms: [
.macOS(.v14)
],
products: moduleProducts,
dependencies: [
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.4.2")
],
targets: moduleTargets
)