From 495bde1fddde2ea1ebe73e7d70fc1936ab50032b Mon Sep 17 00:00:00 2001 From: Ian Leitch Date: Tue, 20 Jul 2021 17:12:10 +0200 Subject: [PATCH] Add String overload of PBXFileElement.fullPath(sourceRoot:) --- Sources/XcodeProj/Objects/Files/PBXFileElement.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/XcodeProj/Objects/Files/PBXFileElement.swift b/Sources/XcodeProj/Objects/Files/PBXFileElement.swift index fb245cd55..573e8ee8e 100644 --- a/Sources/XcodeProj/Objects/Files/PBXFileElement.swift +++ b/Sources/XcodeProj/Objects/Files/PBXFileElement.swift @@ -144,6 +144,15 @@ public class PBXFileElement: PBXContainerItem, PlistSerializable { // MARK: - Helpers public extension PBXFileElement { + /// Returns a file absolute path. + /// + /// - Parameter sourceRoot: project source root. + /// - Returns: file element absolute path. + /// - Throws: an error if the absolute path cannot be obtained. + func fullPath(sourceRoot: String) throws -> String? { + try fullPath(sourceRoot: Path(sourceRoot))?.absolute().string + } + /// Returns a file absolute path. /// /// - Parameter sourceRoot: project source root.