Commit b263097e authored by Fabio Pelosin's avatar Fabio Pelosin

[Documentation] Adapted for Specification refactoring.

parent 59a035f3
...@@ -42,13 +42,11 @@ module Pod ...@@ -42,13 +42,11 @@ module Pod
end end
def files def files
@pod.source_files(false).map(&:to_s) @pod.all_specs_source_files.map(&:to_s)
end end
def index_file def index_file
@pod.chdir do @pod.readme_file
Dir.glob('README*', File::FNM_CASEFOLD).first
end
end end
def spec_appledoc_options def spec_appledoc_options
...@@ -66,8 +64,7 @@ module Pod ...@@ -66,8 +64,7 @@ module Pod
'--keep-undocumented-objects', '--keep-undocumented-objects',
'--keep-undocumented-members', '--keep-undocumented-members',
'--keep-intermediate-files', '--keep-intermediate-files',
'--exit-threshold', '2' '--exit-threshold', '2' # appledoc terminates with an exits status of 1 if a warning was logged
# appledoc exits with 1 if a warning was logged
] ]
index = index_file index = index_file
options += ['--index-desc', index] if index options += ['--index-desc', index] if index
......
...@@ -55,7 +55,8 @@ module Pod ...@@ -55,7 +55,8 @@ module Pod
unless pod.exists? unless pod.exists?
downloader = Downloader.for_pod(pod) downloader = Downloader.for_pod(pod)
downloader.download 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) generate_docs(pod)
pod.clean if config.clean pod.clean if config.clean
end end
...@@ -69,7 +70,7 @@ module Pod ...@@ -69,7 +70,7 @@ module Pod
puts "-> Installing documentation" if config.verbose? puts "-> Installing documentation" if config.verbose?
doc_generator.generate(config.doc_install?) doc_generator.generate(config.doc_install?)
else else
puts "-> Using existing documentation" puts "-> Using existing documentation" if config.verbose?
end end
end end
......
...@@ -102,15 +102,17 @@ module Pod ...@@ -102,15 +102,17 @@ module Pod
end end
def readme_file def readme_file
expanded_paths(%w[README* readme*]).first expanded_paths(%w[ README{*,.*} readme{*,.*} ]).first
end end
def license_file 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 end
# TODO: implement case insensitive search
def preserve_paths 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 end
def header_files def header_files
...@@ -121,6 +123,16 @@ module Pod ...@@ -121,6 +123,16 @@ module Pod
specifications.map { |s| s.xcconfig }.reduce(:merge) specifications.map { |s| s.xcconfig }.reduce(:merge)
end 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 # Integration methods
def link_headers def link_headers
...@@ -141,10 +153,6 @@ module Pod ...@@ -141,10 +153,6 @@ module Pod
top_specification.requires_arc top_specification.requires_arc
end end
# def dependencies
# top_specification.dependencies
# end
private private
def implementation_files 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