Loading apex/apex.go +4 −4 Original line number Diff line number Diff line Loading @@ -3270,7 +3270,7 @@ type bazelApexBundleAttributes struct { Updatable bazel.BoolAttribute Installable bazel.BoolAttribute Native_shared_libs bazel.LabelListAttribute Binaries bazel.StringListAttribute Binaries bazel.LabelListAttribute Prebuilts bazel.LabelListAttribute } Loading Loading @@ -3329,8 +3329,8 @@ func apexBundleBp2BuildInternal(ctx android.TopDownMutatorContext, module *apexB prebuiltsLabelList := android.BazelLabelForModuleDeps(ctx, prebuilts) prebuiltsLabelListAttribute := bazel.MakeLabelListAttribute(prebuiltsLabelList) binaries := module.properties.ApexNativeDependencies.Binaries binariesStringListAttribute := bazel.MakeStringListAttribute(binaries) binaries := android.BazelLabelForModuleDeps(ctx, module.properties.ApexNativeDependencies.Binaries) binariesLabelListAttribute := bazel.MakeLabelListAttribute(binaries) var updatableAttribute bazel.BoolAttribute if module.properties.Updatable != nil { Loading @@ -3352,7 +3352,7 @@ func apexBundleBp2BuildInternal(ctx android.TopDownMutatorContext, module *apexB Updatable: updatableAttribute, Installable: installableAttribute, Native_shared_libs: nativeSharedLibsLabelListAttribute, Binaries: binariesStringListAttribute, Binaries: binariesLabelListAttribute, Prebuilts: prebuiltsLabelListAttribute, } Loading bp2build/apex_conversion_test.go +28 −22 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import ( "android/soong/apex" "android/soong/cc" "android/soong/java" "android/soong/sh" "testing" ) Loading @@ -32,6 +33,8 @@ func registerApexModuleTypes(ctx android.RegistrationContext) { // CC module types needed as they can be APEX dependencies cc.RegisterCCBuildComponents(ctx) ctx.RegisterModuleType("sh_binary", sh.ShBinaryFactory) ctx.RegisterModuleType("cc_binary", cc.BinaryFactory) ctx.RegisterModuleType("cc_library", cc.LibraryFactory) ctx.RegisterModuleType("apex_key", apex.ApexKeyFactory) ctx.RegisterModuleType("android_app_certificate", java.AndroidAppCertificateFactory) Loading @@ -40,7 +43,7 @@ func registerApexModuleTypes(ctx android.RegistrationContext) { func TestApexBundleSimple(t *testing.T) { runApexTestCase(t, bp2buildTestCase{ description: "apex - simple example", description: "apex - example with all props", moduleTypeUnderTest: "apex", moduleTypeUnderTestFactory: apex.BundleFactory, moduleTypeUnderTestBp2BuildMutator: apex.ApexBundleBp2Build, Loading Loading @@ -89,6 +92,9 @@ filegroup { bazel_module: { bp2build_available: false }, } cc_binary { name: "cc_binary_1", bazel_module: { bp2build_available: false } } sh_binary { name: "sh_binary_2", bazel_module: { bp2build_available: false } } apex { name: "com.android.apogee", manifest: "apogee_manifest.json", Loading @@ -104,8 +110,8 @@ apex { "native_shared_lib_2", ], binaries: [ "binary_1", "binary_2", "cc_binary_1", "sh_binary_2", ], prebuilts: [ "pretend_prebuilt_1", Loading @@ -117,8 +123,8 @@ apex { makeBazelTarget("apex", "com.android.apogee", attrNameToString{ "android_manifest": `"ApogeeAndroidManifest.xml"`, "binaries": `[ "binary_1", "binary_2", ":cc_binary_1", ":sh_binary_2", ]`, "certificate": `":com.android.apogee.certificate"`, "file_contexts": `":com.android.apogee-file_contexts"`, Loading Loading
apex/apex.go +4 −4 Original line number Diff line number Diff line Loading @@ -3270,7 +3270,7 @@ type bazelApexBundleAttributes struct { Updatable bazel.BoolAttribute Installable bazel.BoolAttribute Native_shared_libs bazel.LabelListAttribute Binaries bazel.StringListAttribute Binaries bazel.LabelListAttribute Prebuilts bazel.LabelListAttribute } Loading Loading @@ -3329,8 +3329,8 @@ func apexBundleBp2BuildInternal(ctx android.TopDownMutatorContext, module *apexB prebuiltsLabelList := android.BazelLabelForModuleDeps(ctx, prebuilts) prebuiltsLabelListAttribute := bazel.MakeLabelListAttribute(prebuiltsLabelList) binaries := module.properties.ApexNativeDependencies.Binaries binariesStringListAttribute := bazel.MakeStringListAttribute(binaries) binaries := android.BazelLabelForModuleDeps(ctx, module.properties.ApexNativeDependencies.Binaries) binariesLabelListAttribute := bazel.MakeLabelListAttribute(binaries) var updatableAttribute bazel.BoolAttribute if module.properties.Updatable != nil { Loading @@ -3352,7 +3352,7 @@ func apexBundleBp2BuildInternal(ctx android.TopDownMutatorContext, module *apexB Updatable: updatableAttribute, Installable: installableAttribute, Native_shared_libs: nativeSharedLibsLabelListAttribute, Binaries: binariesStringListAttribute, Binaries: binariesLabelListAttribute, Prebuilts: prebuiltsLabelListAttribute, } Loading
bp2build/apex_conversion_test.go +28 −22 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import ( "android/soong/apex" "android/soong/cc" "android/soong/java" "android/soong/sh" "testing" ) Loading @@ -32,6 +33,8 @@ func registerApexModuleTypes(ctx android.RegistrationContext) { // CC module types needed as they can be APEX dependencies cc.RegisterCCBuildComponents(ctx) ctx.RegisterModuleType("sh_binary", sh.ShBinaryFactory) ctx.RegisterModuleType("cc_binary", cc.BinaryFactory) ctx.RegisterModuleType("cc_library", cc.LibraryFactory) ctx.RegisterModuleType("apex_key", apex.ApexKeyFactory) ctx.RegisterModuleType("android_app_certificate", java.AndroidAppCertificateFactory) Loading @@ -40,7 +43,7 @@ func registerApexModuleTypes(ctx android.RegistrationContext) { func TestApexBundleSimple(t *testing.T) { runApexTestCase(t, bp2buildTestCase{ description: "apex - simple example", description: "apex - example with all props", moduleTypeUnderTest: "apex", moduleTypeUnderTestFactory: apex.BundleFactory, moduleTypeUnderTestBp2BuildMutator: apex.ApexBundleBp2Build, Loading Loading @@ -89,6 +92,9 @@ filegroup { bazel_module: { bp2build_available: false }, } cc_binary { name: "cc_binary_1", bazel_module: { bp2build_available: false } } sh_binary { name: "sh_binary_2", bazel_module: { bp2build_available: false } } apex { name: "com.android.apogee", manifest: "apogee_manifest.json", Loading @@ -104,8 +110,8 @@ apex { "native_shared_lib_2", ], binaries: [ "binary_1", "binary_2", "cc_binary_1", "sh_binary_2", ], prebuilts: [ "pretend_prebuilt_1", Loading @@ -117,8 +123,8 @@ apex { makeBazelTarget("apex", "com.android.apogee", attrNameToString{ "android_manifest": `"ApogeeAndroidManifest.xml"`, "binaries": `[ "binary_1", "binary_2", ":cc_binary_1", ":sh_binary_2", ]`, "certificate": `":com.android.apogee.certificate"`, "file_contexts": `":com.android.apogee-file_contexts"`, Loading