Merge "Export apex_available_baseline to soong_injection"
This commit is contained in:
@@ -15,16 +15,22 @@ package apex
|
||||
|
||||
import (
|
||||
"android/soong/android"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// This file contains the bp2build integration for the apex package.
|
||||
|
||||
// Export constants as Starlark using bp2build to Bazel.
|
||||
func BazelApexToolchainVars() string {
|
||||
func BazelApexToolchainVars() (string, error) {
|
||||
marshalled, err := json.Marshal(apexAvailBaseline)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
content := []string{
|
||||
"# GENERATED BY SOONG. DO NOT EDIT.",
|
||||
"default_manifest_version = " + android.DefaultUpdatableModuleVersion, // constants.go is different in every branch.
|
||||
"apex_available_baseline = json.decode('''" + string(marshalled) + "''')",
|
||||
}
|
||||
return strings.Join(content, "\n")
|
||||
return strings.Join(content, "\n"), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user