refactor Bazel variable export
Most of the variable export code for cc modules can be re-used for exporting variables for java modules. Refactor this code into a more composable structure for reuse. Test: build/bazel/bp2build.sh Test: manual comparison of out/soong/soong_injection/cc_toolchain/constants.bzl with previous output Change-Id: Ie5a6fee08cc888b7dc69c3e324e5c3f8aa269a8f
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"android/soong/bazel"
|
||||
"android/soong/starlark_fmt"
|
||||
)
|
||||
|
||||
@@ -393,10 +394,10 @@ func printApiLevelsStarlarkDict(config Config) string {
|
||||
}
|
||||
|
||||
func StarlarkApiLevelConfigs(config Config) string {
|
||||
return fmt.Sprintf(`# GENERATED FOR BAZEL FROM SOONG. DO NOT EDIT.
|
||||
return fmt.Sprintf(bazel.GeneratedBazelFileWarning+`
|
||||
_api_levels = %s
|
||||
|
||||
api_levels = _api_levels
|
||||
`, printApiLevelsStarlarkDict(config),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user