Repository navigation
Expand file tree
/
Copy pathPackage.swift
More file actions
80 lines (79 loc) · 3.68 KB
/
Copy pathPackage.swift
File metadata and controls
80 lines (79 loc) · 3.68 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
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "Belfry",
platforms: [
.macOS(.v14),
.iOS(.v17),
],
dependencies: [
// libghostty surface (default backend), via the Termini SwiftUI wrapper.
// Vendored locally (see vendor/Termini/LOCAL_PATCHES.md) so we can patch
// its NSView resize path; it bundles a prebuilt GhosttyKit.xcframework
// (no Zig toolchain needed).
.package(path: "vendor/Termini"),
// Stable fallback backend (pure Swift, no xcframework).
.package(
url: "https://github.com/migueldeicaza/SwiftTerm.git",
from: "1.13.0"
),
// Auto-updates for the distributed .app (macOS only; the framework is
// embedded + re-signed by scripts/make_app.sh).
.package(
url: "https://github.com/sparkle-project/Sparkle",
from: "2.9.3"
),
// Syntax highlighting for the file pane's code previews (highlight.js
// via JavaScriptCore — works on both platforms, no network). Vendored
// (see vendor/Highlightr/LOCAL_PATCHES.md): upstream's Bundle.module
// lookup fatalErrors in the swift-build-packaged .app, which crashed
// every code preview in shipped builds.
.package(path: "vendor/Highlightr"),
],
targets: [
// The macOS app. `Sources/BelfryKit` is the platform-neutral core,
// compiled directly into each app target (this one via `sources`; the
// iOS app via its xcodegen target) so both stay a single module and
// the shared code needs no access-control ceremony.
.executableTarget(
name: "Belfry",
dependencies: [
.product(name: "Termini", package: "Termini"),
.product(name: "SwiftTerm", package: "SwiftTerm"),
.product(name: "Sparkle", package: "Sparkle"),
.product(name: "Highlightr", package: "Highlightr"),
],
path: "Sources",
exclude: ["BelfryAskpass", "BelfryiOS"],
sources: ["Belfry", "BelfryKit"],
// Swift 5 language mode: avoids strict-concurrency churn while we
// bring the app up; can tighten to .v6 later.
swiftSettings: [.swiftLanguageMode(.v5)]
),
// Tiny GUI helper ssh runs (via SSH_ASKPASS) to prompt for a password /
// passphrase, since the control connection has no visible terminal.
.executableTarget(
name: "belfry-askpass",
path: "Sources/BelfryAskpass",
swiftSettings: [.swiftLanguageMode(.v5)]
),
// Unit tests (macOS host). Depends on the app target so `@testable import
// Belfry` can reach internal seams like `LaunchdTmux.runOutcome` and
// `RemoteTmux.prelude` (Sources/BelfryKit compiles into this module too).
.testTarget(
name: "BelfryTests",
dependencies: ["Belfry"],
path: "Tests/BelfryTests",
swiftSettings: [.swiftLanguageMode(.v5)],
// The app target links Sparkle.framework (normally embedded into the
// .app by make_app.sh). A bare `swift test` bundle has no such embed,
// and SIP strips DYLD_FRAMEWORK_PATH from Xcode's signed test helper,
// so point the loader at the framework SwiftPM already built alongside
// the xctest bundle: <build>/Debug/Sparkle.framework, three levels up
// from the test binary in …/BelfryTests.xctest/Contents/MacOS/.
linkerSettings: [.unsafeFlags([
"-Xlinker", "-rpath", "-Xlinker", "@loader_path/../../..",
])]
),
]
)