Skip to content

Commit

Permalink
Merge pull request CocoaPods#665 from bclymer/patch-1
Browse files Browse the repository at this point in the history
Normalize xcconfig path when generating includes.
  • Loading branch information
dnkoutso authored Feb 22, 2019
2 parents 992afb1 + ee7bdf9 commit 2f9015f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

##### Bug Fixes

* None.

* Normalize xcconfig path when generating includes.
[bclymer](https://github.com/bclymer)

## 1.8.1 (2019-02-19)

Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproj/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def hash_from_file_content(string)
string.split("\n").each do |line|
uncommented_line = strip_comment(line)
if include = extract_include(uncommented_line)
@includes.push include
@includes.push normalized_xcconfig_path(include)
else
key, value = extract_key_value(uncommented_line)
next unless key
Expand Down
8 changes: 7 additions & 1 deletion spec/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ def filename.open(mode)
it 'contains file path refs to all included xcconfigs' do
config = Xcodeproj::Config.new(fixture_path('include.xcconfig'))
config.includes.size.should.be.equal 1
config.includes.first.should.be.equal 'Somefile'
config.includes.first.should.be.equal 'Somefile.xcconfig'
end

it 'contains file path refs to all included xcconfigs, even without the extension added' do
config = Xcodeproj::Config.new(fixture_path('config-with-include-no-extension.xcconfig'))
config.includes.size.should.be.equal 1
config.includes.first.should.be.equal 'another-config-with-include.xcconfig'
end

it 'can be created from multiline file' do
Expand Down
1 change: 1 addition & 0 deletions spec/fixtures/config-with-include-no-extension.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "another-config-with-include"

0 comments on commit 2f9015f

Please sign in to comment.