Loading bp2build/bp2build_product_config.go +15 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ import ( "android/soong/android/soongconfig" "android/soong/starlark_import" "github.com/google/blueprint" "github.com/google/blueprint/proptools" "go.starlark.net/starlark" ) Loading Loading @@ -45,6 +46,15 @@ func CreateProductConfigFiles( return nil, nil, err } // Visit all modules to determine the list of ndk libraries // This list will be used to add additional flags for cc stub generation ndkLibsStringFormatted := []string{} ctx.Context().VisitAllModules(func(m blueprint.Module) { if ctx.Context().ModuleType(m) == "ndk_library" { ndkLibsStringFormatted = append(ndkLibsStringFormatted, fmt.Sprintf(`"%s"`, m.Name())) // name will be `"libc.ndk"` } }) // TODO(b/249685973): the name is product_config_platforms because product_config // was already used for other files. Deduplicate them. currentProductFolder := fmt.Sprintf("product_config_platforms/products/%s-%s", targetProduct, targetBuildVariant) Loading Loading @@ -154,6 +164,11 @@ build --host_platform @soong_injection//{PRODUCT_FOLDER}:{PRODUCT}-{VARIANT}_lin productReplacer.Replace(` build --host_platform @soong_injection//{PRODUCT_FOLDER}:{PRODUCT}-{VARIANT}_darwin_x86_64 `)), newFile( "cc_toolchain", "ndk_libs.bzl", fmt.Sprintf("ndk_libs = [%v]", strings.Join(ndkLibsStringFormatted, ", ")), ), } bp2buildDirFiles := []BazelFile{ newFile( Loading Loading
bp2build/bp2build_product_config.go +15 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ import ( "android/soong/android/soongconfig" "android/soong/starlark_import" "github.com/google/blueprint" "github.com/google/blueprint/proptools" "go.starlark.net/starlark" ) Loading Loading @@ -45,6 +46,15 @@ func CreateProductConfigFiles( return nil, nil, err } // Visit all modules to determine the list of ndk libraries // This list will be used to add additional flags for cc stub generation ndkLibsStringFormatted := []string{} ctx.Context().VisitAllModules(func(m blueprint.Module) { if ctx.Context().ModuleType(m) == "ndk_library" { ndkLibsStringFormatted = append(ndkLibsStringFormatted, fmt.Sprintf(`"%s"`, m.Name())) // name will be `"libc.ndk"` } }) // TODO(b/249685973): the name is product_config_platforms because product_config // was already used for other files. Deduplicate them. currentProductFolder := fmt.Sprintf("product_config_platforms/products/%s-%s", targetProduct, targetBuildVariant) Loading Loading @@ -154,6 +164,11 @@ build --host_platform @soong_injection//{PRODUCT_FOLDER}:{PRODUCT}-{VARIANT}_lin productReplacer.Replace(` build --host_platform @soong_injection//{PRODUCT_FOLDER}:{PRODUCT}-{VARIANT}_darwin_x86_64 `)), newFile( "cc_toolchain", "ndk_libs.bzl", fmt.Sprintf("ndk_libs = [%v]", strings.Join(ndkLibsStringFormatted, ", ")), ), } bp2buildDirFiles := []BazelFile{ newFile( Loading