Skip to content
Open
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 @@ -20,9 +20,17 @@ class XCSwiftPackageProductDependency < AbstractObject
# @return [String] the name of the Swift package product dependency.
#
def display_name
return product_name if product_name
return clean_product_name if product_name
super
end

def clean_product_name
if product_name =~ /^plugin:/
product_name.gsub(/^plugin:/, '')
else
product_name
end
end
end
end
end
Expand Down
5 changes: 5 additions & 0 deletions spec/project/object/swift_package_product_dependency_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ module ProjectSpecs
@proxy.product_name = 'NiceSwiftPackage'
@proxy.display_name.should == 'NiceSwiftPackage'
end

it 'strips plugin prefix from product_name for display_name if package is plugin' do
@proxy.product_name = 'plugin:NiceSwiftPackage'
@proxy.display_name.should == 'NiceSwiftPackage'
end
end
end