androidmk: use map to hold module types

Reduces the number of places that need to be edited when adding
new module types.

Change-Id: Id35d16f005e377e1e3bb955348ed92a4a2c392bb
This commit is contained in:
Colin Cross
2015-03-31 13:58:33 -07:00
parent 7d21c4430d
commit 139b815875
2 changed files with 22 additions and 35 deletions

View File

@@ -107,16 +107,11 @@ func main() {
switch directive.Name {
case "include":
val := directive.Args.Value(file.scope)
switch val {
case build_shared_library, build_static_library,
build_executable, build_host_executable,
build_prebuilt, build_host_static_library,
build_host_shared_library, build_native_test,
build_host_native_test:
switch {
case soongModuleTypes[val]:
handleModuleConditionals(file, directive, cond)
makeModule(file, val)
case clear_vars:
case val == clear_vars:
resetModule(file)
default:
file.errorf(directive, "unsupported include")