Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(941)

Unified Diff: third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py

Issue 1442013004: Use GN response files for devtools .grd (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | tools/gn/action_target_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py
diff --git a/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py b/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py
index d990febfed8eed6aaf1eeeb9e32c71f4bf8bcdbe..95f86b7d3fb815915a706a6ed32a1a815aea6fd6 100755
--- a/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py
+++ b/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py
@@ -35,6 +35,7 @@ from os import path
import errno
import os
+import shlex
import shutil
import sys
from xml.dom import minidom
@@ -67,14 +68,36 @@ class ParsedArgs:
def parse_args(argv):
- static_files_list_position = argv.index('--static_files_list')
+ # The arguments are of the format:
+ # [ <source_files> ]*
+ # [ (--static_files_list <file>) | (--static_files_args <file>) ]
+ # --relative_path_dirs [ <directory> ]*
+ # --images [ <image_dirs> ]*
+ # --output <output_file>
+ #
+ # --static_files_list means the file contains newline-separated filenames
+ # from GYP, and --static_files_args means the file looks like a shell
+ # string from GN.
relative_path_dirs_position = argv.index('--relative_path_dirs')
images_position = argv.index('--images')
output_position = argv.index('--output')
- static_files_list_path = argv[static_files_list_position + 1]
- source_files = argv[:static_files_list_position]
- with open(static_files_list_path, 'r') as static_list_file:
- source_files.extend([line.rstrip('\n') for line in static_list_file.readlines()])
+
+ if '--static_files_list' in argv:
+ # This branch can be removed when GYP support is no longer necessary.
+ static_files_list_position = argv.index('--static_files_list')
+ static_files_list_path = argv[static_files_list_position + 1]
+ source_files = argv[:static_files_list_position]
+ with open(static_files_list_path, 'r') as static_list_file:
+ source_files.extend([line.rstrip('\n') for line in static_list_file.readlines()])
+ elif '--static_files_args' in argv:
+ static_files_args_position = argv.index('--static_files_args')
+ static_files_args_path = argv[static_files_args_position + 1]
+ source_files = argv[:static_files_args_position]
+ with open(static_files_args_path, 'r') as static_args_file:
+ source_files.extend(shlex.split(static_args_file))
+ else:
+ source_files = argv[:relative_path_dirs_position]
+
relative_path_dirs = argv[relative_path_dirs_position + 1:images_position]
image_dirs = argv[images_position + 1:output_position]
return ParsedArgs(source_files, relative_path_dirs, image_dirs, argv[output_position + 1])
« no previous file with comments | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | tools/gn/action_target_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698