From 97001aaffd4bc86c2bd0c656807ce1d500abbec9 Mon Sep 17 00:00:00 2001 From: Jeff Gaston Date: Tue, 12 Sep 2017 18:29:28 -0700 Subject: [PATCH] androidmk suport for aidl includes using LOCAL_PATH Bug: 62882283 Test: m -j blueprint_tools # which runs unit tests Change-Id: I6708aa21eada660a1f01759f090084692baa8937 --- androidmk/cmd/androidmk/android.go | 6 +++++- androidmk/cmd/androidmk/androidmk_test.go | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/androidmk/cmd/androidmk/android.go b/androidmk/cmd/androidmk/android.go index bdd3e97e9..469e960da 100644 --- a/androidmk/cmd/androidmk/android.go +++ b/androidmk/cmd/androidmk/android.go @@ -27,6 +27,7 @@ type variableAssignmentContext struct { var rewriteProperties = map[string](func(variableAssignmentContext) error){ // custom functions + "LOCAL_AIDL_INCLUDES": localAidlIncludes, "LOCAL_C_INCLUDES": localIncludeDirs, "LOCAL_EXPORT_C_INCLUDE_DIRS": exportIncludeDirs, "LOCAL_LDFLAGS": ldflags, @@ -111,7 +112,6 @@ func init() { "LOCAL_DX_FLAGS": "dxflags", "LOCAL_JAVA_LIBRARIES": "libs", "LOCAL_STATIC_JAVA_LIBRARIES": "static_libs", - "LOCAL_AIDL_INCLUDES": "aidl.include_dirs", "LOCAL_AAPT_FLAGS": "aaptflags", "LOCAL_PACKAGE_SPLITS": "package_splits", "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"}) } +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 { val, err := makeVariableToBlueprint(ctx.file, ctx.mkvalue, bpparser.StringType) if err != nil { diff --git a/androidmk/cmd/androidmk/androidmk_test.go b/androidmk/cmd/androidmk/androidmk_test.go index 037ce26ae..664d12c2d 100644 --- a/androidmk/cmd/androidmk/androidmk_test.go +++ b/androidmk/cmd/androidmk/androidmk_test.go @@ -405,6 +405,24 @@ include $(BUILD_SHARED_LIBRARY)`, cc_library_shared { 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"], + } }`, }, }