blob: 2db3018f6aecf2f9c9989f5ab237646a54db9454 [file] [log] [blame]
Dan Willemsenb3614d22019-10-07 16:06:34 -07001// Copyright 2019 Google Inc. All rights reserved.
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
Dan Willemsen6e345142020-12-16 19:03:07 -080015filegroup {
16 name: "py3-stdlib-srcs",
Dan Willemsenb33c6902020-12-23 16:39:22 -080017 visibility: ["//visibility:private"],
Dan Willemsenb3614d22019-10-07 16:06:34 -070018 srcs: [
19 "*.py",
Dan Willemsenee44d9a2020-01-20 23:02:18 -080020 "asyncio/**/*.py",
Dan Willemsenb3614d22019-10-07 16:06:34 -070021 "collections/**/*.py",
Dan Willemsenee44d9a2020-01-20 23:02:18 -080022 "concurrent/**/*.py",
Dan Willemsenb3614d22019-10-07 16:06:34 -070023 "ctypes/**/*.py",
24 "distutils/**/*.py",
25 "email/**/*.py",
26 "encodings/**/*.py",
Dan Willemsenee44d9a2020-01-20 23:02:18 -080027 "html/**/*.py",
28 "http/**/*.py",
Dan Willemsenb3614d22019-10-07 16:06:34 -070029 "importlib/**/*.py",
30 "json/**/*.py",
31 "logging/**/*.py",
32 "multiprocessing/**/*.py",
33 "pydoc_data/**/*.py",
34 "sqlite3/**/*.py",
35 "unittest/**/*.py",
Dan Willemsenee44d9a2020-01-20 23:02:18 -080036 "urllib/**/*.py",
Dan Willemsenb3614d22019-10-07 16:06:34 -070037 "wsgiref/**/*.py",
38 "xml/**/*.py",
Dan Willemsenee44d9a2020-01-20 23:02:18 -080039 "xmlrpc/**/*.py",
Dan Willemsenb3614d22019-10-07 16:06:34 -070040 ],
41 exclude_srcs: [
42 "__phello__.foo.py",
43 ],
Dan Willemsen6e345142020-12-16 19:03:07 -080044}
45
Dan Willemsenb33c6902020-12-23 16:39:22 -080046soong_config_module_type {
47 name: "cpython3_python_stdlib",
48 module_type: "python_library",
49 config_namespace: "cpython3",
50 bool_variables: ["force_build_host"],
51 properties: ["defaults"],
52}
53
54python_defaults {
55 name: "py3-stdlib-force-build",
56 defaults_visibility: ["//visibility:private"],
57 target: {
58 linux_glibc: {
59 exclude_srcs: [":py3-stdlib-prebuilt-srcs"],
60 srcs: [":py3-stdlib-srcs"],
61 },
62 darwin: {
63 exclude_srcs: [":py3-stdlib-prebuilt-srcs"],
64 srcs: [":py3-stdlib-srcs"],
65 },
66 },
67}
68
69cpython3_python_stdlib {
Dan Willemsen6e345142020-12-16 19:03:07 -080070 name: "py3-stdlib",
71 is_internal: true,
72 pkg_path: "stdlib",
Dan Willemsenb3614d22019-10-07 16:06:34 -070073 host_supported: true,
Dan Willemsenb33c6902020-12-23 16:39:22 -080074 target: {
75 android: {
76 srcs: [":py3-stdlib-srcs"],
77 },
78 linux_bionic: {
79 srcs: [":py3-stdlib-srcs"],
80 },
81 linux_glibc: {
82 srcs: [":py3-stdlib-prebuilt-srcs"],
83 },
84 darwin: {
85 srcs: [":py3-stdlib-prebuilt-srcs"],
86 },
87 },
88 soong_config_variables: {
89 force_build_host: {
90 defaults: ["py3-stdlib-force-build"],
91 },
92 },
Dan Willemsenb3614d22019-10-07 16:06:34 -070093}
Dan Willemsen6e345142020-12-16 19:03:07 -080094
95// Used by prebuilts/build-tools/build-prebuilts.sh to update
96// prebuilts/build-tools/common/py3-stdlib
97genrule {
98 name: "py3-stdlib-zip",
Dan Willemsenb33c6902020-12-23 16:39:22 -080099 visibility: ["//visibility:private"],
Dan Willemsen6e345142020-12-16 19:03:07 -0800100 tools: ["soong_zip"],
101 cmd: "echo $(in) >$(genDir)/list && " +
102 "$(location soong_zip) -o $(out) -C external/python/cpython3/Lib -l $(genDir)/list",
103 srcs: [":py3-stdlib-srcs"],
104 out: ["py3-stdlib.zip"],
105}