Commit 85308974 authored by Gwendal Roué's avatar Gwendal Roué

[#221] Pod::Spec#public_header_files accepted and validated by `pod spec lint`

parent 81d3550d
......@@ -298,7 +298,7 @@ module Pod
def paths_starting_with_a_slash_errors
messages = []
%w[source_files resources clean_paths].each do |accessor|
%w[source_files public_header_files resources clean_paths].each do |accessor|
patterns = spec.send(accessor.to_sym)
# Some values are multiplaform
patterns = patterns.is_a?(Hash) ? patterns.values.flatten(1) : patterns
......@@ -400,6 +400,10 @@ module Pod
# at least one file. It requires the pods to be alredy present
# in the current working directory under Pods/spec.name
#
# The exceptions are public_header_files and clean_paths,
# since a Spec may declare an explicit empty list of public
# header files, and an explicit empty of paths to be cleaned up.
#
# It returns a array of messages
#
def file_patterns_errors_for_platfrom(platform_name)
......@@ -535,6 +539,17 @@ Pod::Spec.new do |s|
s.description = 'An optional longer description of #{data[:name]}.'
# A list of file patterns which select the header files that should be
# made available to the application. If the pattern is a directory then the
# path will automatically have '*.h' appended.
#
# Also allows the use of the FileList class like `source_files does.
#
# If you do not explicitely set the list of public header files,
# all headers of source_files will be made public.
#
# s.public_header_files = 'Classes/**/*.h'
# If this Pod runs only on iOS or OS X, then specify the platform and
# the deployment target.
#
......
......@@ -5,7 +5,7 @@ else
end
# This makes Rake::FileList usable with the Specification attributes
# source_files, clean_paths, and resources.
# source_files, public_header_files, clean_paths, and resources.
module Rake
class FileList
......
......@@ -33,7 +33,7 @@ module Pod
def post_initialize
@define_for_platforms = [:osx, :ios]
@clean_paths, @subspecs = [], []
@dependencies, @source_files, @resources = { :ios => [], :osx => [] }, { :ios => [], :osx => [] }, { :ios => [], :osx => [] }
@dependencies, @source_files, @public_header_files, @resources = { :ios => [], :osx => [] }, { :ios => [], :osx => [] }, { :ios => nil, :osx => nil }, { :ios => [], :osx => [] }
@deployment_target = {}
@platform = Platform.new(nil)
@xcconfig = { :ios => Xcodeproj::Config.new, :osx => Xcodeproj::Config.new }
......@@ -155,7 +155,7 @@ module Pod
@specification, @platform = specification, platform
end
%w{ source_files= resource= resources= xcconfig= framework= frameworks= library= libraries= compiler_flags= deployment_target= dependency }.each do |method|
%w{ source_files= public_header_files= resource= resources= xcconfig= framework= frameworks= library= libraries= compiler_flags= deployment_target= dependency }.each do |method|
define_method(method) do |args|
@specification._on_platform(@platform) do
@specification.send(method, args)
......@@ -179,6 +179,13 @@ module Pod
end
attr_reader :source_files
def public_header_files=(patterns)
@define_for_platforms.each do |platform|
@public_header_files[platform] = pattern_list(patterns)
end
end
attr_reader :public_header_files
def deployment_target=(version)
raise Informative, "The deployment target must be defined per platform like s.ios.deployment_target = '5.0'" unless @define_for_platforms.count == 1
@deployment_target[@define_for_platforms.first] = version
......
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