Loading apex/apex.go +7 −0 Original line number Diff line number Diff line Loading @@ -3519,6 +3519,7 @@ type bazelApexBundleAttributes struct { Manifest bazel.LabelAttribute Android_manifest bazel.LabelAttribute File_contexts bazel.LabelAttribute Canned_fs_config bazel.LabelAttribute 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 Loading Loading @@ -3578,6 +3579,11 @@ func convertWithBp2build(a *apexBundle, ctx android.TopDownMutatorContext) (baze fileContextsLabelAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, *a.properties.File_contexts)) } var cannedFsConfigAttribute bazel.LabelAttribute if a.properties.Canned_fs_config != nil { cannedFsConfigAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, *a.properties.Canned_fs_config)) } productVariableProps := android.ProductVariableProperties(ctx, a) // 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. Loading Loading @@ -3664,6 +3670,7 @@ func convertWithBp2build(a *apexBundle, ctx android.TopDownMutatorContext) (baze Manifest: manifestLabelAttribute, Android_manifest: androidManifestLabelAttribute, File_contexts: fileContextsLabelAttribute, Canned_fs_config: cannedFsConfigAttribute, Min_sdk_version: minSdkVersion, Key: keyLabelAttribute, Certificate: certificate, Loading bp2build/apex_conversion_test.go +22 −0 Original line number Diff line number Diff line Loading @@ -1566,3 +1566,25 @@ override_apex { }), }}) } func TestApexBundleSimple_customCannedFsConfig(t *testing.T) { runApexTestCase(t, Bp2buildTestCase{ Description: "apex - custom canned_fs_config", ModuleTypeUnderTest: "apex", ModuleTypeUnderTestFactory: apex.BundleFactory, Filesystem: map[string]string{}, Blueprint: ` apex { name: "com.android.apogee", canned_fs_config: "custom.canned_fs_config", file_contexts: "file_contexts_file", } `, ExpectedBazelTargets: []string{ MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{ "canned_fs_config": `"custom.canned_fs_config"`, "file_contexts": `"file_contexts_file"`, "manifest": `"apex_manifest.json"`, }), }}) } Loading
apex/apex.go +7 −0 Original line number Diff line number Diff line Loading @@ -3519,6 +3519,7 @@ type bazelApexBundleAttributes struct { Manifest bazel.LabelAttribute Android_manifest bazel.LabelAttribute File_contexts bazel.LabelAttribute Canned_fs_config bazel.LabelAttribute 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 Loading Loading @@ -3578,6 +3579,11 @@ func convertWithBp2build(a *apexBundle, ctx android.TopDownMutatorContext) (baze fileContextsLabelAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, *a.properties.File_contexts)) } var cannedFsConfigAttribute bazel.LabelAttribute if a.properties.Canned_fs_config != nil { cannedFsConfigAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, *a.properties.Canned_fs_config)) } productVariableProps := android.ProductVariableProperties(ctx, a) // 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. Loading Loading @@ -3664,6 +3670,7 @@ func convertWithBp2build(a *apexBundle, ctx android.TopDownMutatorContext) (baze Manifest: manifestLabelAttribute, Android_manifest: androidManifestLabelAttribute, File_contexts: fileContextsLabelAttribute, Canned_fs_config: cannedFsConfigAttribute, Min_sdk_version: minSdkVersion, Key: keyLabelAttribute, Certificate: certificate, Loading
bp2build/apex_conversion_test.go +22 −0 Original line number Diff line number Diff line Loading @@ -1566,3 +1566,25 @@ override_apex { }), }}) } func TestApexBundleSimple_customCannedFsConfig(t *testing.T) { runApexTestCase(t, Bp2buildTestCase{ Description: "apex - custom canned_fs_config", ModuleTypeUnderTest: "apex", ModuleTypeUnderTestFactory: apex.BundleFactory, Filesystem: map[string]string{}, Blueprint: ` apex { name: "com.android.apogee", canned_fs_config: "custom.canned_fs_config", file_contexts: "file_contexts_file", } `, ExpectedBazelTargets: []string{ MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{ "canned_fs_config": `"custom.canned_fs_config"`, "file_contexts": `"file_contexts_file"`, "manifest": `"apex_manifest.json"`, }), }}) }