Changeset 127475 in webkit
- Timestamp:
- Sep 4, 2012 11:33:10 AM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r127473 r127475 1 2012-09-04 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] Print API missing documentation when generating gtkdoc 4 https://bugs.webkit.org/show_bug.cgi?id=95703 5 6 Reviewed by Carlos Garcia Campos. 7 8 Print out API missing documentation when generating gtkdoc. This makes it 9 easier to fix documentation errors. 10 11 * gtk/generate-gtkdoc: 12 (print_missing_api): Added. 13 (generate_doc): Inline the rebase step, since it now reports an error 14 when you try to rebase without generating documentation first. 15 * gtk/gtkdoc.py: 16 (GTKDoc.rebase_installed_docs): Raise an error when rebasing without 17 generating documentation first to enable a small cleanup at the caller. 18 (GTKDoc.api_missing_documentation): Added. 19 1 20 2012-09-04 Vincent Scheib <scheib@chromium.org> 2 21 -
trunk/Tools/gtk/generate-gtkdoc
r124741 r127475 138 138 return options 139 139 140 def generate_doc(pkg_config_path, options): 141 generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, options) 140 def print_missing_api(generator): 141 missing_api = generator.api_missing_documentation() 142 if not missing_api: 143 return 144 print "\nThe following API are missing documentation:" 145 for api in missing_api: 146 print "\t%s" % api 147 148 def generate_doc(generator): 142 149 generator.generate(html='--skip-html' not in sys.argv) 150 if generator.saw_warnings: 151 print_missing_api(generator) 143 152 return generator.saw_warnings 144 145 def rebase_installed_docs(pkg_config_path, options):146 if not os.path.isdir(options['output_dir']):147 print "Documentation was not generated"148 return149 generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, options)150 generator.rebase_installed_docs()151 153 152 154 configure_logging() … … 166 168 if os.path.exists(pkg_config_path): 167 169 options = get_webkit1_options(common.gtk_version_of_pkg_config_file(pkg_config_path)) 170 generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, options) 168 171 if '--rebase' not in sys.argv: 169 172 print "Generating WebKit1 documentation..." 170 saw_webkit1_warnings = generate_doc( pkg_config_path, options)173 saw_webkit1_warnings = generate_doc(generator) 171 174 else: 172 175 print "Rebasing WebKit1 documentation..." 173 rebase_installed_docs(pkg_config_path, options)176 generator.rebase_installed_docs() 174 177 175 178 # WebKit2 might not be enabled, so check for the pkg-config file before building documentation. 176 179 pkg_config_path = common.build_path('Source', 'WebKit2', 'webkit2gtk-3.0.pc') 177 180 if os.path.exists(pkg_config_path): 178 options = get_webkit2_options()181 generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, get_webkit2_options()) 179 182 if '--rebase' not in sys.argv: 180 183 print "\nGenerating WebKit2 documentation..." 181 saw_webkit2_warnings = generate_doc( pkg_config_path, options)184 saw_webkit2_warnings = generate_doc(generator) 182 185 else: 183 186 print "\nRebasing WebKit2 documentation..." 184 rebase_installed_docs(pkg_config_path, options)187 generator.rebase_installed_docs() 185 188 186 189 sys.exit(saw_webkit1_warnings or saw_webkit2_warnings) -
trunk/Tools/gtk/gtkdoc.py
r107164 r127475 362 362 363 363 def rebase_installed_docs(self): 364 if not os.path.isdir(self.output_dir): 365 raise Exception("Tried to rebase documentation before generating it.") 364 366 html_dir = os.path.join(self.virtual_root + self.prefix, 'share', 'gtk-doc', 'html', self.module_name) 365 367 if not os.path.isdir(html_dir): … … 373 375 self._run_command(args, cwd=self.output_dir) 374 376 377 def api_missing_documentation(self): 378 unused_doc_file = os.path.join(self.output_dir, self.module_name + "-unused.txt") 379 if not os.path.exists(unused_doc_file) or not os.access(unused_doc_file, os.R_OK): 380 return [] 381 return open(unused_doc_file).read().splitlines() 375 382 376 383 class PkgConfigGTKDoc(GTKDoc):
Note: See TracChangeset
for help on using the changeset viewer.