File tree Expand file tree Collapse file tree
Sources/XcodeProject/Objects+Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,8 +38,9 @@ public extension PBXGroup {
3838 return group
3939 }
4040
41- func sync( recursive: Bool ) {
42- addMissingFiles ( recursive: recursive)
41+ func sync( recursive: Bool , target: PBXTarget ? = nil ) {
42+ let target = target ?? parentProject? . targets. first
43+ addMissingFiles ( recursive: recursive, target: target)
4344 removeMissingFiles ( recursive: recursive)
4445 }
4546
@@ -80,10 +81,9 @@ public extension PBXGroup {
8081 children = newChildren
8182 }
8283
83- private func addMissingFiles( recursive: Bool , target: PBXTarget ? = nil ) {
84+ private func addMissingFiles( recursive: Bool , target: PBXTarget ? ) {
8485 guard let url = self . url else { return }
8586 print ( " Adding missing file: \( url) " )
86- let target = target ?? parentProject? . targets. first
8787 let childPathItems : [ ( String , PBXReference ) ] = children. flatMap {
8888 guard let childURL = $0. url else { return nil }
8989 return ( childURL. path, $0)
You can’t perform that action at this time.
0 commit comments