2011-05-31 Mikhail Naganov <mnaganov@chromium.org>
authormnaganov@chromium.org <mnaganov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jun 2011 07:46:13 +0000 (07:46 +0000)
committermnaganov@chromium.org <mnaganov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jun 2011 07:46:13 +0000 (07:46 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector [Chromium]: Put worker scripts into devtools_frontend.zip.
        https://bugs.webkit.org/show_bug.cgi?id=61803

        * WebKit.gyp:
        * scripts/generate_devtools_zip.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87781 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gyp
Source/WebKit/chromium/scripts/generate_devtools_zip.py

index ab2cb98..6fea6e2 100644 (file)
@@ -1,3 +1,13 @@
+2011-05-31  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector [Chromium]: Put worker scripts into devtools_frontend.zip.
+        https://bugs.webkit.org/show_bug.cgi?id=61803
+
+        * WebKit.gyp:
+        * scripts/generate_devtools_zip.py:
+
 2011-05-31  Kinuko Yasuda  <kinuko@chromium.org>
 
         Reviewed by Kent Tamura.
index 7bef1fa..bf8e6c7 100644 (file)
                 'action_name': 'generate_devtools_zip',
                 'script_name': 'scripts/generate_devtools_zip.py',
                 'inspector_html': '../../WebCore/inspector/front-end/inspector.html',
+                'workers_files': [
+                    '../../WebCore/inspector/front-end/HeapSnapshotWorker.js',
+                    '../../WebCore/inspector/front-end/JavaScriptFormatter.js',
+                    '../../WebCore/inspector/front-end/ScriptFormatterWorker.js',
+                    '<@(webinspector_uglifyjs_files)'
+                ],
                 'inputs': [
                     '<@(_script_name)',
                     'scripts/generate_devtools_html.py',
                     '<@(devtools_files)',
                     '<@(webinspector_files)',
                     '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js',
+                    '<@(_workers_files)',
                     '<@(webinspector_image_files)',
                     '<@(devtools_image_files)',
                 ],
                 'outputs': ['<(PRODUCT_DIR)/devtools_frontend.zip'],
                 'action': ['python', '<@(_script_name)', '<@(_inspector_html)',
                                      '--devtools-files', '<@(devtools_files)',
+                                     '--workers-files', '<@(_workers_files)',
                                      '--search-path', '<@(_search_path)',
                                      '--image-search-path', '<@(_image_search_path)',
                                      '--output', '<@(_outputs)'],
index 736da05..6bd7683 100644 (file)
@@ -47,10 +47,11 @@ import generate_devtools_html
 
 
 class ParsedArgs:
-    def __init__(self, inspector_html, devtools_files, search_dirs,
-                 image_search_dirs, output_filename):
+    def __init__(self, inspector_html, devtools_files, workers_files,
+                 search_dirs, image_search_dirs, output_filename):
         self.inspector_html = inspector_html
         self.devtools_files = devtools_files
+        self.workers_files = workers_files
         self.search_dirs = search_dirs
         self.image_search_dirs = image_search_dirs
         self.output_filename = output_filename
@@ -60,16 +61,18 @@ def parse_args(argv):
     inspector_html = argv[0]
 
     devtools_files_position = argv.index('--devtools-files')
+    workers_files_position = argv.index('--workers-files')
     search_path_position = argv.index('--search-path')
     image_search_path_position = argv.index('--image-search-path')
     output_position = argv.index('--output')
 
-    devtools_files = argv[devtools_files_position + 1:search_path_position]
+    devtools_files = argv[devtools_files_position + 1:workers_files_position]
+    workers_files = argv[workers_files_position + 1:search_path_position]
     search_dirs = argv[search_path_position + 1:image_search_path_position]
     image_search_dirs = argv[image_search_path_position + 1:output_position]
 
-    return ParsedArgs(inspector_html, devtools_files, search_dirs,
-                      image_search_dirs, argv[output_position + 1])
+    return ParsedArgs(inspector_html, devtools_files, workers_files,
+                      search_dirs, image_search_dirs, argv[output_position + 1])
 
 
 def main(argv):
@@ -98,6 +101,24 @@ def main(argv):
                             (input_file_name, 'devtools.html'))
         zip.write(full_path, os.path.basename(full_path))
 
+    front_end_path = 'front-end'
+    for dirname in parsed_args.search_dirs:
+        if dirname.find(front_end_path):
+            front_end_path = dirname
+            break
+
+    for input_file_name in set(parsed_args.workers_files):
+        # We assume that workers-related files reside in the 'front-end'
+        # directory
+        relpath = os.path.relpath(os.path.dirname(input_file_name),
+                                  front_end_path)
+        if relpath == '.':
+            relpath = ''
+        else:
+            relpath += '/'
+        zip.write(input_file_name,
+                  relpath + os.path.basename(input_file_name))
+
     for dirname in parsed_args.image_search_dirs:
         for filename in os.listdir(dirname):
             if not filename.endswith('.png') and not filename.endswith('.gif'):