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:
Colin Cross
2023-12-07 13:10:56 -08:00
parent e51c6e4109
commit 8ff105860d
168 changed files with 64 additions and 39712 deletions

View File

@@ -15,10 +15,7 @@
package rust
import (
"fmt"
"android/soong/android"
"android/soong/bazel"
)
func init() {
@@ -50,8 +47,6 @@ func ProcMacroFactory() android.Module {
func NewProcMacro(hod android.HostOrDeviceSupported) (*Module, *procMacroDecorator) {
module := newModule(hod, android.MultilibFirst)
android.InitBazelModule(module)
procMacro := &procMacroDecorator{
baseCompiler: NewBaseCompiler("lib", "lib64", InstallInSystem),
flagExporter: NewFlagExporter(),
@@ -103,65 +98,3 @@ func (procMacro *procMacroDecorator) everInstallable() bool {
// Proc_macros are never installed
return false
}
type procMacroAttributes struct {
Srcs bazel.LabelListAttribute
Compile_data bazel.LabelListAttribute
Crate_name bazel.StringAttribute
Edition bazel.StringAttribute
Crate_features bazel.StringListAttribute
Deps bazel.LabelListAttribute
Rustc_flags bazel.StringListAttribute
}
func procMacroBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
procMacro := m.compiler.(*procMacroDecorator)
srcs, compileData := srcsAndCompileDataAttrs(ctx, *procMacro.baseCompiler)
deps := android.BazelLabelForModuleDeps(ctx, append(
procMacro.baseCompiler.Properties.Rustlibs,
procMacro.baseCompiler.Properties.Rlibs...,
))
var rustcFLags []string
for _, cfg := range procMacro.baseCompiler.Properties.Cfgs {
rustcFLags = append(rustcFLags, fmt.Sprintf("--cfg=%s", cfg))
}
attrs := &procMacroAttributes{
Srcs: bazel.MakeLabelListAttribute(
srcs,
),
Compile_data: bazel.MakeLabelListAttribute(
compileData,
),
Crate_name: bazel.StringAttribute{
Value: &procMacro.baseCompiler.Properties.Crate_name,
},
Edition: bazel.StringAttribute{
Value: procMacro.baseCompiler.Properties.Edition,
},
Crate_features: bazel.StringListAttribute{
Value: procMacro.baseCompiler.Properties.Features,
},
Deps: bazel.MakeLabelListAttribute(
deps,
),
Rustc_flags: bazel.StringListAttribute{
Value: append(
rustcFLags,
procMacro.baseCompiler.Properties.Flags...,
),
},
}
// m.IsConvertedByBp2build()
ctx.CreateBazelTargetModule(
bazel.BazelTargetModuleProperties{
Rule_class: "rust_proc_macro",
Bzl_load_location: "@rules_rust//rust:defs.bzl",
},
android.CommonAttributes{
Name: m.Name(),
},
attrs,
)
}