Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module types, along with the related code. Bug: 315353489 Test: m blueprint_tests Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
This commit is contained in:
47
rust/rust.go
47
rust/rust.go
@@ -18,11 +18,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"android/soong/bazel"
|
||||
"android/soong/bloaty"
|
||||
"android/soong/testing"
|
||||
"android/soong/ui/metrics/bp2build_metrics_proto"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
"github.com/google/blueprint/proptools"
|
||||
|
||||
@@ -176,8 +173,6 @@ type Module struct {
|
||||
|
||||
transitiveAndroidMkSharedLibs *android.DepSet[string]
|
||||
|
||||
android.BazelModuleBase
|
||||
|
||||
// Aconfig files for all transitive deps. Also exposed via TransitiveDeclarationsInfo
|
||||
mergedAconfigFiles map[string]android.Paths
|
||||
}
|
||||
@@ -1856,48 +1851,6 @@ func (c *Module) Partition() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Module) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
|
||||
if ctx.ModuleType() == "rust_library_host" || ctx.ModuleType() == "rust_library" {
|
||||
libraryBp2build(ctx, m)
|
||||
} else if ctx.ModuleType() == "rust_proc_macro" {
|
||||
procMacroBp2build(ctx, m)
|
||||
} else if ctx.ModuleType() == "rust_binary_host" {
|
||||
binaryBp2build(ctx, m)
|
||||
} else if ctx.ModuleType() == "rust_protobuf_host" || ctx.ModuleType() == "rust_protobuf" {
|
||||
protoLibraryBp2build(ctx, m)
|
||||
} else if ctx.ModuleType() == "rust_ffi_static" {
|
||||
ffiStaticBp2build(ctx, m)
|
||||
} else {
|
||||
ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_TYPE_UNSUPPORTED, "")
|
||||
}
|
||||
}
|
||||
|
||||
// This is a workaround by assuming the conventions that rust crate repos are structured
|
||||
// while waiting for the sandboxing work to complete.
|
||||
// TODO(b/297344471): When crate_root prop is set which enforces inputs sandboxing,
|
||||
// always use `srcs` and `compile_data` props to generate `srcs` and `compile_data` attributes
|
||||
// instead of using globs.
|
||||
func srcsAndCompileDataAttrs(ctx android.Bp2buildMutatorContext, c baseCompiler) (bazel.LabelList, bazel.LabelList) {
|
||||
var srcs bazel.LabelList
|
||||
var compileData bazel.LabelList
|
||||
|
||||
if c.Properties.Srcs[0] == "src/lib.rs" {
|
||||
srcs = android.BazelLabelForModuleSrc(ctx, []string{"src/**/*.rs"})
|
||||
compileData = android.BazelLabelForModuleSrc(
|
||||
ctx,
|
||||
[]string{
|
||||
"src/**/*.proto",
|
||||
"examples/**/*.rs",
|
||||
"**/*.md",
|
||||
},
|
||||
)
|
||||
} else {
|
||||
srcs = android.BazelLabelForModuleSrc(ctx, c.Properties.Srcs)
|
||||
}
|
||||
|
||||
return srcs, compileData
|
||||
}
|
||||
|
||||
var Bool = proptools.Bool
|
||||
var BoolDefault = proptools.BoolDefault
|
||||
var String = proptools.String
|
||||
|
Reference in New Issue
Block a user