Repository navigation
Expand file tree
/
Copy pathPackage.swift
More file actions
91 lines (82 loc) · 2.59 KB
/
Copy pathPackage.swift
File metadata and controls
91 lines (82 loc) · 2.59 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
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: 6.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "Melody",
platforms: [
.macOS(.v14),
.iOS(.v17),
.tvOS(.v26),
.visionOS(.v26)
],
products: [
.library(name: "Core", targets: ["Core"]),
.library(name: "Runtime", targets: ["Runtime"]),
.library(name: "Widgets", targets: ["Widgets"]),
.executable(name: "melody", targets: ["MelodyCLI"]),
],
dependencies: [
.package(url: "https://github.com/jpsim/Yams.git", from: "5.0.0"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0"),
.package(url: "https://github.com/swiftlang/swift-docc-plugin.git", from: "1.4.3"),
],
targets: [
// Lua 5.4 C library (vendored)
.target(
name: "CLua",
path: "Sources/CLua",
publicHeadersPath: "include",
cSettings: [
.define("LUA_USE_POSIX", .when(platforms: [.macOS, .linux])),
.define("LUA_USE_IOS", .when(platforms: [.iOS, .tvOS, .visionOS])),
.headerSearchPath("."),
]
),
// Core types shared between CLI and Runtime
.target(
name: "Core",
dependencies: ["Yams"],
path: "Sources/Core"
),
.target(
name: "Runtime",
dependencies: ["Core", "CLua"],
path: "Sources/Runtime",
swiftSettings: [
.define("MELODY_DEV", .when(configuration: .debug)),
]
),
.target(
name: "Widgets",
dependencies: ["Core", "CLua", "Yams"],
path: "Sources/Widgets"
),
// CLI executable
.executableTarget(
name: "MelodyCLI",
dependencies: [
"Core",
"Runtime",
"Yams",
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
path: "Sources/CLI",
resources: [.copy("Resources")],
swiftSettings: [
.swiftLanguageMode(.v5),
]
),
// Tests
.testTarget(
name: "CoreTests",
dependencies: ["Core"],
path: "Tests/CoreTests",
resources: [.copy("Fixtures")]
),
.testTarget(
name: "RuntimeTests",
dependencies: ["Runtime"],
path: "Tests/RuntimeTests"
),
]
)