Skip to content

Commit

Permalink
Merge pull request #919 from taphouseio/fix-local-package
Browse files Browse the repository at this point in the history
Use relative_path for local Swift packages
  • Loading branch information
dnkoutso committed Sep 12, 2023
2 parents 2ce68b6 + 4933515 commit ea0cc26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
#--------------------------------------#

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/project/object/swift_package_local_reference_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ea0cc26

Please sign in to comment.