| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2017 The Chromium Authors. All rights reserved. | 2 # Copyright 2017 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 os | 7 import os |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 _HERE_PATH = os.path.dirname(__file__) | 10 _HERE_PATH = os.path.dirname(__file__) |
| 11 _SRC_PATH = os.path.normpath(os.path.join(_HERE_PATH, '..', '..', '..')) | 11 _SRC_PATH = os.path.normpath(os.path.join(_HERE_PATH, '..', '..', '..')) |
| 12 _CWD = os.getcwd() | 12 _CWD = os.getcwd() |
| 13 | 13 |
| 14 sys.path.append(os.path.join(_SRC_PATH, 'third_party', 'node')) | 14 sys.path.append(os.path.join(_SRC_PATH, 'third_party', 'node')) |
| 15 import node | 15 import node |
| 16 import node_modules | 16 import node_modules |
| 17 | 17 |
| 18 def _css_build(out_folder, input_files, output_files): | 18 def _css_build(out_folder, input_files, output_files): |
| 19 out_path = os.path.join(_CWD, out_folder) | 19 out_path = os.path.join(_CWD, out_folder) |
| 20 in_paths = map(lambda f: os.path.join(out_path, f), input_files) | 20 in_paths = map(lambda f: os.path.join(out_path, f), input_files) |
| 21 out_paths = map(lambda f: os.path.join(out_path, f), output_files) | 21 out_paths = map(lambda f: os.path.join(out_path, f), output_files) |
| 22 | 22 |
| 23 args = ['--no-inline-includes', '-f'] + in_paths + ['-o'] + out_paths | 23 node.RunNode([node_modules.PathToPolymerCssBuild(), '-f'] + in_paths + |
| 24 node.RunNode([node_modules.PathToPolymerCssBuild()] + args) | 24 ['-o'] + out_paths) |
| 25 | 25 |
| 26 | 26 |
| 27 def main(): | 27 def main(): |
| 28 parser = argparse.ArgumentParser() | 28 parser = argparse.ArgumentParser() |
| 29 parser.add_argument('--out_folder') | 29 parser.add_argument('--out_folder') |
| 30 parser.add_argument('--input_files', nargs='+') | 30 parser.add_argument('--input_files', nargs='+') |
| 31 parser.add_argument('--output_files', nargs='+') | 31 parser.add_argument('--output_files', nargs='+') |
| 32 args = parser.parse_args() | 32 args = parser.parse_args() |
| 33 | 33 |
| 34 _css_build( | 34 _css_build( |
| 35 args.out_folder, | 35 args.out_folder, |
| 36 input_files=args.input_files, | 36 input_files=args.input_files, |
| 37 output_files=args.output_files) | 37 output_files=args.output_files) |
| 38 | 38 |
| 39 | 39 |
| 40 if __name__ == '__main__': | 40 if __name__ == '__main__': |
| 41 main() | 41 main() |
| OLD | NEW |