From 47a81fde4bfa4092577abd29122206c19ad0cf98 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 5 May 2024 14:50:26 +0800 Subject: [PATCH] Add swift-numerics dependency --- Package.resolved | 11 ++++++++++- Package.swift | 30 ++++++++++++++++++------------ 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Package.resolved b/Package.resolved index 60273fe..c749553 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,6 +1,15 @@ { - "originHash" : "9bbeb48f673780072b1cb86308961efbc9eaf1cec5a177dcbbb7b9424cd07a78", + "originHash" : "08c5b038cf77a79fefbf15fe8ee430265dbe92590190dde25f83708222a7942f", "pins" : [ + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics", + "state" : { + "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", + "version" : "1.0.2" + } + }, { "identity" : "swift-syntax", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index 2e701be..2e83e62 100644 --- a/Package.swift +++ b/Package.swift @@ -125,20 +125,26 @@ if attributeGraphCondition { // Remove this when swift-testing is 1.0.0 let swiftTestingCondition = envEnable("OPENGRAPH_SWIFT_TESTING", default: true) if swiftTestingCondition { - package.dependencies.append( - .package(url: "https://github.com/apple/swift-testing", exact: "0.6.0") - ) - openGraphTestTarget.dependencies.append( - .product(name: "Testing", package: "swift-testing") - ) + var dependencies = package.dependencies + dependencies.append(contentsOf: [ + .package(url: "https://github.com/apple/swift-testing", exact: "0.6.0"), + .package(url: "https://github.com/apple/swift-numerics", from: "1.0.2"), + ]) + package.dependencies = dependencies + + func addTestDependency(_ target: Target) { + var dependencies = target.dependencies + dependencies.append(contentsOf: [ + .product(name: "Testing", package: "swift-testing"), + .product(name: "RealModule", package: "swift-numerics"), + ]) + target.dependencies = dependencies + } + addTestDependency(openGraphTestTarget) package.targets.append(openGraphTestTarget) - openGraphCompatibilityTestTarget.dependencies.append( - .product(name: "Testing", package: "swift-testing") - ) + addTestDependency(openGraphCompatibilityTestTarget) package.targets.append(openGraphCompatibilityTestTarget) - openGraphTempTestTarget.dependencies.append( - .product(name: "Testing", package: "swift-testing") - ) + addTestDependency(openGraphTempTestTarget) package.targets.append(openGraphTempTestTarget) }