[GTK] gtkdoc does not appear in DevHelp
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Jan 2015 11:12:24 +0000 (11:12 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Jan 2015 11:12:24 +0000 (11:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139369

.:

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2015-01-26
Reviewed by Philippe Normand.

Expect the gtkdoc to be generated in folders named with the API version.

* Source/PlatformGTK.cmake:

Source/WebCore:

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2015-01-26
Reviewed by Philippe Normand.

* PlatformGTK.cmake: Include the API version in the gtkdoc filenames.

Source/WebKit2:

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2015-01-26
Reviewed by Philippe Normand.

* PlatformGTK.cmake: Include the API version in the gtkdoc filenames.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt.
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk.types.

Tools:

Patch by Michael Catanzaro  <mcatanzaro@igalia.com> and Carlos Garcia Campos <cgarcia@igalia.com> on 2015-01-26
Reviewed by Philippe Normand.

* gtk/generate-gtkdoc: Create the generators in the main function
and use them to get the local cross renference dependencies. Also
pass the generator module name to webkitdom.write_doc_files().
(get_gtkdoc_module_paths): Receive a list of local cross reference
dependencies.
(get_generator_for_config): Set the main_sgml_file property of the
GtkDoc object from the configuration file.
(generate_documentation): Generate the documentation for the given
generator.
(generate_documentation_for_config): Deleted.
* gtk/manifest.txt.in: Expect the API version in the gtkdoc filenames.
* gtk/webkitdom.py:
(write_doc_files): Receive the module name used to build the
-sections.txt filename.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179111 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
ChangeLog
Source/PlatformGTK.cmake
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt [moved from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt with 100% similarity]
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0.types [moved from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk.types with 100% similarity]
Tools/ChangeLog
Tools/gtk/generate-gtkdoc
Tools/gtk/manifest.txt.in
Tools/gtk/webkitdom.py

index 72de8b8..695893a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-01-26  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [GTK] gtkdoc does not appear in DevHelp
+        https://bugs.webkit.org/show_bug.cgi?id=139369
+
+        Reviewed by Philippe Normand.
+
+        Expect the gtkdoc to be generated in folders named with the API version.
+
+        * Source/PlatformGTK.cmake:
+
 2015-01-26  Zan Dobersek  <zdobersek@igalia.com>
 
         [EFL][GTK] Stop compiling with fno-omit-frame-pointer, -fno-tree-dce
index cc044bc..eeffa8b 100644 (file)
@@ -9,14 +9,14 @@ list(APPEND DocumentationDependencies
     GObjectDOMBindings
     WebKit2
     "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml"
-    "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt"
+    "${CMAKE_SOURCE_DIR}/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-${WEBKITGTK_API_VERSION}-sections.txt"
 )
 
 if (ENABLE_GTKDOC)
-    install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk/html/
+    install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk-${WEBKITGTK_API_VERSION}/html/
             DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkit2gtk-${WEBKITGTK_API_VERSION}"
     )
-    install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkitdomgtk/html/
+    install(DIRECTORY ${CMAKE_BINARY_DIR}/Documentation/webkitdomgtk-${WEBKITGTK_API_VERSION}/html/
             DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html/webkitdomgtk-${WEBKITGTK_API_VERSION}"
     )
 endif ()
index 7c32400..ecb6ed2 100644 (file)
@@ -1,3 +1,12 @@
+2015-01-26  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [GTK] gtkdoc does not appear in DevHelp
+        https://bugs.webkit.org/show_bug.cgi?id=139369
+
+        Reviewed by Philippe Normand.
+
+        * PlatformGTK.cmake: Include the API version in the gtkdoc filenames.
+
 2015-01-25  Chris Dumez  <cdumez@apple.com>
 
         Remove 'font' shorthand property special casing
index 6d4ebc8..84b2fa4 100644 (file)
@@ -807,7 +807,7 @@ add_dependencies(GObjectDOMBindings
 )
 
 file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkitdom.cfg
-    "[webkitdomgtk]\n"
+    "[webkitdomgtk-${WEBKITGTK_API_VERSION}]\n"
     "pkgconfig_file=${WebKit2_PKGCONFIG_FILE}\n"
     "namespace=webkit_dom\n"
     "cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
@@ -818,6 +818,7 @@ file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkitdom.cfg
     "source_dirs=${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}\n"
     "            ${WEBCORE_DIR}/bindings/gobject\n"
     "headers=${GObjectDOMBindingsStable_INSTALLED_HEADERS}\n"
+    "main_sgml_file=webkitdomgtk-docs.sgml\n"
 )
 
 install(FILES ${GObjectDOMBindingsStable_INSTALLED_HEADERS}
index b8b2e82..5a348a0 100644 (file)
@@ -1,3 +1,14 @@
+2015-01-26  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [GTK] gtkdoc does not appear in DevHelp
+        https://bugs.webkit.org/show_bug.cgi?id=139369
+
+        Reviewed by Philippe Normand.
+
+        * PlatformGTK.cmake: Include the API version in the gtkdoc filenames.
+        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt.
+        * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk.types.
+
 2015-01-25  Timothy Horton  <timothy_horton@apple.com>
 
         Unresponsive Web processes sometimes throw ObjC exceptions under didPerformActionMenuHitTest:
index 4b448f2..bb904a2 100644 (file)
@@ -937,7 +937,7 @@ if (ENABLE_INTROSPECTION)
 endif ()
 
 file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkit2gtk.cfg
-    "[webkit2gtk]\n"
+    "[webkit2gtk-${WEBKITGTK_API_VERSION}]\n"
     "pkgconfig_file=${WebKit2_PKGCONFIG_FILE}\n"
     "namespace=webkit\n"
     "cflags=-I${CMAKE_SOURCE_DIR}/Source\n"
@@ -949,6 +949,7 @@ file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkit2gtk.cfg
     "            ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk\n"
     "            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}\n"
     "headers=${WebKit2GTK_ENUM_GENERATION_HEADERS} ${WebKit2WebExtension_INSTALLED_HEADERS}\n"
+    "main_sgml_file=webkit2gtk-docs.sgml\n"
 )
 
 file(GLOB_RECURSE WebKit2_HEADERS
index 253102d..c9ac657 100644 (file)
@@ -1,3 +1,25 @@
+2015-01-26  Michael Catanzaro  <mcatanzaro@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] gtkdoc does not appear in DevHelp
+        https://bugs.webkit.org/show_bug.cgi?id=139369
+
+        Reviewed by Philippe Normand.
+
+        * gtk/generate-gtkdoc: Create the generators in the main function
+        and use them to get the local cross renference dependencies. Also
+        pass the generator module name to webkitdom.write_doc_files().
+        (get_gtkdoc_module_paths): Receive a list of local cross reference
+        dependencies.
+        (get_generator_for_config): Set the main_sgml_file property of the
+        GtkDoc object from the configuration file.
+        (generate_documentation): Generate the documentation for the given
+        generator.
+        (generate_documentation_for_config): Deleted.
+        * gtk/manifest.txt.in: Expect the API version in the gtkdoc filenames.
+        * gtk/webkitdom.py:
+        (write_doc_files): Receive the module name used to build the
+        -sections.txt filename.
+
 2015-01-26  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r179107.
