Updated the target and test target definitions in the Package file.

This commit is contained in:
2025-09-17 19:14:34 +02:00
parent bb60fd8309
commit 1c4f98973b
3 changed files with 29 additions and 12 deletions
+27 -11
View File
@@ -1,26 +1,42 @@
// swift-tools-version: 6.2 // swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription import PackageDescription
let package = Package( let package = Package(
name: "hummingbird-docc-middleware", name: DocCMiddleware.package,
platforms: [
.iOS(.v17),
.macCatalyst(.v17),
.macOS(.v14),
.tvOS(.v17),
.visionOS(.v1)
],
products: [ products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library( .library(
name: "hummingbird-docc-middleware", name: DocCMiddleware.package,
targets: ["hummingbird-docc-middleware"] targets: [DocCMiddleware.target]
), ),
], ],
targets: [ targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target( .target(
name: "hummingbird-docc-middleware" name: DocCMiddleware.target,
path: "Sources/DocCMiddleware",
swiftSettings: [.enableExperimentalFeature("StrictConcurrency=complete")]
), ),
.testTarget( .testTarget(
name: "hummingbird-docc-middlewareTests", name: DocCMiddleware.test,
dependencies: ["hummingbird-docc-middleware"] dependencies: [
.byName(name: DocCMiddleware.target)
],
path: "Tests/DocCMiddleware"
), ),
] ]
) )
// MARK: - Constants
enum DocCMiddleware {
static let package = "hummingbird-docc-middleware"
static let target = "DocCMiddleware"
static let test = "\(DocCMiddleware.target)Tests"
}
@@ -1,5 +1,6 @@
import Testing import Testing
@testable import hummingbird_docc_middleware
@testable import DocCMiddleware
@Test func example() async throws { @Test func example() async throws {
// Write your test here and use APIs like `#expect(...)` to check expected conditions. // Write your test here and use APIs like `#expect(...)` to check expected conditions.