mirror of
https://github.com/apple/swift-log
synced 2026-11-24 03:47:49 +00:00
### Motivation:
In the latest release (1.9.0) the package manifest was split for Swift
6.0 and 6.1+. The 6.0 manifest lost the `InMemoryLogging` library
product, causing API breakage for adopters using Swift 6.0:
```diff
% diff -u <(git show 1.8.0:Package.swift) <(git show 1.9.0:Package@swift-6.0.swift)
--- /dev/fd/63 2026-01-19 10:30:21
+++ /dev/fd/62 2026-01-19 10:30:21
@@ -18,25 +18,16 @@
let package = Package(
name: "swift-log",
products: [
- .library(name: "Logging", targets: ["Logging"]),
- .library(name: "InMemoryLogging", targets: ["InMemoryLogging"]),
+ .library(name: "Logging", targets: ["Logging"])
],
targets: [
.target(
name: "Logging",
dependencies: []
),
- .target(
- name: "InMemoryLogging",
- dependencies: ["Logging"]
- ),
.testTarget(
name: "LoggingTests",
dependencies: ["Logging"]
- ),
- .testTarget(
- name: "InMemoryLoggingTests",
- dependencies: ["InMemoryLogging", "Logging"]
),
]
)
```
### Modifications:
Reinstate InMemoryLogging product in Swift 6.0 manifest
### Result:
Adopters using `InMemoryLogging` on Swift 6.0 are unbroken.
### Related issues:
Fixes #402
65 lines
2.0 KiB
Swift
65 lines
2.0 KiB
Swift
// swift-tools-version:6.0
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift Logging API open source project
|
|
//
|
|
// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of Swift Logging API project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
import PackageDescription
|
|
|
|
let package = Package(
|
|
name: "swift-log",
|
|
products: [
|
|
.library(name: "Logging", targets: ["Logging"]),
|
|
.library(name: "InMemoryLogging", targets: ["InMemoryLogging"]),
|
|
],
|
|
targets: [
|
|
.target(
|
|
name: "Logging",
|
|
dependencies: []
|
|
),
|
|
.target(
|
|
name: "InMemoryLogging",
|
|
dependencies: ["Logging"]
|
|
),
|
|
.testTarget(
|
|
name: "LoggingTests",
|
|
dependencies: ["Logging"]
|
|
),
|
|
.testTarget(
|
|
name: "InMemoryLoggingTests",
|
|
dependencies: ["InMemoryLogging", "Logging"]
|
|
),
|
|
]
|
|
)
|
|
|
|
for target in package.targets {
|
|
var settings = target.swiftSettings ?? []
|
|
settings.append(.enableExperimentalFeature("StrictConcurrency=complete"))
|
|
target.swiftSettings = settings
|
|
}
|
|
|
|
// --- STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- //
|
|
for target in package.targets {
|
|
switch target.type {
|
|
case .regular, .test, .executable:
|
|
var settings = target.swiftSettings ?? []
|
|
// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md
|
|
settings.append(.enableUpcomingFeature("MemberImportVisibility"))
|
|
target.swiftSettings = settings
|
|
case .macro, .plugin, .system, .binary:
|
|
() // not applicable
|
|
@unknown default:
|
|
() // we don't know what to do here, do nothing
|
|
}
|
|
}
|
|
// --- END: STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- //
|