Add support for prebuilts attribute to the bp2build APEX converter.
Test: Updated unit test. Change-Id: I73dfa84d7a55c0b94393ad6257b5f16313422852
This commit is contained in:
@@ -3197,6 +3197,7 @@ type bazelApexBundleAttributes struct {
|
|||||||
Installable bazel.BoolAttribute
|
Installable bazel.BoolAttribute
|
||||||
Native_shared_libs bazel.LabelListAttribute
|
Native_shared_libs bazel.LabelListAttribute
|
||||||
Binaries bazel.StringListAttribute
|
Binaries bazel.StringListAttribute
|
||||||
|
Prebuilts bazel.LabelListAttribute
|
||||||
}
|
}
|
||||||
|
|
||||||
type bazelApexBundle struct {
|
type bazelApexBundle struct {
|
||||||
@@ -3262,6 +3263,10 @@ func apexBundleBp2BuildInternal(ctx android.TopDownMutatorContext, module *apexB
|
|||||||
nativeSharedLibsLabelList := android.BazelLabelForModuleDeps(ctx, nativeSharedLibs)
|
nativeSharedLibsLabelList := android.BazelLabelForModuleDeps(ctx, nativeSharedLibs)
|
||||||
nativeSharedLibsLabelListAttribute := bazel.MakeLabelListAttribute(nativeSharedLibsLabelList)
|
nativeSharedLibsLabelListAttribute := bazel.MakeLabelListAttribute(nativeSharedLibsLabelList)
|
||||||
|
|
||||||
|
prebuilts := module.properties.Prebuilts
|
||||||
|
prebuiltsLabelList := android.BazelLabelForModuleDeps(ctx, prebuilts)
|
||||||
|
prebuiltsLabelListAttribute := bazel.MakeLabelListAttribute(prebuiltsLabelList)
|
||||||
|
|
||||||
binaries := module.properties.ApexNativeDependencies.Binaries
|
binaries := module.properties.ApexNativeDependencies.Binaries
|
||||||
binariesStringListAttribute := bazel.MakeStringListAttribute(binaries)
|
binariesStringListAttribute := bazel.MakeStringListAttribute(binaries)
|
||||||
|
|
||||||
@@ -3286,6 +3291,7 @@ func apexBundleBp2BuildInternal(ctx android.TopDownMutatorContext, module *apexB
|
|||||||
Installable: installableAttribute,
|
Installable: installableAttribute,
|
||||||
Native_shared_libs: nativeSharedLibsLabelListAttribute,
|
Native_shared_libs: nativeSharedLibsLabelListAttribute,
|
||||||
Binaries: binariesStringListAttribute,
|
Binaries: binariesStringListAttribute,
|
||||||
|
Prebuilts: prebuiltsLabelListAttribute,
|
||||||
}
|
}
|
||||||
|
|
||||||
props := bazel.BazelTargetModuleProperties{
|
props := bazel.BazelTargetModuleProperties{
|
||||||
|
@@ -69,6 +69,18 @@ cc_library {
|
|||||||
bazel_module: { bp2build_available: false },
|
bazel_module: { bp2build_available: false },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(b/194878861): Add bp2build support for prebuilt_etc
|
||||||
|
cc_library {
|
||||||
|
name: "pretend_prebuilt_1",
|
||||||
|
bazel_module: { bp2build_available: false },
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO(b/194878861): Add bp2build support for prebuilt_etc
|
||||||
|
cc_library {
|
||||||
|
name: "pretend_prebuilt_2",
|
||||||
|
bazel_module: { bp2build_available: false },
|
||||||
|
}
|
||||||
|
|
||||||
filegroup {
|
filegroup {
|
||||||
name: "com.android.apogee-file_contexts",
|
name: "com.android.apogee-file_contexts",
|
||||||
srcs: [
|
srcs: [
|
||||||
@@ -95,6 +107,10 @@ apex {
|
|||||||
"binary_1",
|
"binary_1",
|
||||||
"binary_2",
|
"binary_2",
|
||||||
],
|
],
|
||||||
|
prebuilts: [
|
||||||
|
"pretend_prebuilt_1",
|
||||||
|
"pretend_prebuilt_2",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
expectedBazelTargets: []string{`apex(
|
expectedBazelTargets: []string{`apex(
|
||||||
@@ -114,6 +130,10 @@ apex {
|
|||||||
":native_shared_lib_1",
|
":native_shared_lib_1",
|
||||||
":native_shared_lib_2",
|
":native_shared_lib_2",
|
||||||
],
|
],
|
||||||
|
prebuilts = [
|
||||||
|
":pretend_prebuilt_1",
|
||||||
|
":pretend_prebuilt_2",
|
||||||
|
],
|
||||||
updatable = False,
|
updatable = False,
|
||||||
)`}})
|
)`}})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user