index 81b7c49..7044d2a 100755 (executable)
@@ -43,7 +43,7 @@ def configure_logging(verbose):
     else:
         handler.setFormatter(logging.Formatter('%(message)s'))
 
-def get_gtkdoc_module_paths():
+def get_gtkdoc_module_paths(cross_reference_deps):
     dependent_packages = {
         'glib-2.0' : ['glib', 'gobject', 'gio'],
         'libsoup-2.4' : ['libsoup-2.4'],
@@ -59,9 +59,9 @@ def get_gtkdoc_module_paths():
             continue
         for module in modules:
             paths.append(os.path.join(prefix, html_dir, module))
-    # This technically is not needed for the GObject DOM bindings documentation itself,
-    # but adding it doesn't hurt and allows us to avoid a check here.
-    paths.append(common.build_path('Documentation', 'webkitdomgtk', 'html'))
+
+    for local_dep in cross_reference_deps:
+        paths.append(common.build_path('Documentation', local_dep, 'html'))
     return paths
 
 def print_missing_api(generator):
@@ -98,7 +98,7 @@ def files_to_ignore(source_dirs, headers_with_gtkdoc):
     all_files = sum([[os.path.join(dir, file) for file in os.listdir(dir)] for dir in source_dirs], [])
     return filter(file_should_be_ignored, all_files)
 
-def get_generator_for_config(config_file, virtual_root):
+def get_generator_for_config(config_file, virtual_root, cross_reference_deps = []):
     if not os.path.isfile(config_file):
         return None
 
@@ -121,10 +121,11 @@ def get_generator_for_config(config_file, virtual_root):
         'namespace': config.get(module_name, 'namespace'),
         'doc_dir': config.get(module_name, 'doc_dir'),
         'output_dir': common.build_path('Documentation', module_name),
+        'main_sgml_file': config.get(module_name, 'main_sgml_file'),
         'source_dirs': source_dirs,
         'headers': headers,
         'cflags': " ".join(config.get(module_name, 'cflags').split()),
-        'cross_reference_deps': get_gtkdoc_module_paths(),
+        'cross_reference_deps': get_gtkdoc_module_paths(cross_reference_deps),
         'ignored_files': files_to_ignore(source_dirs, headers),
     })
 
