8000 Do not generate default `Info.plist` file for test targets if one is already specified. by dnkoutso · Pull Request #8432 · CocoaPods/CocoaPods · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Do not generate default Info.plist file for test targets if one is already specified. #8432

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### Bug Fixes

* Do not generate default `Info.plist` file for test targets if one is already specified.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#8432](https://github.com/CocoaPods/CocoaPods/pull/8432)

* Set `showEnvVarsInLog` for script phases only when its disabled.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#8400](https://github.com/CocoaPods/CocoaPods/pull/8400)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,22 @@ def install!
add_swift_library_compatibility_header_phase(native_target)
end

target.test_spec_consumers.each do |test_spec_consumer|
test_native_target = test_native_target_from_spec_consumer(test_spec_consumer, test_native_targets)
unless skip_info_plist?(test_native_target)
# Generate vanilla Info.plist for test target similar to the one Xcode generates for new test target.
# This creates valid test bundle accessible at the runtime, allowing tests to load bundle resources
# defined in podspec.
create_info_plist_file(target.info_plist_path_for_spec(test_spec_consumer.spec), test_native_target,
'1.0', target.platform, :bndl)
end
end

unless skip_pch?(target.library_specs)
path = target.prefix_header_path
create_prefix_header(path, library_file_accessors, target.platform, native_target)
end

unless skip_pch?(target.test_specs)
target.test_specs.each do |test_spec|
path = target.prefix_header_path_for_spec(test_spec)
Expand All @@ -109,6 +121,7 @@ def install!
create_prefix_header(path, test_file_accessors, target.platform, test_native_target)
end
end

unless skip_pch?(target.app_specs)
target.app_specs.each do |app_spec|
path = target.prefix_header_path_for_spec(app_spec)
Expand Down Expand Up @@ -136,11 +149,14 @@ def skip_pch?(specs)
specs.any? { |spec| spec.prefix_header_file.is_a?(FalseClass) }
end

# True if info.plist generation should be skipped
# True if default Info.plist generation should be skipped
#
# @param [PXNativeTarget] native_target
# The native target to check whether it already has `INFOPLIST_FILE` set.
#
# @return [Boolean] Whether the target should build an Info.plist file
# @return [Boolean]
# Whether the target should skip generating a default Info.plist file because one is already specified
# in the target build settings.
#
def skip_info_plist?(native_target)
existing_setting = native_target.resolved_build_setting('INFOPLIST_FILE', true).values.compact
Expand Down Expand Up @@ -326,11 +342,6 @@ def add_test_targets
create_test_target_embed_frameworks_script(test_spec)
create_test_target_copy_resources_script(test_spec)

# Generate vanilla Info.plist for test target similar to the one Xcode generates for new test target.
# This creates valid test bundle accessible at the runtime, allowing tests to load bundle resources
# defined in podspec.
create_info_plist_file(target.info_plist_path_for_spec(test_spec), test_native_target, '1.0', target.platform, :bndl)

test_native_target
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def support_files_temp_dir
# @return [void]
#
def create_info_plist_file(path, native_target, version, platform, bundle_package_type = :fmwk)
create_info_plist_file_with_sandbox(@sandbox, path, native_target, version, platform, bundle_package_type)
create_info_plist_file_with_sandbox(sandbox, path, native_target, version, platform, bundle_package_type)
add_file_to_support_group(path)
end

Expand Down
0