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 os | 6 import os |
7 import subprocess | 7 import subprocess |
8 import sys | 8 import sys |
9 import tempfile | 9 import tempfile |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 '--script-in-head', 'false', | 85 '--script-in-head', 'false', |
86 '--html', html_out_path, | 86 '--html', html_out_path, |
87 '--js', js_out_path]) | 87 '--js', js_out_path]) |
88 | 88 |
89 # TODO(tsergeant): Remove when JS resources are minified by default: | 89 # TODO(tsergeant): Remove when JS resources are minified by default: |
90 # crbug.com/619091. | 90 # crbug.com/619091. |
91 _run_cmd(['uglifyjs', js_out_path, | 91 _run_cmd(['uglifyjs', js_out_path, |
92 '--beautify', 'indent-level=2,quote_style=3', | 92 '--beautify', 'indent-level=2,quote_style=3', |
93 '--comments', '/Copyright|license|LICENSE|\<\/?if/', | 93 '--comments', '/Copyright|license|LICENSE|\<\/?if/', |
94 '--output', js_out_path]) | 94 '--output', js_out_path]) |
| 95 _run_cmd(['polymer-css-build', html_out_path]) |
95 finally: | 96 finally: |
96 os.remove(tmp.name) | 97 os.remove(tmp.name) |
97 | 98 |
98 | 99 |
99 def main(): | 100 def main(): |
100 _vulcanize(directory='md_downloads', host='downloads', | 101 _vulcanize(directory='md_downloads', host='downloads', |
101 html_in_file='downloads.html') | 102 html_in_file='downloads.html') |
102 | 103 |
103 # Already loaded by history.html: | 104 # Already loaded by history.html: |
104 history_extra_args = ['--exclude', 'chrome://resources/html/util.html', | 105 history_extra_args = ['--exclude', 'chrome://resources/html/util.html', |
105 '--exclude', 'chrome://history/constants.html'] | 106 '--exclude', 'chrome://history/constants.html'] |
106 _vulcanize(directory='md_history', host='history', html_in_file='app.html', | 107 _vulcanize(directory='md_history', host='history', html_in_file='app.html', |
107 html_out_file='app.vulcanized.html', js_out_file='app.crisper.js', | 108 html_out_file='app.vulcanized.html', js_out_file='app.crisper.js', |
108 extra_args=history_extra_args) | 109 extra_args=history_extra_args) |
109 | 110 |
110 | 111 |
111 if __name__ == '__main__': | 112 if __name__ == '__main__': |
112 main() | 113 main() |
OLD | NEW |