Convert rust module-info.json to soong
This leads to idendical results as before, with the exception of
the "required" field in module-info.json. Make has more complicated
logic to fill out the required field than soong, and it leads to
make-specific names such as ones suffixed with :32 and don't make sense
in soong. I'm don't think there are critical users of that field though,
so I'll try removing it.
Everything else should be identical to the make-generated information
though.
Bug: 389720048
Test: diff'd module-info.json before and after this cl in soong+make mode
Change-Id: I74aefe578287f07474c15e5f92a0c2780a679047
diff --git a/rust/benchmark.go b/rust/benchmark.go
index eaa2176..daba964 100644
--- a/rust/benchmark.go
+++ b/rust/benchmark.go
@@ -130,3 +130,20 @@
benchmark.binaryDecorator.install(ctx)
}
+
+func (benchmark *benchmarkDecorator) moduleInfoJSON(ctx ModuleContext, moduleInfoJSON *android.ModuleInfoJSON) {
+ benchmark.binaryDecorator.moduleInfoJSON(ctx, moduleInfoJSON)
+ moduleInfoJSON.Class = []string{"NATIVE_TESTS"}
+ if benchmark.testConfig != nil {
+ if _, ok := benchmark.testConfig.(android.WritablePath); ok {
+ moduleInfoJSON.AutoTestConfig = []string{"true"}
+ }
+ moduleInfoJSON.TestConfig = append(moduleInfoJSON.TestConfig, benchmark.testConfig.String())
+ }
+
+ if len(benchmark.Properties.Test_suites) > 0 {
+ moduleInfoJSON.CompatibilitySuites = append(moduleInfoJSON.CompatibilitySuites, benchmark.Properties.Test_suites...)
+ } else {
+ moduleInfoJSON.CompatibilitySuites = append(moduleInfoJSON.CompatibilitySuites, "null-suite")
+ }
+}