diff --git a/Tools/Scripts/run-gtk-tests b/Tools/Scripts/run-gtk-tests index 5088447a4ef1..e98086039b2e 100755 --- a/Tools/Scripts/run-gtk-tests +++ b/Tools/Scripts/run-gtk-tests @@ -31,9 +31,6 @@ 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 @@ -198,7 +195,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"] = jhbuildrc_common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit2") + self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = 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 diff --git a/Tools/gtk/check-gdom-symbols b/Tools/gtk/check-gdom-symbols index 588b7e83e729..bf35c213d0c5 100755 --- a/Tools/gtk/check-gdom-symbols +++ b/Tools/gtk/check-gdom-symbols @@ -22,9 +22,6 @@ 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): return False @@ -52,7 +49,7 @@ if __name__ == '__main__': tmp.write(file_handle.read()) tmp.flush() - gdom_source_path = jhbuildrc_common.top_level_path('Source', 'WebCore', 'bindings') + gdom_source_path = 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]) diff --git a/Tools/gtk/common.py b/Tools/gtk/common.py index 6e51af59b946..02f8b654116e 100644 --- a/Tools/gtk/common.py +++ b/Tools/gtk/common.py @@ -21,9 +21,7 @@ import subprocess import sys -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild")) -import jhbuildrc_common - +top_level_dir = None build_dir = None library_build_dir = None tests_library_build_dir = None @@ -31,6 +29,13 @@ build_types = ('Release', 'Debug') +def top_level_path(*args): + global top_level_dir + if not top_level_dir: + top_level_dir = os.path.join(os.path.dirname(__file__), '..', '..') + return os.path.join(*(top_level_dir,) + args) + + def set_build_types(new_build_types): global build_types build_types = new_build_types @@ -100,20 +105,20 @@ def is_valid_build_directory(path): global build_types for build_type in build_types: - build_dir = jhbuildrc_common.top_level_path('WebKitBuild', build_type) + build_dir = 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 = jhbuildrc_common.top_level_path("_build") + build_dir = top_level_path("_build") if is_valid_build_directory(build_dir): return build_dir - build_dir = jhbuildrc_common.top_level_path() + build_dir = top_level_path() if is_valid_build_directory(build_dir): return build_dir - build_dir = jhbuildrc_common.top_level_path("WebKitBuild") + build_dir = top_level_path("WebKitBuild") if is_valid_build_directory(build_dir): return build_dir diff --git a/Tools/gtk/find-make-dist-errors b/Tools/gtk/find-make-dist-errors index a0c4150cab3f..880c780a5134 100755 --- a/Tools/gtk/find-make-dist-errors +++ b/Tools/gtk/find-make-dist-errors @@ -20,9 +20,6 @@ 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') @@ -89,7 +86,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(jhbuildrc_common.top_level_path(header)): + if not os.path.exists(common.top_level_path(header)): missing.add(header) return missing diff --git a/Tools/gtk/generate-inspector-gresource-manifest.py b/Tools/gtk/generate-inspector-gresource-manifest.py index 0bd639429957..58a1df17f5a0 100755 --- a/Tools/gtk/generate-inspector-gresource-manifest.py +++ b/Tools/gtk/generate-inspector-gresource-manifest.py @@ -20,10 +20,7 @@ import os import sys -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild")) -import jhbuildrc_common - -resources_path = jhbuildrc_common.top_level_path() + "/Source/WebInspectorUI/" +resources_path = common.top_level_path() + "/Source/WebInspectorUI/" inspector_files = \ glob.glob(resources_path + 'UserInterface/*.html') + \ glob.glob(resources_path + 'UserInterface/*.js') + \