Make a new object called Fixer to hold the state of the tree, and
make a copy of the input tree so the original doesn't get modified.
Test: bpfix_test.go
Change-Id: I1dc6fd99158c8b0e1db029df99e6cf72699a5e63
java_import and android_library_import modules can't be handled
directly in androidmk because the results may depend on properties
that haven't been parsed yet. Add a bpfix pass (which is
automatically included at the end of androidmk) to select
android_library_import vs. java_import based on the extension
of the prebuilt file, and convert the srcs property to jars or aars
as appropriate.
Bug: 73724997
Test: androidmk_test.go
Change-Id: I1024742e9e96d5e1e88c3cc139eeb0d5a2f6849b
The functions in bpfix that take a *parser.List and return a
modified *parser.List are always returning the same pointer
and mutating the target of the pointer. Remove the extra
unnecessary return value.
Also extract the getLiteralListProperty function.
Test: androidmk_test.go
Change-Id: I08d8aff955c72b7916741cda8083974a49af4d6f
Since in some cases they're not the default value.
Test: echo "cc_defaults{ system_shared_libs:[] }" | bpfix | grep system_shared_libs > /dev/null && echo ok
Bug: 66979076
Change-Id: I760b34f980281b955972819676bd62154a6c73f5