generated from StanfordBDHG/SwiftPackageTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bluetooth Device Pairing Infrastructure and Health Measurements (#1)
# Bluetooth Device Pairing Infrastructure and Health Measurements ## ♻️ Current situation & Problem This is the initial PR for SpeziDevices. It introduces three targets `SpeziDevices`, `SpeziDevicesUI` and `SpeziOmron`. SpeziDevices provides device pairing and health measurements functionality for `BluetoothDevice`s implemented using `SpeziBluetooth`. SpeziDevicesUI provides UI components on top of that, e.g., visualizing paired devices, editing their information, showing nearby pairable devices, showing new health measurements, etc. SpeziOmron provides reusable implementations of Omron Bluetooth peripherals like the SC150 weight scale and the BP5250 blood pressure cuff. ## ⚙️ Release Notes * Introduce `PairedDevices` module to manage paired devices. Discovering, pairing and connecting to them. * Introduce `HealthMeasurements` to manage health measurements from Bluetooth Devices and converting them to HealthKit samples. * Introduce SpeziOmron with reusable Omron device implementations. ## 📚 Documentation All targets contain DocC catalogs, documenting all their types. ## ✅ Testing This PR adds extensive unit testing of components and has an UI Test app to test UI components. ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
- Loading branch information
Showing
116 changed files
with
8,722 additions
and
757 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,137 @@ | ||
// swift-tools-version:5.9 | ||
|
||
// | ||
// This source file is part of the TemplatePackage open source project | ||
// This source file is part of the Stanford SpeziDevices open source project | ||
// | ||
// SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md) | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
import class Foundation.ProcessInfo | ||
import PackageDescription | ||
|
||
|
||
#if swift(<6) | ||
let swiftConcurrency: SwiftSetting = .enableExperimentalFeature("StrictConcurrency") | ||
#else | ||
let swiftConcurrency: SwiftSetting = .enableUpcomingFeature("StrictConcurrency") | ||
#endif | ||
|
||
|
||
let package = Package( | ||
name: "TemplatePackage", | ||
name: "SpeziDevices", | ||
defaultLocalization: "en", | ||
platforms: [ | ||
.iOS(.v17), | ||
.watchOS(.v10), | ||
.visionOS(.v1), | ||
.tvOS(.v17), | ||
.macOS(.v14) | ||
.visionOS(.v1) | ||
], | ||
products: [ | ||
.library(name: "TemplatePackage", targets: ["TemplatePackage"]) | ||
.library(name: "SpeziDevices", targets: ["SpeziDevices"]), | ||
.library(name: "SpeziDevicesUI", targets: ["SpeziDevicesUI"]), | ||
.library(name: "SpeziOmron", targets: ["SpeziOmron"]) | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/apple/swift-collections.git", from: "1.1.1"), | ||
.package(url: "https://github.com/StanfordSpezi/SpeziFoundation", from: "1.1.1"), | ||
.package(url: "https://github.com/StanfordSpezi/Spezi.git", from: "1.4.0"), | ||
.package(url: "https://github.com/StanfordSpezi/SpeziViews.git", from: "1.5.0"), | ||
.package(url: "https://github.com/StanfordSpezi/SpeziBluetooth", from: "2.0.0"), | ||
.package(url: "https://github.com/StanfordSpezi/SpeziNetworking", from: "2.1.1"), | ||
.package(url: "https://github.com/StanfordBDHG/XCTestExtensions.git", .upToNextMinor(from: "0.4.12")) | ||
] + swiftLintPackage(), | ||
targets: [ | ||
.target( | ||
name: "TemplatePackage" | ||
name: "SpeziDevices", | ||
dependencies: [ | ||
.product(name: "OrderedCollections", package: "swift-collections"), | ||
.product(name: "SpeziFoundation", package: "SpeziFoundation"), | ||
.product(name: "SpeziBluetooth", package: "SpeziBluetooth"), | ||
.product(name: "SpeziBluetoothServices", package: "SpeziBluetooth"), | ||
.product(name: "SpeziViews", package: "SpeziViews"), | ||
.product(name: "Spezi", package: "Spezi") | ||
], | ||
swiftSettings: [ | ||
swiftConcurrency | ||
], | ||
plugins: [] + swiftLintPlugin() | ||
), | ||
.target( | ||
name: "SpeziDevicesUI", | ||
dependencies: [ | ||
.target(name: "SpeziDevices"), | ||
.product(name: "SpeziViews", package: "SpeziViews"), | ||
.product(name: "SpeziValidation", package: "SpeziViews"), | ||
.product(name: "SpeziBluetooth", package: "SpeziBluetooth") | ||
], | ||
resources: [ | ||
.process("Resources") | ||
], | ||
swiftSettings: [ | ||
swiftConcurrency | ||
], | ||
plugins: [] + swiftLintPlugin() | ||
), | ||
.target( | ||
name: "SpeziOmron", | ||
dependencies: [ | ||
.target(name: "SpeziDevices"), | ||
.product(name: "SpeziBluetooth", package: "SpeziBluetooth"), | ||
.product(name: "SpeziBluetoothServices", package: "SpeziBluetooth") | ||
], | ||
resources: [ | ||
.process("Resources") | ||
], | ||
swiftSettings: [ | ||
swiftConcurrency | ||
], | ||
plugins: [] + swiftLintPlugin() | ||
), | ||
.testTarget( | ||
name: "SpeziDevicesTests", | ||
dependencies: [ | ||
.target(name: "SpeziDevices"), | ||
.product(name: "SpeziFoundation", package: "SpeziFoundation"), | ||
.product(name: "XCTSpezi", package: "Spezi"), | ||
.product(name: "SpeziBluetooth", package: "SpeziBluetooth"), | ||
.product(name: "SpeziBluetoothServices", package: "SpeziBluetooth"), | ||
.product(name: "XCTestExtensions", package: "XCTestExtensions") | ||
], | ||
swiftSettings: [ | ||
swiftConcurrency | ||
], | ||
plugins: [] + swiftLintPlugin() | ||
), | ||
.testTarget( | ||
name: "TemplatePackageTests", | ||
name: "SpeziOmronTests", | ||
dependencies: [ | ||
.target(name: "TemplatePackage") | ||
] | ||
.target(name: "SpeziOmron"), | ||
.product(name: "SpeziBluetooth", package: "SpeziBluetooth"), | ||
.product(name: "XCTByteCoding", package: "SpeziNetworking"), | ||
.product(name: "XCTestExtensions", package: "XCTestExtensions") | ||
], | ||
swiftSettings: [ | ||
swiftConcurrency | ||
], | ||
plugins: [] + swiftLintPlugin() | ||
) | ||
] | ||
) | ||
|
||
|
||
func swiftLintPlugin() -> [Target.PluginUsage] { | ||
// Fully quit Xcode and open again with `open --env SPEZI_DEVELOPMENT_SWIFTLINT /Applications/Xcode.app` | ||
if ProcessInfo.processInfo.environment["SPEZI_DEVELOPMENT_SWIFTLINT"] != nil { | ||
[.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")] | ||
} else { | ||
[] | ||
} | ||
} | ||
|
||
func swiftLintPackage() -> [PackageDescription.Package.Dependency] { | ||
if ProcessInfo.processInfo.environment["SPEZI_DEVELOPMENT_SWIFTLINT"] != nil { | ||
[.package(url: "https://github.com/realm/SwiftLint.git", .upToNextMinor(from: "0.55.1"))] | ||
} else { | ||
[] | ||
} | ||
} |
Oops, something went wrong.