rust: Move compiler interface to compiler.go
Refactor cleanup Bug: 309943184 Test: m nothing Change-Id: I7dcb0af64a4db71fdc46c0876b22e5015c02438e
This commit is contained in:
@@ -34,6 +34,44 @@ const (
|
|||||||
DylibLinkage
|
DylibLinkage
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
func (compiler *baseCompiler) edition() string {
|
func (compiler *baseCompiler) edition() string {
|
||||||
return proptools.StringDefault(compiler.Properties.Edition, config.DefaultEdition)
|
return proptools.StringDefault(compiler.Properties.Edition, config.DefaultEdition)
|
||||||
}
|
}
|
||||||
|
38
rust/rust.go
38
rust/rust.go
@@ -485,44 +485,6 @@ type RustLibrary struct {
|
|||||||
CrateName string
|
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 {
|
type exportedFlagsProducer interface {
|
||||||
exportLinkDirs(...string)
|
exportLinkDirs(...string)
|
||||||
exportLinkObjects(...string)
|
exportLinkObjects(...string)
|
||||||
|
Reference in New Issue
Block a user