From 1f588e3aed543635b2c4a197659335abf23a77b0 Mon Sep 17 00:00:00 2001 From: kandelvijaya Date: Sat, 18 Mar 2017 14:51:45 +0100 Subject: [PATCH] Replaced [String] dependency url with [Package.Dependency]. The problem with [String] urls was that inside the Package specification, we were running a map function that was inserting major version 2 for all the URLS. This is not the best way to deal. Reason: What if in some near future we add 1 more dependency? Will that dependency also take 2 as major version? Likely not. Solution: The current approach adds the ability to add fully satisfied dependency without the explict knowledge of mapping over. --- Package.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 739fd948..06e9bebe 100644 --- a/Package.swift +++ b/Package.swift @@ -19,10 +19,10 @@ import PackageDescription -var urls = [String]() +var dependencies = Array() #if os(Linux) -urls += ["https://github.com/PerfectlySoft/Perfect-LinuxBridge.git"] +dependencies += [.Package(url: "https://github.com/PerfectlySoft/Perfect-LinuxBridge.git", majorVersion: 2)] #else #endif @@ -30,6 +30,6 @@ urls += ["https://github.com/PerfectlySoft/Perfect-LinuxBridge.git"] let package = Package( name: "PerfectLib", targets: [], - dependencies: urls.map { .Package(url: $0, majorVersion: 2) }, + dependencies: dependencies, exclude: [] )