The installation of the symlink
(<partition>/app/MyApp/lib/<arch>/libfoo.so) and its target
(/system/lib64/libfoo.so) are now done int Soong.
I gave up the idea of always embedding jni libs to apps, due to a
hard-to-fix regression in storage usage. Specifically, consider this
case.
app --(jni_lib)--> libfoo
--(jni_lib)--> libbar
libfoo --(shared_lib)--> libbar
Ideally, with the embedding idea, both libfoo and libbar should be
embedded into the app and there should be no libfoo or libbar outside of
the apk, unless there's no dependency to any of them from outside of the
apk.
However, the previous implementation installed libbar to /system/lib64,
leading two copies of the lib; one in /system/lib64, the other in the
apk.
This was happening because libbar was also considered as a transitive
dep of libfoo, and therefore a dependency to its installation path is
added to the apk. The problem here is that the app doesn't know that
libfoo depends on libbar. We in theory can write a very delicate
dependency traverse routine which filters libbar out of the transitive
deps, but that looked too complicated.
Bug: 339923078
Bug: 330276359
Test: Build and watch any bloatbuster warning
Test: m aosp_cf_system_x86_64
The following three files are found
* system/lib64/libnfc_nci_jni.so
* system/etc/libnfc-nci.conf
* system/priv-app/NfcNci/lib/arm64/libnfc_nci_jni.so
Change-Id: I0930cb1ebb8ca8a6efd64b1ce2cdfd1c47fe19ef
This change modifies the build actions of java_sdk_library module type
so that it does not perform any compilation actions (i.e. does not
create the top level java_sdk_library jar file). Instead, it delegates
the build actions the top level jar file was performing to the
dynamically created ".impl"-suffixed java library module. The build
actions that are delegated to the impl library module include hiddenapi
processing, dexing, and dexpreopt.
This change relands https://r.android.com/3035972. Implementation
changes from the original change:
- "all_apex_contributions" is added as a dependecy to the implementation
library modules where the parent sdk_library module has a prebuilt
equivalent. This allows the source apex variant to be hidden from make
when the prebuilt is active.
Test: patch in internal main, lunch barbet-ap2a-userdebug && m nothing
Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: I017938e5567aef82e428e7ceb557d9c9090e0257
Context
- Android-<target>.mk currently does not contain information about partition for its dependent unembedded jni libraries, but only lists the name of the unembedded jni libraries.
- If an android_app module depends on an unembedded jni library that is located in a different partition, make cannot find the library.
Implementation
- Create a string field partition in jniLib struct.
- Add variable "LOCAL_SOONG_JNI_LIBS_PARTITION_<target>", an array of mappings of the name of the jni library to its partition.
Bug: 154162945
Test: m
Change-Id: I6b8e1272ff59dc70e3dd6ce8c6c8e4686dad76df
Move overrides attribute from appProperties to overridableAppProperties
Bug: 220029162
Test: m
Change-Id: I6f527df3173f142311734333ad37018c83d5e279
Merged-In: I6f527df3173f142311734333ad37018c83d5e279
(cherry picked from commit a2ce78f80d)
Introduce and set the variable LOCAL_DISABLE_TEST_CONFIG varaible to be
true for the `android_test_helper_app` type modules.
Bug: 188927912
Test: rum 'm module-name' (`android_test_helper_app` type module)
Test: TreeHugger
Change-Id: I5db1029f31d8afe1ca5e9fab95e39d751971058d
Replaces uses of javaFixtureFactory with prepareForJavaTest and removes
the unused javaFixtureFactory.
Bug: 182885307
Test: m nothing
Change-Id: I809772d14af2af211b9e15ad676fbdc06b07cd46
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.
Bug: 182885307
Test: m nothing
Change-Id: Ibb9520d1500fcef9a4348570926a07b5bb54bf8c
These tests rely on files provided by javaMockFS() so need to are being
converted to test fixtures to allow them to remove that dependency
which will allow javaMockFS() to be removed.
Bug: 182638834
Test: m nothing
Change-Id: If736b95d134fe73c0a0ccd438ec31e93568fb929
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.
Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Without LOCAL_SOONG_DEX_JAR, ninja fails with a missing
dependency error.
Test: m nothing
Test: new TestImportSoongDexJar
Bug: 173705556
Change-Id: I54a4c6ea93877667a3fb97f8b2621c42e431f577
A previous change handles dist properties automatically for all module
types and as a result has made the java.Library setting of DistFiles
redundant so this change removes that and the tests that duplicate
tests of the general mechanism.
Test: m nothing
m dist sdk - before and after this change, compare result to
make sure that there are no significant differences.
Bug: 174226317
Change-Id: Ib79a3bdd46897efd84a9c456c37c374bd6036303
This reverts commit 323dc60712.
Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests
Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.
Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
This CL adds "dists" to the base property struct to support multiple
dist file configurations, and generic tag support to dist tagged outputs
of modules.
Fixes: b/152834186
Test: soong tests and `m sdk dist`
Change-Id: I80c86bc9b7b09e671f640a4480c45d438bdd9a2a
Signed-off-by: Jingwen Chen <jingwen@google.com>
Make java_library support this mode of output, to allow
callers to dist the classes.jar file rather than the dexed
jar file.
Bug: 152618077
Test: followup CL
Change-Id: I5ba6949833a0fbb95376142aec5096ff5f084c00
Merged-In: I5ba6949833a0fbb95376142aec5096ff5f084c00
(cherry picked from commit 1e65f94a4b)
Previously, the -hostdex library was emitted using the ExtraFooters.
Now, it has its own AndroidMkEntries, which can be returned together
with the AndroidMkEntries for the main library.
Bug: 128708192
Test: m
Change-Id: Ic9eb0d3839572ed340ccbc5fc6c4b54241e1cb24
AndroidMkEntries now returns multiple AndroidMkEntires so that a module
can emit multiple Make modules if needed.
Bug: 128708192
Test: m
Change-Id: I56b6f76d22943b80329951c5acb80a1b932441ad
This change migrates some of AndroidMk()s in java/androidmk.go to
AndroidMkEntries(), mainly focusing on deduping test-related helper
funcs.
Test: Soong tests
Test: Built a system image
Test: Manual inspection of diffs
Change-Id: I7810085521600d9ea2df078837688ade41c04825
java.Module is using "Custom" function to write Android.mk.
And if "hostdex" is set to "true", it writes "hostdex" module definition
as well as original module.
As of now, Required/Host_required/Target_required props are filled in
the AndroidMkEntries structure(aosp/939505). But these are not
passed to old AndroidMkData.Custom function.
So, if a java_library declares "hostdex:true" and "required:[...]"
together, "required" is not applied to the "hostdex" variant.
This change copies *Required props from AndroidMkEntries to
AndroidMkData before calling its Custom callback.
Test: m (runs soong unit tests)
Change-Id: I5f85714f721a2a0917ab18072dbea52294c770e7