Add aidl file support to java builds

Add support for aidl files listed in srcs for java builds, and
an aidl_preprocess module type for framework and sdk aidls.

Change-Id: I3aa537f4483822e5b534c74d0b35f13a938f8947
This commit is contained in:
Colin Cross
2015-04-08 13:03:43 -07:00
parent 6cbb127564
commit c0b06f191f
9 changed files with 217 additions and 43 deletions

View File

@@ -18,45 +18,22 @@ import (
"fmt"
"regexp"
"strings"
"android/soong/common"
)
// Efficiently converts a list of include directories to a single string
// of cflags with -I prepended to each directory.
func includeDirsToFlags(dirs []string) string {
return joinWithPrefix(dirs, "-I")
return common.JoinWithPrefix(dirs, "-I")
}
func ldDirsToFlags(dirs []string) string {
return joinWithPrefix(dirs, "-L")
return common.JoinWithPrefix(dirs, "-L")
}
func libNamesToFlags(names []string) string {
return joinWithPrefix(names, "-l")
}
func joinWithPrefix(strs []string, prefix string) string {
if len(strs) == 0 {
return ""
}
if len(strs) == 1 {
return prefix + strs[0]
}
n := len(" ") * (len(strs) - 1)
for _, s := range strs {
n += len(prefix) + len(s)
}
ret := make([]byte, 0, n)
for i, s := range strs {
if i != 0 {
ret = append(ret, ' ')
}
ret = append(ret, prefix...)
ret = append(ret, s...)
}
return string(ret)
return common.JoinWithPrefix(names, "-l")
}
func inList(s string, list []string) bool {