androidmk suport for aidl includes using LOCAL_PATH

Bug: 62882283
Test: m -j blueprint_tools # which runs unit tests
Change-Id: I6708aa21eada660a1f01759f090084692baa8937
This commit is contained in:
Jeff Gaston 2017-09-12 18:29:28 -07:00
parent 38f794ee49
commit 97001aaffd
2 changed files with 23 additions and 1 deletions

View file

@ -27,6 +27,7 @@ type variableAssignmentContext struct {
var rewriteProperties = map[string](func(variableAssignmentContext) error){ var rewriteProperties = map[string](func(variableAssignmentContext) error){
// custom functions // custom functions
"LOCAL_AIDL_INCLUDES": localAidlIncludes,
"LOCAL_C_INCLUDES": localIncludeDirs, "LOCAL_C_INCLUDES": localIncludeDirs,
"LOCAL_EXPORT_C_INCLUDE_DIRS": exportIncludeDirs, "LOCAL_EXPORT_C_INCLUDE_DIRS": exportIncludeDirs,
"LOCAL_LDFLAGS": ldflags, "LOCAL_LDFLAGS": ldflags,
@ -111,7 +112,6 @@ func init() {
"LOCAL_DX_FLAGS": "dxflags", "LOCAL_DX_FLAGS": "dxflags",
"LOCAL_JAVA_LIBRARIES": "libs", "LOCAL_JAVA_LIBRARIES": "libs",
"LOCAL_STATIC_JAVA_LIBRARIES": "static_libs", "LOCAL_STATIC_JAVA_LIBRARIES": "static_libs",
"LOCAL_AIDL_INCLUDES": "aidl.include_dirs",
"LOCAL_AAPT_FLAGS": "aaptflags", "LOCAL_AAPT_FLAGS": "aaptflags",
"LOCAL_PACKAGE_SPLITS": "package_splits", "LOCAL_PACKAGE_SPLITS": "package_splits",
"LOCAL_COMPATIBILITY_SUITE": "test_suites", "LOCAL_COMPATIBILITY_SUITE": "test_suites",
@ -308,6 +308,10 @@ func exportIncludeDirs(ctx variableAssignmentContext) error {
return splitAndAssign(ctx, classifyLocalOrGlobalPath, map[string]string{"global": "export_include_dirs", "local": "export_include_dirs"}) return splitAndAssign(ctx, classifyLocalOrGlobalPath, map[string]string{"global": "export_include_dirs", "local": "export_include_dirs"})
} }
func localAidlIncludes(ctx variableAssignmentContext) error {
return splitAndAssign(ctx, classifyLocalOrGlobalPath, map[string]string{"global": "aidl.include_dirs", "local": "aidl.local_include_dirs"})
}
func stem(ctx variableAssignmentContext) error { func stem(ctx variableAssignmentContext) error {
val, err := makeVariableToBlueprint(ctx.file, ctx.mkvalue, bpparser.StringType) val, err := makeVariableToBlueprint(ctx.file, ctx.mkvalue, bpparser.StringType)
if err != nil { if err != nil {

View file

@ -405,6 +405,24 @@ include $(BUILD_SHARED_LIBRARY)`,
cc_library_shared { cc_library_shared {
name: "iAmAModule", name: "iAmAModule",
}`,
},
{
desc: "LOCAL_AIDL_INCLUDES",
in: `
include $(CLEAR_VARS)
LOCAL_MODULE := iAmAModule
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/main/java system/core
include $(BUILD_SHARED_LIBRARY)`,
expected: `
cc_library_shared {
name: "iAmAModule",
aidl: {
include_dirs: ["system/core"],
local_include_dirs: ["src/main/java"],
}
}`, }`,
}, },
} }