Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve license files, for inclusion in acknowledgements #2

Merged
merged 2 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions lib/cocoapods-binary/rome/build_framework.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ def build_for_iosish_platform(sandbox,
module_name = target.product_module_name
device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework"
simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework"
if !File.directory?(device_framework_path)
# Newer Xcodes seem to build all in one directory.
device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{module_name}.framework"
simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{module_name}.framework"
end

device_binary = device_framework_path + "/#{module_name}"
simulator_binary = simulator_framework_path + "/#{module_name}"
Expand Down