Andrew Lamb | eceaec0 | 2020-02-11 14:16:41 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
| 2 | # Copyright 2020 The Chromium OS Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | """Run a program's constraint checks on a project.""" |
| 6 | |
| 7 | import argparse |
| 8 | import os |
| 9 | |
| 10 | from checker import io_utils |
| 11 | |
| 12 | |
| 13 | def argument_parser(): |
| 14 | parser = argparse.ArgumentParser(description=__doc__) |
| 15 | parser.add_argument( |
| 16 | '--program', |
| 17 | required=True, |
| 18 | help=('Path to the root of the program repo' |
| 19 | ' e.g. .../chromiumos/src/program/program1'), |
| 20 | metavar='PATH') |
| 21 | parser.add_argument( |
| 22 | '--project', |
| 23 | required=True, |
| 24 | help=('Path to the root of the project repo' |
| 25 | ' e.g. .../chromiumos/src/project/program1/project1'), |
| 26 | metavar='PATH') |
| 27 | return parser |
| 28 | |
| 29 | |
| 30 | def main(): |
| 31 | parser = argument_parser() |
| 32 | args = parser.parse_args() |
| 33 | |
| 34 | project_config = io_utils.read_repo_config(args.project) |
| 35 | program_config = io_utils.read_repo_config(args.program) |
| 36 | |
| 37 | print('Read project config: {}'.format(project_config)) |
| 38 | print('Read program config: {}'.format(program_config)) |
| 39 | |
| 40 | |
| 41 | if __name__ == '__main__': |
| 42 | main() |