lib/cocoapods-binary/Integration.rb in cocoapods-binary-0.4.1 vs lib/cocoapods-binary/Integration.rb in cocoapods-binary-0.4.2

- old
+ new

@@ -53,11 +53,11 @@ # symbol link copy all substructure walk(real_file_folder) do |child| source = child # only make symlink to file and `.framework` folder - if child.directory? and child.extname == ".framework" + if child.directory? and [".framework", ".dSYM"].include? child.extname mirror_with_symlink(source, real_file_folder, target_folder) next false # return false means don't go deeper elsif child.file? mirror_with_symlink(source, real_file_folder, target_folder) next true @@ -165,10 +165,36 @@ end original_vendored_frameworks += [target.framework_name] spec.attributes_hash["vendored_frameworks"] = original_vendored_frameworks spec.attributes_hash["source_files"] = [] + # 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 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 end @@ -215,19 +241,24 @@ #!/bin/sh # ---- this is added by cocoapods-binary --- # Readlink cannot handle relative symlink well, so we override it to a new one # If the path isn't an absolute path, we add a realtive prefix. + old_read_link=`which readlink` readlink () { - path=`/usr/bin/readlink $1`; + path=`$old_read_link $1`; if [ $(echo "$path" | cut -c 1-1) = '/' ]; then echo $path; else echo "`dirname $1`/$path"; fi } # --- SH + + # patch the rsync for copy dSYM symlink + script = script.gsub "rsync --delete", "rsync --copy-links --delete" + patch + script end end end end \ No newline at end of file