Merge changes I0caddbf6,Iee20b060,I6c92580b,I45028945,Ia7dd5220, ... into main

* changes:
  rust: Resolve crate roots outside rust-project
  rust: Cache crateRootPath to avoid ctx
  rust: internalize srcPathFromModuleSrcs
  rust: move crateRootPath to compiler
  rust: Privatize Cargo* methods on compiler
  rust: Move compiler interface to compiler.go
This commit is contained in:
Matthew Maurer
2023-11-22 20:37:27 +00:00
committed by Gerrit Code Review
9 changed files with 153 additions and 206 deletions

View File

@@ -487,44 +487,6 @@ type RustLibrary struct {
CrateName string
}
type compiler interface {
initialize(ctx ModuleContext)
compilerFlags(ctx ModuleContext, flags Flags) Flags
cfgFlags(ctx ModuleContext, flags Flags) Flags
featureFlags(ctx ModuleContext, flags Flags) Flags
compilerProps() []interface{}
compile(ctx ModuleContext, flags Flags, deps PathDeps) buildOutput
compilerDeps(ctx DepsContext, deps Deps) Deps
crateName() string
rustdoc(ctx ModuleContext, flags Flags, deps PathDeps) android.OptionalPath
// Output directory in which source-generated code from dependencies is
// copied. This is equivalent to Cargo's OUT_DIR variable.
CargoOutDir() android.OptionalPath
// CargoPkgVersion returns the value of the Cargo_pkg_version property.
CargoPkgVersion() string
// CargoEnvCompat returns whether Cargo environment variables should be used.
CargoEnvCompat() bool
inData() bool
install(ctx ModuleContext)
relativeInstallPath() string
everInstallable() bool
nativeCoverage() bool
Disabled() bool
SetDisabled()
stdLinkage(ctx *depsContext) RustLinkage
noStdlibs() bool
unstrippedOutputFilePath() android.Path
strippedOutputFilePath() android.OptionalPath
}
type exportedFlagsProducer interface {
exportLinkDirs(...string)
exportLinkObjects(...string)