| #!/usr/bin/env python3 | |
| # Copyright 2019 The Chromium OS Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| """Build the library deliverables.""" | |
| from __future__ import print_function | |
| import argparse | |
| import os | |
| import sys | |
| import libdot | |
| def get_parser(): | |
| """Get a command line parser.""" | |
| parser = libdot.ArgumentParser( | |
| description=__doc__, | |
| formatter_class=argparse.RawDescriptionHelpFormatter) | |
| parser.add_argument('-o', '--output', | |
| default=os.path.join(libdot.DIR, 'js'), | |
| help='Output directory. (default: %(default)s)') | |
| return parser | |
| def main(argv): | |
| """The main func!""" | |
| parser = get_parser() | |
| opts = parser.parse_args(argv) | |
| # TODO(vapier): Move more logic out of package.json here, maybe? | |
| os.makedirs(opts.output, exist_ok=True) | |
| libdot.concat.concat( | |
| os.path.join(libdot.DIR, 'concat', 'libdot.concat'), | |
| os.path.join(opts.output, 'libdot.js')) | |
| if __name__ == '__main__': | |
| sys.exit(main(sys.argv[1:])) |