Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 import itertools | 7 import itertools |
| 8 import os | 8 import os |
| 9 import platform | 9 import platform |
| 10 import re | 10 import re |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 def _vulcanize(in_folder, args): | 148 def _vulcanize(in_folder, args): |
| 149 in_path = os.path.normpath(os.path.join(_CWD, in_folder)) | 149 in_path = os.path.normpath(os.path.join(_CWD, in_folder)) |
| 150 out_path = os.path.join(_CWD, args.out_folder) | 150 out_path = os.path.join(_CWD, args.out_folder) |
| 151 | 151 |
| 152 html_out_path = os.path.join(out_path, args.html_out_file) | 152 html_out_path = os.path.join(out_path, args.html_out_file) |
| 153 js_out_path = os.path.join(out_path, args.js_out_file) | 153 js_out_path = os.path.join(out_path, args.js_out_file) |
| 154 | 154 |
| 155 output = _run_node( | 155 output = _run_node( |
| 156 [node_modules.PathToVulcanize()] + | 156 [node_modules.PathToVulcanize()] + |
| 157 _VULCANIZE_BASE_ARGS + _VULCANIZE_REDIRECT_ARGS + | 157 _VULCANIZE_BASE_ARGS + _VULCANIZE_REDIRECT_ARGS + |
| 158 ['--out-request-list', os.path.join(out_path, _REQUEST_LIST_FILE), | 158 ['--out-request-list', os.path.normpath( |
| 159 os.path.join(out_path, _REQUEST_LIST_FILE)), | |
|
Dan Beam
2017/02/10 23:14:47
are you going to rebase on calamity@'s "vulcanize
dpapad
2017/02/13 18:53:54
Rebased.
| |
| 159 '--redirect', '"/|%s"' % in_path, | 160 '--redirect', '"/|%s"' % in_path, |
| 160 '--redirect', '"chrome://%s/|%s"' % (args.host, in_path), | 161 '--redirect', '"chrome://%s/|%s"' % (args.host, in_path), |
| 161 # TODO(dpapad): Figure out why vulcanize treats the input path | 162 # TODO(dpapad): Figure out why vulcanize treats the input path |
| 162 # differently on Windows VS Linux/Mac. | 163 # differently on Windows VS Linux/Mac. |
| 163 os.path.join( | 164 os.path.join( |
| 164 in_path if platform.system() == 'Windows' else os.sep, | 165 in_path if platform.system() == 'Windows' else os.sep, |
| 165 args.html_in_file)]) | 166 args.html_in_file)]) |
| 166 | 167 |
| 167 # Grit includes are not supported, use HTML imports instead. | 168 # Grit includes are not supported, use HTML imports instead. |
| 168 output = output.replace('<include src="', '<include src-disabled="') | 169 output = output.replace('<include src="', '<include src-disabled="') |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 vulcanize_input_folder = output_folder | 231 vulcanize_input_folder = output_folder |
| 231 | 232 |
| 232 _vulcanize(vulcanize_input_folder, args) | 233 _vulcanize(vulcanize_input_folder, args) |
| 233 _css_build(args.out_folder, files=[args.html_out_file]) | 234 _css_build(args.out_folder, files=[args.html_out_file]) |
| 234 | 235 |
| 235 _update_dep_file(vulcanize_input_folder, args) | 236 _update_dep_file(vulcanize_input_folder, args) |
| 236 | 237 |
| 237 | 238 |
| 238 if __name__ == '__main__': | 239 if __name__ == '__main__': |
| 239 main(sys.argv[1:]) | 240 main(sys.argv[1:]) |
| OLD | NEW |