Repository Public License
1// swift-tools-version: 6.02// ORIX Navigator — NavigatorKit. One package, many targets, one-way dependencies:3// NavigatorCore ← Persistence ← engines ← NavigatorUI ← apps. LunarDesign and Diagnostics depend on nothing.4import PackageDescription56let swift: [SwiftSetting] = [.swiftLanguageMode(.v6)]78func lib(_ name: String, _ deps: [Target.Dependency] = [], resources: [Resource]? = nil) -> Target {9 .target(name: name, dependencies: deps, path: "Sources/\(name)", resources: resources, swiftSettings: swift)10}11func tests(_ name: String, _ extra: [Target.Dependency] = [], resources: [Resource]? = nil) -> Target {12 .testTarget(name: "\(name)Tests", dependencies: [.target(name: name), "TestSupport"] + extra,13 path: "Tests/\(name)Tests", resources: resources, swiftSettings: swift)14}1516let modules = ["NavigatorCore", "Persistence", "LunarDesign", "WebRuntime", "OrbitEngine", "PrivacyEngine", "DownloadEngine", "MemoryEngine", "AgentRuntime", "ProviderKit", "FlowEngine", "CanvasEngine", "SyncEngine", "Diagnostics", "NavigatorUI",17 "FeatureOrbit", "FeatureCommand", "FeaturePrivacy", "FeatureReading", "FeatureAgent", "FeatureStudio", "NavigatorFeatures"]1819// A feature target may import the shell and every engine below it.20let featureDependencies: [Target.Dependency] = [21 "NavigatorUI", "NavigatorCore", "Persistence", "LunarDesign", "WebRuntime", "OrbitEngine", "PrivacyEngine",22 "DownloadEngine", "MemoryEngine", "AgentRuntime", "ProviderKit", "FlowEngine", "CanvasEngine", "SyncEngine",23 "Diagnostics",24]2526let package = Package(27 name: "NavigatorKit",28 defaultLocalization: "en",29 platforms: [.macOS(.v15), .iOS(.v18)],30 // One umbrella product for the apps, plus one product per module so each can be built alone (per-module schemes).31 products: [.library(name: "NavigatorKit", targets: modules)] + modules.map { .library(name: $0, targets: [$0]) },32 // No third-party dependency: SQLite comes from the system (libsqlite3), see docs/adr/0002.33 dependencies: [],34 targets: [35 lib("NavigatorCore"),36 lib("Diagnostics"),37 lib("LunarDesign"),38 lib("Persistence", ["NavigatorCore", "Diagnostics"]),39 lib("WebRuntime", ["NavigatorCore", "Diagnostics"], resources: [.process("Resources")]),40 lib("PrivacyEngine", ["NavigatorCore", "Persistence", "Diagnostics"], resources: [.process("Resources")]),41 lib("OrbitEngine", ["NavigatorCore", "Persistence"]),42 lib("DownloadEngine", ["NavigatorCore", "Persistence", "Diagnostics"]),43 lib("MemoryEngine", ["NavigatorCore", "Persistence"]),44 lib("ProviderKit", ["NavigatorCore", "Diagnostics"]),45 lib("AgentRuntime", ["NavigatorCore", "ProviderKit", "Persistence", "Diagnostics"]),46 lib("FlowEngine", ["NavigatorCore", "Persistence"]),47 lib("CanvasEngine", ["NavigatorCore", "Persistence"]),48 lib("SyncEngine", ["NavigatorCore", "Persistence", "Diagnostics"]),49 lib("TestSupport", ["NavigatorCore"]),50 lib("NavigatorUI", [51 "NavigatorCore", "Persistence", "LunarDesign", "WebRuntime", "OrbitEngine", "PrivacyEngine",52 "DownloadEngine", "MemoryEngine", "AgentRuntime", "ProviderKit", "FlowEngine", "CanvasEngine",53 "SyncEngine", "Diagnostics",54 ], resources: [.process("Resources")]),5556 // Signature modules: one UI target per feature group. Each depends on the shell (NavigatorUI) and plugs in57 // through its feature registry; NavigatorFeatures registers them all for the apps.58 lib("FeatureOrbit", featureDependencies, resources: [.process("Resources")]),59 lib("FeatureCommand", featureDependencies, resources: [.process("Resources")]),60 lib("FeaturePrivacy", featureDependencies, resources: [.process("Resources")]),61 lib("FeatureReading", featureDependencies, resources: [.process("Resources")]),62 lib("FeatureAgent", featureDependencies, resources: [.process("Resources")]),63 lib("FeatureStudio", featureDependencies, resources: [.process("Resources")]),64 lib("NavigatorFeatures", ["NavigatorUI", "FeatureOrbit", "FeatureCommand", "FeaturePrivacy", "FeatureReading",65 "FeatureAgent", "FeatureStudio"]),6667 tests("NavigatorCore"),68 tests("Persistence"),69 tests("LunarDesign"),70 tests("WebRuntime"),71 tests("OrbitEngine"),72 tests("PrivacyEngine"),73 tests("DownloadEngine"),74 tests("MemoryEngine"),75 tests("ProviderKit"),76 tests("AgentRuntime"),77 tests("FlowEngine"),78 tests("CanvasEngine"),79 tests("SyncEngine"),80 tests("Diagnostics"),81 tests("NavigatorUI"),82 tests("FeatureOrbit"),83 tests("FeatureCommand"),84 tests("FeaturePrivacy"),85 tests("FeatureReading"),86 tests("FeatureAgent"),87 tests("FeatureStudio"),88 tests("NavigatorFeatures"),89 ]90)91