diff --git a/CHANGELOG.md b/CHANGELOG.md index 37b121d5b6..66564a4b44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ##### Bug Fixes +* Fix missing `-ObjC` for static XCFrameworks - take 2 + [Paul Beusterien](https://github.com/paulb777) + [#10459](https://github.com/CocoaPods/CocoaPods/issuess/10459) + * Change URL validation failure to a note [Paul Beusterien](https://github.com/paulb777) [#10291](https://github.com/CocoaPods/CocoaPods/issues/10291) diff --git a/lib/cocoapods/sandbox/file_accessor.rb b/lib/cocoapods/sandbox/file_accessor.rb index 8018782336..37ddf26193 100644 --- a/lib/cocoapods/sandbox/file_accessor.rb +++ b/lib/cocoapods/sandbox/file_accessor.rb @@ -172,6 +172,15 @@ def vendored_dynamic_frameworks end end + # @return [Array] The paths of the dynamic xcframework bundles + # that come shipped with the Pod. + # + def vendored_static_xcframeworks + vendored_xcframeworks.select do |path| + Xcode::XCFramework.new(path).build_type == BuildType.static_framework + end + end + # @return [Array] The paths of the static (fake) framework # bundles that come shipped with the Pod. # @@ -289,7 +298,7 @@ def vendored_dynamic_artifacts # that come shipped with the Pod. # def vendored_static_artifacts - vendored_static_libraries + vendored_static_frameworks + vendored_static_libraries + vendored_static_frameworks + vendored_static_xcframeworks end # @return [Hash{String => Array}] A hash that describes the diff --git a/lib/cocoapods/target/build_settings.rb b/lib/cocoapods/target/build_settings.rb index e1d6e47452..63c297559d 100644 --- a/lib/cocoapods/target/build_settings.rb +++ b/lib/cocoapods/target/build_settings.rb @@ -1263,24 +1263,8 @@ def other_swift_flags_without_swift? end end - # @return [Boolean] - define_build_settings_method :any_vendored_static_xcframeworks?, :memoized => true do - pod_targets.any? do |pt| - pt.build_settings.any? do |bs| - if bs.respond_to?(:vendored_xcframeworks) - bs.vendored_xcframeworks.any? do |xcf| - xcf.build_type == BuildType.static_framework - end - end - end - end - end - # @return [Boolean] define_build_settings_method :any_vendored_static_artifacts?, :memoized => true do - if any_vendored_static_xcframeworks? - return true - end pod_targets.any? do |pt| pt.file_accessors.any? do |fa| !fa.vendored_static_artifacts.empty? diff --git a/spec/cocoapods-integration-specs b/spec/cocoapods-integration-specs index 09cf02c582..536f201f72 160000 --- a/spec/cocoapods-integration-specs +++ b/spec/cocoapods-integration-specs @@ -1 +1 @@ -Subproject commit 09cf02c5825722693622b3f794a3603ec15e992e +Subproject commit 536f201f729e5336150b5f9d1e0284b280b47677 diff --git a/spec/unit/target/build_settings_spec.rb b/spec/unit/target/build_settings_spec.rb index a9c63846e0..0cf11a89d7 100644 --- a/spec/unit/target/build_settings_spec.rb +++ b/spec/unit/target/build_settings_spec.rb @@ -352,19 +352,13 @@ def aggregate(aggregate_target, configuration_name = 'Release') file_accessor = stub('file_accessor', :spec => spec, :spec_consumer => consumer, - :vendored_static_artifacts => [], + :vendored_static_artifacts => [1, 2, 3], :vendored_static_libraries => [], :vendored_dynamic_libraries => [], :vendored_static_frameworks => [], :vendored_dynamic_frameworks => [], :vendored_xcframeworks => [], ) - vendored_xcframework = stub('vendored_xcframework', - :build_type => BuildType.static_framework, - ) - build_setting = stub('build_setting', - :vendored_xcframeworks => [vendored_xcframework], - ) pod_target = stub('pod_target', :any_vendored_static_artifacts? => true, :file_accessors => [file_accessor], @@ -377,7 +371,6 @@ def aggregate(aggregate_target, configuration_name = 'Release') :spec_consumers => [consumer], :build_as_static? => false, :build_as_dynamic? => false, - :build_settings => [build_setting], :product_basename => 'PodTarget', :target_definitions => [target_definition], :root_spec => spec, @@ -407,12 +400,6 @@ def aggregate(aggregate_target, configuration_name = 'Release') :vendored_dynamic_frameworks => [], :vendored_xcframeworks => [], ) - vendored_xcframework = stub('vendored_xcframework', - :build_type => BuildType.dynamic_framework, - ) - build_setting = stub('build_setting', - :vendored_xcframeworks => [vendored_xcframework], - ) pod_target = stub('pod_target', :any_vendored_static_artifacts? => true, :file_accessors => [file_accessor], @@ -425,7 +412,6 @@ def aggregate(aggregate_target, configuration_name = 'Release') :spec_consumers => [consumer], :build_as_static? => false, :build_as_dynamic? => false, - :build_settings => [build_setting], :product_basename => 'PodTarget', :target_definitions => [target_definition], :root_spec => spec,