1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19python_defaults {
20    name: "external_updater_defaults",
21    version: {
22        py2: {
23            enabled: false,
24            embedded_launcher: false,
25        },
26        py3: {
27            enabled: true,
28            // Error if enable:
29            // certificate verify failed: unable to get local issuer certificate
30            embedded_launcher: false,
31        },
32    },
33}
34
35python_binary_host {
36    name: "external_updater",
37    defaults: ["external_updater_defaults"],
38    main: "external_updater.py",
39    srcs: ["external_updater.py"],
40    libs: ["external_updater_lib"],
41}
42
43python_binary_host {
44    name: "external_updater_notifier",
45    defaults: ["external_updater_defaults"],
46    main: "notifier.py",
47    srcs: ["notifier.py"],
48}
49
50python_library_host {
51    name: "external_updater_lib",
52    defaults: ["external_updater_defaults"],
53    srcs: [
54        "archive_utils.py",
55        "base_updater.py",
56        "crates_updater.py",
57        "fileutils.py",
58        "git_updater.py",
59        "git_utils.py",
60        "github_archive_updater.py",
61        "hashtags.py",
62        "metadata.proto",
63        "reviewers.py",
64        "updater_utils.py",
65    ],
66    libs: [
67        "python-symbol",
68        "libprotobuf-python",
69    ],
70    proto: {
71        canonical_path_from_root: false,
72    },
73    data: [
74        "update_package.sh",
75        "regen_bp.sh",
76    ],
77}
78
79python_defaults {
80    name: "external_updater_test_defaults",
81    defaults: ["external_updater_defaults"],
82    version: {
83        py3: {
84            embedded_launcher: true,
85        },
86    },
87}
88
89python_test_host {
90    name: "external_updater_test",
91    defaults: ["external_updater_test_defaults"],
92    main: "external_updater_test.py",
93    srcs: ["external_updater_test.py"],
94    libs: ["external_updater_lib"],
95    test_options: {
96        unit_test: true,
97    },
98}
99
100python_test_host {
101    name: "external_updater_reviewers_test",
102    defaults: ["external_updater_test_defaults"],
103    main: "external_updater_reviewers_test.py",
104    srcs: ["external_updater_reviewers_test.py"],
105    libs: ["external_updater_lib"],
106    test_options: {
107        unit_test: true,
108    },
109}
110