@@ -142,12 +143,7 @@ def rebase_doc(generator):
     except Exception:
         print("Rebase did not happen, likely no documentation is present.")
 
-def generate_documentation_for_config(config_file):
-    generator = get_generator_for_config(config_file, arguments.virtual_root)
-    if not generator:
-        print("{0} does not exist! Skipping that documentation.".format(os.path.basename(config_file)))
-        return
-
+def generate_documentation(generator):
     if not arguments.rebase:
         return generate_doc(generator, arguments.skip_html)
 
@@ -197,8 +193,19 @@ if __name__ == "__main__":
 
     prepare_environment_for_gtkdoc_generation()
 
-    webkitdom.write_doc_files()
-    generate_documentation_for_config(common.build_path('gtkdoc-webkitdom.cfg'))
-    saw_warnings = generate_documentation_for_config(common.build_path('gtkdoc-webkit2gtk.cfg'))
+    webkitdom_generator = get_generator_for_config(common.build_path('gtkdoc-webkitdom.cfg'), arguments.virtual_root)
+    if not webkitdom_generator:
+        print("gtkdoc-webkitdom.cfg does not exist! Skipping that documentation")
+        sys.exit(1)
+    webkitdom.write_doc_files(webkitdom_generator.module_name)
+    saw_warnings = generate_documentation(webkitdom_generator)
+    if saw_warnings:
+        sys.exit(saw_warnings)
+
+    webkit2_generator = get_generator_for_config(common.build_path('gtkdoc-webkit2gtk.cfg'), arguments.virtual_root, [webkitdom_generator.module_name])
+    if not webkit2_generator:
+        print("gtkdoc-webkit2gtk.cfg does not exist! Skipping that documentation")
+        sys.exit(1)
+    saw_warnings = generate_documentation(webkit2_generator)
 
     sys.exit(saw_warnings)
index b8fff85..ff680d8 100644 (file)
@@ -102,5 +102,5 @@ file Tools/Scripts/webkit-build-directory
 file Tools/Scripts/webkitdirs.pm
 file Tools/jhbuild/jhbuildutils.py
 
-directory ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk/html Documentation/webkit2gtk/html
-directory ${CMAKE_BINARY_DIR}/Documentation/webkitdomgtk/html Documentation/webkitdomgtk/html
+directory ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk-${WEBKITGTK_API_VERSION}/html Documentation/webkit2gtk-${WEBKITGTK_API_VERSION}/html
+directory ${CMAKE_BINARY_DIR}/Documentation/webkitdomgtk-${WEBKITGTK_API_VERSION}/html Documentation/webkitdomgtk-${WEBKITGTK_API_VERSION}/html
index c403ea1..e1bc795 100755 (executable)
@@ -207,7 +207,7 @@ class WebKitDOMDocGeneratorSections(WebKitDOMDocGenerator):
         self.write('</SECTION>\n\n')
 
 
-def write_doc_files():
+def write_doc_files(module_name):
     doc_dir = common.build_path('DerivedSources', 'webkitdom', 'docs')
 
     try:
@@ -217,7 +217,7 @@ def write_doc_files():
             sys.stderr.write("Could not create doc dir at %s: %s\n" % (doc_dir, str(e)))
             sys.exit(1)
 
-    with open(os.path.join(doc_dir, 'webkitdomgtk-sections.txt'), 'w') as sections_file:
+    with open(os.path.join(doc_dir, '%s-sections.txt' % module_name), 'w') as sections_file:
         generator = WebKitDOMDocGeneratorSections(get_all_webkitdom_symbol_files(), sections_file)
         generator.generate()
     with open(os.path.join(doc_dir, 'webkitdomgtk-docs.sgml'), 'w') as sgml_file: