From 2e0901ea34df81d2d5ef27ace27817f2870de0a1 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Tue, 9 Aug 2022 09:19:19 +0100 Subject: [PATCH] Remove warnings from Package.swift Motivation: In #1467 different Package.swift versions were added. Raising the tools version to 5.6 in 'Package.swift' highlighted use of deprecated SPM APIs. Modifications: - Stop using the deprecated API in Package.swift - Remove the code conditionalised on the Swift version Result: Fewer warnings --- Package.swift | 17 +++++------------ Package@swift-5.4.swift | 10 +--------- Package@swift-5.5.swift | 10 +--------- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/Package.swift b/Package.swift index 09fae334f..da2618013 100644 --- a/Package.swift +++ b/Package.swift @@ -27,14 +27,6 @@ let cgrpcZlibTargetName = cgrpcZlibProductName let includeNIOSSL = ProcessInfo.processInfo.environment["GRPC_NO_NIO_SSL"] == nil -#if swift(>=5.6) -// swift-argument-parser raised its minimum Swift version in 1.1.0 but -// also accidentally broke API. This was fixed in "1.1.1". -let argumentParserMinimumVersion: Version = "1.1.1" -#else -let argumentParserMinimumVersion: Version = "1.0.0" -#endif - // MARK: - Package Dependencies let packageDependencies: [Package.Dependency] = [ @@ -55,7 +47,6 @@ let packageDependencies: [Package.Dependency] = [ from: "1.4.0" ), .package( - name: "SwiftProtobuf", url: "https://github.com/apple/swift-protobuf.git", from: "1.19.0" ), @@ -65,7 +56,9 @@ let packageDependencies: [Package.Dependency] = [ ), .package( url: "https://github.com/apple/swift-argument-parser.git", - from: argumentParserMinimumVersion + // Version is higher than in other Package@swift manifests: 1.1.0 raised the minimum Swift + // version and indluded async support. + from: "1.1.1" ), .package( url: "https://github.com/apple/swift-docc-plugin", @@ -121,10 +114,10 @@ extension Target.Dependency { package: "swift-nio-transport-services" ) static let logging: Self = .product(name: "Logging", package: "swift-log") - static let protobuf: Self = .product(name: "SwiftProtobuf", package: "SwiftProtobuf") + static let protobuf: Self = .product(name: "SwiftProtobuf", package: "swift-protobuf") static let protobufPluginLibrary: Self = .product( name: "SwiftProtobufPluginLibrary", - package: "SwiftProtobuf" + package: "swift-protobuf" ) } diff --git a/Package@swift-5.4.swift b/Package@swift-5.4.swift index 6122630d2..069e519de 100644 --- a/Package@swift-5.4.swift +++ b/Package@swift-5.4.swift @@ -27,14 +27,6 @@ let cgrpcZlibTargetName = cgrpcZlibProductName let includeNIOSSL = ProcessInfo.processInfo.environment["GRPC_NO_NIO_SSL"] == nil -#if swift(>=5.6) -// swift-argument-parser raised its minimum Swift version in 1.1.0 but -// also accidentally broke API. This was fixed in "1.1.1". -let argumentParserMinimumVersion: Version = "1.1.1" -#else -let argumentParserMinimumVersion: Version = "1.0.0" -#endif - // MARK: - Package Dependencies let packageDependencies: [Package.Dependency] = [ @@ -65,7 +57,7 @@ let packageDependencies: [Package.Dependency] = [ ), .package( url: "https://github.com/apple/swift-argument-parser.git", - from: argumentParserMinimumVersion + from: "1.0.0" ), ].appending( .package( diff --git a/Package@swift-5.5.swift b/Package@swift-5.5.swift index 453a4c384..a6806791f 100644 --- a/Package@swift-5.5.swift +++ b/Package@swift-5.5.swift @@ -27,14 +27,6 @@ let cgrpcZlibTargetName = cgrpcZlibProductName let includeNIOSSL = ProcessInfo.processInfo.environment["GRPC_NO_NIO_SSL"] == nil -#if swift(>=5.6) -// swift-argument-parser raised its minimum Swift version in 1.1.0 but -// also accidentally broke API. This was fixed in "1.1.1". -let argumentParserMinimumVersion: Version = "1.1.1" -#else -let argumentParserMinimumVersion: Version = "1.0.0" -#endif - // MARK: - Package Dependencies let packageDependencies: [Package.Dependency] = [ @@ -65,7 +57,7 @@ let packageDependencies: [Package.Dependency] = [ ), .package( url: "https://github.com/apple/swift-argument-parser.git", - from: argumentParserMinimumVersion + from: "1.0.0" ), ].appending( .package(