Fix more androidbp bugs
Don't insert a space when concatentating strings. Lists will already have
a separator, and strings may need to be a single word.
Use valueToString to print individual elements in a list to pick up the
same expression fix from a previous patch.
"static_executable" converts to LOCAL_FORCE_STATIC_EXECUTABLE, not "static".
Add "no_default_compiler_flags" to LOCAL_NO_DEFAULT_COMPILER_FLAGS.
Change-Id: I45c7eb8355ee1b40d7949e1560cc11cc959764b3
diff --git a/androidbp/cmd/androidbp.go b/androidbp/cmd/androidbp.go
index 23c9c98..2dba6c1 100644
--- a/androidbp/cmd/androidbp.go
+++ b/androidbp/cmd/androidbp.go
@@ -33,7 +33,7 @@
if value.Expression.Operator != '+' {
panic(fmt.Errorf("unexpected operator '%c'", value.Expression.Operator))
}
- return fmt.Sprintf("%s %s",
+ return fmt.Sprintf("%s%s",
valueToString(value.Expression.Args[0]),
valueToString(value.Expression.Args[1]))
} else {
@@ -88,12 +88,7 @@
func listToMkString(list []bpparser.Value) string {
lines := make([]string, 0, len(list))
for _, tok := range list {
- if tok.Type == bpparser.String {
- lines = append(lines, fmt.Sprintf(" %s", processWildcards(tok.StringValue)))
- } else {
- lines = append(lines, fmt.Sprintf("# ERROR: unsupported type %s in list",
- tok.Type.String()))
- }
+ lines = append(lines, fmt.Sprintf(" %s", valueToString(tok)))
}
return strings.Join(lines, " \\\n")
diff --git a/androidbp/cmd/soong.go b/androidbp/cmd/soong.go
index 2b7d32e..1f15aac 100644
--- a/androidbp/cmd/soong.go
+++ b/androidbp/cmd/soong.go
@@ -51,15 +51,15 @@
// ==== BOOL PROPERTIES ====
"host": {"LOCAL_IS_HOST_MODULE", bpparser.Bool},
"clang": {"LOCAL_CLANG", bpparser.Bool},
- "static": {"LOCAL_FORCE_STATIC_EXECUTABLE", bpparser.Bool},
+ "static_executable": {"LOCAL_FORCE_STATIC_EXECUTABLE", bpparser.Bool},
"asan": {"LOCAL_ADDRESS_SANITIZER", bpparser.Bool},
"native_coverage": {"LOCAL_NATIVE_COVERAGE", bpparser.Bool},
"nocrt": {"LOCAL_NO_CRT", bpparser.Bool},
"allow_undefined_symbols": {"LOCAL_ALLOW_UNDEFINED_SYMBOLS", bpparser.Bool},
- "rtti": {"LOCAL_RTTI_FLAG", bpparser.Bool},
- "no_standard_libraries": {"LOCAL_NO_STANDARD_LIBRARIES", bpparser.Bool},
- "export_package_resources": {"LOCAL_EXPORT_PACKAGE_RESOURCES", bpparser.Bool},
- "static_executable": {"LOCAL_FORCE_STATIC_EXECUTABLE", bpparser.Bool},
+ "rtti": {"LOCAL_RTTI_FLAG", bpparser.Bool},
+ "no_standard_libraries": {"LOCAL_NO_STANDARD_LIBRARIES", bpparser.Bool},
+ "export_package_resources": {"LOCAL_EXPORT_PACKAGE_RESOURCES", bpparser.Bool},
+ "no_default_compiler_flags": {"LOCAL_NO_DEFAULT_COMPILER_FLAGS", bpparser.Bool},
}
var rewriteProperties = map[string]struct {