bp2build apex min_sdk_version w/ soong config var
Previously min_sdk_version did not handle soong config vars Test: m bp2build and verify com.android.adbd Change-Id: I48426a8e6e03b61234b77ce7d7ec07b1cab36b7b
This commit is contained in:
committed by
Sasha Smundak
parent
9d2d41065c
commit
b83b7b024e
18
apex/apex.go
18
apex/apex.go
@@ -3426,7 +3426,7 @@ type bazelApexBundleAttributes struct {
|
||||
Key bazel.LabelAttribute
|
||||
Certificate bazel.LabelAttribute // used when the certificate prop is a module
|
||||
Certificate_name bazel.StringAttribute // used when the certificate prop is a string
|
||||
Min_sdk_version *string
|
||||
Min_sdk_version bazel.StringAttribute
|
||||
Updatable bazel.BoolAttribute
|
||||
Installable bazel.BoolAttribute
|
||||
Binaries bazel.LabelListAttribute
|
||||
@@ -3445,6 +3445,10 @@ type convertedNativeSharedLibs struct {
|
||||
Native_shared_libs_64 bazel.LabelListAttribute
|
||||
}
|
||||
|
||||
const (
|
||||
minSdkVersionPropName = "Min_sdk_version"
|
||||
)
|
||||
|
||||
// ConvertWithBp2build performs bp2build conversion of an apex
|
||||
func (a *apexBundle) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
|
||||
// We only convert apex and apex_test modules at this time
|
||||
@@ -3483,11 +3487,19 @@ func convertWithBp2build(a *apexBundle, ctx android.TopDownMutatorContext) (baze
|
||||
fileContextsLabelAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, *a.properties.File_contexts))
|
||||
}
|
||||
|
||||
productVariableProps := android.ProductVariableProperties(ctx)
|
||||
// TODO(b/219503907) this would need to be set to a.MinSdkVersionValue(ctx) but
|
||||
// given it's coming via config, we probably don't want to put it in here.
|
||||
var minSdkVersion *string
|
||||
var minSdkVersion bazel.StringAttribute
|
||||
if a.properties.Min_sdk_version != nil {
|
||||
minSdkVersion = a.properties.Min_sdk_version
|
||||
minSdkVersion.SetValue(*a.properties.Min_sdk_version)
|
||||
}
|
||||
if props, ok := productVariableProps[minSdkVersionPropName]; ok {
|
||||
for c, p := range props {
|
||||
if val, ok := p.(*string); ok {
|
||||
minSdkVersion.SetSelectValue(c.ConfigurationAxis(), c.SelectKey(), val)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var keyLabelAttribute bazel.LabelAttribute
|
||||
|
Reference in New Issue
Block a user