Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use relative_path for local Swift packages #919

Merged
merged 4 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading