diff options
author | Trevor Radcliffe <tradical@google.com> | 2021-10-06 18:24:17 +0000 |
---|---|---|
committer | Trevor Radcliffe <tradical@google.com> | 2021-10-06 20:28:01 +0000 |
commit | 31b48a72d021a7c84ccbca777e52c943e2a09104 (patch) | |
tree | 214f23cccadebe0f54f62bdc15e46b8d1c2f7f63 /androidmk | |
parent | f3c6843b33e4aba757eae89d315b11cde46897af (diff) | |
download | soong-31b48a72d021a7c84ccbca777e52c943e2a09104.tar.gz |
Add support for USES_LIBRARIES to androidmk
And OPTIONAL_USES_LIBRARIES. Also includes lint fix.
Fixes: 202163928
Test: Ran tool against development/apps/Development/Android.mk
Test: Added integration test cases
Change-Id: I9c8130b19f05df938f01957852384c0532e73433
Diffstat (limited to 'androidmk')
-rw-r--r-- | androidmk/androidmk/android.go | 5 | ||||
-rw-r--r-- | androidmk/androidmk/androidmk_test.go | 38 |
2 files changed, 42 insertions, 1 deletions
diff --git a/androidmk/androidmk/android.go b/androidmk/androidmk/android.go index 80801b290..963e905cb 100644 --- a/androidmk/androidmk/android.go +++ b/androidmk/androidmk/android.go @@ -15,11 +15,12 @@ package androidmk import ( - mkparser "android/soong/androidmk/parser" "fmt" "sort" "strings" + mkparser "android/soong/androidmk/parser" + bpparser "github.com/google/blueprint/parser" ) @@ -128,6 +129,8 @@ func init() { "LOCAL_STATIC_LIBRARIES": "static_libs", "LOCAL_WHOLE_STATIC_LIBRARIES": "whole_static_libs", "LOCAL_SYSTEM_SHARED_LIBRARIES": "system_shared_libs", + "LOCAL_USES_LIBRARIES": "uses_libs", + "LOCAL_OPTIONAL_USES_LIBRARIES": "optional_uses_libs", "LOCAL_ASFLAGS": "asflags", "LOCAL_CLANG_ASFLAGS": "clang_asflags", "LOCAL_COMPATIBILITY_SUPPORT_FILES": "data", diff --git a/androidmk/androidmk/androidmk_test.go b/androidmk/androidmk/androidmk_test.go index 02ab89d0b..9fd4ff943 100644 --- a/androidmk/androidmk/androidmk_test.go +++ b/androidmk/androidmk/androidmk_test.go @@ -1479,6 +1479,44 @@ android_test { } `, }, + { + desc: "LOCAL_USES_LIBRARIES", + in: ` +include $(CLEAR_VARS) +LOCAL_MODULE := foo +LOCAL_USES_LIBRARIES := foo.test bar.test baz.test +include $(BUILD_PACKAGE) +`, + expected: ` +android_app { + name: "foo", + uses_libs: [ + "foo.test", + "bar.test", + "baz.test", + ], +} +`, + }, + { + desc: "LOCAL_OPTIONAL_USES_LIBRARIES", + in: ` +include $(CLEAR_VARS) +LOCAL_MODULE := foo +LOCAL_OPTIONAL_USES_LIBRARIES := foo.test bar.test baz.test +include $(BUILD_PACKAGE) +`, + expected: ` +android_app { + name: "foo", + optional_uses_libs: [ + "foo.test", + "bar.test", + "baz.test", + ], +} +`, + }, } func TestEndToEnd(t *testing.T) { |