summaryrefslogtreecommitdiff
path: root/rust/library.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2025-01-29 15:14:17 -0800
committer Cole Faust <colefaust@google.com> 2025-01-29 15:29:06 -0800
commit58eef4f7de976345ce33c94cfc45440634158448 (patch)
treef67c7370762e3871e739acda33d81c4e04b2c606 /rust/library.go
parentd2c82e1253469a518acf2cf6431ee966551da693 (diff)
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
Diffstat (limited to 'rust/library.go')
-rw-r--r--rust/library.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/rust/library.go b/rust/library.go
index 77280d959..95e7099a6 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -858,6 +858,20 @@ func (library *libraryDecorator) SetDisabled() {
library.MutatedProperties.VariantIsDisabled = true
}
+func (library *libraryDecorator) moduleInfoJSON(ctx ModuleContext, moduleInfoJSON *android.ModuleInfoJSON) {
+ library.baseCompiler.moduleInfoJSON(ctx, moduleInfoJSON)
+
+ if library.rlib() {
+ moduleInfoJSON.Class = []string{"RLIB_LIBRARIES"}
+ } else if library.dylib() {
+ moduleInfoJSON.Class = []string{"DYLIB_LIBRARIES"}
+ } else if library.static() {
+ moduleInfoJSON.Class = []string{"STATIC_LIBRARIES"}
+ } else if library.shared() {
+ moduleInfoJSON.Class = []string{"SHARED_LIBRARIES"}
+ }
+}
+
var validCrateName = regexp.MustCompile("[^a-zA-Z0-9_]+")
func validateLibraryStem(ctx BaseModuleContext, filename string, crate_name string) {