Commit 109d9702 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #5021 from CocoaPods/seg-validate-headers-in-source-files

[Validator] Validate that header files are in source_files
parents 5d0c4c7a 823c7d5d
...@@ -20,6 +20,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -20,6 +20,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[#5016](https://github.com/CocoaPods/CocoaPods/issues/5016) [#5016](https://github.com/CocoaPods/CocoaPods/issues/5016)
* The validator will check that all `public_header_files` and
`private_header_files` are also present in `source_files`.
[Samuel Giddins](https://github.com/segiddins)
[#4936](https://github.com/CocoaPods/CocoaPods/issues/4936)
##### Bug Fixes ##### Bug Fixes
* The master specs repository can no longer be added via `pod repo add`, but * The master specs repository can no longer be added via `pod repo add`, but
...@@ -36,6 +41,7 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -36,6 +41,7 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Marius Rackwitz](https://github.com/mrackwitz) [Marius Rackwitz](https://github.com/mrackwitz)
[#5022](https://github.com/CocoaPods/CocoaPods/issues/5022) [#5022](https://github.com/CocoaPods/CocoaPods/issues/5022)
## 1.0.0.beta.5 (2016-03-08) ## 1.0.0.beta.5 (2016-03-08)
##### Breaking ##### Breaking
......
...@@ -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