Move config into common and provide helper
Using ctx.Config().(Config) everywhere is a mouthful, and it is inefficient to do the type assertion. Put the Config interface into the context, and provide an AConfig() to return the Config already converted to the right type. Change-Id: I301a1fd7d2a005580aabca7866a37c5d42ad8c69
This commit is contained in:
12
java/java.go
12
java/java.go
@@ -29,14 +29,6 @@ import (
|
||||
"android/soong/common"
|
||||
)
|
||||
|
||||
type Config interface {
|
||||
SrcDir() string
|
||||
PrebuiltOS() string
|
||||
HostBinTool(string) (string, error)
|
||||
HostJavaTool(string) (string, error)
|
||||
Getenv(string) string
|
||||
}
|
||||
|
||||
// TODO:
|
||||
// Autogenerated files:
|
||||
// AIDL
|
||||
@@ -266,11 +258,11 @@ func (j *javaBase) GenerateJavaBuildActions(ctx common.AndroidModuleContext) {
|
||||
dxFlags = append(dxFlags, "--no-locals")
|
||||
}
|
||||
|
||||
if ctx.Config().(Config).Getenv("NO_OPTIMIZE_DX") != "" {
|
||||
if ctx.AConfig().Getenv("NO_OPTIMIZE_DX") != "" {
|
||||
dxFlags = append(dxFlags, "--no-optimize")
|
||||
}
|
||||
|
||||
if ctx.Config().(Config).Getenv("GENERATE_DEX_DEBUG") != "" {
|
||||
if ctx.AConfig().Getenv("GENERATE_DEX_DEBUG") != "" {
|
||||
dxFlags = append(dxFlags,
|
||||
"--debug",
|
||||
"--verbose",
|
||||
|
Reference in New Issue
Block a user