<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[224566] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/224566">224566</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2017-11-07 23:23:38 -0800 (Tue, 07 Nov 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script
https://bugs.webkit.org/show_bug.cgi?id=179317

Reviewed by Michael Catanzaro.

Source/WebKit:

This is the script used by Apple and it has several advantages:

  - It allows to combine and minify most of the js and css files, which improves performance and binary size.
  - It removes the debug resources and assertions in production builds.
  - It allows to remove the test resources in production builds.

The patch also moves the common cmake code to generate the resources to a new file InspectorGResources.cmake included
by GTK+ and WPE platform cmake files.

* InspectorGResources.cmake: Added.
* PlatformGTK.cmake:
* PlatformWPE.cmake:

Tools:

Move generate-inspector-gresource-manifest.py to glib dir to be shared by GTK+ and WPE ports and update it to
receive an input directory instead of a list of patterns.
File::Copy::Recursive is required by copy-user-interface-resources.pl, so make sure it's installed.

* glib/generate-inspector-gresource-manifest.py: Renamed from Tools/gtk/generate-inspector-gresource-manifest.py.
(get_filenames):
(get_filenames.should_ignore_resource):
* gtk/install-dependencies:
* wpe/generate-inspector-gresource-manifest.py: Removed.
* wpe/install-dependencies:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitPlatformGTKcmake">trunk/Source/WebKit/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKitPlatformWPEcmake">trunk/Source/WebKit/PlatformWPE.cmake</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsgtkinstalldependencies">trunk/Tools/gtk/install-dependencies</a></li>
<li><a href="#trunkToolswpeinstalldependencies">trunk/Tools/wpe/install-dependencies</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitInspectorGResourcescmake">trunk/Source/WebKit/InspectorGResources.cmake</a></li>
<li>trunk/Tools/glib/</li>
<li><a href="#trunkToolsglibgenerateinspectorgresourcemanifestpy">trunk/Tools/glib/generate-inspector-gresource-manifest.py</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkToolsgtkgenerateinspectorgresourcemanifestpy">trunk/Tools/gtk/generate-inspector-gresource-manifest.py</a></li>
<li><a href="#trunkToolswpegenerateinspectorgresourcemanifestpy">trunk/Tools/wpe/generate-inspector-gresource-manifest.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (224565 => 224566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2017-11-08 07:10:02 UTC (rev 224565)
+++ trunk/Source/WebKit/ChangeLog       2017-11-08 07:23:38 UTC (rev 224566)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script
+        https://bugs.webkit.org/show_bug.cgi?id=179317
+
+        Reviewed by Michael Catanzaro.
+
+        This is the script used by Apple and it has several advantages:
+
+          - It allows to combine and minify most of the js and css files, which improves performance and binary size.
+          - It removes the debug resources and assertions in production builds.
+          - It allows to remove the test resources in production builds.
+
+        The patch also moves the common cmake code to generate the resources to a new file InspectorGResources.cmake included
+        by GTK+ and WPE platform cmake files.
+
+        * InspectorGResources.cmake: Added.
+        * PlatformGTK.cmake:
+        * PlatformWPE.cmake:
+
</ins><span class="cx"> 2017-11-07  Jeremy Jones  <jeremyj@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Add downcast support for FullscreenClient.
</span></span></pre></div>
<a id="trunkSourceWebKitInspectorGResourcescmake"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/InspectorGResources.cmake (0 => 224566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/InspectorGResources.cmake                            (rev 0)
+++ trunk/Source/WebKit/InspectorGResources.cmake       2017-11-08 07:23:38 UTC (rev 224566)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+macro(WEBKIT_BUILD_INSPECTOR_GRESOURCES _derived_sources_dir)
+    set(InspectorFiles
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Base/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.css
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.css
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.css
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/ESLint/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/Esprima/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/three.js/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Models/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Protocol/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Proxies/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Test/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.css
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/Formatter/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/*.js
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.png
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.svg
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
+    )
+
+    file(GLOB InspectorFilesDependencies
+        ${InspectorFiles}
+    )
+
+    set(InspectorResourceScripts
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/combine-resources.pl
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/fix-worker-imports-for-optimized-builds.pl
+        ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/remove-console-asserts.pl
+        ${JavaScriptCore_SCRIPTS_DIR}/cssmin.py
+        ${JavaScriptCore_SCRIPTS_DIR}/jsmin.py
+    )
+
+    # DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
+    # expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
+    add_custom_command(
+        OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
+        DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
+        COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
+        VERBATIM
+    )
+
+    if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+        set(COMBINE_INSPECTOR_RESOURCES NO)
+        set(COMBINE_TEST_RESOURCES YES)
+    elseif (DEVELOPER_MODE)
+        set(COMBINE_INSPECTOR_RESOURCES YES)
+        set(COMBINE_TEST_RESOURCES YES)
+    else ()
+        set(COMBINE_INSPECTOR_RESOURCES YES)
+        set(COMBINE_TEST_RESOURCES NO)
+    endif ()
+
+    add_custom_command(
+        OUTPUT ${CMAKE_BINARY_DIR}/inspector-resources.stamp
+        DEPENDS ${InspectorFilesDependencies}
+                ${InspectorResourceScripts}
+                ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
+        COMMAND cp ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js ${FORWARDING_HEADERS_DIR}/JavaScriptCore/Scripts
+        COMMAND ${CMAKE_COMMAND} -E env "DERIVED_SOURCES_DIR=${DERIVED_SOURCES_WEBINSPECTORUI_DIR}" "SRCROOT=${CMAKE_SOURCE_DIR}/Source/WebInspectorUI" "JAVASCRIPTCORE_PRIVATE_HEADERS_DIR=${FORWARDING_HEADERS_DIR}/JavaScriptCore/Scripts" "TARGET_BUILD_DIR=${_derived_sources_dir}/InspectorResources" "UNLOCALIZED_RESOURCES_FOLDER_PATH=WebInspectorUI" "COMBINE_INSPECTOR_RESOURCES=${COMBINE_INSPECTOR_RESOURCES}" "COMBINE_TEST_RESOURCES=${COMBINE_TEST_RESOURCES}" ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
+        COMMAND mkdir -p ${_derived_sources_dir}/InspectorResources/WebInspectorUI/Localizations/en.lproj
+        COMMAND cp ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js ${_derived_sources_dir}/InspectorResources/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
+        COMMAND touch ${CMAKE_BINARY_DIR}/inspector-resources.stamp
+        VERBATIM
+    )
+
+    add_custom_command(
+        OUTPUT ${_derived_sources_dir}/InspectorGResourceBundle.xml
+        DEPENDS ${CMAKE_BINARY_DIR}/inspector-resources.stamp
+                ${TOOLS_DIR}/glib/generate-inspector-gresource-manifest.py
+        COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/glib/generate-inspector-gresource-manifest.py --input=${_derived_sources_dir}/InspectorResources --output=${_derived_sources_dir}/InspectorGResourceBundle.xml
+        VERBATIM
+    )
+
+    add_custom_command(
+        OUTPUT ${_derived_sources_dir}/InspectorGResourceBundle.c
+        DEPENDS ${_derived_sources_dir}/InspectorGResourceBundle.xml
+        COMMAND glib-compile-resources --generate --sourcedir=${_derived_sources_dir}/InspectorResources/WebInspectorUI --target=${_derived_sources_dir}/InspectorGResourceBundle.c ${_derived_sources_dir}/InspectorGResourceBundle.xml
+        VERBATIM
+    )
+endmacro()
</ins></span></pre></div>
<a id="trunkSourceWebKitPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/PlatformGTK.cmake (224565 => 224566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/PlatformGTK.cmake    2017-11-08 07:10:02 UTC (rev 224565)
+++ trunk/Source/WebKit/PlatformGTK.cmake       2017-11-08 07:23:38 UTC (rev 224566)
</span><span class="lines">@@ -1,3 +1,5 @@
</span><ins>+include(InspectorGResources.cmake)
+
</ins><span class="cx"> set(WebKit_OUTPUT_NAME webkit2gtk-${WEBKITGTK_API_VERSION})
</span><span class="cx"> set(WebKit_WebProcess_OUTPUT_NAME WebKitWebProcess)
</span><span class="cx"> set(WebKit_NetworkProcess_OUTPUT_NAME WebKitNetworkProcess)
</span><span class="lines">@@ -720,43 +722,6 @@
</span><span class="cx">     ${WEBKIT_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h
</span><span class="cx"> )
</span><span class="cx"> 
</span><del>-set(InspectorFiles
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Base/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.css
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.css
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.css
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/ESLint/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/Esprima/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/three.js/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Models/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Protocol/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Proxies/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Test/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.css
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/Formatter/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.png
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.svg
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
-)
-
-file(GLOB InspectorFilesDependencies
-    ${InspectorFiles}
-)
-
-# DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
-# expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
-add_custom_command(
-    OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
-    DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
-    COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
-)
-
</del><span class="cx"> # This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
</span><span class="cx"> list(INSERT WebKit_INCLUDE_DIRECTORIES 0
</span><span class="cx">     "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
</span><span class="lines">@@ -876,22 +841,8 @@
</span><span class="cx">     COMMAND glib-mkenums --template ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitEnumTypes.cpp.template ${WebKit2GTK_ENUM_GENERATION_HEADERS} | sed s/web_kit/webkit/ > ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.cpp
</span><span class="cx">     VERBATIM)
</span><span class="cx"> 
</span><del>-add_custom_command(
-    OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
-    DEPENDS ${InspectorFilesDependencies}
-            ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
-            ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py
-    COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py --output=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml ${InspectorFiles} ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
-    VERBATIM
-)
</del><ins>+WEBKIT_BUILD_INSPECTOR_GRESOURCES(${DERIVED_SOURCES_WEBKIT2GTK_DIR})
</ins><span class="cx"> 
</span><del>-add_custom_command(
-    OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
-    DEPENDS ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
-    COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebInspectorUI --sourcedir=${DERIVED_SOURCES_WEBINSPECTORUI_DIR} --target=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
-    VERBATIM
-)
-
</del><span class="cx"> set(WebKitResources
</span><span class="cx">     "        <file alias=\"images/missingImage\">missingImage.png</file>\n"
</span><span class="cx">     "        <file alias=\"images/missingImage@2x\">missingImage@2x.png</file>\n"
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformWPEcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/PlatformWPE.cmake (224565 => 224566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/PlatformWPE.cmake    2017-11-08 07:10:02 UTC (rev 224565)
+++ trunk/Source/WebKit/PlatformWPE.cmake       2017-11-08 07:23:38 UTC (rev 224566)
</span><span class="lines">@@ -1,3 +1,5 @@
</span><ins>+include(InspectorGResources.cmake)
+
</ins><span class="cx"> set(WebKit_OUTPUT_NAME WPEWebKit)
</span><span class="cx"> set(WebKit_WebProcess_OUTPUT_NAME WPEWebProcess)
</span><span class="cx"> set(WebKit_NetworkProcess_OUTPUT_NAME WPENetworkProcess)
</span><span class="lines">@@ -446,59 +448,7 @@
</span><span class="cx">     ${WPE_LIBRARIES}
</span><span class="cx"> )
</span><span class="cx"> 
</span><del>-set(InspectorFiles
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Base/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.css
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.css
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Debug/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.css
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/ESLint/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/Esprima/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/three.js/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.png
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.svg
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Models/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Protocol/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Proxies/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Test/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.css
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/Formatter/*.js
-    ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/*.js
-)
-
-file(GLOB InspectorFilesDependencies
-    ${InspectorFiles}
-)
-
-# DerivedSources/JavaScriptCore/inspector/InspectorBackendCommands.js is
-# expected in DerivedSources/WebInspectorUI/UserInterface/Protocol/.
-add_custom_command(
-    OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
-    DEPENDS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js
-    COMMAND cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
-)
-
-add_custom_command(
-    OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.xml
-    DEPENDS ${InspectorFilesDependencies}
-            ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
-            ${TOOLS_DIR}/wpe/generate-inspector-gresource-manifest.py
-    COMMAND ${TOOLS_DIR}/wpe/generate-inspector-gresource-manifest.py --output=${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.xml ${InspectorFiles} ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
-    VERBATIM
-)
-
-add_custom_command(
-    OUTPUT ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.c
-    DEPENDS ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.xml
-    COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebInspectorUI --sourcedir=${DERIVED_SOURCES_WEBINSPECTORUI_DIR} --target=${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.c ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.xml
-    VERBATIM
-)
-
</del><ins>+WEBKIT_BUILD_INSPECTOR_GRESOURCES(${DERIVED_SOURCES_WEBINSPECTORUI_DIR})
</ins><span class="cx"> list(APPEND WPEWebInspectorResources_DERIVED_SOURCES
</span><span class="cx">     ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/InspectorGResourceBundle.c
</span><span class="cx"> )
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (224565 => 224566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2017-11-08 07:10:02 UTC (rev 224565)
+++ trunk/Tools/ChangeLog       2017-11-08 07:23:38 UTC (rev 224566)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script
+        https://bugs.webkit.org/show_bug.cgi?id=179317
+
+        Reviewed by Michael Catanzaro.
+
+        Move generate-inspector-gresource-manifest.py to glib dir to be shared by GTK+ and WPE ports and update it to
+        receive an input directory instead of a list of patterns.
+        File::Copy::Recursive is required by copy-user-interface-resources.pl, so make sure it's installed.
+
+        * glib/generate-inspector-gresource-manifest.py: Renamed from Tools/gtk/generate-inspector-gresource-manifest.py.
+        (get_filenames):
+        (get_filenames.should_ignore_resource):
+        * gtk/install-dependencies:
+        * wpe/generate-inspector-gresource-manifest.py: Removed.
+        * wpe/install-dependencies:
+
</ins><span class="cx"> 2017-11-07  Don Olmstead  <don.olmstead@sony.com>
</span><span class="cx"> 
</span><span class="cx">         Fix webkitpy tests after rev 224549.
</span></span></pre></div>
<a id="trunkToolsglibgenerateinspectorgresourcemanifestpyfromrev224565trunkToolsgtkgenerateinspectorgresourcemanifestpy"></a>
<div class="copfile"><h4>Copied: trunk/Tools/glib/generate-inspector-gresource-manifest.py (from rev 224565, trunk/Tools/gtk/generate-inspector-gresource-manifest.py) (0 => 224566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/glib/generate-inspector-gresource-manifest.py                                (rev 0)
+++ trunk/Tools/glib/generate-inspector-gresource-manifest.py   2017-11-08 07:23:38 UTC (rev 224566)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+#!/usr/bin/env python
+# Copyright (C) 2013 Igalia S.L.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+import argparse
+import os
+import sys
+
+VALID_EXTENSIONS = ['.html', '.js', '.css', '.svg', '.png']
+COMPRESSIBLE_EXTENSIONS = ['.html', '.js', '.css', '.svg']
+BASE_DIR = 'WebInspectorUI/'
+
+
+def get_filenames(directory):
+    filenames = []
+
+    def should_ignore_resource(resource):
+        if resource.startswith('Images') and 'gtk' not in resource:
+            return True
+        if resource.startswith(os.path.join('Protocol', 'Legacy')):
+            return True
+        if os.path.splitext(resource)[1] not in VALID_EXTENSIONS:
+            return True
+
+    for root, dirs, files in os.walk(directory):
+        for file in files:
+            filename = os.path.join(root, file)
+            base_dir_index = filename.rfind(BASE_DIR)
+            if base_dir_index == -1:
+                continue
+
+            name = filename[base_dir_index + len(BASE_DIR):]
+            # The result should use forward slashes, thus make sure any os-specific
+            # separator, is properly replaced
+            if os.sep != '/':
+                name = name.replace(os.sep, '/')
+            if not should_ignore_resource(name):
+                filenames.append(name)
+
+    return filenames
+
+
+def is_compressible(filename):
+    return os.path.splitext(filename)[1] in COMPRESSIBLE_EXTENSIONS
+
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser(description='Generate a GResources file for the inspector.')
+    parser.add_argument('--input', type=str,
+                        help='the input directory')
+    parser.add_argument('--output', nargs='?', type=argparse.FileType('w'), default=sys.stdout,
+                        help='the output file')
+
+    args = parser.parse_args(sys.argv[1:])
+
+    args.output.write(\
+    """<?xml version=1.0 encoding=UTF-8?>
+    <gresources>
+        <gresource prefix="/org/webkitgtk/inspector">
+""")
+
+    for filename in get_filenames(args.input):
+        line = '            <file'
+        if is_compressible(filename):
+            line += ' compressed="true"'
+        if not filename.startswith('Localization'):
+            alias = 'UserInterface/' + filename
+            if 'Images/gtk/' in alias:
+                alias = alias.replace('gtk/', '')
+            line += ' alias="%s"' % alias
+        line += '>%s</file>\n' % filename
+
+        args.output.write(line)
+
+    args.output.write(\
+    """    </gresource>
+</gresources>
+""")
</ins></span></pre></div>
<a id="trunkToolsgtkgenerateinspectorgresourcemanifestpy"></a>
<div class="delfile"><h4>Deleted: trunk/Tools/gtk/generate-inspector-gresource-manifest.py (224565 => 224566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/generate-inspector-gresource-manifest.py 2017-11-08 07:10:02 UTC (rev 224565)
+++ trunk/Tools/gtk/generate-inspector-gresource-manifest.py    2017-11-08 07:23:38 UTC (rev 224566)
</span><span class="lines">@@ -1,77 +0,0 @@
</span><del>-#!/usr/bin/env python
-# Copyright (C) 2013 Igalia S.L.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-import argparse
-import glob
-import os
-import sys
-
-COMPRESSIBLE_EXTENSIONS = ['.html', '.js', '.css', '.svg']
-BASE_DIR = 'WebInspectorUI/'
-
-
-def get_filenames(args):
-    filenames = []
-
-    for pattern in args:
-        paths = sorted(glob.glob(pattern))
-        for filename in paths:
-            base_dir_index = filename.rfind(BASE_DIR)
-            if base_dir_index != -1:
-                name = filename[base_dir_index + len(BASE_DIR):]
-                # The result should use forward slashes, thus make sure any os-specific
-                # separator, added by the glob.glob() call, is properly replaced
-                if os.sep != '/':
-                    name = name.replace(os.sep, '/')
-                filenames.append(name)
-    return filenames
-
-
-def is_compressible(filename):
-    return os.path.splitext(filename)[1] in COMPRESSIBLE_EXTENSIONS
-
-
-if __name__ == "__main__":
-    parser = argparse.ArgumentParser(description='Generate a GResources file for the inspector.')
-    parser.add_argument('--output', nargs='?', type=argparse.FileType('w'), default=sys.stdout,
-                        help='the output file')
-    parser.add_argument('filenames', metavar='FILES', nargs='+',
-                        help='the list of files to include')
-
-    args = parser.parse_args(sys.argv[1:])
-
-    args.output.write(\
-    """<?xml version=1.0 encoding=UTF-8?>
-    <gresources>
-        <gresource prefix="/org/webkitgtk/inspector">
-""")
-
-    for filename in get_filenames(args.filenames):
-        line = '            <file'
-        if is_compressible(filename):
-            line += ' compressed="true"'
-        if 'Images/gtk/' in filename:
-            line += ' alias="%s"' % filename.replace('gtk/', '')
-        line += '>%s</file>\n' % filename
-
-        args.output.write(line)
-
-    args.output.write(\
-    """    </gresource>
-</gresources>
-""")
-
</del></span></pre></div>
<a id="trunkToolsgtkinstalldependencies"></a>
<div class="modfile"><h4>Modified: trunk/Tools/gtk/install-dependencies (224565 => 224566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/install-dependencies     2017-11-08 07:10:02 UTC (rev 224565)
+++ trunk/Tools/gtk/install-dependencies        2017-11-08 07:23:38 UTC (rev 224566)
</span><span class="lines">@@ -108,6 +108,7 @@
</span><span class="cx">         libenchant-dev \
</span><span class="cx">         libfaad-dev \
</span><span class="cx">         libffi-dev \
</span><ins>+        libfile-copy-recursive-perl \
</ins><span class="cx">         $(aptIfElse libgcrypt20-dev libgcrypt11-dev) \
</span><span class="cx">         libgirepository1.0-dev \
</span><span class="cx">         libgl1-mesa-dev \
</span><span class="lines">@@ -279,6 +280,7 @@
</span><span class="cx">         mpg123 \
</span><span class="cx">         opus \
</span><span class="cx">         pango \
</span><ins>+        perl-file-copy-recursive \
</ins><span class="cx">         libgcrypt \
</span><span class="cx">         libnotify \
</span><span class="cx">         libpng \
</span><span class="lines">@@ -435,6 +437,7 @@
</span><span class="cx">         opus-devel \
</span><span class="cx">         patch \
</span><span class="cx">         pcre-devel \
</span><ins>+        perl-File-Copy-Recursive \
</ins><span class="cx">         perl-JSON-PP \
</span><span class="cx">         perl-Switch \
</span><span class="cx">         perl-Time-HiRes \
</span></span></pre></div>
<a id="trunkToolswpegenerateinspectorgresourcemanifestpy"></a>
<div class="delfile"><h4>Deleted: trunk/Tools/wpe/generate-inspector-gresource-manifest.py (224565 => 224566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/wpe/generate-inspector-gresource-manifest.py 2017-11-08 07:10:02 UTC (rev 224565)
+++ trunk/Tools/wpe/generate-inspector-gresource-manifest.py    2017-11-08 07:23:38 UTC (rev 224566)
</span><span class="lines">@@ -1,76 +0,0 @@
</span><del>-#!/usr/bin/env python
-# Copyright (C) 2014 Igalia S.L.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-import argparse
-import glob
-import os
-import sys
-
-COMPRESSIBLE_EXTENSIONS = ['.html', '.js', '.css', '.svg']
-BASE_DIR = 'WebInspectorUI/'
-
-
-def get_filenames(args):
-    filenames = []
-
-    for pattern in args:
-        paths = glob.glob(pattern)
-        for filename in paths:
-            base_dir_index = filename.rfind(BASE_DIR)
-            if base_dir_index != -1:
-                name = filename[base_dir_index + len(BASE_DIR):]
-                # The result should use forward slashes, thus make sure any os-specific
-                # separator, added by the glob.glob() call, is properly replaced
-                if os.sep != '/':
-                    name = name.replace(os.sep, '/')
-                filenames.append(name)
-    return filenames
-
-
-def is_compressible(filename):
-    return os.path.splitext(filename)[1] in COMPRESSIBLE_EXTENSIONS
-
-
-if __name__ == "__main__":
-    parser = argparse.ArgumentParser(description='Generate a GResources file for the inspector.')
-    parser.add_argument('--output', nargs='?', type=argparse.FileType('w'), default=sys.stdout,
-                        help='the output file')
-    parser.add_argument('filenames', metavar='FILES', nargs='+',
-                        help='the list of files to include')
-
-    args = parser.parse_args(sys.argv[1:])
-
-    args.output.write(\
-    """<?xml version=1.0 encoding=UTF-8?>
-    <gresources>
-        <gresource prefix="/org/wpe/inspector">
-""")
-
-    for filename in get_filenames(args.filenames):
-        line = '            <file'
-        if is_compressible(filename):
-            line += ' compressed="true"'
-        if 'Images/gtk/' in filename:
-            line += ' alias="%s"' % filename.replace('gtk/', '')
-        line += '>%s</file>\n' % filename
-
-        args.output.write(line)
-
-    args.output.write(\
-    """    </gresource>
-</gresources>
-""")
</del></span></pre></div>
<a id="trunkToolswpeinstalldependencies"></a>
<div class="modfile"><h4>Modified: trunk/Tools/wpe/install-dependencies (224565 => 224566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/wpe/install-dependencies     2017-11-08 07:10:02 UTC (rev 224565)
+++ trunk/Tools/wpe/install-dependencies        2017-11-08 07:23:38 UTC (rev 224566)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function installDependenciesWithApt {
</span><del>-    # These are dependencies necessary for building WPE+.
</del><ins>+    # These are dependencies necessary for building WPE.
</ins><span class="cx">     packages=" \
</span><span class="cx">         autoconf \
</span><span class="cx">         automake \
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx">         libgstreamer-plugins-base1.0-dev \
</span><span class="cx">         libicu-dev \
</span><span class="cx">         libjpeg-dev \
</span><ins>+        libfile-copy-recursive-perl \
</ins><span class="cx">         $(aptIfElse libpng-dev libpng12-dev) \
</span><span class="cx">         libsqlite3-dev \
</span><span class="cx">         libtasn1-6-dev \
</span><span class="lines">@@ -132,7 +133,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function installDependenciesWithPacman {
</span><del>-    # These are dependencies necessary for building WebKitGTK+.
</del><ins>+    # These are dependencies necessary for building WPE.
</ins><span class="cx">     packages=" \
</span><span class="cx">         autoconf \
</span><span class="cx">         automake \
</span><span class="lines">@@ -165,6 +166,7 @@
</span><span class="cx">         make \
</span><span class="cx">         ninja \
</span><span class="cx">         patch \
</span><ins>+        perl-file-copy-recursive \
</ins><span class="cx">         pkg-config \
</span><span class="cx">         ruby
</span><span class="cx">         sed \
</span><span class="lines">@@ -247,6 +249,7 @@
</span><span class="cx">         libxslt-devel \
</span><span class="cx">         ninja-build \
</span><span class="cx">         patch \
</span><ins>+        perl-File-Copy-Recursive \
</ins><span class="cx">         perl-Time-HiRes \
</span><span class="cx">         perl-version \
</span><span class="cx">         ruby \
</span></span></pre>
</div>
</div>

</body>
</html>