Merge "Revert "Revert "Add static_libs support to android_app bp2build converter."""

This commit is contained in:
Romain Jobredeaux
2022-01-21 20:51:06 +00:00
committed by Gerrit Code Review
3 changed files with 8 additions and 1 deletions

View File

@@ -1436,6 +1436,7 @@ type bazelAndroidAppAttributes struct {
Manifest bazel.Label
Custom_package *string
Resource_files bazel.LabelListAttribute
Deps bazel.LabelListAttribute
}
// ConvertWithBp2build is used to convert android_app to Bazel.
@@ -1453,12 +1454,15 @@ func (a *AndroidApp) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
resourceFiles.Includes = append(resourceFiles.Includes, files...)
}
deps := bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, a.properties.Static_libs))
attrs := &bazelAndroidAppAttributes{
Srcs: srcs,
Manifest: android.BazelLabelForModuleSrcSingle(ctx, manifest),
// TODO(b/209576404): handle package name override by product variable PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES
Custom_package: a.overridableAppProperties.Package_name,
Resource_files: bazel.MakeLabelListAttribute(resourceFiles),
Deps: deps,
}
props := bazel.BazelTargetModuleProperties{Rule_class: "android_binary",
Bzl_load_location: "@rules_android//rules:rules.bzl"}