From 1332b0035caf416d4d9b275e6bfead48fe0b9cac Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 7 Apr 2015 17:11:30 -0700 Subject: 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 --- cmd/soong_build/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd/soong_build') diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go index 01740d1c..a1a4ce05 100644 --- a/cmd/soong_build/main.go +++ b/cmd/soong_build/main.go @@ -26,7 +26,6 @@ import ( "android/soong/art" "android/soong/cc" "android/soong/common" - "android/soong/config" "android/soong/genrule" "android/soong/java" ) @@ -78,7 +77,7 @@ func main() { ctx.RegisterSingletonType("checkbuild", common.CheckbuildSingleton) ctx.RegisterSingletonType("env", common.EnvSingleton) - configuration, err := config.New(srcDir) + configuration, err := common.NewConfig(srcDir) if err != nil { fmt.Fprintf(os.Stderr, "%s", err) os.Exit(1) @@ -87,5 +86,5 @@ func main() { // Temporary hack //ctx.SetIgnoreUnknownModuleTypes(true) - bootstrap.Main(ctx, configuration, config.ConfigFileName) + bootstrap.Main(ctx, configuration, common.ConfigFileName) } -- cgit v1.2.3