diff --git a/lib/xcodeproj/project/object/swift_package_local_reference.rb b/lib/xcodeproj/project/object/swift_package_local_reference.rb index 4fbc8827..aa5ae7f4 100644 --- a/lib/xcodeproj/project/object/swift_package_local_reference.rb +++ b/lib/xcodeproj/project/object/swift_package_local_reference.rb @@ -10,6 +10,11 @@ class XCLocalSwiftPackageReference < AbstractObject # attribute :path, String + # @return [String] the repository path where the package is located relative + # to the Xcode project. + # + attribute :relative_path, String + # @!group AbstractObject Hooks #--------------------------------------# @@ -20,7 +25,7 @@ def ascii_plist_annotation # @return [String] the path of the local Swift package reference. # def display_name - return path if path + return relative_path if relative_path super end end diff --git a/spec/project/object/swift_package_local_reference_spec.rb b/spec/project/object/swift_package_local_reference_spec.rb index adda1ffe..bbb2034a 100644 --- a/spec/project/object/swift_package_local_reference_spec.rb +++ b/spec/project/object/swift_package_local_reference_spec.rb @@ -11,12 +11,12 @@ module ProjectSpecs end it 'returns path for display_name if path is set' do - @proxy.path = '../path' + @proxy.relative_path = '../path' @proxy.display_name.should == '../path' end it 'returns the ascii plist annotation with the last component of path' do - @proxy.path = '../path' + @proxy.relative_path = '../path' @proxy.ascii_plist_annotation.should == ' XCLocalSwiftPackageReference "path" ' end end