Prepare for launcher prebuilts on the host
Instead of building python3 for the host for every build using
`embedded_launcher: true`, I'm preparing to switch us to using prebuilts
from prebuilts/build-tools. Besides improving build speed, this should
let us enable the _ssl module, which requires openssl, which is not
available on platform branches.
The changes to actually support using the prebuilts will come in a later
change, as we need to get the prebuilts in the tree first.
Test: treehugger
Change-Id: Ibc99c3e41ea8c03e8d17ec38cbd25b24f7d96acf
diff --git a/Lib/Android.bp b/Lib/Android.bp
index e744fac..ecc8b29 100644
--- a/Lib/Android.bp
+++ b/Lib/Android.bp
@@ -12,10 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-python_library {
- name: "py3-stdlib",
- is_internal: true,
- pkg_path: "stdlib",
+filegroup {
+ name: "py3-stdlib-srcs",
srcs: [
"*.py",
"asyncio/**/*.py",
@@ -42,5 +40,23 @@
exclude_srcs: [
"__phello__.foo.py",
],
+}
+
+python_library {
+ name: "py3-stdlib",
+ is_internal: true,
+ pkg_path: "stdlib",
+ srcs: [":py3-stdlib-srcs"],
host_supported: true,
}
+
+// Used by prebuilts/build-tools/build-prebuilts.sh to update
+// prebuilts/build-tools/common/py3-stdlib
+genrule {
+ name: "py3-stdlib-zip",
+ tools: ["soong_zip"],
+ cmd: "echo $(in) >$(genDir)/list && " +
+ "$(location soong_zip) -o $(out) -C external/python/cpython3/Lib -l $(genDir)/list",
+ srcs: [":py3-stdlib-srcs"],
+ out: ["py3-stdlib.zip"],
+}