Bugfix: Consider folders with dot in it when generating projects (#826)

* Bug fix in SourceGenerator

Folders which would have a dot in it, would be added to Copy Bundle Resources even though it contained swift files. This commit, updates the if checks to check if the extension is not of type lproj or xcassets or bundle. This would let Xcodegen handle paths with dots in it

* Refactor SourceGenerator.swift getGroupSources function

* Add FolderWithDot2.0 to TestProject/App_iOS

* Update TestProject fixture with SwiftFileInDotPath and FolderWithDot2.0 changes

* Update test to assert bundles are included in resources

* Remove intentDefinition from whitelistedDirectoryExtensions because it's not a directory, it's always a file so the check is not required
This commit is contained in:
Asif
2020-04-09 07:47:54 -05:00
committed by GitHub
parent b1edbda583
commit 400c19ee9a
5 changed files with 35 additions and 2 deletions
+4 -2
View File
@@ -413,12 +413,14 @@ class SourceGenerator {
let children = try getSourceChildren(targetSource: targetSource, dirPath: path, excludePaths: excludePaths, includePaths: includePaths)
let createIntermediateGroups = targetSource.createIntermediateGroups ?? project.options.createIntermediateGroups
let directoryExtensionsToSkip = ["lproj", "bundle", "xcassets", "xcdatamodeld"]
let directories = children
.filter { $0.isDirectory && $0.extension == nil && $0.extension != "lproj" }
.filter { $0.isDirectory && !directoryExtensionsToSkip.contains($0.extension ?? "") }
let whitelistedDirectoryExtensionsForFilePath = ["xcdatamodeld", "xcdatamodel" , "xcassets"]
let filePaths = children
.filter { $0.isFile || $0.extension != nil && $0.extension != "lproj" }
.filter { $0.isFile || $0.extension != nil && $0.extension != "lproj" && (whitelistedDirectoryExtensionsForFilePath.contains($0.extension ?? "") || !$0.isDirectory) }
let localisedDirectories = children
.filter { $0.extension == "lproj" }