Skip to content

Commit

Permalink
[GTK] gtkdoc does not appear in DevHelp
Browse files Browse the repository at this point in the history
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: http://svn.webkit.org/repository/webkit/trunk@179111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
commit-queue@webkit.org committed Jan 26, 2015
1 parent 532e35d commit ef2ffdf
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 24 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions Source/PlatformGTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down
9 changes: 9 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/PlatformGTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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}
Expand Down
11 changes: 11 additions & 0 deletions Source/WebKit2/ChangeLog
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
3 changes: 2 additions & 1 deletion Source/WebKit2/PlatformGTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
22 changes: 22 additions & 0 deletions Tools/ChangeLog
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
37 changes: 22 additions & 15 deletions Tools/gtk/generate-gtkdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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):
Expand Down Expand Up @@ -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

Expand All @@ -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),
})

Expand All @@ -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)

Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions Tools/gtk/manifest.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions Tools/gtk/webkitdom.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def write_footer(self):
self.write('</SECTION>\n\n')


def write_doc_files():
def write_doc_files(module_name):
doc_dir = common.build_path('DerivedSources', 'webkitdom', 'docs')

try:
Expand All @@ -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:
Expand Down

0 comments on commit ef2ffdf

Please sign in to comment.