File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
utils/swift-xcodegen/Sources/SwiftXcodeGen Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ struct SwiftTargets {
285
285
286
286
func getTargets( below path: RelativePath ) -> [ SwiftTarget ] {
287
287
targets. filter { target in
288
- guard let parent = target. buildRule? . parentPath, parent. hasPrefix ( path)
288
+ guard let parent = target. buildRule? . parentPath, parent. starts ( with : path)
289
289
else {
290
290
return false
291
291
}
Original file line number Diff line number Diff line change @@ -154,8 +154,9 @@ fileprivate final class ProjectGenerator {
154
154
guard let path else { return true }
155
155
156
156
// Not very efficient, but excludedPaths should be small in practice.
157
- guard let excluded = spec. excludedPaths. first ( where: { path. hasPrefix ( $0. path) } )
158
- else {
157
+ guard let excluded = spec. excludedPaths. first (
158
+ where: { path. starts ( with: $0. path) }
159
+ ) else {
159
160
return true
160
161
}
161
162
if let description, let reason = excluded. reason {
@@ -238,7 +239,9 @@ fileprivate final class ProjectGenerator {
238
239
group ( for: repoRelativePath. appending ( parentPath) ) != nil else {
239
240
// If this isn't a child of an explicitly added reference, something
240
241
// has probably gone wrong.
241
- if !spec. referencesToAdd. contains ( where: { parentPath. hasPrefix ( $0. path) } ) {
242
+ if !spec. referencesToAdd. contains (
243
+ where: { parentPath. starts ( with: $0. path) }
244
+ ) {
242
245
log. warning ( """
243
246
Target ' \( name) ' at ' \( repoRelativePath. appending ( parentPath) ) ' is \
244
247
nested in a folder reference; skipping. This is likely an xcodegen bug.
Original file line number Diff line number Diff line change @@ -78,8 +78,8 @@ public extension PathProtocol {
78
78
return exts. contains ( where: { ext == $0. rawValue } )
79
79
}
80
80
81
- func hasPrefix ( _ other: Self ) -> Bool {
82
- rawPath . hasPrefix ( other. rawPath )
81
+ func starts ( with other: Self ) -> Bool {
82
+ self . storage . starts ( with : other. storage )
83
83
}
84
84
85
85
var components : FilePath . ComponentView {
You can’t perform that action at this time.
0 commit comments