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

Fix small bug where product references have a trailing dot #757

Merged
merged 2 commits into from May 5, 2020
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

##### Bug Fixes

* None.
* Fix small bug where product references have a trailing dot
[nickgravelyn](https://github.com/nickgravelyn)
[#757](https://github.com/CocoaPods/Xcodeproj/pull/757)


## 1.16.0 (2020-04-10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def new_product_ref_for_target(group, target_name, product_type)
prefix = 'lib'
end
extension = Constants::PRODUCT_UTI_EXTENSIONS[product_type]
ref = new_reference(group, "#{prefix}#{target_name}.#{extension}", :built_products)
path = "#{prefix}#{target_name}"
path += ".#{extension}" if extension
ref = new_reference(group, path, :built_products)
ref.include_in_index = '0'
ref.set_explicit_file_type
ref
Expand Down
14 changes: 14 additions & 0 deletions spec/project/object/helpers/file_references_factory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,5 +281,19 @@ module ProjectSpecs
end

#-------------------------------------------------------------------------#

describe '::new_product_ref_for_target' do
it 'adds extension for target types that have extensions' do
ref = @factory.new_product_ref_for_target(@group, 'Pods', :static_library)
ref.path.should == 'libPods.a'
end

it 'does not add trailing dot for target types that do not have extensions' do
ref = @factory.new_product_ref_for_target(@group, 'mytool', :command_line_tool)
ref.path.should == 'mytool'
end
end

#-------------------------------------------------------------------------#
end
end