Fix excluding directories that have sub-directories

This commit is contained in:
Brentley Jones 2018-06-28 18:48:39 -05:00
parent 0567bea517
commit 79e2413fa7
2 changed files with 10 additions and 1 deletions

View File

@ -241,7 +241,7 @@ class SourceGenerator {
return [$0]
}
return (try? $0.recursiveChildren().filter { $0.isFile }) ?? []
return (try? $0.recursiveChildren()) ?? []
}
.reduce([], +)
}

View File

@ -206,6 +206,10 @@ class SourceGeneratorTests: XCTestCase {
- a.ignored
- project.xcodeproj:
- project.pbxproj
- a.playground:
- Sources:
- a.swift
- Resources
"""
try createDirectories(directories)
@ -220,6 +224,7 @@ class SourceGeneratorTests: XCTestCase {
"ignore.file",
"*.ignored",
"*.xcodeproj",
"*.playground",
// not supported
// "**/*.ignored",
]
@ -248,6 +253,10 @@ class SourceGeneratorTests: XCTestCase {
try pbxProj.expectFileMissing(paths: ["Sources", "a.ignored"])
try pbxProj.expectFileMissing(paths: ["Sources", "ignore.file"])
try pbxProj.expectFileMissing(paths: ["Sources", "project.xcodeproj"])
try pbxProj.expectFileMissing(paths: ["Sources", "a.playground"])
// not supported: "**/*.ignored"
// try pbxProj.expectFileMissing(paths: ["Sources", "A", "a.ignored"])
// try pbxProj.expectFileMissing(paths: ["Sources", "A", "B", "b.ignored"])
}
$0.it("generates file sources") {