sort carthage dependencies

This commit is contained in:
mironal 2017-10-05 10:53:08 +09:00
parent d1efa9ac64
commit f6d6f17f1b

View File

@ -381,14 +381,16 @@ public class PBXProjGenerator {
buildPhases.append(copyFilesPhase.reference)
}
let carthageFrameworksToEmbed = carthageDependencies
.filter { ($0.embed ?? true) }
.map { $0.reference }
let carthageFrameworksToEmbed = Array(Set(carthageDependencies
.filter { $0.embed ?? true }
.map { $0.reference }))
.sorted()
if !carthageFrameworksToEmbed.isEmpty {
if target.type.isApp && target.platform != .macOS {
let inputPaths = Set(carthageFrameworksToEmbed).map { "$(SRCROOT)/\(carthageBuildPath)/\(target.platform)/\($0)\($0.contains(".") ? "" : ".framework")" }
let outputPaths = Set(carthageFrameworksToEmbed).map { "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/\($0)\($0.contains(".") ? "" : ".framework")" }
let inputPaths = carthageFrameworksToEmbed.map { "$(SRCROOT)/\(carthageBuildPath)/\(target.platform)/\($0)\($0.contains(".") ? "" : ".framework")" }
let outputPaths = carthageFrameworksToEmbed.map { "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/\($0)\($0.contains(".") ? "" : ".framework")" }
let carthageScript = PBXShellScriptBuildPhase(reference: generateUUID(PBXShellScriptBuildPhase.self, "Carthage" + target.name), files: [], name: "Carthage", inputPaths: inputPaths, outputPaths: outputPaths, shellPath: "/bin/sh", shellScript: "/usr/local/bin/carthage copy-frameworks\n")
addObject(carthageScript)
buildPhases.append(carthageScript.reference)