Skip to content

Commit c5c5a8b

Browse files
committed
Preserve license files, for inclusion in acknowledgements
1 parent 5b4a1cb commit c5c5a8b

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

lib/cocoapods-binary/Integration.rb

-3
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,6 @@ def empty_source_files(spec)
216216
spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"}
217217
end
218218

219-
# to avoid the warning of missing license
220-
spec.attributes_hash["license"] = {}
221-
222219
end
223220

224221
end

lib/cocoapods-binary/Prebuild.rb

+7-6
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def prebuild_frameworks!
156156
Pod::Prebuild.remove_build_dir(sandbox_path)
157157

158158

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

172172
target.spec_consumers.each do |consumer|
173173
file_accessor = Sandbox::FileAccessor.new(root_path, consumer)
174-
lib_paths = file_accessor.vendored_frameworks || []
175-
lib_paths += file_accessor.vendored_libraries
174+
preserve_paths = file_accessor.vendored_frameworks || []
175+
preserve_paths += file_accessor.vendored_libraries
176+
preserve_paths << file_accessor.license if file_accessor.license
176177
# @TODO dSYM files
177-
lib_paths.each do |lib_path|
178-
relative = lib_path.relative_path_from(root_path)
178+
preserve_paths.each do |path|
179+
relative = path.relative_path_from(root_path)
179180
destination = target_folder + relative
180181
destination.dirname.mkpath unless destination.dirname.exist?
181-
FileUtils.cp_r(lib_path, destination, :remove_destination => true)
182+
FileUtils.cp_r(path, destination, :remove_destination => true)
182183
end
183184
end
184185
end

0 commit comments

Comments
 (0)