Chromium Code Reviews| Index: chrome/browser/resources/vulcanize_gn.py |
| diff --git a/chrome/browser/resources/vulcanize_gn.py b/chrome/browser/resources/vulcanize_gn.py |
| index 9189330863c0d3d6734c2da8ac7b9669d6c06cea..a6f1fda9f339bd2b3fc61dc2af6c3544baff7179 100755 |
| --- a/chrome/browser/resources/vulcanize_gn.py |
| +++ b/chrome/browser/resources/vulcanize_gn.py |
| @@ -73,9 +73,6 @@ _VULCANIZE_REDIRECT_ARGS = list(itertools.chain.from_iterable(map( |
| lambda m: ['--redirect', '"%s|%s"' % (m[0], m[1])], _URL_MAPPINGS))) |
| -_REQUEST_LIST_FILE = 'request_list.txt' |
| - |
| - |
| _PAK_UNPACK_FOLDER = 'flattened' |
| @@ -98,6 +95,8 @@ def _undo_mapping(mappings, url): |
| return url.replace(redirect_url, file_path + os.sep) |
| return url |
| +def _request_list_path(out_path, html_out_file): |
| + return os.path.join(out_path, html_out_file + '.requestlist') |
|
dpapad
2017/02/08 23:04:19
I am not super fond of using random file extension
calamity
2017/02/09 03:07:35
I've changed it to <html_out_file>_requestlist.txt
|
| # Get a list of all files that were bundled with Vulcanize and update the |
| # depfile accordingly such that Ninja knows when to trigger re-vulcanization. |
| @@ -106,8 +105,8 @@ def _update_dep_file(in_folder, args): |
| out_path = os.path.join(_CWD, args.out_folder) |
| # Prior call to vulcanize already generated the deps list, grab it from there. |
| - request_list = open(os.path.join( |
| - out_path, _REQUEST_LIST_FILE), 'r').read().splitlines() |
|
Dan Beam
2017/02/08 05:41:55
rebase
calamity
2017/02/09 03:07:35
Done.
|
| + request_list = open(_request_list_path(out_path, args.html_out_file), |
| + 'r').read().splitlines() |
| # Undo the URL mappings applied by vulcanize to get file paths relative to |
| # current working directory. |
| @@ -140,10 +139,15 @@ def _vulcanize(in_folder, args): |
| html_out_path = os.path.join(out_path, args.html_out_file) |
| js_out_path = os.path.join(out_path, args.js_out_file) |
| + exclude_args = [] |
| + for f in args.exclude or []: |
| + exclude_args.append('--exclude') |
| + exclude_args.append(f) |
| + |
| output = _run_node( |
| [node_modules.PathToVulcanize()] + |
| - _VULCANIZE_BASE_ARGS + _VULCANIZE_REDIRECT_ARGS + |
| - ['--out-request-list', os.path.join(out_path, _REQUEST_LIST_FILE), |
| + _VULCANIZE_BASE_ARGS + _VULCANIZE_REDIRECT_ARGS + exclude_args + |
| + ['--out-request-list', _request_list_path(out_path, args.html_out_file), |
| '--redirect', '"/|%s"' % in_path, |
| '--redirect', '"chrome://%s/|%s"' % (args.host, in_path), |
| # TODO(dpapad): Figure out why vulcanize treats the input path |
| @@ -188,6 +192,7 @@ def _css_build(out_folder, files): |
| def main(): |
| parser = argparse.ArgumentParser() |
| parser.add_argument('--depfile') |
| + parser.add_argument('--exclude', action='append') |
|
Dan Beam
2017/02/08 05:41:55
rebase
calamity
2017/02/09 03:07:35
Done.
|
| parser.add_argument('--host') |
| parser.add_argument('--html_in_file') |
| parser.add_argument('--html_out_file') |
| @@ -205,7 +210,6 @@ def main(): |
| # vulcanize. |
| if (args.input_type == 'PAK_FILE'): |
| import unpack_pak |
| - input_folder = os.path.join(_CWD, args.input) |
| output_folder = os.path.join(args.out_folder, _PAK_UNPACK_FOLDER) |
| unpack_pak.unpack(args.input, output_folder) |
| vulcanize_input_folder = output_folder |