From ebdc20f571cdba8e77fc97fb6be07b6382a3aba9 Mon Sep 17 00:00:00 2001 From: Jingwen Chen Date: Thu, 1 Sep 2022 18:54:50 +0000 Subject: [PATCH] Use CommonAttributes.Data for cc_test.data. data is a common attr like name, so avoid redefining it in testBinaryAttrs. Test: presubmits Change-Id: Ia694b94620dfad6b8411e5a1b6c530843983ca01 --- cc/test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cc/test.go b/cc/test.go index 3e85e2df9..28a0e5ebf 100644 --- a/cc/test.go +++ b/cc/test.go @@ -643,7 +643,6 @@ type testBinaryAttributes struct { Gtest bool Isolated bool - Data bazel.LabelListAttribute } // testBinaryBp2build is the bp2build converter for cc_test modules. A cc_test's @@ -659,6 +658,8 @@ func testBinaryBp2build(ctx android.TopDownMutatorContext, m *Module) { var testBinaryAttrs testBinaryAttributes testBinaryAttrs.binaryAttributes = binaryBp2buildAttrs(ctx, m) + var data bazel.LabelListAttribute + testBinaryProps := m.GetArchVariantProperties(ctx, &TestBinaryProperties{}) for axis, configToProps := range testBinaryProps { for config, props := range configToProps { @@ -668,7 +669,7 @@ func testBinaryBp2build(ctx android.TopDownMutatorContext, m *Module) { combinedData.Append(android.BazelLabelForModuleSrc(ctx, p.Data)) combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_bins)) combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_libs)) - testBinaryAttrs.Data.SetSelectValue(axis, config, combinedData) + data.SetSelectValue(axis, config, combinedData) } } } @@ -686,6 +687,9 @@ func testBinaryBp2build(ctx android.TopDownMutatorContext, m *Module) { Rule_class: "cc_test", Bzl_load_location: "//build/bazel/rules/cc:cc_test.bzl", }, - android.CommonAttributes{Name: m.Name()}, + android.CommonAttributes{ + Name: m.Name(), + Data: data, + }, &testBinaryAttrs) }