From 02a6f6e33f910b17e23120086ad7808b2c3289d2 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Thu, 12 Dec 2024 09:05:35 +0000 Subject: [PATCH] Enable MemberImportVisibility check on all targets (#107) Enable MemberImportVisibility check on all targets. Use a standard string header and footer to bracket the new block for ease of updating in the future with scripts. --- Package.swift | 11 +++++++++++ Sources/SWIM/SWIMInstance.swift | 1 + Sources/SWIMNIOExample/SWIMNIOHandler.swift | 7 +++++++ Sources/SWIMNIOExample/SWIMNIOShell.swift | 1 + Tests/SWIMNIOExampleTests/SWIMNIOClusteredTests.swift | 1 + 5 files changed, 21 insertions(+) diff --git a/Package.swift b/Package.swift index 159543a..ea9e92a 100644 --- a/Package.swift +++ b/Package.swift @@ -154,3 +154,14 @@ var package = Package( cxxLanguageStandard: .cxx11 ) + +// --- STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- // +for target in package.targets { + if target.type != .plugin { + 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 + } +} +// --- END: STANDARD CROSS-REPO SETTINGS DO NOT EDIT --- // diff --git a/Sources/SWIM/SWIMInstance.swift b/Sources/SWIM/SWIMInstance.swift index 4750231..0f0c1bb 100644 --- a/Sources/SWIM/SWIMInstance.swift +++ b/Sources/SWIM/SWIMInstance.swift @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// import ClusterMembership +import CoreMetrics import Logging import struct Dispatch.DispatchTime diff --git a/Sources/SWIMNIOExample/SWIMNIOHandler.swift b/Sources/SWIMNIOExample/SWIMNIOHandler.swift index d7a2884..9181ad4 100644 --- a/Sources/SWIMNIOExample/SWIMNIOHandler.swift +++ b/Sources/SWIMNIOExample/SWIMNIOHandler.swift @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// import ClusterMembership +import CoreMetrics import Logging import NIO import NIOFoundationCompat @@ -20,6 +21,12 @@ import SWIM import struct Dispatch.DispatchTime +#if canImport(FoundationEssentials) +import FoundationEssentials +#else +import Foundation +#endif + /// `ChannelDuplexHandler` responsible for encoding/decoding SWIM messages to/from the `SWIMNIOShell`. /// /// It is designed to work with `DatagramBootstrap`s, and the contained shell can send messages by writing `SWIMNIOSWIMNIOWriteCommand` diff --git a/Sources/SWIMNIOExample/SWIMNIOShell.swift b/Sources/SWIMNIOExample/SWIMNIOShell.swift index ea4cce6..52811bc 100644 --- a/Sources/SWIMNIOExample/SWIMNIOShell.swift +++ b/Sources/SWIMNIOExample/SWIMNIOShell.swift @@ -14,6 +14,7 @@ import ClusterMembership import Logging +import Metrics import NIO import SWIM diff --git a/Tests/SWIMNIOExampleTests/SWIMNIOClusteredTests.swift b/Tests/SWIMNIOExampleTests/SWIMNIOClusteredTests.swift index 6070b99..055339c 100644 --- a/Tests/SWIMNIOExampleTests/SWIMNIOClusteredTests.swift +++ b/Tests/SWIMNIOExampleTests/SWIMNIOClusteredTests.swift @@ -16,6 +16,7 @@ import ClusterMembership import Logging import NIO import SWIM +import SWIMTestKit import XCTest @testable import SWIMNIOExample