Clean up art's Soong go files
Replace deprecated BaseContext with LoadHookContext.
Use ctx.Config() instead of ctx.AConfig().
Use existing ctx.Config() functions instead of wrappers.
Sort imports.
Test: m checkbuild
Change-Id: Idf30996ef38f4056a93af511c607b2c24678a5fa
diff --git a/build/codegen.go b/build/codegen.go
index 8e5ef1a..7ada8f5 100644
--- a/build/codegen.go
+++ b/build/codegen.go
@@ -19,9 +19,10 @@
// arches on the device.
import (
- "android/soong/android"
"sort"
"strings"
+
+ "android/soong/android"
)
type moduleType struct {
@@ -40,14 +41,14 @@
func codegen(ctx android.LoadHookContext, c *codegenProperties, t moduleType) {
var hostArches, deviceArches []string
- e := envDefault(ctx, "ART_HOST_CODEGEN_ARCHS", "")
+ e := ctx.Config().Getenv("ART_HOST_CODEGEN_ARCHS")
if e == "" {
hostArches = supportedArches
} else {
hostArches = strings.Split(e, " ")
}
- e = envDefault(ctx, "ART_TARGET_CODEGEN_ARCHS", "")
+ e = ctx.Config().Getenv("ART_TARGET_CODEGEN_ARCHS")
if e == "" {
deviceArches = defaultDeviceCodegenArches(ctx)
} else {