fix files not being added to root properly

This commit is contained in:
Yonas Kolb committed 2018-04-12 00:02:31 +10:00
1 parent 89d3bfcf91
commit c0df295366
4 files changed
+15 -4

No files matched your search

+10 -4
View File
@@ -440,11 +440,17 @@ class SourceGenerator {
let sourceFile = generateSourceFile(targetSource: targetSource, path: path)
let parentGroup = getGroup(path: parentPath, mergingChildren: [fileReference], createIntermediateGroups: createIntermediateGroups, isBaseGroup: true)
sourcePath = parentPath
if parentPath == spec.basePath {
sourcePath = path
sourceReference = fileReference
rootGroups.insert(fileReference)
} else {
let parentGroup = getGroup(path: parentPath, mergingChildren: [fileReference], createIntermediateGroups: createIntermediateGroups, isBaseGroup: true)
sourcePath = parentPath
sourceReference = parentGroup.reference
}
sourceFiles.append(sourceFile)
sourceReference = parentGroup.reference
case .group:
let (groupSourceFiles, groups) = try getGroupSources(targetSource: targetSource, path: path, isBaseGroup: true)
let group = groups.first!