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
This commit is contained in:
@@ -15,11 +15,12 @@
|
|||||||
package androidmk
|
package androidmk
|
||||||
|
|
||||||
import (
|
import (
|
||||||
mkparser "android/soong/androidmk/parser"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
mkparser "android/soong/androidmk/parser"
|
||||||
|
|
||||||
bpparser "github.com/google/blueprint/parser"
|
bpparser "github.com/google/blueprint/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -128,6 +129,8 @@ func init() {
|
|||||||
"LOCAL_STATIC_LIBRARIES": "static_libs",
|
"LOCAL_STATIC_LIBRARIES": "static_libs",
|
||||||
"LOCAL_WHOLE_STATIC_LIBRARIES": "whole_static_libs",
|
"LOCAL_WHOLE_STATIC_LIBRARIES": "whole_static_libs",
|
||||||
"LOCAL_SYSTEM_SHARED_LIBRARIES": "system_shared_libs",
|
"LOCAL_SYSTEM_SHARED_LIBRARIES": "system_shared_libs",
|
||||||
|
"LOCAL_USES_LIBRARIES": "uses_libs",
|
||||||
|
"LOCAL_OPTIONAL_USES_LIBRARIES": "optional_uses_libs",
|
||||||
"LOCAL_ASFLAGS": "asflags",
|
"LOCAL_ASFLAGS": "asflags",
|
||||||
"LOCAL_CLANG_ASFLAGS": "clang_asflags",
|
"LOCAL_CLANG_ASFLAGS": "clang_asflags",
|
||||||
"LOCAL_COMPATIBILITY_SUPPORT_FILES": "data",
|
"LOCAL_COMPATIBILITY_SUPPORT_FILES": "data",
|
||||||
|
@@ -1477,6 +1477,44 @@ android_test {
|
|||||||
name: "foo",
|
name: "foo",
|
||||||
lineage: "lineage",
|
lineage: "lineage",
|
||||||
}
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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",
|
||||||
|
],
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user