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

Set INFOPLIST_FILE build setting to $(SRCROOT)/App/App-Info.plist #10937

Merged
merged 1 commit into from Sep 10, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### Bug Fixes

* Set `INFOPLIST_FILE` build setting to `$(SRCROOT)/App/App-Info.plist` during lint.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#10927](https://github.com/CocoaPods/CocoaPods/issues/10927)

* Set `PRODUCT_BUNDLE_IDENTIFIER` for generated app during lint.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#10933](https://github.com/CocoaPods/CocoaPods/issues/10933)
Expand Down
Expand Up @@ -48,17 +48,23 @@ def update_changed_file(generator, path)
# @param [Hash] additional_entries
# any additional entries to include in this Info.plist file.
#
# @param [String] build_setting_value
# an optional value to set for the `INFOPLIST_FILE` build setting on the
# native target. If none is specified then the value is calculated from the
# Info.plist path relative to the sandbox root.
#
# @return [void]
#
def create_info_plist_file_with_sandbox(sandbox, path, native_target, version, platform,
bundle_package_type = :fmwk, additional_entries: {})
bundle_package_type = :fmwk, additional_entries: {},
build_setting_value: nil)
UI.message "- Generating Info.plist file at #{UI.path(path)}" do
generator = Generator::InfoPlistFile.new(version, platform, bundle_package_type, additional_entries)
update_changed_file(generator, path)

relative_path_string = path.relative_path_from(sandbox.root).to_s
build_setting_value ||= path.relative_path_from(sandbox.root).to_s
native_target.build_configurations.each do |c|
c.build_settings['INFOPLIST_FILE'] = relative_path_string
c.build_settings['INFOPLIST_FILE'] = build_setting_value
end
end
end
Expand Down
8 changes: 7 additions & 1 deletion lib/cocoapods/validator.rb
Expand Up @@ -583,7 +583,13 @@ def create_app_project
app_target = Pod::Generator::AppTargetHelper.add_app_target(app_project, consumer.platform_name, deployment_target)
sandbox = Sandbox.new(config.sandbox_root)
info_plist_path = app_project.path.dirname.+('App/App-Info.plist')
Pod::Installer::Xcode::PodsProjectGenerator::TargetInstallerHelper.create_info_plist_file_with_sandbox(sandbox, info_plist_path, app_target, '1.0.0', Platform.new(consumer.platform_name), :appl)
Pod::Installer::Xcode::PodsProjectGenerator::TargetInstallerHelper.create_info_plist_file_with_sandbox(sandbox,
info_plist_path,
app_target,
'1.0.0',
Platform.new(consumer.platform_name),
:appl,
:build_setting_value => '$(SRCROOT)/App/App-Info.plist')
Pod::Generator::AppTargetHelper.add_swift_version(app_target, derived_swift_version)
app_target.build_configurations.each do |config|
# Lint will fail if a AppIcon is set but no image is found with such name
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/validator_spec.rb
Expand Up @@ -998,7 +998,7 @@ def podspec_path(name = 'JSONKit', version = '1.4', source = nil)
target.deployment_target.should.be.nil
target.platform_name.should == :ios
target.build_configurations.each do |c|
File.basename(c.build_settings['INFOPLIST_FILE']).should == 'App-Info.plist'
c.build_settings['INFOPLIST_FILE'].should == '$(SRCROOT)/App/App-Info.plist'
end
Xcodeproj::Project.schemes(project.path).should == %w(App)
end
Expand Down