tuist / XcodeProj

πŸ“ Read, update and write your Xcode projects

Home Page:https://xcodeproj.tuist.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New warnings when built using Xcode 13.3

hisaac opened this issue Β· comments

Context πŸ•΅οΈβ€β™€οΈ

I noticed that when running the project using Xcode 13.3, some new warnings are produced.

What 🌱

We're running XcodeProj via the command line, and two sets of warnings get printed to the console when building (file paths intentionally anonymized):

1:

/Users/<user>/path/to/project/scripts/TuistManifestProjectSwiftLint/.build/checkouts/XcodeProj/Sources/XcodeProj/Workspace/XCWorkspace.swift:31:70: warning: 'self' refers to the method 'XCWorkspace.self', which may be unexpected
        let data = XCWorkspaceData(children: [.file(.init(location: .self("")))])
                                                                     ^
/Users/<user>/path/to/project/scripts/TuistManifestProjectSwiftLint/.build/checkouts/XcodeProj/Sources/XcodeProj/Workspace/XCWorkspace.swift:31:70: note: use 'XCWorkspace.self' to silence this warning
        let data = XCWorkspaceData(children: [.file(.init(location: .self("")))])
                                                                     ^
                                                                     XCWorkspace.

2:

/Users/<user>/path/to/project/scripts/TuistManifestProjectSwiftLint/.build/checkouts/XcodeProj/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift:65:21: warning: 'self' refers to the method 'XCWorkspaceDataElementLocationType.self', which may be unexpected
            self = .self(path)
                    ^
/Users/<user>/path/to/project/scripts/TuistManifestProjectSwiftLint/.build/checkouts/XcodeProj/Sources/XcodeProj/Workspace/XCWorkspaceDataElementLocationType.swift:65:21: note: use 'XCWorkspaceDataElementLocationType.self' to silence this warning
            self = .self(path)
                    ^
                    XCWorkspaceDataElementLocationType.

And here's how the errors look in Xcode when building the project there:

CleanShot 2022-03-31 at 08 35 24@2x

CleanShot 2022-03-31 at 08 35 42@2x

Proposal πŸŽ‰

A simple solution would be to just rename that .self case in the XCWorkspaceDataElementLocationType enum. I don't know enough about the project to know if that's the right solution, but after doing so, the project compiles and runs without warnings.

I'll open a PR shortly to rename that enum case, but I'm open to different solutions if there are better ideas from folks more familiar with the project here.