• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2# coding: utf-8
3
4"""
5Copyright (c) 2021-2023 Huawei Device Co., Ltd.
6Licensed under the Apache License, Version 2.0 (the "License");
7you may not use this file except in compliance with the License.
8You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing, software
13distributed under the License is distributed on an "AS IS" BASIS,
14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15See the License for the specific language governing permissions and
16limitations under the License.
17
18"""
19
20import os
21import argparse
22import re
23import subprocess
24import tempfile
25import shutil
26import build_policy_api
27
28
29def parse_args():
30    parser = argparse.ArgumentParser()
31    parser.add_argument(
32        '--dst-file', help='the policy dest path', required=True)
33    parser.add_argument('--tool-path',
34                        help='the policy tool bin path', required=True)
35    parser.add_argument('--source-root-dir',
36                        help='prj root path', required=True)
37    parser.add_argument('--policy_dir_list',
38                        help='policy dirs need to be included', required=True)
39    parser.add_argument('--debug-version',
40                        help='build for debug target', required=True)
41    parser.add_argument('--updater-version',
42                        help='build for updater target', required=True)
43    parser.add_argument('--components',
44                        help='system or vendor or default', required=True)
45    parser.add_argument('--vendor-policy-version',
46                        help='plat version of vendor policy', required=False)
47    return parser.parse_args()
48
49
50if __name__ == "__main__":
51    input_args = parse_args()
52    build_policy_api.main(input_args)
53