Skip to content

Commit

Permalink
Merge pull request #739 from CocoaPods/paulb777/cmake
Browse files Browse the repository at this point in the history
Handle project_dir_path attribute for project location
  • Loading branch information
dnkoutso committed Feb 21, 2020
2 parents 4772726 + c3fe099 commit b937504
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@

##### Bug Fixes

* None.

* Handle project_dir_path attribute for project location.
[Paul Beusterien](https://github.com/paulb777)
[Andrew](https://github.com/mad-rain)
[#739](https://github.com/CocoaPods/Xcodeproj/pull/739)

## 1.15.0 (2020-02-04)

Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproj/project/object/helpers/groupable_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def source_tree_real_path(object)
when '<group>'
object_parent = parent(object)
if object_parent.isa == 'PBXProject'.freeze
object.project.project_dir
object.project.project_dir + object.project.root_object.project_dir_path
else
real_path(object_parent)
end
Expand Down
7 changes: 7 additions & 0 deletions spec/project/object/helpers/groupable_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ module ProjectSpecs
@helper.source_tree_real_path(@group).should == Pathname.new('/project_dir')
end

it 'check project_dir_path adjustment' do
@group.source_tree = '<group>'
@project.root_object.stubs(:project_dir_path).returns('../')
@helper.source_tree_real_path(@group).to_s.should.not.include Pathname.new('/project_dir').to_s
Pathname.new('/project_dir').to_s.should.include @helper.source_tree_real_path(@group).to_s
end

it 'returns the source tree of a path relative to a group' do
@group.source_tree = '<absolute>'
@group.path = '/parent_group_path'
Expand Down

0 comments on commit b937504

Please sign in to comment.