blob: c0ab2750aa09c7bbd6e1b24686a2442f86409613 [file] [log] [blame]
Andrew Lambeceaec02020-02-11 14:16:41 -07001#!/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
7import argparse
8import os
9
10from checker import io_utils
11
12
13def 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
30def 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
41if __name__ == '__main__':
42 main()