Package.swift (2342B)
1 // swift-tools-version: 5.9 2 // SPDX-License-Identifier: GPL-2.0-only 3 import PackageDescription 4 5 let package = Package( 6 name: "DiveKit", 7 platforms: [.iOS(.v17), .macOS(.v14)], 8 products: [ 9 .library(name: "GitLite", targets: ["GitLite"]), 10 .library(name: "SubsurfaceLog", targets: ["SubsurfaceLog"]), 11 .library(name: "DiveComputerKit", targets: ["DiveComputerKit"]), 12 .library(name: "DivePlanner", targets: ["DivePlanner"]), 13 ], 14 targets: [ 15 // Minimal git client in pure Swift: objects, packfiles, smart HTTP protocol. 16 .target(name: "GitLite", linkerSettings: [.linkedLibrary("z")]), 17 // Subsurface logbook format (git storage): reading, editing, sync. 18 .target(name: "SubsurfaceLog", dependencies: ["GitLite"]), 19 // libdivecomputer (LGPL-2.1), vendored unmodified: protocols and parsers of dive computers. 20 .target(name: "CLibDiveComputer", exclude: ["README.md", "COPYING.LGPL-2.1"], 21 cSettings: [.define("HAVE_PTHREAD_H"), .define("ENABLE_LOGGING"), .unsafeFlags(["-w"])]), 22 // Swift layer over libdivecomputer: device list, download over a caller-provided transport, parsing. 23 // Small C shims: libdivecomputer macros that Swift cannot import. 24 .target(name: "CDiveComputerShims", dependencies: ["CLibDiveComputer"]), 25 .target(name: "DiveComputerKit", dependencies: ["CLibDiveComputer", "CDiveComputerShims", "SubsurfaceLog"]), 26 // Gas calculations and decompression planning (Bühlmann ZHL-16C with gradient factors). No dependency. 27 .target(name: "DivePlanner"), 28 // Test support: drives the real command-line git (macOS only). 29 .target(name: "GitTestSupport", dependencies: ["GitLite"]), 30 // Command-line tool (macOS): import a file into a cloud logbook, list a logbook. 31 .executableTarget(name: "divelog-cli", dependencies: ["SubsurfaceLog", "GitLite"]), 32 .testTarget(name: "GitLiteTests", dependencies: ["GitLite", "GitTestSupport"]), 33 .testTarget(name: "SubsurfaceLogTests", dependencies: ["SubsurfaceLog", "GitLite", "GitTestSupport"]), 34 .testTarget(name: "DivePlannerTests", dependencies: ["DivePlanner"]), 35 .testTarget(name: "DiveComputerKitTests", dependencies: ["DiveComputerKit", "SubsurfaceLog", "GitTestSupport"]), 36 ] 37 )