Fix TargetSource excludes tests.

This commit is contained in:
Peyman Khanjan
2017-11-19 15:20:45 +00:00
parent 8b0cc83416
commit b73aca231a
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -160,7 +160,7 @@ class SourceGenerator {
private func getSourceChildren(targetSource: TargetSource, dirPath: Path) throws -> [Path] {
func getSourceExcludes(targetSource: TargetSource, dirPath: Path) -> [Path] {
func getSourceExcludes(dirPath: Path) -> [Path] {
return targetSource.excludes.map {
Path.glob("\(dirPath)/\($0)")
.map {
@@ -177,7 +177,7 @@ class SourceGenerator {
let defaultExcludedFiles = [".DS_Store"].map { dirPath + Path($0) }
let sourcePath = Path(targetSource.path)
let rootSourcePath = spec.basePath + targetSource.path
/*
Exclude following if mentioned in TargetSource.excludes.
@@ -185,7 +185,7 @@ class SourceGenerator {
+ Pre-defined Excluded files
*/
let sourceExcludeFilePaths: Set<Path> = Set(getSourceExcludes(targetSource: targetSource, dirPath: sourcePath)
let sourceExcludeFilePaths: Set<Path> = Set(getSourceExcludes(dirPath: rootSourcePath)
+ defaultExcludedFiles)
return try dirPath.children()