rust: move crateRootPath to compiler
Test: m nothing
Bug: 309943184
Change-Id: I45028945357c394301d93ca7995a4f9adf281931
diff --git a/rust/library.go b/rust/library.go
index 18bf0a0..613e9b7 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -489,7 +489,7 @@
var outputFile android.ModuleOutPath
var ret buildOutput
var fileName string
- crateRootPath := library.crateRootPath(ctx, deps)
+ crateRootPath := library.crateRootPath(ctx)
if library.sourceProvider != nil {
deps.srcProviderFiles = append(deps.srcProviderFiles, library.sourceProvider.Srcs()...)
@@ -584,15 +584,12 @@
return ret
}
-func (library *libraryDecorator) crateRootPath(ctx ModuleContext, _ PathDeps) android.Path {
+func (library *libraryDecorator) crateRootPath(ctx ModuleContext) android.Path {
if library.sourceProvider != nil {
// Assume the first source from the source provider is the library entry point.
return library.sourceProvider.Srcs()[0]
- } else if library.baseCompiler.Properties.Crate_root == nil {
- path, _ := srcPathFromModuleSrcs(ctx, library.baseCompiler.Properties.Srcs)
- return path
} else {
- return android.PathForModuleSrc(ctx, *library.baseCompiler.Properties.Crate_root)
+ return library.baseCompiler.crateRootPath(ctx)
}
}
@@ -607,7 +604,7 @@
return android.OptionalPath{}
}
- return android.OptionalPathForPath(Rustdoc(ctx, library.crateRootPath(ctx, deps),
+ return android.OptionalPathForPath(Rustdoc(ctx, library.crateRootPath(ctx),
deps, flags))
}