Skip to content

PBXReferenceProxy missing display_name attribute. #472

@barakwei

Description

@barakwei

Hello
I noticed that if I open my project and immediately save it without changing anything, the project file was always changes. All the lines like

0D492AD61E6D924B00A313DB /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D492AC71E6D91B300A313DB /* SDWebImage.framework */; };

Changed to

0D492AD61E6D924B00A313DB /* ReferenceProxy in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D492AC71E6D91B300A313DB /* SDWebImage.framework */; };

I look like in build_file.rb#L45 it calls the ref display_name which is not implemented there so it fails over to the base implementation, and since name doesn't exist, ReferenceProxy is returned.
I believe adding display_name to PBXReferenceProxy that returns path if name doesn't exist should fix it.

I solved it by opening the class in my code:

module Xcodeproj
  class Project
    module Object
      class PBXReferenceProxy
        def display_name
          return name if name
          return path if path
          super
        end
      end
    end
  end
end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions