Skip to content

Commit

Permalink
Merge 164585 - Extract common parts from jhbuildrc files.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=125986

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-02-24
Reviewed by Csaba Osztrogonác.

Co-authored with Peter Szanka <h868064@stud.u-szeged.hu>.

* Scripts/run-gtk-tests:
(TestRunner._setup_testing_environment):
* efl/common.py: Removed.
* efl/jhbuildrc:
* gtk/check-gdom-symbols:
* gtk/common.py:
(binary_build_path):
(get_build_path):
* gtk/find-make-dist-errors:
(get_missing_headers):
* gtk/generate-gtkdoc:
(get_webkit2_options):
(get_webkit1_options.src_path):
(get_webkit1_options):
(get_webkitdom_options.src_path):
(get_webkitdom_options):
* gtk/generate-inspector-gresource-manifest.py:
* gtk/jhbuildrc:
* jhbuild/jhbuildrc_common.py: Added.
(script_path):
(top_level_path):
(init):


Conflicts:
	Tools/ChangeLog
  • Loading branch information
Tibor Meszaros authored and kov committed May 13, 2014
1 parent 92a2f3f commit f280155
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 112 deletions.
5 changes: 4 additions & 1 deletion Tools/Scripts/run-gtk-tests
Expand Up @@ -31,6 +31,9 @@ sys.path.append(os.path.join(top_level_directory, "Tools", "gtk"))
import common
import jhbuildutils

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
import jhbuildrc_common

class SkippedTest:
ENTIRE_SUITE = None

Expand Down Expand Up @@ -195,7 +198,7 @@ class TestRunner:
def _setup_testing_environment(self):
self._test_env = os.environ
self._test_env['GSETTINGS_BACKEND'] = 'memory'
self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit2")
self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = jhbuildrc_common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit2")
self._test_env["TEST_WEBKIT_API_WEBKIT2_INJECTED_BUNDLE_PATH"] = common.tests_library_build_path()
self._test_env["WEBKIT_EXEC_PATH"] = self._programs_path

Expand Down
31 changes: 0 additions & 31 deletions Tools/efl/common.py

This file was deleted.

32 changes: 3 additions & 29 deletions Tools/efl/jhbuildrc
Expand Up @@ -16,37 +16,11 @@
# 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 multiprocessing
import sys

__efl_tools_directory = os.path.abspath(os.path.dirname(__file__))
sys.path = [__efl_tools_directory] + sys.path
import common

build_policy = 'updated'

# FIXME: move shared parts into ../jhbuild folder.

__moduleset_file_uri = 'file://' + os.path.join(__efl_tools_directory, 'jhbuild.modules')
__extra_modulesets = os.environ.get("WEBKIT_EXTRA_MODULESETS", "").split(",")
moduleset = [ __moduleset_file_uri, ]
if __extra_modulesets != ['']:
moduleset.extend(__extra_modulesets)

__extra_modules = os.environ.get("WEBKIT_EXTRA_MODULES", "").split(",")
modules = [ 'webkitefl-testing-dependencies', ]
if __extra_modules != ['']:
modules.extend(__extra_modules)

if os.environ.has_key('WEBKIT_OUTPUTDIR'):
checkoutroot = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies', 'Source'))
prefix = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies', 'Root'))
else:
checkoutroot = os.path.abspath(common.top_level_path('WebKitBuild','Dependencies', 'Source'))
prefix = os.path.abspath(common.top_level_path('WebKitBuild','Dependencies', 'Root'))

nonotify = True
notrayicon = True
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild") )
import jhbuildrc_common
jhbuildrc_common.init(globals(), "efl")

if 'NUMBER_OF_PROCESSORS' in os.environ:
jobs = os.environ['NUMBER_OF_PROCESSORS']
Expand Down
4 changes: 3 additions & 1 deletion Tools/gtk/check-gdom-symbols
Expand Up @@ -22,6 +22,8 @@ import subprocess
import sys
import tempfile

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
import jhbuildrc_common

def should_update_symbols_file(new, old):
if not os.path.exists(old):
Expand Down Expand Up @@ -50,7 +52,7 @@ if __name__ == '__main__':
tmp.write(file_handle.read())
tmp.flush()

gdom_source_path = common.top_level_path('Source', 'WebCore', 'bindings')
gdom_source_path = jhbuildrc_common.top_level_path('Source', 'WebCore', 'bindings')
api_break_test_path = os.path.join(gdom_source_path, 'scripts', 'gobject-run-api-break-test')
subprocess.call([sys.executable, api_break_test_path, os.path.join(gdom_source_path, 'gobject', 'webkitdom.symbols'), tmp.name])

Expand Down
23 changes: 7 additions & 16 deletions Tools/gtk/common.py
Expand Up @@ -21,7 +21,9 @@
import subprocess
import sys

script_dir = None
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
import jhbuildrc_common

build_dir = None
library_build_dir = None
tests_library_build_dir = None
Expand Down Expand Up @@ -71,17 +73,6 @@ def binary_build_path(*args):
return library_build_dir


def script_path(*args):
global script_dir
if not script_dir:
script_dir = os.path.join(os.path.dirname(__file__), '..', 'Scripts')
return os.path.join(*(script_dir,) + args)


def top_level_path(*args):
return os.path.join(*((os.path.join(os.path.dirname(__file__), '..', '..'),) + args))


def get_build_path(fatal=True):
global build_dir
if build_dir:
Expand Down Expand Up @@ -109,20 +100,20 @@ def is_valid_build_directory(path):

global build_types
for build_type in build_types:
build_dir = top_level_path('WebKitBuild', build_type)
build_dir = jhbuildrc_common.top_level_path('WebKitBuild', build_type)
if is_valid_build_directory(build_dir):
return build_dir

# distcheck builds in a directory named _build in the top-level path.
build_dir = top_level_path("_build")
build_dir = jhbuildrc_common.top_level_path("_build")
if is_valid_build_directory(build_dir):
return build_dir

build_dir = top_level_path()
build_dir = jhbuildrc_common.top_level_path()
if is_valid_build_directory(build_dir):
return build_dir

build_dir = top_level_path("WebKitBuild")
build_dir = jhbuildrc_common.top_level_path("WebKitBuild")
if is_valid_build_directory(build_dir):
return build_dir

Expand Down
5 changes: 4 additions & 1 deletion Tools/gtk/find-make-dist-errors
Expand Up @@ -20,6 +20,9 @@ import os
import subprocess
import sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
import jhbuildrc_common

def is_source_file_listing(line):
return line.strip().startswith('Source')

Expand Down Expand Up @@ -86,7 +89,7 @@ def get_unlisted_headers(listed_makefile_headers):
def get_missing_headers(listed_makefile_headers):
missing = set()
for header in listed_makefile_headers:
if not os.path.exists(common.top_level_path(header)):
if not os.path.exists(jhbuildrc_common.top_level_path(header)):
missing.add(header)
return missing

Expand Down
19 changes: 11 additions & 8 deletions Tools/gtk/generate-gtkdoc
Expand Up @@ -23,6 +23,9 @@ import logging
import os.path
import sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
import jhbuildrc_common

def configure_logging(verbose):
level = logging.DEBUG if verbose else logging.INFO
logger = logging.getLogger('gtkdoc')
Expand Down Expand Up @@ -61,8 +64,8 @@ def webkitdom_docs_html_path():
return common.build_path('Documentation', 'webkitdomgtk', 'html')

def get_webkit2_options(virtual_root):
api_path = common.top_level_path('Source', 'WebKit2', 'UIProcess', 'API', 'gtk')
injected_bundle_api_path = common.top_level_path('Source', 'WebKit2', 'WebProcess', 'InjectedBundle', 'API', 'gtk')
api_path = jhbuildrc_common.top_level_path('Source', 'WebKit2', 'UIProcess', 'API', 'gtk')
injected_bundle_api_path = jhbuildrc_common.top_level_path('Source', 'WebKit2', 'WebProcess', 'InjectedBundle', 'API', 'gtk')

if common.is_cmake_build():
generated_api_path = common.build_path('DerivedSources', 'webkit2gtk', 'webkit2')
Expand All @@ -89,7 +92,7 @@ def get_webkit2_options(virtual_root):
'source_dirs' : [src_path(), generated_api_path, injected_bundle_api_path],
'cflags' :
# Common paths
' -I' + common.top_level_path('Source') + \
' -I' + jhbuildrc_common.top_level_path('Source') + \
' -I' + api_path + \
# Autotools paths
' -I' + common.build_path('DerivedSources', 'webkit2gtk', 'include') + \
Expand All @@ -115,7 +118,7 @@ def get_webkit2_options(virtual_root):

def get_webkit1_options(gtk_version, virtual_root):
def src_path(*args):
return common.top_level_path(*(('Source', 'WebKit', 'gtk') + args))
return jhbuildrc_common.top_level_path(*(('Source', 'WebKit', 'gtk') + args))

def webkitversionh_path():
if common.is_cmake_build():
Expand Down Expand Up @@ -146,8 +149,8 @@ def get_webkit1_options(gtk_version, virtual_root):
'cflags' : ' -I' + common.build_path('WebKit', 'gtk') + \
' -I' + common.build_path('DerivedSources') + \
' -I' + src_path() + \
' -I' + common.top_level_path('Source') + \
' -I' + common.top_level_path('Source', 'JavaScriptCore', 'ForwardingHeaders'),
' -I' + jhbuildrc_common.top_level_path('Source') + \
' -I' + jhbuildrc_common.top_level_path('Source', 'JavaScriptCore', 'ForwardingHeaders'),
'cross_reference_deps' : get_gtkdoc_module_paths(xref_deps) + [webkitdom_docs_html_path()],
'ignored_files': glob.glob(src_path('webkit', '*private.*')) + \
glob.glob(src_path('webkit', 'webkitauthenticationdialog.*')) + \
Expand All @@ -159,7 +162,7 @@ def get_webkitdom_options(virtual_root):
def derived_sources_path(*args):
return common.build_path(*(('DerivedSources', 'webkitdom') + args))
def src_path(*args):
return common.top_level_path(*(('Source', 'WebCore', 'bindings', 'gobject') + args))
return jhbuildrc_common.top_level_path(*(('Source', 'WebCore', 'bindings', 'gobject') + args))

xref_deps = { 'glib-2.0' : ['glib', 'gobject', 'gio'] }

Expand All @@ -175,7 +178,7 @@ def get_webkitdom_options(virtual_root):
'source_dirs' : [derived_sources_path()],
'cflags' : ' -I' + derived_sources_path() + \
' -I' + src_path() + \
' -I' + common.top_level_path('Source'),
' -I' + jhbuildrc_common.top_level_path('Source'),
'cross_reference_deps' : get_gtkdoc_module_paths(xref_deps),
'ignored_files': glob.glob(derived_sources_path('*Private.h'))
}
Expand Down
5 changes: 4 additions & 1 deletion Tools/gtk/generate-inspector-gresource-manifest.py
Expand Up @@ -20,7 +20,10 @@
import os
import sys

resources_path = common.top_level_path() + "/Source/WebInspectorUI/"
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
import jhbuildrc_common

resources_path = jhbuildrc_common.top_level_path() + "/Source/WebInspectorUI/"
inspector_files = \
glob.glob(resources_path + 'UserInterface/*.html') + \
glob.glob(resources_path + 'UserInterface/*.js') + \
Expand Down
28 changes: 4 additions & 24 deletions Tools/gtk/jhbuildrc
Expand Up @@ -15,36 +15,16 @@
# 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 multiprocessing
import sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild") )
import jhbuildrc_common
jhbuildrc_common.init(globals(), "gtk")

