From 447f6c99c9eef8f814552f70697dfe4a42bda5bd Mon Sep 17 00:00:00 2001 From: Alex Márquez Pérez Muñíz Díaz Púras Thaureaux Date: Tue, 31 Aug 2021 20:30:36 +0000 Subject: Bp2Build common properties auto-handling Introduce `commonAttributes` & `fillCommonBp2BuildModuleAttrs used in CreateBazelTargetModule Adapt `bp2BuildInfo` to use `commonAttrs` instead of `Name`. And thus also all downstream users of `CreateBazelTargetModule`. As initial user, the Soong `required` property will be translated to Bazel's `data`. Bug: 198146582, 196091467 Test: build_converstion_test.go:TestCommonBp2BuildModuleAttrs Test: go test Test: mixed_{libc,droid}.sh Change-Id: Ib500e40f7e2cb48c459f1ebe3188962fc41ec124 --- python/binary.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'python/binary.go') diff --git a/python/binary.go b/python/binary.go index afcc53a65..bf6167c3c 100644 --- a/python/binary.go +++ b/python/binary.go @@ -37,7 +37,6 @@ func registerPythonBinaryComponents(ctx android.RegistrationContext) { type bazelPythonBinaryAttributes struct { Main string Srcs bazel.LabelListAttribute - Data bazel.LabelListAttribute Deps bazel.LabelListAttribute Python_version string } @@ -85,7 +84,6 @@ func PythonBinaryBp2Build(ctx android.TopDownMutatorContext) { attrs := &bazelPythonBinaryAttributes{ Main: main, Srcs: baseAttrs.Srcs, - Data: baseAttrs.Data, Deps: baseAttrs.Deps, Python_version: python_version, } @@ -95,7 +93,10 @@ func PythonBinaryBp2Build(ctx android.TopDownMutatorContext) { Rule_class: "py_binary", } - ctx.CreateBazelTargetModule(m.Name(), props, attrs) + ctx.CreateBazelTargetModule(props, android.CommonAttributes{ + Name: m.Name(), + Data: baseAttrs.Data, + }, attrs) } type BinaryProperties struct { -- cgit v1.2.3-59-g8ed1b