MeetYouDevs / cocoapods-imy-bin

1.05k stars 245 forks source link

Fix build type #95

Closed dabing1022 closed 3 years ago

dabing1022 commented 3 years ago

podspec

...
  s.dependency 'SDWebImage'
  s.dependency 'SDWebImageFLPlugin'
  s.dependency 'SDWebImageWebPCoder'
end

podfile

target 'Demo' do
  pod 'SDWebImage'
  pod 'SDWebImageWebPCoder'
  pod 'SDWebImageFLPlugin'
  pod 'FLAnimatedImage'
end

出现了 build-arch目录下 全部是动态库的问题 https://github.com/MeetYouDevs/cocoapods-imy-bin/issues/93#issuecomment-759963867

image

之前的写法

# cocoapods-core/podfile/target_definition.rb

      def use_frameworks!(option = true)
        value = case option
                when true, false
                  option ? BuildType.dynamic_framework : BuildType.static_library
                when Hash
                  BuildType.new(:linkage => option.fetch(:linkage), :packaging => :framework)
                else
                  raise ArgumentError, "Got `#{option.inspect}`, should be a boolean or hash."
                end
        set_hash_value('uses_frameworks', value.to_hash)
      end

误设置true导致走了 BuildType.dynamic_framework。

修改成官方写法会更严谨。(cocoapods-generate库 generate/podfile_generator.rb)

su350380433 commented 3 years ago

good