Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Path

public enum Package: Equatable, Codable, Sendable {
case remote(url: String, requirement: Requirement)
case local(path: AbsolutePath)
case local(path: AbsolutePath, groupPath: String?)
}

extension XcodeGraph.Package {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extension Package {
switch self {
case let .remote(url, _):
return url
case let .local(path):
case let .local(path, _):
return path.pathString
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct XCPackageMapper: XCPackageMapping {
func map(package: XCLocalSwiftPackageReference, sourceDirectory: AbsolutePath) throws -> Package {
let relativePath = try RelativePath(validating: package.relativePath)
let path = sourceDirectory.appending(relativePath)
return .local(path: path)
return .local(path: path, groupPath: nil)
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider propagating groupPath information if available to support structured folder logic, rather than defaulting to nil.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we get groupPath from XCLocalSwiftPackageReference?

}

// MARK: - Private Helpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct PBXProjectMapper: PBXProjectMapping {
}
let localPackages = try pbxProject.localPackages.compactMap {
try packageMapper.map(package: $0, sourceDirectory: sourceDirectory)
} + localPackagePaths.map { .local(path: $0) }
} + localPackagePaths.map { .local(path: $0, groupPath: nil) }
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All local package mappings use nil for groupPath. If structured folders are intended, consider retrieving and passing the appropriate group path when available to improve maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, can't we get groupPath?


// Create a files group for the main group
let filesGroup = ProjectGroup.group(name: pbxProject.mainGroup?.name ?? "Project")
Expand Down