From 98b26c576a9e96b31dbb0263baa1866e5d0ab2ef Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 27 Jul 2015 15:08:24 -0700 Subject: [PATCH] Use the blueprint plugin infrastructure Instead of using this hardcoded list, use the blueprint plugin infrastructure to find them at build time and load them. Bug: 23567252 Change-Id: Iae87e8c9bf020f4beb42c418b9a6bf8b0fe8b601 --- Android.bp | 7 +++---- build.ninja.in | 22 +++++++++++----------- cmd/soong_build/main.go | 5 ----- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/Android.bp b/Android.bp index 404c47876..30cbf150c 100644 --- a/Android.bp +++ b/Android.bp @@ -16,12 +16,8 @@ bootstrap_go_binary { "blueprint", "blueprint-bootstrap", "soong", - "soong-art", - "soong-cc", "soong-common", "soong-env", - "soong-genrule", - "soong-java", ], srcs: [ "cmd/soong_build/main.go", @@ -133,6 +129,7 @@ bootstrap_go_package { testSrcs: [ "cc/cc_test.go", ], + pluginFor: ["soong_build"], } bootstrap_go_package { @@ -147,6 +144,7 @@ bootstrap_go_package { srcs: [ "genrule/genrule.go", ], + pluginFor: ["soong_build"], } bootstrap_go_binary { @@ -174,6 +172,7 @@ bootstrap_go_package { "java/java.go", "java/resources.go", ], + pluginFor: ["soong_build"], } // diff --git a/build.ninja.in b/build.ninja.in index e72166eac..8639166cf 100644 --- a/build.ninja.in +++ b/build.ninja.in @@ -64,7 +64,7 @@ rule g.bootstrap.test # Module: blueprint # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·003 # Defined: build/blueprint/Blueprints:1:1 build $ @@ -154,7 +154,7 @@ default $ # Module: blueprint-bootstrap # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·003 # Defined: build/blueprint/Blueprints:70:1 build $ @@ -182,7 +182,7 @@ default $ # Module: blueprint-bootstrap-bpdoc # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·003 # Defined: build/blueprint/Blueprints:89:1 build $ @@ -203,7 +203,7 @@ default $ # Module: blueprint-deptools # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·003 # Defined: build/blueprint/Blueprints:46:1 build $ @@ -219,7 +219,7 @@ default $ # Module: blueprint-parser # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·003 # Defined: build/blueprint/Blueprints:31:1 build $ @@ -284,7 +284,7 @@ default $ # Module: blueprint-pathtools # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·003 # Defined: build/blueprint/Blueprints:52:1 build $ @@ -344,7 +344,7 @@ default $ # Module: blueprint-proptools # Variant: # Type: bootstrap_go_package -# Factory: github.com/google/blueprint/bootstrap.func·002 +# Factory: github.com/google/blueprint/bootstrap.func·003 # Defined: build/blueprint/Blueprints:64:1 build $ @@ -360,7 +360,7 @@ default $ # Module: choosestage # Variant: # Type: bootstrap_core_go_binary -# Factory: github.com/google/blueprint/bootstrap.func·003 +# Factory: github.com/google/blueprint/bootstrap.func·005 # Defined: build/blueprint/Blueprints:127:1 build ${g.bootstrap.buildDir}/.bootstrap/choosestage/obj/choosestage.a: $ @@ -383,7 +383,7 @@ default ${g.bootstrap.BinDir}/choosestage # Module: gotestmain # Variant: # Type: bootstrap_core_go_binary -# Factory: github.com/google/blueprint/bootstrap.func·003 +# Factory: github.com/google/blueprint/bootstrap.func·005 # Defined: build/blueprint/Blueprints:122:1 build ${g.bootstrap.buildDir}/.bootstrap/gotestmain/obj/gotestmain.a: $ @@ -406,7 +406,7 @@ default ${g.bootstrap.BinDir}/gotestmain # Module: minibp # Variant: # Type: bootstrap_core_go_binary -# Factory: github.com/google/blueprint/bootstrap.func·003 +# Factory: github.com/google/blueprint/bootstrap.func·005 # Defined: build/blueprint/Blueprints:101:1 build ${g.bootstrap.buildDir}/.bootstrap/minibp/obj/minibp.a: $ @@ -436,7 +436,7 @@ default ${g.bootstrap.BinDir}/minibp # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Singleton: bootstrap -# Factory: github.com/google/blueprint/bootstrap.func·008 +# Factory: github.com/google/blueprint/bootstrap.func·012 rule s.bootstrap.primarybp command = ${g.bootstrap.BinDir}/minibp --build-primary ${runTests} -m ${g.bootstrap.bootstrapManifest} --timestamp ${timestamp} --timestampdep ${timestampdep} -b ${g.bootstrap.buildDir} -d ${outfile}.d -o ${outfile} ${in} diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go index 33fdd6980..65194020a 100644 --- a/cmd/soong_build/main.go +++ b/cmd/soong_build/main.go @@ -24,12 +24,7 @@ import ( "android/soong" - // These imports cause the modules to register their ModuleTypes, etc. with the soong package - _ "android/soong/art" - _ "android/soong/cc" "android/soong/common" - _ "android/soong/genrule" - _ "android/soong/java" ) func main() {