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

resolved_build_setting does not consider variables with same key from project xcconfig #883

Open
dfelber opened this issue Jun 10, 2022 · 0 comments

Comments

@dfelber
Copy link

dfelber commented Jun 10, 2022

Given a Xcode project with a xcconfig file defining PRODUCT_BUNDLE_IDENTIFIER and targets using the setting with the same key (e.g. $(PRODUCT_BUNDLE_IDENTIFIER).suffix), I would expect the targets to have the variable in the value resolved with the value defined in xcconfig when querying with resolved_build_setting.

#native_target_spec.rb

it 'returns the resolved build setting string value for a given key considering variable substitution: target referencing project xcconfig' do
    project_xcconfig = @project.new_file(fixture_path('project.xcconfig'))
    @project.build_configuration_list.build_configurations.each { |build_config| build_config.base_configuration_reference = project_xcconfig }
    @target.build_configuration_list.set_setting('PRODUCT_BUNDLE_IDENTIFIER', '$(PRODUCT_BUNDLE_IDENTIFIER).suffix')
    expected_value_release = 'com.cocoapods.app.suffix'
    expected_value_debug = 'com.cocoapods.app.dev.suffix'
    @target.resolved_build_setting('PRODUCT_BUNDLE_IDENTIFIER', true).should == { 'Release' => expected_value_release, 'Debug' => expected_value_debug }
end

However, only the value of the xcconfig file is used:

Bacon::Error: {"Release"=>"com.cocoapods.app", "Debug"=>"com.cocoapods.app.dev"}.==({"Release"=>"com.cocoapods.app.suffix", "Debug"=>"com.cocoapods.app.dev.suffix"}) failed

As far as I see, this only happens when using a variable with the same name as the key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant