Commit 06ad5a4a authored by Samuel Giddins's avatar Samuel Giddins

[Validator] Validate that header files are in source_files

parent 5d0c4c7a
...@@ -560,12 +560,18 @@ module Pod ...@@ -560,12 +560,18 @@ module Pod
# Ensures that a list of header files only contains header files. # Ensures that a list of header files only contains header files.
# #
def _validate_header_files(attr_name) def _validate_header_files(attr_name)
non_header_files = file_accessor.send(attr_name). header_files = file_accessor.send(attr_name)
non_header_files = header_files.
select { |f| !Sandbox::FileAccessor::HEADER_EXTENSIONS.include?(f.extname) }. select { |f| !Sandbox::FileAccessor::HEADER_EXTENSIONS.include?(f.extname) }.
map { |f| f.relative_path_from(file_accessor.root) } map { |f| f.relative_path_from(file_accessor.root) }
unless non_header_files.empty? unless non_header_files.empty?
error(attr_name, "The pattern matches non-header files (#{non_header_files.join(', ')}).") error(attr_name, "The pattern matches non-header files (#{non_header_files.join(', ')}).")
end end
non_source_files = header_files - file_accessor.source_files
unless non_source_files.empty?
error(attr_name, 'The pattern includes header files that are not listed' \
"in source_files (#{non_source_files.join(', ')}).")
end
end end
def _validate_header_mappings_dir def _validate_header_mappings_dir
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment