Skip to content

Commit

Permalink
Set INFOPLIST_FILE build setting to $(SRCROOT)/App/App-Info.plist
Browse files Browse the repository at this point in the history
… during lint.
  • Loading branch information
dnkoutso committed Sep 9, 2021
1 parent c39584d commit 6a134d8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
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

0 comments on commit 6a134d8

Please sign in to comment.