CocoaPods / Xcodeproj

Create and modify Xcode projects from Ruby.
http://rubygems.org/gems/xcodeproj
MIT License
2.32k stars 452 forks source link

Use relative_path for local Swift packages #919

Closed jsorge closed 10 months ago

jsorge commented 10 months ago

PR #911 added support for local packages but did not add support for the relativePath property inside of the local package definition. Here's a sample from my pbxproj file:

/* Begin XCLocalSwiftPackageReference section */
        93ED17092AAED02600B3DB25 /* XCLocalSwiftPackageReference "../../Packages/SharedResources" */ = {
            isa = XCLocalSwiftPackageReference;
            relativePath = ../../Packages/SharedResources;
        };

When I try to use the new local package model I got the following error: [!] Xcodeproj doesn't know about the following attributes {"relativePath"=>"../../Packages/SharedResources"} for the 'XCLocalSwiftPackageReference' isa. and I believe that was because the class was looking for path (which doesn't exist) and not relativePath which does.

This PR fixes that problem for local packages.

dnkoutso commented 10 months ago

@jsorge can you have both path and relativePath? Why is the first one replaced?

jsorge commented 10 months ago

@jsorge can you have both path and relativePath? Why is the first one replaced?

I replaced it because I didn’t see path as a thing that could be parsed from the project file. Happy to add it back if it could be there.

dnkoutso commented 10 months ago

Wonder if an Xcode version upgrade replaced it or added it...................also wonder if there is harm in keeping both

jsorge commented 10 months ago

Added it back @dnkoutso

serbancoroiu commented 8 months ago

Fixed in the last release, works now. Thanks!