This relands I12a0f907753fefd1997ab8b4ea2ac331234093cf along with
a fix to blueprint for absolute paths.
Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.
Change-Id: I24ac485677aa102eec1a2521d16820da6ee1ae77
Fixes: 146437378
Test: m checkbuild
Test: m OUT_DIR=/tmp/out nothing
Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.
Fixes: 146437378
Test: m checkbuild
Change-Id: I12a0f907753fefd1997ab8b4ea2ac331234093cf
Using a gomod-aware editor with build/soong requires that files
in build/soong can be mapped to the android/soong package path.
Move the partner androidmk and bpfix files such that their path
matches the package path when the android/soong package prefix is
replaced with the build/soong path prefix.
Test: go test ./...
Test: m bpfix androidmk partner_bpfix partner_androidmk
Change-Id: Ic7f7aad9e5eb9178eef0383f0b37e4fb93ce8314
Allows our partners to maintain partner-specific fixes in their repos. Converts most of androidmk into a library similar to bpfix. Makes some methods and types public for use by extended versions.
Bug:140727544
Test: Ran unit test cases &&
ran test conversions with sample
Change-Id: I7e1fbf3a6a7a8bd47334f43fe3eb68cbbd3426c1
Corrects an error message that refers to no_standard_libs.
Removes any tests that use no_standard_libs:true where possible as
there are duplicate tests for sdk_version:"none". Otherwise, switches
them over to use sdk_version:"none".
The androidmk mapping from LOCAL_NO_STANDARD_LIBRARIES to
no_standard_libs has also been removed. There was little point in
updating the tool to map it through to sdk_version:"none" as there are
only a couple of places where it is used, in art's test running mk
targets and in some unbundled packages to work around some limitation
in .mk based build.
Bug: 134566750
Test: m droid
Change-Id: I6413c9b1fe3e63b93753a6a017d2981e32b7e013
This introduces a generic function SortedStringKeys which can be used to
get a slice of sorted string keys for all kinds of maps having string
keys.
Bug: N/A
Test: m
Change-Id: I542194c68984d909b7ad1dbf060d4d3a98f0ef23
There are a couple of makefiles that have etc with $(TARGET_OUT)/etc/firmware,
$(TARGET_OUT_VENDOR)/firmare as the local module path. Added the conversion in
androidmk for target.
Bug: b/133711895
Test: Unit test cases.
Change-Id: I74aca18a7eb8aa4dd692cde680fa4e112edcf6d1
- Updates the fuzzer builds to use SANITIZE_TARGET='fuzzer' instead of
'coverage'.
- Removed an old dependency that made fuzzer builds without ASan
an error.
- Fixed up the build flags to allow fuzzers to be built. Previously, the
coverage flags were manually provided. As the toolchain has moved on,
these flags are no longer compatible with libFuzzer, and so I've updated
them to use the correct, compatible flags.
- Added a dependency mutator for fuzzer coverage.
Bug: 121042685
Test: With all patches in the bug merged, build a fuzzer using
'SANITIZE_TARGET=fuzzer mmma <your_fuzzer>'.
Change-Id: Ib6246980f77bc4babe587b1e88038aa12228fa83
Merged-In: Ib6246980f77bc4babe587b1e88038aa12228fa83
There are a couple of makefiles that have etc with $(TARGET_OUT)/fonts
and $(TARGET_OUT_PRODUCT)/fonts as the local module path. Added the
conversion in androidmk for target.
bug: b/123403785
Test: Wrote and ran unit test cases, did a test conversion on
* platform/external/google-fonts/dancing-script/Android.mk
* internal/external/google-fonts/arbutus-fonts/Android.mk
Change-Id: Id67e10f80b32b27c5027cd274a7944801dad0880
There are a couple of makefiles that have etc with $(TARGET_OUT)/usr/share
as the local module path. Added the conversion in androidmk for target
and host.
Bug: b/132123818
Test: Wrote and ran unit test cases, did a test conversion on
external/neven/Android.mk makefile.
Change-Id: Iafed89f4cee499f561a1235f8870b1f1329e99bc
So that <module>/gen/yacc/... is (re)created by a single rule, previous
files are removed, and location.hh is in the build graph when it is
produced.
Test: treehugger
Change-Id: I2f6e47ea07f315e10ae1cb8ad50697e7123d0285
They are counterparts of LOCAL_HOST_REQUIRED_MODULES and
LOCAL_TARGET_REQUIRED_MODULES respectively.
Fixes: 128693436
Test: treehugger, convert cts/hostsidetests/devicepolicy/Android.bp
Change-Id: Id66ffca6edffe18993ac51e8930f1d0e78178249
Rename jetifier_enabled to jetifier since there are no users
yet and it is more consistent with the rest of the Soong
properties. Also add it to androidmk translation.
Fixes: 123524520
Test: androidmk_test.go
Change-Id: Ib4c688cf3cb171a822ddf7dd49467522c4c1276c
The value of a property to be merged may be a reference to a variable.
When we first create an attribute for a makefile variable (e.g. we
create 'android_static_libs' from LOCAL_STATIC_ANDROID_LIBRARIES), we
set its type correctly. However, reparse in bpfix erases this
information, so by the time 'android_static_libs' attribute is to be
merged with 'static_libs', it has no type and merge occurs. It isn't
easy to fix properly, so just don't merge in such case, Soong will
complain and it will be fixed manually.
Fixes: 125519127
Test: unit tests in androidmk_test.go
Change-Id: Ic66d7ab686a2fdde987f32e2b204c72d9bf0d026
The variables LOCAL_ADDITIONAL_CERTIFICATES. LOCAL_ASSET_DIR,
LOCAL_CERTIFICATE, LOCAL_JARJAR_RULES, LOCAL_PROGUARD_FLAG_FILES,
LOCAL_RESOURCE_DIR specify the paths relative to the top of the
source tree using $(LOCAL_PATH)/. Remove it when converting to
blueprint files and diagnose the cases when these paths do not start
with $(LOCAL_PATH).
Fixes: 122728056
Test: Internal tests
Change-Id: Id3fcacdd5445a97365c03e00656291bfe829c035
Many Android.mk files for the CTS tests have
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
statement. This can be dropped during the conversion to blueprint
files.
Also, ignore the assignments to obsolete LOCAL_CTS_TEST_PACKAGE
variable.
Fixes: 125405331
Test: Internal tests, selectively run androidmk on Android.mk's in cts/
directory
Change-Id: I2ed88acd3c8837f96b84be6eb7c7b9b0b5405f57
Test: internal (see android/vts_config_test.go) + run 'm vts' and check
that host/linux-x86/vts/android-vts.zip remians the same
Change-Id: I0249a974a240e7669c3b9378c17739df8e120873
Fixes: 122617100
When use_embedded_dex is set, store the dex uncompressed in the
APK and set the android:useEmbeddedDex="true" attribute in the
manifest.
Test: m checkbuild
Change-Id: Iea6e7ed19599830ac72392ef93f9c98957df1cce
Only put uncompressed native libs in an APK if the min_sdk_version
supports it (>= 23, Marshmallow), and set
android:extractNativeLibs="false" in the AndroidManifest.xml so
that the platform won't extract them anyways.
Bug: 117618214
Test: m checkbuild
Change-Id: I760017e48bf3c6b618aabde0982df45995765d48
The conversion is a two-step process: first, when processing
BUILT_PREBUILT, convert LOCAL_SOURCE_PATH to a variable reference+fixed
subpath path in the blueprint AST. Then, set various boolean flags
depending on variable being referenced. androidmk_test.go has a test for
each handled case.
Change-Id: Iabd18d5f8645ca7077536863cd6640df5b24d24a
Fixes: 122906526
Test: treehugger
The annotation_processors property is deprected, translate
LOCAL_ANNOTATION_PROCESSORS to plugins instead. Also remove
LOCAL_ANNOTATION_PROCESSOR_CLASSES properties, they are
retrieved from java_plugin dependencies instead.
Bug: 77284273
Test: androidmk_test.go
Change-Id: If6f6177262d5579e03bae58d9eb54a599e3da786
This change fixes a bug where androidmk assumes all-*-files-under
function only takes one directory parameter.
Test: androidmk_text.go, manual execution
Change-Id: Ib1614a2ddde7ea1120c1c37126231988f4862165
It should be translated to a poperty map with one entry, not a string
value.
Bug: 74083867
Change-Id: Ida659749a63e67eb55184e7c79959f57b8549dad
Test: androidmk_test.go
Some android_app modules need certificates located outside their
directory. Instead of requiring paths from the root of the tree,
add an android_app_certificate module that exports the certificate
files.
Test: m checkbuild
Change-Id: Icbf3898894f3eb857e2d907e3e58dd072c6fabe9
Make android_app modules a MultiTargets module, which means the
common variant will have a list of Targets that it needs to handle.
Collect JNI libraries for each Target, and package them into or
alongside the APK.
Bug: 80095087
Test: app_test.go
Change-Id: Iabd3921e1d4c4b4cfcc7e131a0b0d9ab83b0ebbb
This is an adaptation of Icc4f8c16bc389fe20db680849f311d02df1299c3, to
support modules that are installed on the /product-services partition.
Bug: 80741439
Test: m -j both with and without enabling the new partition
Change-Id: I72b335ad38baff5848cd3da7489343f8cf98ff16
In androidmk, translate BUILD_JAVA_LIBRARY to java_library plus
installable: true, and BUILD_STATIC_JAVA_LIBRARY to java_library.
In bpfix, rewrite java_library_static to java_library.
Bug: 110885583
Test: androidmk_test.go, bpfix_test.go
Change-Id: I63c2f759ae9c62a43f3439526552d2cd8e8cedc3
Add min_sdk_version properties and use it for aapt2
--min-sdk-version and --target-sdk-version flags. Add an sdkContext
interface that any function that needs an sdk version can take in
order to get the values for the current module.
Bug: 110848854
Test: m checkbuild
Change-Id: Ic69f1f935d8b865ec77689350407df08bfac5925
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
Add a platform_apis property. The logic to verify it isn't
hooked up yet, but this will allow translating modules to
Soong without losing the annotation.
Test: m checkbuild
Change-Id: I75ff2d7b94247873f5bb1547a9b347a8e73c3191