Chromium Code Reviews| Index: chrome/browser/resources/css_build_gn.py |
| diff --git a/chrome/browser/resources/css_build_gn.py b/chrome/browser/resources/css_build_gn.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..b3fe4760844e55a001e1a06e86964421898cd252 |
| --- /dev/null |
| +++ b/chrome/browser/resources/css_build_gn.py |
| @@ -0,0 +1,41 @@ |
| +#!/usr/bin/env python |
| +# Copyright 2016 The Chromium Authors. All rights reserved. |
|
dpapad
2017/02/16 18:58:09
2017
calamity
2017/02/17 00:24:04
Done.
|
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import argparse |
| +import os |
| +import sys |
| + |
| +_HERE_PATH = os.path.dirname(__file__) |
| +_SRC_PATH = os.path.normpath(os.path.join(_HERE_PATH, '..', '..', '..')) |
| +_CWD = os.getcwd() |
| + |
| +sys.path.append(os.path.join(_SRC_PATH, 'third_party', 'node')) |
| +import node |
| +import node_modules |
| + |
| +def _css_build(out_folder, input_files, output_files): |
| + out_path = os.path.join(_CWD, out_folder) |
| + in_paths = map(lambda f: os.path.join(out_path, f), input_files) |
| + out_paths = map(lambda f: os.path.join(out_path, f), output_files) |
| + |
| + node.RunNode([node_modules.PathToPolymerCssBuild(), '-f'] + in_paths + |
|
dpapad
2017/02/16 18:58:09
Did you investigate at all whether we were missing
calamity
2017/02/17 00:24:04
I'll start looking now.
|
| + ['-o'] + out_paths) |
| + |
| + |
| +def main(): |
| + parser = argparse.ArgumentParser() |
| + parser.add_argument('--out_folder') |
| + parser.add_argument('--input_files', nargs='+') |
| + parser.add_argument('--output_files', nargs='+') |
| + args = parser.parse_args() |
| + |
| + _css_build( |
| + args.out_folder, |
| + input_files=args.input_files, |
| + output_files=args.output_files) |
| + |
| + |
| +if __name__ == '__main__': |
| + main() |