Add some initial benchmarking for bp2build.
Test: go test -benchmark=. in bp2build directory
Change-Id: I8275c38461078cc6100fbc89837177de0edc9d68
diff --git a/bp2build/testing.go b/bp2build/testing.go
index f3cd7f0..faf1a44 100644
--- a/bp2build/testing.go
+++ b/bp2build/testing.go
@@ -33,7 +33,8 @@
Nested_props nestedProps
Nested_props_ptr *nestedProps
- Arch_paths []string `android:"path,arch_variant"`
+ Arch_paths []string `android:"path,arch_variant"`
+ Arch_paths_exclude []string `android:"path,arch_variant"`
}
type customModule struct {
@@ -155,16 +156,18 @@
return
}
- paths := bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, m.props.Arch_paths))
+ paths := bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrcExcludes(ctx, m.props.Arch_paths, m.props.Arch_paths_exclude))
for axis, configToProps := range m.GetArchVariantProperties(ctx, &customProps{}) {
for config, props := range configToProps {
if archProps, ok := props.(*customProps); ok && archProps.Arch_paths != nil {
- paths.SetSelectValue(axis, config, android.BazelLabelForModuleSrc(ctx, archProps.Arch_paths))
+ paths.SetSelectValue(axis, config, android.BazelLabelForModuleSrcExcludes(ctx, archProps.Arch_paths, archProps.Arch_paths_exclude))
}
}
}
+ paths.ResolveExcludes()
+
attrs := &customBazelModuleAttributes{
String_prop: m.props.String_prop,
String_list_prop: m.props.String_list_prop,
@@ -216,3 +219,9 @@
buildFileToTargets, _, _ := GenerateBazelTargets(codegenCtx, false)
return buildFileToTargets[dir]
}
+
+func registerCustomModuleForBp2buildConversion(ctx *android.TestContext) {
+ ctx.RegisterModuleType("custom", customModuleFactory)
+ ctx.RegisterBp2BuildMutator("custom", customBp2BuildMutator)
+ ctx.RegisterForBazelConversion()
+}