diff --git a/lib/cocoapods-binary/Integration.rb b/lib/cocoapods-binary/Integration.rb index 7d7bad7..c68746e 100644 --- a/lib/cocoapods-binary/Integration.rb +++ b/lib/cocoapods-binary/Integration.rb @@ -199,6 +199,19 @@ def empty_source_files(spec) # platform and not for another platform.' empty_source_files(spec) + # to remove the resurce bundle target. + # When specify the "resource_bundles" in podspec, xcode will generate a bundle + # target after pod install. But the bundle have already built when the prebuit + # phase and saved in the framework folder. We will treat it as a normal resource + # file. + # https://github.com/leavez/cocoapods-binary/issues/29 + if spec.attributes_hash["resource_bundles"] + bundle_names = spec.attributes_hash["resource_bundles"].keys + spec.attributes_hash["resource_bundles"] = nil + spec.attributes_hash["resources"] ||= [] + spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"} + end + # to avoid the warning of missing license spec.attributes_hash["license"] = {} end diff --git a/lib/cocoapods-binary/Prebuild.rb b/lib/cocoapods-binary/Prebuild.rb index c939f80..da59865 100644 --- a/lib/cocoapods-binary/Prebuild.rb +++ b/lib/cocoapods-binary/Prebuild.rb @@ -121,10 +121,11 @@ def prebuild_frameworks! if target.static_framework? and !target.resource_paths.empty? framework_path = output_path + target.framework_name standard_sandbox_path = sandbox.standard_sanbox_path - path_objects = target.resource_paths.select{|f| f.start_with? "${PODS_ROOT}"}.map do |path| + path_objects = target.resource_paths.map do |path| object = Prebuild::Passer::ResourcePath.new object.real_file_path = framework_path + File.basename(path) - object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) + object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) if path.start_with? '${PODS_ROOT}' + object.target_file_path = path.gsub("${PODS_CONFIGURATION_BUILD_DIR}", standard_sandbox_path.to_s) if path.start_with? "${PODS_CONFIGURATION_BUILD_DIR}" object end Prebuild::Passer.resources_to_copy_for_static_framework[target.name] = path_objects