Merge "bp2build: convert apex.logging_parent." am: c90a3cd6f6
am: d0645003cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2122357 Change-Id: Ic3bd9285dba93cc5c9455c3e4d91d6d460f776f8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
bd5b1a3672
2 changed files with 86 additions and 3 deletions
12
apex/apex.go
12
apex/apex.go
|
@ -2548,6 +2548,11 @@ func (o *OverrideApex) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
|
|||
if overridableProperties.Package_name != "" {
|
||||
attrs.Package_name = &overridableProperties.Package_name
|
||||
}
|
||||
|
||||
// Logging parent
|
||||
if overridableProperties.Logging_parent != "" {
|
||||
attrs.Logging_parent = &overridableProperties.Logging_parent
|
||||
}
|
||||
}
|
||||
|
||||
ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: o.Name()}, &attrs)
|
||||
|
@ -3198,6 +3203,7 @@ type bazelApexBundleAttributes struct {
|
|||
Native_shared_libs_64 bazel.LabelListAttribute
|
||||
Compressible bazel.BoolAttribute
|
||||
Package_name *string
|
||||
Logging_parent *string
|
||||
}
|
||||
|
||||
type convertedNativeSharedLibs struct {
|
||||
|
@ -3297,6 +3303,11 @@ func convertWithBp2build(a *apexBundle, ctx android.TopDownMutatorContext) (baze
|
|||
packageName = &a.overridableProperties.Package_name
|
||||
}
|
||||
|
||||
var loggingParent *string
|
||||
if a.overridableProperties.Logging_parent != "" {
|
||||
loggingParent = &a.overridableProperties.Logging_parent
|
||||
}
|
||||
|
||||
attrs := bazelApexBundleAttributes{
|
||||
Manifest: manifestLabelAttribute,
|
||||
Android_manifest: androidManifestLabelAttribute,
|
||||
|
@ -3312,6 +3323,7 @@ func convertWithBp2build(a *apexBundle, ctx android.TopDownMutatorContext) (baze
|
|||
Prebuilts: prebuiltsLabelListAttribute,
|
||||
Compressible: compressibleAttribute,
|
||||
Package_name: packageName,
|
||||
Logging_parent: loggingParent,
|
||||
}
|
||||
|
||||
props := bazel.BazelTargetModuleProperties{
|
||||
|
|
|
@ -137,6 +137,7 @@ apex {
|
|||
"prebuilt_2",
|
||||
],
|
||||
package_name: "com.android.apogee.test.package",
|
||||
logging_parent: "logging.parent",
|
||||
}
|
||||
`,
|
||||
expectedBazelTargets: []string{
|
||||
|
@ -174,6 +175,7 @@ apex {
|
|||
"updatable": "False",
|
||||
"compressible": "False",
|
||||
"package_name": `"com.android.apogee.test.package"`,
|
||||
"logging_parent": `"logging.parent"`,
|
||||
}),
|
||||
}})
|
||||
}
|
||||
|
@ -945,3 +947,72 @@ override_apex {
|
|||
}),
|
||||
}})
|
||||
}
|
||||
|
||||
func TestApexBundleSimple_NoLoggingParentOverride(t *testing.T) {
|
||||
runOverrideApexTestCase(t, bp2buildTestCase{
|
||||
description: "override_apex - logging_parent - no override",
|
||||
moduleTypeUnderTest: "override_apex",
|
||||
moduleTypeUnderTestFactory: apex.OverrideApexFactory,
|
||||
filesystem: map[string]string{
|
||||
"system/sepolicy/apex/Android.bp": `
|
||||
filegroup {
|
||||
name: "com.android.apogee-file_contexts",
|
||||
srcs: [ "apogee-file_contexts", ],
|
||||
bazel_module: { bp2build_available: false },
|
||||
}`,
|
||||
},
|
||||
blueprint: `
|
||||
apex {
|
||||
name: "com.android.apogee",
|
||||
bazel_module: { bp2build_available: false },
|
||||
logging_parent: "foo.bar.baz",
|
||||
}
|
||||
|
||||
override_apex {
|
||||
name: "com.google.android.apogee",
|
||||
base: ":com.android.apogee",
|
||||
}
|
||||
`,
|
||||
expectedBazelTargets: []string{
|
||||
makeBazelTarget("apex", "com.google.android.apogee", attrNameToString{
|
||||
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
|
||||
"manifest": `"apex_manifest.json"`,
|
||||
"logging_parent": `"foo.bar.baz"`,
|
||||
}),
|
||||
}})
|
||||
}
|
||||
|
||||
func TestApexBundleSimple_LoggingParentOverride(t *testing.T) {
|
||||
runOverrideApexTestCase(t, bp2buildTestCase{
|
||||
description: "override_apex - logging_parent - override",
|
||||
moduleTypeUnderTest: "override_apex",
|
||||
moduleTypeUnderTestFactory: apex.OverrideApexFactory,
|
||||
filesystem: map[string]string{
|
||||
"system/sepolicy/apex/Android.bp": `
|
||||
filegroup {
|
||||
name: "com.android.apogee-file_contexts",
|
||||
srcs: [ "apogee-file_contexts", ],
|
||||
bazel_module: { bp2build_available: false },
|
||||
}`,
|
||||
},
|
||||
blueprint: `
|
||||
apex {
|
||||
name: "com.android.apogee",
|
||||
bazel_module: { bp2build_available: false },
|
||||
logging_parent: "foo.bar.baz",
|
||||
}
|
||||
|
||||
override_apex {
|
||||
name: "com.google.android.apogee",
|
||||
base: ":com.android.apogee",
|
||||
logging_parent: "foo.bar.baz.override",
|
||||
}
|
||||
`,
|
||||
expectedBazelTargets: []string{
|
||||
makeBazelTarget("apex", "com.google.android.apogee", attrNameToString{
|
||||
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
|
||||
"manifest": `"apex_manifest.json"`,
|
||||
"logging_parent": `"foo.bar.baz.override"`,
|
||||
}),
|
||||
}})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue