lib/cocoapods-sled/integration.rb in cocoapods-sled-0.0.1 vs lib/cocoapods-sled/integration.rb in cocoapods-sled-0.0.2

- old
+ new

@@ -56,11 +56,11 @@ old_install_pod_sources.bind(self).() # Installer.sled_reuse_type = :device return unless Installer.sled_should_resure? - UI.section "查找#{Installer.sled_reuse_type_desc} Sled 缓存" do + UI.section "查找#{Installer.sled_reuse_type_desc}二进制缓存" do sled_reuse_action end end def sled_reuse_action @@ -88,11 +88,11 @@ sled_totalTargets << target.name if target.sled_local? - return if Podfile::DSL.sled_disable_binary_cache_for_dev_pod + next if Podfile::DSL.sled_disable_binary_cache_for_dev_pod sled_modify_pod_target(target) else sled_modify_pod_target(target) end end @@ -130,11 +130,11 @@ path = f_cache.path_for_framework(slug) pod_root = sandbox.pod_dir(root_spec.name) framework_dir_path = path + target.sled_framework_cache_subpath(Installer.sled_reuse_type_name) - framework_file_path = framework_dir_path + target.product_name + framework_file_path = framework_dir_path + target.product_name if framework_file_path.directory? path.utime(Time.now, Time.now) @sled_hits << target.name @@ -145,16 +145,18 @@ end framework_dir_relative_path = framework_dir_path.relative_path_from(pod_root) framework_file_relative_path = framework_file_path.relative_path_from(pod_root) - target.specs.each do |spec| - - sled_empty_source_files(spec) - sled_add_vendered_framework(spec, framework_file_relative_path.to_s) - sled_replace_resource_bundles(spec, framework_dir_relative_path.to_s) - sled_add_header_search_paths(spec, target, framework_file_path.to_s) + if target.specs && !target.specs.empty? + target.specs.each do |spec| + sled_empty_source_files(spec) + sled_replace_resource_bundles(spec, framework_dir_relative_path.to_s) + sled_add_header_search_paths(spec, target, framework_file_path.to_s) + end + + sled_add_vendered_framework(target.specs.first, framework_file_relative_path.to_s) end else @sled_miss << target.name sled_add_script_phases(target, path) end @@ -186,10 +188,10 @@ spec.attributes_hash["vendored_frameworks"] = Array(spec.attributes_hash["vendored_frameworks"]) spec.attributes_hash["vendored_frameworks"] += [framework_file_path] # spec.attributes_hash["source_files"] = framework_file_path + '/Headers/*.h' # spec.attributes_hash["public_header_files"] = framework_file_path + '/Headers/*.h' - spec.attributes_hash["subspecs"] = nil + # spec.attributes_hash["subspecs"] = nil end # source_files 置空 def sled_empty_source_files(spec) spec.attributes_hash["source_files"] = [] \ No newline at end of file