summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJingwen Chen <jingwen@google.com>2021-03-15 06:02:43 -0400
committerJingwen Chen <jingwen@google.com>2021-03-30 13:22:48 +0000
commit0702791a99d076f79f2971ff96cf0e4eb5308319 (patch)
treef1a0754e473d19bb7f1e5ce7107a7b48b748edb3 /python
parent053520a86a9f5790aee3942cc454544f53ec1823 (diff)
bp2build: arch-configurable selects for label list attrs.
This CL adds the configurable LabelListAttribute support to bp2build. Test: go test Change-Id: I2ef9e385d9cf1b1845988128eca1d8cda1ecb5e8
Diffstat (limited to 'python')
-rw-r--r--python/binary.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/python/binary.go b/python/binary.go
index 5b0f080b3..e955492a6 100644
--- a/python/binary.go
+++ b/python/binary.go
@@ -36,8 +36,8 @@ func registerPythonBinaryComponents(ctx android.RegistrationContext) {
type bazelPythonBinaryAttributes struct {
Main string
- Srcs bazel.LabelList
- Data bazel.LabelList
+ Srcs bazel.LabelListAttribute
+ Data bazel.LabelListAttribute
Python_version string
}
@@ -97,10 +97,13 @@ func PythonBinaryBp2Build(ctx android.TopDownMutatorContext) {
// do nothing, since python_version defaults to PY3.
}
+ srcs := android.BazelLabelForModuleSrcExcludes(ctx, m.properties.Srcs, m.properties.Exclude_srcs)
+ data := android.BazelLabelForModuleSrc(ctx, m.properties.Data)
+
attrs := &bazelPythonBinaryAttributes{
Main: main,
- Srcs: android.BazelLabelForModuleSrcExcludes(ctx, m.properties.Srcs, m.properties.Exclude_srcs),
- Data: android.BazelLabelForModuleSrc(ctx, m.properties.Data),
+ Srcs: bazel.MakeLabelListAttribute(srcs),
+ Data: bazel.MakeLabelListAttribute(data),
Python_version: python_version,
}