Skip to content

Commit

Permalink
Preserve license files, for inclusion in acknowledgements
Browse files Browse the repository at this point in the history
  • Loading branch information
jrose-signal committed Feb 2, 2021
1 parent 5b4a1cb commit c5c5a8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
3 changes: 0 additions & 3 deletions lib/cocoapods-binary/Integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@ def empty_source_files(spec)
spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"}
end

# to avoid the warning of missing license
spec.attributes_hash["license"] = {}

end

end
Expand Down
13 changes: 7 additions & 6 deletions lib/cocoapods-binary/Prebuild.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def prebuild_frameworks!
Pod::Prebuild.remove_build_dir(sandbox_path)


# copy vendored libraries and frameworks
# copy vendored libraries and frameworks as well as any license
targets.each do |target|
root_path = self.sandbox.pod_dir(target.name)
target_folder = sandbox.framework_folder_path_for_target_name(target.name)
Expand All @@ -171,14 +171,15 @@ def prebuild_frameworks!

target.spec_consumers.each do |consumer|
file_accessor = Sandbox::FileAccessor.new(root_path, consumer)
lib_paths = file_accessor.vendored_frameworks || []
lib_paths += file_accessor.vendored_libraries
preserve_paths = file_accessor.vendored_frameworks || []
preserve_paths += file_accessor.vendored_libraries
preserve_paths << file_accessor.license if file_accessor.license
# @TODO dSYM files
lib_paths.each do |lib_path|
relative = lib_path.relative_path_from(root_path)
preserve_paths.each do |path|
relative = path.relative_path_from(root_path)
destination = target_folder + relative
destination.dirname.mkpath unless destination.dirname.exist?
FileUtils.cp_r(lib_path, destination, :remove_destination => true)
FileUtils.cp_r(path, destination, :remove_destination => true)
end
end
end
Expand Down

0 comments on commit c5c5a8b

Please sign in to comment.