__gtk_tools_directory = os.path.abspath(os.path.dirname(__file__))
sys.path = [__gtk_tools_directory] + sys.path
import common

build_policy = 'updated'

__moduleset_file_uri = 'file://' + os.path.join(__gtk_tools_directory, 'jhbuild.modules')
__extra_modulesets = os.environ.get("WEBKIT_EXTRA_MODULESETS", "").split(",")
moduleset = [ __moduleset_file_uri, ]
if __extra_modulesets != ['']:
moduleset.extend(__extra_modulesets)

__extra_modules = os.environ.get("WEBKIT_EXTRA_MODULES", "").split(",")
modules = [ 'webkitgtk-testing-dependencies', ]
if __extra_modules != ['']:
modules.extend(__extra_modules)

if os.environ.has_key('WEBKIT_OUTPUTDIR'):
checkoutroot = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies', 'Source'))
prefix = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies', 'Root'))
else:
checkoutroot = os.path.abspath(common.top_level_path('WebKitBuild','Dependencies', 'Source'))
prefix = os.path.abspath(common.top_level_path('WebKitBuild','Dependencies', 'Root'))

nonotify = True
notrayicon = True

if 'NUMBER_OF_PROCESSORS' in os.environ:
jobs = os.environ['NUMBER_OF_PROCESSORS']

Expand Down
64 changes: 64 additions & 0 deletions Tools/jhbuild/jhbuildrc_common.py
@@ -0,0 +1,64 @@
#!/usr/bin/env python
# Copyright (C) 2011 Igalia S.L.
# Copyright (C) 2012 Intel Corporation
#
# 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 multiprocessing
import sys
import os


script_dir = None


def script_path(*args):
global script_dir
if not script_dir:
script_dir = os.path.join(os.path.dirname(__file__), '..', 'Scripts')
return os.path.join(*(script_dir,) + args)


def top_level_path(*args):
return os.path.join(*((os.path.join(os.path.dirname(__file__), '..', '..'),) + args))


def init(jhbuildrc_globals, platform):

__tools_directory = os.path.join(os.path.dirname(__file__), "../", platform)
sys.path.insert(0, __tools_directory)

jhbuildrc_globals["build_policy"] = 'updated'

__moduleset_file_uri = 'file://' + os.path.join(__tools_directory, 'jhbuild.modules')
__extra_modulesets = os.environ.get("WEBKIT_EXTRA_MODULESETS", "").split(",")
jhbuildrc_globals["moduleset"] = [__moduleset_file_uri, ]
if __extra_modulesets != ['']:
jhbuildrc_globals["moduleset"].extend(__extra_modulesets)

__extra_modules = os.environ.get("WEBKIT_EXTRA_MODULES", "").split(",")
jhbuildrc_globals["modules"] = ['webkit' + platform + '-testing-dependencies', ]
if __extra_modules != ['']:
jhbuildrc_globals["modules"].extend(__extra_modules)

if 'WEBKIT_OUTPUTDIR' in os.environ:
jhbuildrc_globals["checkoutroot"] = checkoutroot = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies', 'Source'))
jhbuildrc_globals["prefix"] = os.path.abspath(os.path.join(os.environ['WEBKIT_OUTPUTDIR'], 'Dependencies', 'Root'))
else:
jhbuildrc_globals["checkoutroot"] = checkoutroot = os.path.abspath(top_level_path('WebKitBuild', 'Dependencies', 'Source'))
jhbuildrc_globals["prefix"] = os.path.abspath(top_level_path('WebKitBuild', 'Dependencies', 'Root'))

jhbuildrc_globals["nonotify"] = True
jhbuildrc_globals["notrayicon"] = True

0 comments on commit f280155

Please sign in to comment.