product_variables srcs in prebuilt_etc
bp2build conversion handles product_variable srcs
bug: 228353067
Test: prebuilt_etc_conversion_test.go
Change-Id: I82d3a384ee14d4e981d502dd9eb824c87d5ae2c7
diff --git a/etc/prebuilt_etc.go b/etc/prebuilt_etc.go
index b2361ce..7520f58 100644
--- a/etc/prebuilt_etc.go
+++ b/etc/prebuilt_etc.go
@@ -31,6 +31,7 @@
"encoding/json"
"fmt"
"path/filepath"
+ "reflect"
"strings"
"github.com/google/blueprint/proptools"
@@ -692,6 +693,22 @@
src.SetSelectValue(axis, config, label)
}
}
+
+ for propName, productConfigProps := range android.ProductVariableProperties(ctx) {
+ for configProp, propVal := range productConfigProps {
+ if propName == "Src" {
+ props, ok := propVal.(*string)
+ if !ok {
+ ctx.PropertyErrorf(" Expected Property to have type string, but was %s\n", reflect.TypeOf(propVal).String())
+ continue
+ }
+ if props != nil {
+ label := android.BazelLabelForModuleSrcSingle(ctx, *props)
+ src.SetSelectValue(configProp.ConfigurationAxis(), configProp.SelectKey(), label)
+ }
+ }
+ }
+ }
}
var filename string