Commit b263097e authored by Fabio Pelosin's avatar Fabio Pelosin

[Documentation] Adapted for Specification refactoring.

parent 59a035f3
......@@ -42,13 +42,11 @@ module Pod
end
def files
@pod.source_files(false).map(&:to_s)
@pod.all_specs_source_files.map(&:to_s)
end
def index_file
@pod.chdir do
Dir.glob('README*', File::FNM_CASEFOLD).first
end
@pod.readme_file
end
def spec_appledoc_options
......@@ -66,8 +64,7 @@ module Pod
'--keep-undocumented-objects',
'--keep-undocumented-members',
'--keep-intermediate-files',
'--exit-threshold', '2'
# appledoc exits with 1 if a warning was logged
'--exit-threshold', '2' # appledoc terminates with an exits status of 1 if a warning was logged
]
index = index_file
options += ['--index-desc', index] if index
......
......@@ -55,7 +55,8 @@ module Pod
unless pod.exists?
downloader = Downloader.for_pod(pod)
downloader.download
# The docs need to be generated before cleaning
# The docs need to be generated before cleaning because
# the documentation is created for all the subspecs.
generate_docs(pod)
pod.clean if config.clean
end
......@@ -69,7 +70,7 @@ module Pod
puts "-> Installing documentation" if config.verbose?
doc_generator.generate(config.doc_install?)
else
puts "-> Using existing documentation"
puts "-> Using existing documentation" if config.verbose?
end
end
......
......@@ -102,15 +102,17 @@ module Pod
end
def readme_file
expanded_paths(%w[README* readme*]).first
expanded_paths(%w[ README{*,.*} readme{*,.*} ]).first
end
def license_file
expanded_paths(%w[ LICENSE* licence* ]).first
file = top_specification.license[:file] if top_specification.license
file || expanded_paths(%w[ LICENSE{*,.*} licence{*,.*} ]).first
end
# TODO: implement case insensitive search
def preserve_paths
chained_expanded_paths(:preserve_paths) + expanded_paths(%w[ *.podspec notice* NOTICE* ])
chained_expanded_paths(:preserve_paths) + expanded_paths(%w[ *.podspec notice* NOTICE* CREDITS* ])
end
def header_files
......@@ -121,6 +123,16 @@ module Pod
specifications.map { |s| s.xcconfig }.reduce(:merge)
end
# Method used by documentation generator. It return the source files
# of all the specs.
def all_specs_source_files
specs = top_specification.recursive_subspecs << top_specification
files = specs.map { |s| expanded_paths(s.source_files, :glob => '*.{h,m,mm,c,cpp}') }.compact.flatten.uniq
puts files.join("\n").reversed
files
end
# Integration methods
def link_headers
......@@ -141,10 +153,6 @@ module Pod
top_specification.requires_arc
end
# def dependencies
# top_specification.dependencies
# end
private
def implementation_files
......
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