The station's packages
Sources/Shared originally held everything the apps shared: models, providers'
clients, settings, views, and players. It was first split into separate SwiftPM
packages by layer (so a Swift server could build on Linux without views:
history/linux-server.md), and later consolidated into
a single multi-target manifest at Packages/Package.swift (Swift 6.0, .macOS(.v14),
.tvOS(.v17), .iOS(.v17)) once Antenna Tower moved to Go (tower/).
Consolidated package layout (Packages/Package.swift) #
| Target | What's in it | Platforms |
|---|---|---|
RetroLineup |
lineup rules (DialNumbers), IPTV parsing, playback diagnostics, OTLP redaction (Redact, OTLPLogs), VOD models & store |
macOS, tvOS, iOS |
RetroSports |
sport rules (Sports, SportJudge, Schedules, EventParsing, Games, Showings). Linked only by StationJobs, ManagerUI, check-sports, and tests — never a screen app |
macOS, tvOS, iOS |
check-sports |
CLI executable checking sport rules and Jev against docs/sport-examples.json and settled labels (just check-sports) |
macOS |
RelayKit |
relay HTTP client (RelayFinder / RelayClient types for /v1/hello, feeds, VOD, logs) |
macOS, tvOS, iOS |
RelayAdmin |
admin API protocol (AdminClient), three-way merge (AdminMerge), R2 mirror formats & CryptoKit sealing (Mirror, R2) |
macOS, tvOS, iOS |
RemoteControl |
phone remote HTTP server (ControlServer) and client (ControlClient) |
macOS, tvOS, iOS |
StationCore |
non-UI station state & services: LineupModel, Channel, ChannelModules, SettingsSync, RemoteLink, Telemetry, StationTheme kind, profiles, providers, guide, On Demand catalog/jobs |
macOS, tvOS, iOS |
StationJobs |
Manager-side job helpers (SportSettings, OnDemandTagger, IPTVChannelSports) |
macOS, tvOS, iOS |
Players |
OnDemandEngine (AVEngine, VLCEngine), VLCSurface, Subtitles: the only target importing VLCKitSPM |
macOS, tvOS, iOS |
StationUI |
broadcast views, StationTheme UI roles, StationModel, RootView, TV Guide, channel screens, InviteOpening |
macOS, tvOS, iOS |
PhoneUI |
iOS/iPadOS touch player, guide, remote, and manager tabs (PhoneRoot, PhoneOnDemand, PhoneRemote, etc.) |
macOS, tvOS, iOS |
ManagerUI |
Rabbit Ears Manager app windows and panes (ManagerApp, ManagerNavigation, ServerPane, EventsPane, IPTVPane, etc.) |
macOS |
Tests live under Packages/Tests/ (RetroLineupTests, RelayAdminTests,
RemoteControlTests, StationTests) and run together via just test
(swift test --package-path Packages).
The app folders under Sources/ hold only thin @main entry points, plists,
and assets:
Sources/TVApp/(RetroTVApp.swift) — shared byRetroTV-macOSandRetroTV-tvOSSources/Manager/(ManagerMain.swift) —RetroTV-ManagerSources/iOS/(PhoneApp.swift) —RetroTV-iOS, delegating UI toPhoneUI
Rules #
- Nothing in
StationCoredraws. No SwiftUI, AVKit, VLCKit, MapKit or SceneKit. AppKit and UIKit appear only behind#if os(…), for lifecycle notifications. - A model doesn't live in its view's file. When a type is both what a thing
is and how it looks, split it. A channel module is a
ModuleDefinition(inStationCore'sStation/ModuleDefinitions.swift) and aChannelModulescreen (inStationUI'sStation/ChannelModules.swift);StationThemeis the enum/key inStationCore/Core/StationThemeKind.swift, with its UI roles inStationUI/Core/StationTheme.swift. See channel-modules.md. - No compile flags across packages. Targets ask
AppKind.current(.playeror.manager, set inSources/entry points) instead of#if MANAGER. packagevspublicvisibility. Targets insidePackages/Package.swiftshare internal package APIs viapackageaccess, keepingpublicrestricted to what the@mainapp shells inSources/and cross-target boundaries actually use (withSendabledeclared on public value types). Tests reach internals with@testable import.
History & retired shims #
Earlier stages split the codebase across six separate SwiftPM packages (RetroLineup,
RetroRelay, Station, StationUI, Players, ManagerUI) and included a Swift
server target (StationServer, Sources/AntennaTower), standalone Manager job loops,
Linux compatibility shims (CSQLite, LinuxLogger.swift, NoCloud.swift,
swift-crypto, just linux-check), and access-rewriting scripts (scripts/publicize.py,
scripts/fix-access-errors.py). Once Antenna Tower moved to Go (tower/) and the
Manager became a pure remote client, those separate manifests, server targets, Linux
shims, and scripts were retired and the remaining Swift targets consolidated into
Packages/Package.swift.
just check-tvos emits each tvOS-facing Swift module from Packages/Sources/
with -swift-version 6 and type-checks Sources/TVApp/ against the tvOS SDK.
Phin Tech docs
Rabbit Ears Manager in the store →