Commit aa635b53 authored by mrobinson@webkit.org's avatar mrobinson@webkit.org

[GTK][CMake] Integrate GResource for inspector files (and others?)

https://bugs.webkit.org/show_bug.cgi?id=125569

Reviewed by Gustavo Noronha Silva.

Source/WebInspectorUI:

* GNUmakefile.am: Use the new generation script instead of generating with
shell scripting in the makefile.

Source/WebKit2:

* GNUmakefile.am: Use the newly added static WebKit2InspectorGResourceBundle.xml
instead of generating the same file each time.
* PlatformGTK.cmake: Add support for building the GResource bundles into WebKit2.
* UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Added.

Tools:

* gtk/generate-inspector-gresource-manifest.py: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1fa0e27c
2013-12-22 Martin Robinson <mrobinson@igalia.com>
[GTK][CMake] Integrate GResource for inspector files (and others?)
https://bugs.webkit.org/show_bug.cgi?id=125569
Reviewed by Gustavo Noronha Silva.
* GNUmakefile.am: Use the new generation script instead of generating with
shell scripting in the makefile.
2013-12-19 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Frontend Error when selecting Database folder in Resources Sidebar
......
......@@ -5,21 +5,11 @@ ${GENSOURCES_WEBINSPECTOR_UI}/GResourceBundle.xml: GNUmakefile \
$(WebInspectorUI)/UserInterface/Images/*.png \
$(WebInspectorUI)/UserInterface/Images/*.svg \
$(WebInspectorUI)/UserInterface/External/CodeMirror/* \
$(WebInspectorUI)/Localizations/en.lproj/localizedStrings.js
$(WebInspectorUI)/Localizations/en.lproj/localizedStrings.js \
$(srcdir)/Tools/gtk/generate-inspector-gresource-manifest.py
$(AM_V_GEN)
$(AM_V_at)mkdir -p ${GENSOURCES_WEBINSPECTOR_UI}
$(AM_V_at)echo '<?xml version="1.0" encoding="UTF-8"?>' > ${GENSOURCES_WEBINSPECTOR_UI}/GResourceBundle.xml
$(AM_V_at)echo '<gresources>' >> ${GENSOURCES_WEBINSPECTOR_UI}/GResourceBundle.xml
$(AM_V_at)echo ' <gresource prefix="/org/webkitgtk/inspector">' >> ${GENSOURCES_WEBINSPECTOR_UI}/GResourceBundle.xml
$(AM_V_at)\
basepath=`echo $(WebInspectorUI)/ | sed 's,^./,,g'`; \
for file in $^; do \
if [ "$$file" = "GNUmakefile" ]; then continue; fi; \
file=`echo $$file | sed "s,$$basepath,,g"`; \
echo " <file>$$file</file>" >> ${GENSOURCES_WEBINSPECTOR_UI}/GResourceBundle.xml; \
done
$(AM_V_at)echo ' </gresource>' >> ${GENSOURCES_WEBINSPECTOR_UI}/GResourceBundle.xml
$(AM_V_at)echo '</gresources>' >> ${GENSOURCES_WEBINSPECTOR_UI}/GResourceBundle.xml
$(AM_V_at)$(srcdir)/Tools/gtk/generate-inspector-gresource-manifest.py $@
${GENSOURCES_WEBINSPECTOR_UI}/GResourceBundle.c: DerivedSources/WebInspectorUI/GResourceBundle.xml
$(AM_V_GEN)
......
2013-12-22 Martin Robinson <mrobinson@igalia.com>
[GTK][CMake] Integrate GResource for inspector files (and others?)
https://bugs.webkit.org/show_bug.cgi?id=125569
Reviewed by Gustavo Noronha Silva.
* GNUmakefile.am: Use the newly added static WebKit2InspectorGResourceBundle.xml
instead of generating the same file each time.
* PlatformGTK.cmake: Add support for building the GResource bundles into WebKit2.
* UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Added.
2013-12-22 Csaba Osztrogonác <ossy@webkit.org>
URTBF after r160971 to try to make EFL build again.
......
......@@ -19,24 +19,12 @@ libexec_PROGRAMS += \
Programs/WebKitPluginProcess
endif
${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml: GNUmakefile \
$(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html
$(AM_V_GEN)
$(AM_V_at)mkdir -p ${GENSOURCES_WEBINSPECTOR_UI}
$(AM_V_at)echo '<?xml version="1.0" encoding="UTF-8"?>' > ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
$(AM_V_at)echo '<gresources>' >> ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
$(AM_V_at)echo ' <gresource prefix="/org/webkitgtk/inspector/UserInterface">' >> ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
$(AM_V_at)echo " <file>inspectorPageIndex.html</file>" >> ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
$(AM_V_at)echo ' </gresource>' >> ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
$(AM_V_at)echo '</gresources>' >> ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.c: DerivedSources/WebInspectorUI/WebKit2GResourceBundle.xml
${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.c: \
$(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html \
$(WebKit2)/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
$(AM_V_GEN)
$(AM_V_at)glib-compile-resources --generate --sourcedir=$(WebKit2)/UIProcess/InspectorServer/front-end \
--target=${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.c ${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.xml
BUILT_SOURCES += \
DerivedSources/WebInspectorUI/WebKit2GResourceBundle.xml
--target=${GENSOURCES_WEBINSPECTOR_UI}/WebKit2GResourceBundle.c $(WebKit2)/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
webkit2gtk_built_sources += \
DerivedSources/WebInspectorUI/WebKit2GResourceBundle.c
......
......@@ -15,6 +15,9 @@ add_definitions(-DPACKAGE_LOCALE_DIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
add_definitions(-DLIBDIR="${CMAKE_INSTALL_FULL_LIBDIR}")
list(APPEND WebKit2_SOURCES
${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
${WEBKIT2_BUILT_API_DIR}/WebKitEnumTypes.cpp
${WEBKIT2_BUILT_API_DIR}/WebKitMarshal.cpp
......@@ -352,7 +355,16 @@ set(WebKit2_INSTALLED_HEADERS
${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h
${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h
${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h
)
file(GLOB InspectorFiles
${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.css
${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/External/CodeMirror/*
${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/*.png
${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/*.svg
${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.js
)
list(APPEND WebKit2_MESSAGES_IN_FILES
......@@ -445,6 +457,30 @@ add_custom_command(
COMMAND glib-mkenums --template ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitEnumTypes.cpp.template ${WebKit2_INSTALLED_HEADERS} | sed s/web_kit/webkit/ > ${WEBKIT2_BUILT_API_DIR}/WebKitEnumTypes.cpp
VERBATIM)
add_custom_command(
OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
DEPENDS ${InspectorFiles}
${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py
COMMAND ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
VERBATIM
)
add_custom_command(
OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
DEPENDS ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
${InspectorFiles}
COMMAND glib-compile-resources --generate --sourcedir=${CMAKE_SOURCE_DIR}/Source/WebInspectorUI --target=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
VERBATIM
)
add_custom_command(
OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
DEPENDS ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end/inspectorPageIndex.html
COMMAND glib-compile-resources --generate --sourcedir=${WEBKIT2_DIR}/UIProcess/InspectorServer/front-end --target=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml
VERBATIM
)
# This symbolic link allows includes like #include <webkit2/WebkitWebView.h> which simulates installed headers.
add_custom_target(fake-installed-headers
mkdir -p ${DERIVED_SOURCES_WEBKIT2_DIR}/webkit2gtk/include
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/webkitgtk/inspector/UserInterface">
<file>inspectorPageIndex.html</file>
</gresource>
</gresources>
2013-12-22 Martin Robinson <mrobinson@igalia.com>
[GTK][CMake] Integrate GResource for inspector files (and others?)
https://bugs.webkit.org/show_bug.cgi?id=125569
Reviewed by Gustavo Noronha Silva.
* gtk/generate-inspector-gresource-manifest.py: Added.
2013-12-22 Csaba Osztrogonác <ossy@webkit.org>
Last URTBF after r160971 to make EFL build happy.
......
#!/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 common
import glob
import os
import sys
resources_path = common.top_level_path() + "/Source/WebInspectorUI/"
inspector_files = \
glob.glob(resources_path + 'UserInterface/*.html') + \
glob.glob(resources_path + 'UserInterface/*.js') + \
glob.glob(resources_path + 'UserInterface/*.css') + \
glob.glob(resources_path + 'UserInterface/Images/*.png') + \
glob.glob(resources_path + 'UserInterface/Images/*.svg') + \
glob.glob(resources_path + 'UserInterface/External/CodeMirror/*') + \
glob.glob(resources_path + 'Localizations/en.lproj/localizedStrings.js')
gresources_file_content = \
"""<?xml version=1.0 encoding=UTF-8?>
<gresources>
<gresource prefix="/org/webkitgtk/inspector">
"""
for file in inspector_files:
gresources_file_content += " <file>" + file.replace(resources_path, '') + "</file>\n"
gresources_file_content += \
""" </gresource>
</gresources>
"""
open(sys.argv[1], 'w').write(gresources_file_content)
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