diff --git a/Sources/XcodeGenKit/SourceGenerator.swift b/Sources/XcodeGenKit/SourceGenerator.swift index 0451ea2f..1966f350 100644 --- a/Sources/XcodeGenKit/SourceGenerator.swift +++ b/Sources/XcodeGenKit/SourceGenerator.swift @@ -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! diff --git a/Tests/Fixtures/TestProject/Mintfile b/Tests/Fixtures/TestProject/Mintfile new file mode 100644 index 00000000..e69de29b diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 0b334a51..835d519e 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -141,6 +141,7 @@ FR_172952167809 /* FrameworkFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrameworkFile.swift; sourceTree = ""; }; FR_183521624014 /* MyFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFramework.h; sourceTree = ""; }; FR_196911129660 /* MoreUnder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreUnder.swift; sourceTree = ""; }; + FR_232605427418 /* Mintfile */ = {isa = PBXFileReference; path = Mintfile; sourceTree = ""; }; FR_238161558082 /* MyBundle.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = MyBundle.bundle; sourceTree = ""; }; FR_247808626608 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; FR_256263906698 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -414,6 +415,7 @@ G_6651250437419 /* StandaloneFiles */, FR_479281060337 /* Folder */, FR_815403394914 /* Headers */, + FR_232605427418 /* Mintfile */, FR_257073931060 /* ResourceFolder */, ); indentWidth = 2; diff --git a/Tests/Fixtures/TestProject/spec.yml b/Tests/Fixtures/TestProject/spec.yml index 06562942..3604eebc 100644 --- a/Tests/Fixtures/TestProject/spec.yml +++ b/Tests/Fixtures/TestProject/spec.yml @@ -42,6 +42,9 @@ targets: - path: Folder type: folder buildPhase: none + - path: Mintfile + type: file + buildPhase: none settings: INFOPLIST_FILE: App_iOS/Info.plist PRODUCT_BUNDLE_IDENTIFIER: com.project.app