Previously, android_app targets for which a.shouldEmbedJnis(ctx) = true
(e.g. CtsSelinuxTargetSdk25TestCases) would need to specify all of their
recursive library dependencies, including for example libc++ when depending
on the platform libc++. This means unnecessary churn when we add a new
dependency to libc++ (e.g. libunwind [1]). To avoid the churn and allow
jni_libs clauses to be simplified, make the build system search for the
recursive dependencies and automatically include them.
This change allows us to remove code that was previously adding NDK libc++
as a special case, as it is now covered by the generic code.
Also fix some improper quoting that was exposed as a result of this change
causing more files to be packaged than before.
[1] https://android-review.googlesource.com/q/topic:%22libunwind-so%22
Bug: 144430859
Change-Id: I3d6fbcce75bc108a982eb7483992a4b202056339
AndroidMkEntries now returns multiple AndroidMkEntires so that a module
can emit multiple Make modules if needed.
Bug: 128708192
Test: m
Change-Id: I56b6f76d22943b80329951c5acb80a1b932441ad
Link type checking for java_library has not been working unintentionally.
So turn on link type checking for these types.
And also add tests for link type checking.
Bug: 145799020
Test: cherry-pick aosp/1182522 and check if build fails
Test: m nothing and there is no error(soong unittest)
Change-Id: Ifc347f657885de1028ac0076ddd103c0387b597a
This change also adds instrumentation_target_package to android_test, so
that the target package name in a test manifest can be easily
overridden.
Fixes: 134624457
Test: app_test.go
Change-Id: Ib8dd703da0038ac76210c92d79e133e37c718122
This fixes a bug where unsigned split apks were installed instead of
their signed counterparts.
Fixes: 140795853
Test: app_test.go
Test: m Split && apksigner verify --print-certs
Change-Id: I12cdbcaff9932b6388f920d7e03301d687c3bfdb
Only if PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE is set,
every app and java library in product cannot use hidden APIs anymore.
checkSdkVersion() checks if sdk_version of app and library is narrow enough,
checkLinkType() checks every library that app links agianst
Bug: 132780927
Test: m
Test: set PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE, and check whether build
error occurs.
Change-Id: Ic630503b875040f730feda4fef826ed6d71da111
For now, Soong checks link-type in java_library, so it cannot block hidden api usage from android_library that app links with.
So we should add check in 'android_library'
Test: m nothing
Change-Id: Ic040270ec668bdd693b690ac8a88be1048922c3b
Stripping is incompatible with ART module updatability.
Bug: 65154345
Bug: 138851227
Test: build and observe no change in output (stripping is not used by
default).
Change-Id: I4bbc01d9979605b7dd2f73ee99a74c1e817c3e8c
As sdk_check.mk checks, soong starts to check every app.
If sdk_version is empty, platform_apis must be true.
If sdk_version is not empty, platform_apis must be false.
Test: soong test
Test: m
Bug: 132780927
Change-Id: I7ba702d616404d155f8ac40cd008828663ad1488
Instead of circumventing the limitation of Prebuilt implementation by
picking a source path itself, it now uses the same mechanism as
archMutator and replaces the source path in advance so that Prebuilt
always sees the corrent source path.
Because this requires the Apk field to be a string pointer, the single
source prebuilt implementation is being updated to be reflection-based.
Test: Soong unit tests, m soong_docs, TreeHugger
Change-Id: I2304f15e32d632f74f95f0d9e9bf1f75ff3e2225
Mainline builds privileged apps unbundled and then uses them as
prebuilts, so they need to respect the privileged flag when
deciding whether or not to uncompress the dex.
Bug: 135772877
Test: TestUncompressDex
Change-Id: I91da7116b779ae35c0617ef77dbcb9788902370c
If embed_notices or ALWAYS_EMBED_NOTICES is set, collect NOTICE files
from all dependencies of the android_app, merge them with the app's own
one (if exists), transform it to HTML, gzip it, and put it as an asset
in the final APK output.
Bug: 135460391
Test: app_test.go
Change-Id: I52d92e2fd19b3f5f396100424665c5cc344190d8
Corrects an error message that refers to no_framework_libs.
Removes any tests that use no_framework_libs:true where possible as
there are duplicate tests for sdk_version:"core_platform". Otherwise,
switches them over to use sdk_version:"core_platform".
Bug: 134566750
Test: m droid
Change-Id: I41abe1a49f5c744e3393ca9cdf0c41888f810c9f
Where possible this duplicates any tests that use no_framework_libs:true
with ones that use sdk_version:"core_platform". If not possible (e.g. in the
default targets included in java/testing.go) it switches some to use
sdk_version:"core_platform" to ensure that there is no regression in the
behavior of no_framework_libs:true.
Follow up changes will switch all usages of no_framework_libs:true over
to use sdk_version:"core_platform" at which point no_framework_libs will be
removed.
Bug: 134566750
Test: m droid
Change-Id: I42cb181f628b723c8f32a158ae4752b4c83365ae
When it is set to c++_shared, the added dependency should be
libc++_shared, not libc++.
Fixes: 130891985
Test: app_test.go, atest 'CtsNdkBinderTestCases' w/ conversion CL
Change-Id: I0e50e0d5bf511aa6e52d16cd715a185721011255
There are cases where a module needs to refer to an intermediate
output of another module instead of its final output. For example,
a module may want to use the .jar containing .class files from
another module whose final output is a .jar containing classes.dex
files. Support a new ":module{.tag}" format in any property that
is annotated with `android:"path"`, which will query the target
module for its ".tag" output(s).
Test: path_properties_test.go, paths_test.go
Test: no unexpected changes in build.ninja
Change-Id: Icd3c9b0d83ff125771767c04046fcffb9fc3f65a
The new package manager behavior requires packages without source code
to have an application element with hasCode attribute set to false in
their manifest. With this change, Soong can now automatically insert one
for codeless apps.
Test: app_test.go, manifest_fixer_test.py
Fixes: 124375490
Change-Id: Ied89a8d07c63805ab910859a4f7c45fc1c60bb73
Ports 09f3b97f4b488cd3a7b7d72038b173575b02c162 (Add support for
preopt with uses-libraries) from Make to Soong to support verifying
and preopting shared libraries.
This reapplies Id25f55f07a55120bebe2a9b32c094209efc85c8b with fixes
for unbundled builds and builds with ALLOW_MISSING_DEPENDENCIES=true
set.
Bug: 132357300
Test: app_test.go
Test: m checkbuild
Change-Id: I964309a68ec4ed081f3f3154879c71048ecb5455
Ports 09f3b97f4b488cd3a7b7d72038b173575b02c162 (Add support for
preopt with uses-libraries) from Make to Soong to support verifying
and preopting shared libraries.
Bug: 132357300
Test: app_test.go
Test: m checkbuild
Change-Id: Id25f55f07a55120bebe2a9b32c094209efc85c8b
The flag is a Soong version of LOCAL_NDK_STL_VARIANT in apps and app
tests. Unlike in the case of cc_library and its siblings, the only
meaningful value for the make var when it's used in apps is
'c++_shared', in which case we add additional dependency to libc++.
Fixes: 130891985
Test: app_test.go + CtsNdkBinderTestCases
Change-Id: I83f45d375742164fff7f160a734b0686e56b5c38
This change fixes an issue where an android_test could not depened on an
override_android_app or an android_app overridden by one by moving all
override processing to post-deps and forwarding incoming dependencies on
override_android_apps to base android_app modules
Fixes: 132447700
Test: app_test.go
Change-Id: I4ac593be661f541f5ea9823ef97373bee4b186f9
This is an initial version that handles the most basic cases.
Bug: 128610294
Test: app_test.go + prebuilt webview.apk
Change-Id: Ic525559aad5612987e50aa75b326b77b23acb716
proptools.PrependProperties doesn't replace a pointer when both the src
and the dst have one. This prevented override_module from overriding
simple value pointer properties when the base module has existing
values. It turns out this was why the name property needed to be
overwritten manually.
Bug: 122957760
Test: app_test.go
Change-Id: I3302287c31a560422548c22fade95261ddbe606a
android_test modules should always have native libraries packaged
into the APK even when use_embedded_native_libs: false is set.
Fixes: 129298278
Test: TestJNIPackaging
Change-Id: Idfcc630f7c6579c1280a920b5d71808b0a502e06
This enables users to override the package name of their apps either
directly in android_app or through override_android_app.
Bug: 122957760
Test: app_test.go
Change-Id: I98080a4076ce970fc85e58fc33495ba9b363eec9
This is a new implementation of overriding module types that makes use
of local variants. With this, product owners can use PRODUCT_PACKAGES to
decide which override module to include in their products.
Bug: 122957760
Bug: 123640028
Test: app_test.go
Change-Id: Ie65e97f615d006b6e9475193b6017ea9d97e8e97
This change adds book-keeping of whether an overlay came from
DEVICE_PACKAGE_OVERLAYS or PRODUCT_PACKAGE_OVERLAYS. This is
later used when writing the output to soong_app_prebuilt.mk, to
use either LOCAL_SOONG_[DEVICE|PRODUCT]_RRO_PACKAGES depending
on the original source.
This change is intended to be a noop on its own, but allows a
follow-up make change to customize the location of the auto-generated
RRO packages.
Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: Ib24fe1d05be132c360dd6966f7c83968c9939f77
Pass the package_splits list from the property to aapt2 as
--split arguments, sign the extra outputs, install them, and
add them as extra output files for SourceFileProducer.
Bug: 127921149
Test: TestAppSplits
Change-Id: Id94a53ae6a8a68ec81e98abba2fefc9c23feaa7a
This change adds an aapt2 flag, rename-instrumentation-target-package,
when an android test's instrumention target module's manifest package
name is overridden.
Bug: 122957760
Test: app_test.go, atest DocumentsUITests
Change-Id: I7116a51ec5ec9d61a20cd28509b3af0e383730d7
This reverts commit aa65e17016.
Reason for revert: Not compatible with PRODUCT_PACKAGES, and so has very limited use.
Change-Id: Ib141d3984a6f12bb50989e66037494c466b066f1
This new module type replaces the inherit-package function in make by
allowing developers to override the name, the certificate, and the
manifest package name of an android_app module.
Bug: 122957760
Fixes: 123640028
Test: app_test.go + BrowserGoogle
Change-Id: Iefe447e7078b25039233221361ef95c83a29973a
If a static library has static library dependencies then all resources
need to be moved to an overlay to maintain the correct ordering so
that a static library resource overlays the same resource in a
dependency.
Also fix the ordering of transitive static dependencies, a direct
dependency should override a transitive dependency.
Expand TestEnforceRRO to include a transitive static library and
verify both the direct resources and overlays, and rename it to
TestAndroidResources.
Bug: 124108931
Test: TestAndroidResources
Change-Id: I355f835a2ffb728af28aa208d951794c609e7409