diff options
author | 2020-11-25 16:06:39 -0800 | |
---|---|---|
committer | 2021-01-07 14:34:00 -0500 | |
commit | 2dd9ca422d4745fac52d9d76e5e32fba3c555075 (patch) | |
tree | b3c65f92fe6eabfefff762d6029963dc5c9b5875 /android/queryview.go | |
parent | 5bcf99a93a18030dbfa549dc99a41e8c762aa6d5 (diff) |
Refactor queryview.
Splits queryview into queryview and bp2build. The latter runs as a
presingleton (could be converted to a singleton). This prevents needing
to run soong_ui a subsequent time to build the query. Queryview remains
as a separate step to prevent increasing runtime due to this generation
every time Soong runs.
Currently this is running as a presingleton as this gives a translation
of Android.bp files after only LoadHooks have run, no mutators.
Test: go tests
Test: m queryview && bazel query --config=queryview //...
Change-Id: If2ba28c7ef60fbd41f43bda6623d41c8c7d23a1b
Diffstat (limited to 'android/queryview.go')
-rw-r--r-- | android/queryview.go | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/android/queryview.go b/android/queryview.go index 1b7e77dd6..9e3e45a32 100644 --- a/android/queryview.go +++ b/android/queryview.go @@ -26,7 +26,6 @@ import ( // for calling the soong_build primary builder in the main build.ninja file. func init() { RegisterSingletonType("bazel_queryview", BazelQueryViewSingleton) - RegisterSingletonType("bazel_converter", BazelConverterSingleton) } // BazelQueryViewSingleton is the singleton responsible for registering the @@ -52,13 +51,7 @@ type bazelConverterSingleton struct{} func generateBuildActionsForBazelConversion(ctx SingletonContext, converterMode bool) { name := "queryview" - additionalEnvVars := "" descriptionTemplate := "[EXPERIMENTAL, PRE-PRODUCTION] Creating the Bazel QueryView workspace with %s at $outDir" - if converterMode { - name = "bp2build" - additionalEnvVars = "CONVERT_TO_BAZEL=true" - descriptionTemplate = "[EXPERIMENTAL, PRE-PRODUCTION] Converting all Android.bp to Bazel BUILD files with %s at $outDir" - } // Create a build and rule statement, using the Bazel QueryView's WORKSPACE // file as the output file marker. @@ -74,9 +67,8 @@ func generateBuildActionsForBazelConversion(ctx SingletonContext, converterMode blueprint.RuleParams{ Command: fmt.Sprintf( "rm -rf ${outDir}/* && "+ - "%s %s --bazel_queryview_dir ${outDir} %s && "+ + "%s --bazel_queryview_dir ${outDir} %s && "+ "echo WORKSPACE: `cat %s` > ${outDir}/.queryview-depfile.d", - additionalEnvVars, primaryBuilder.String(), strings.Join(os.Args[1:], " "), moduleListFilePath.String(), // Use the contents of Android.bp.list as the depfile. |