CocoaPods / Xcodeproj

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

swift_package_product_dependency: override `ascii_plist_annotation`. #932

Open GalBerezansky opened 7 months ago

GalBerezansky commented 7 months ago

We have a build plugin which is a Swift package, it's represented as a XCSwiftPackageProductDependency object. The display name contains a "plugin:" prefix so when it's serialized it's everywhere. The problem is that Xcode removes this prefix and uses the package name in the keys of the serialized objects and in refs to them.

Below is an example before and after the change.

before (wrong):

/* Begin XCSwiftPackageProductDependency section */
        19AA76E52A9F557900F1F6A1 /* plugin:SomePackageName */ = {
            isa = XCSwiftPackageProductDependency;
            productName = "plugin:SomePackageName";
        };

after (correct):

/* Begin XCSwiftPackageProductDependency section */
        19AA76E52A9F557900F1F6A1 /* SomePackageName */ = {
            isa = XCSwiftPackageProductDependency;
            productName = "plugin:SomePackageName";
        };
GalBerezansky commented 7 months ago

The .delete_prefix('plugin:') is a little meh but I couldn't find a better solution for this issue.

GalBerezansky commented 6 months ago

@dnkoutso Can you take a look please? Thank you 😄