android_test module are APKs that can be run as tests, either
as standalone unit tests or as instrumentation tests for another
APK.
Test: m checkbuild
Change-Id: I16661701637e4048fd99442029c3e195ebf373a4
And fix up androidmk / bpfix to provide warnings about what to do
instead.
Test: m blueprint_tools (runs the tests, ensures there aren't any tags left)
Change-Id: I1a3ad8600211050420041740207d6957f44463c8
This way we can remove the line the property was on, not just the
property itself.
Test: `m blueprint_tools` to run the unit tests
Test: diff bpfix results on all of AOSP before/after this change
Change-Id: I61fdd945e6ee711c620b79683dfee7b7c751b3c4
This will move the common properties:
name
defaults
device_supported
host_supported
To be listed first (and in that order) for every module. Other
properties are untouched.
This also adds a helper to test individual passes in an end-to-end
manner, and a helper to run passes that use PatchLists.
Test: `m blueprint_tools` to add the new tests
Test: Diff bpfix results over all of aosp before/after this change
Change-Id: I746a00a3731cb7597d2613ef2dc45a99654cd122
According to the documentation: "NewBuffer creates and initializes a new
Buffer using buf as its initial contents. The new Buffer takes ownership
of buf, and the caller should not use buf after this call."
Test: Run bpfix twice, only wrote the first time.
Change-Id: I52f88bfd9247240436b46f396c9196157774615b
This still leaves a blank line in it's place, but that's a more general
problem.
Test: m blueprint_tools
Test: Run bpfix over AOSP, diff.
Change-Id: I55c1d1c183cfa49beeca07abd539348bc2524c5a
The java library rewrites should only happen for java modules, not cc
modules.
Test: Ran androidmk on a number of Android.mk files
Change-Id: Ife2cfb5a69d7db37216671f08317033b99fcd3a1
Add support for translating LOCAL_MANIFEST_FILE, LOCAL_RESOURCE_DIR
LOCAL_SHARED_ANDROID_LIBRARIES, and LOCAL_STATIC_ANDROID_LIBRARIES.
Use the presence of non-empty LOCAL_RESOURCE_DIR,
LOCAL_SHARED_ANDROID_LIBRARIES or LOCAL_STATIC_ANDROID_LIBRARIES
to convert a java_library_static into an android_library module,
and then squash LOCAL_SHARED_ANDROID_LIBRARIES into
LOCAL_SHARED_LIBRARIES and LOCAL_STATIC_ANDROID_LIBRARIES into
LOCAL_STATIC_LIBRARIES.
Test: androidmk_test.go
Change-Id: I3ad2a3561f69ebd097eca97cb170754d64e06123
androidmk will start to generate multiple static_libs: properties
in a single module, add a pass in bpfix to fix them up into a
single property.
Test: bpfix_test.go
Change-Id: I30955b6efbb767c02ba77f2f18d44951ef094bad
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