From af08da4c413eeb604c8ce8aaa11cc10edf4ca614 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Wed, 11 Dec 2024 14:34:39 +0000 Subject: [PATCH 1/2] Enable MemberImportVisibility check on all targets (#19) 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. --------- Co-authored-by: George Barnett --- Package.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Package.swift b/Package.swift index 56463cf..644e7d0 100644 --- a/Package.swift +++ b/Package.swift @@ -43,6 +43,7 @@ let defaultSwiftSettings: [SwiftSetting] = [ .swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny"), .enableUpcomingFeature("InternalImportsByDefault"), + .enableUpcomingFeature("MemberImportVisibility"), ] let targets: [Target] = [ From 9b7969304a4b35b206885da7991459d0e2dd4bb1 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Thu, 12 Dec 2024 07:45:20 +0000 Subject: [PATCH 2/2] Ignore case for boolean option values in protoc-gen-grpc-swift (#20) Motivation: The protoc-gen-grpc-swift plugin has a few boolean options which currently require a lowercased value. This is overly strict, the casing of "true"/"false" shouldn't matter. Modifications: - Ignore case for boolean optioned values Result: Easier to use protoc-gen-grpc-swift --- Sources/protoc-gen-grpc-swift/Options.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/protoc-gen-grpc-swift/Options.swift b/Sources/protoc-gen-grpc-swift/Options.swift index aeb59c3..05bf131 100644 --- a/Sources/protoc-gen-grpc-swift/Options.swift +++ b/Sources/protoc-gen-grpc-swift/Options.swift @@ -88,14 +88,14 @@ struct GeneratorOptions { } case "Server": - if let value = Bool(pair.value) { + if let value = Bool(pair.value.lowercased()) { self.generateServer = value } else { throw GenerationError.invalidParameterValue(name: pair.key, value: pair.value) } case "Client": - if let value = Bool(pair.value) { + if let value = Bool(pair.value.lowercased()) { self.generateClient = value } else { throw GenerationError.invalidParameterValue(name: pair.key, value: pair.value) @@ -142,14 +142,14 @@ struct GeneratorOptions { } case "ReflectionData": - if let value = Bool(pair.value) { + if let value = Bool(pair.value.lowercased()) { self.generateReflectionData = value } else { throw GenerationError.invalidParameterValue(name: pair.key, value: pair.value) } case "UseAccessLevelOnImports": - if let value = Bool(pair.value) { + if let value = Bool(pair.value.lowercased()) { self.useAccessLevelOnImports = value } else { throw GenerationError.invalidParameterValue(name: pair.key, value: pair.value)