Export proguard flags from Android library modules, and use them
from static dependencies in Android apps when running proguard.
Also export them to Make.
Unlike Make, which concatentates all the exported flags from
dependencies, Soong dedups exported flags files.
Bug: 73724997
Test: m checkbuild
Change-Id: I8f86fecb09cbc591832ce67e8ecef551a6600349
Merged-In: I8f86fecb09cbc591832ce67e8ecef551a6600349
(cherry picked from commit 89c31581a5)
Convert pom2mk to pom2bp that writes out Android.bp files instead
of Android.mk files. pom2mk stays for now until the last users
of it are cleaned up.
Bug: 78300023
Test: cd prebuilts/sdk/current/support && pom2bp -regen Android.mk
Change-Id: I584d63c4228bad32f9e1914b06bde807078d6a55
Merged-In: I584d63c4228bad32f9e1914b06bde807078d6a55
(cherry picked from commit 70dd38f09e)
Static android libraries should not get the product-specific
flags.
Bug: 73724997
Test: m checkbuild
Change-Id: I89e8c0a3fb788b18ee6603e9d21c9b9a5275f42f
Merged-In: I89e8c0a3fb788b18ee6603e9d21c9b9a5275f42f
(cherry picked from commit e78dcd313c)
Add support for compiling android_library modules into AARs,
and refactor app support on top of it.
Bug: 73724997
Test: app_test.go
Change-Id: I1dfac5fffe577c6680bc4709147b2061eb7d819c
Merged-In: I1dfac5fffe577c6680bc4709147b2061eb7d819c
(cherry picked from commit a97c5d3f08)
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.
Bug: 73724997
Test: androidmk_test.go
Change-Id: I3ad2a3561f69ebd097eca97cb170754d64e06123
Merged-In: I3ad2a3561f69ebd097eca97cb170754d64e06123
(cherry picked from commit 2dee86d69c)
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.
Bug: 73724997
Test: bpfix_test.go
Change-Id: I30955b6efbb767c02ba77f2f18d44951ef094bad
Merged-In: I30955b6efbb767c02ba77f2f18d44951ef094bad
(cherry picked from commit 9c55d237f6)
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.
Bug: 73724997
Test: bpfix_test.go
Change-Id: I1dc6fd99158c8b0e1db029df99e6cf72699a5e63
Merged-In: I1dc6fd99158c8b0e1db029df99e6cf72699a5e63
(cherry picked from commit adee968a4b)
Fix issues caught by go vet.
Bug: 73724997
Test: m checkbuild
Change-Id: Ib8d740457c15432dabe1575a6707726ddaf93084
Merged-In: Ib8d740457c15432dabe1575a6707726ddaf93084
(cherry picked from commit f46e37f5f7)
Add an option to pom2mk to exclude modules by name.
Bug: 78300023
Test: cd prebuilts/sdk/current/support && pom2mk -regen Android.mk -exclude androidx.car_car
Change-Id: I083907ef364384aace524ced81820567f5075d76
Merged-In: I083907ef364384aace524ced81820567f5075d76
(manually cherry-picked from c7453caf2c0a94192d0f722f26e9552da953ef8f)
pom2mk -regen Android.mk will read the previous arguments out of
Android.mk, rerun pom2mk with those arguments, and write the result
to Android.mk.
Bug: 78300023
Test: cd prebuilts/sdk/current/support && pom2mk -regen Android.mk
Change-Id: Ie8e0f97ae5b87c8078cf8e753489326d80da1896
Merged-In: Ie8e0f97ae5b87c8078cf8e753489326d80da1896
(manually cherry-picked from 6b359adc1e2bf1726567000d97e412fea6e88b95)
Some builds set AppsDefaultVersionName() to include the build
number ("P-123456"). aapt2 copies the version name of
framework-res into app manifests as compileSdkVersionCodename,
which confuses things if it contains the build number. Use the
DefaultAppTargetSdk ("P") instead.
Bug: 78324052
Test: m TARGET_BUILD_WITH_APPS_VERSION_NAME=true Dialer
aapt dump badging $OUT/system/priv-app/Dialer/Dialer.apk | grep compile
shows compileSdkVersionCodename=P
Change-Id: If67f40aae1066d4ff3bf97da1b2de2e1e250ad9c
Merged-In: If67f40aae1066d4ff3bf97da1b2de2e1e250ad9c
(cherry-picked from commit 402d5e0919)
Specifically, the use case is android-support-car requires some stubs that don't have a Maven pom.
So those stubs can't easily be listed as a dependency in the pom.
However, we do want the dependency to exist when importing to Make and detected by extract_deps.py
Bug: 76692459
Test: m -j blueprint_tools \
&& update_prebuilts.py -s <build_id> \
&& git diff HEAD^ -- fix_dependencies.mk \
&& m -j checkbuild
Change-Id: If546ecf7416580a01bde7b906976ada4b1145253
Merged-In: If546ecf7416580a01bde7b906976ada4b1145253
(manually cherry-picked from commit 358f25e97d)
LOCAL_RESOURCE_DIRS puts the highest priority overlay first, but
aapt2 expects the highest priority overlay last. Soong stores the
list in aapt2 order (low to high priority), but that means when it
exports to Make as LOCAL_SOONG_RRO_DIRS, which goes to
build_rro_package.mk and then package_internal.mk, it gets reversed
again and comes out backwards.
Bug: 78032566
Test: m checkbuild
Change-Id: If72bf929fbf1d126f9051a2f21ec1eb4e3030e6e
Merged-In: If72bf929fbf1d126f9051a2f21ec1eb4e3030e6e
(cherry picked from commit a140bb05f1)
aapt2 --min-sdk-version was using AppsDefaultVersionName(), which
is OMR1 for a non-finalized SDK, but 8.1.0 after finalization.
Add PlatformSdkCodename() for non-finalized SDKs, use it for
DefaultAppTargetSdk(), and pass it for aapt2 --min-sdk-version.
Bug: 78224641
Test: TestAppSdkVersion in app_test.go
Change-Id: I622eaf92f8a940f79007c2a579536da325700b06
Merged-In: I622eaf92f8a940f79007c2a579536da325700b06
(cherry picked from commit d09b0b653b)
Bug: 78118272
Bug: 72225642
Test: SKIP_ABI_CHECKS=true mm -j64 in external/libjpeg-turbo; no abi
dumping / diffing happens
Test: SKIP_ABI_CHECKS=false mm -j64 in external/libjpeg-turbo; abi
dumping / diffing happens
Test: SKIP_ABI_CHECKS=foo mm -j64 in external/libjpeg-turbo; abi
dumping / diffing happens
Merged-In: I6330bc6de81abd589e78572af8efdf70d4c69b80
Change-Id: I6330bc6de81abd589e78572af8efdf70d4c69b80
(cherry picked from commit b391feaea5)
This allows Soong (Go) plugins to get custom configurations set in the
current product's BoardConfig.mk.
I'll have some more comprehensive documentation later, but the general
concept is that you'd have one namespace per plugin, defined in the
BoardConfig.mk (though they would work in the product.mk files too):
SOONG_CONFIG_NAMESPACES += myPlugin
Within that namespace you can set key-value pairs:
SOONG_CONFIG_myPlugin := key1 key2 ...
...
SOONG_CONFIG_myPlugin_key1 := value
...
SOONG_CONFIG_myPlugin_key2 := true
Then in your plugin, you can ask for your namespace:
vars := ctx.Config().VendorConfig("myPlugin")
And then use them:
str := vars.String("key1")
if vars.Bool("key2") { ... }
if vars.IsSet("key3") { ... }
Warning: It's not a good idea to fail on missing inputs, since an
android tree may contain plugins from multiple owners, and we may
configure your modules (but not build/install them) even if they're not
meant for the currently configured product.
Bug: 76168832
Test: define some variables, use them
Test: m blueprint_tools
Change-Id: I4c38f5a4344022c6f332de279d9bbef24502e741
Merged-In: I4c38f5a4344022c6f332de279d9bbef24502e741
(cherry picked from commit 0fe7866897)
All access to these should be going through the methods on Config /
DeviceConfig.
Bug: 76168832
Test: m blueprint_tools
Change-Id: I47512dd58fb1a1a3f25838a9b1adaed2c41af8d3
Merged-In: I47512dd58fb1a1a3f25838a9b1adaed2c41af8d3
(cherry picked from commit 45133ac184)
In preparation for unexporting ProductVariables, explicitly return a
pointer to the structure from TestConfig / TestArchConfig.
Bug: 76168832
Test: m blueprint_tools
Change-Id: Iccfb4c912f8e0ee3f620cc1ee00f0cdc5cba7735
Merged-In: Iccfb4c912f8e0ee3f620cc1ee00f0cdc5cba7735
(cherry picked from commit 674dc7f7f0)
An upcoming change will stop exporting ProductVariables from Config, so
switch to using existing accessor functions, and add more when they're
missing.
Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
Merged-In: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
(cherry picked from commit 3fb1faeeb9)
Instead of open-coding the logic of whether there is one, or where to
find it.
Bug: 76168832
Test: diff out/soong/build.ninja without dist
Test: diff out/soong/build.ninja with dist specified
Change-Id: Ia3f1ef335e2d6e2175343338d04867d778a50300
Merged-In: Ia3f1ef335e2d6e2175343338d04867d778a50300
(cherry picked from commit bc0c509267)
So that the Path and similar functions can be used directly, without
manually adding something like configErrorWrapper (it just uses it all
the time now).
Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: I8cb524b09a84d0b8357d7c3501c71270af411e17
Merged-In: I8cb524b09a84d0b8357d7c3501c71270af411e17
(cherry picked from commit 54daaf0371)
Unlike the original change on master, this does not remove
product_variables.brillo, as I'm not backporting all of the other
removal CLs.
Bug: 76168832
Test: none
Change-Id: I6a5ce57b317f0cdae1abef15def01e6a31e18d3e
Merged-In: I6a5ce57b317f0cdae1abef15def01e6a31e18d3e
(cherry picked from commit a052599bb6)
Rename was expecting fully qualified names, but context.go always
passes it short names.
Bug: 77922456
Test: TestRename in namespace_test.go
Change-Id: I552ff39fd8ed6ba6da4262925060b45104840ff7
Merged-In: I552ff39fd8ed6ba6da4262925060b45104840ff7
(cherry picked from commit eafb10c23a)
ParseGeneratorParameter delimits based on commas, not colons:
external/protobuf/src/google/protobuf/compiler/code_generator.cc
Bug: 72570104
Test: flash device with new build
Change-Id: I00042782a718d288ca6b0cb78f856d0fb223a926
(cherry picked from commit fb5b31ce96)
Bug: 64267858
Test: create reference dump for libjpeg; add exported function to libjpeg;
m -j libjpeg.vendor, build fails with helpful message.
Test: create reference dump for libjpeg; add exported function to libjpeg;
m -j libjpeg.vendor dist DIST_DIR=dist, build fails with helpful message.
Merged-In: Iae25374fe937a0cbe8a8ddf9e23c3bc1f62bbb2a
Change-Id: Iae25374fe937a0cbe8a8ddf9e23c3bc1f62bbb2a
(cherry picked from commit d8b70a39d1)
(cherry picked from commit 301aa8a8dcb0a92e96ffbf1aa2da3ca49ce2bda9)
For easier debugging if there are multiple duplicates
Bug: 76692459
Test: ./update_current.py -x <build-id>
Change-Id: I3079cb4ed1cfd365d792a7b41c9cdb4e7a1e148f
Merged-In: I3079cb4ed1cfd365d792a7b41c9cdb4e7a1e148f
It still excludes test deps though
Bug: 76692459
Test: ./update_current.py -x <build-id>
Change-Id: I55a786e9feab31f99b95b7cebe84869757e46270
Merged-In: I55a786e9feab31f99b95b7cebe84869757e46270
If there are no symbols to keep (i.e. all function symbols are also in
the dynsym table), then the "${outfile}.keep_symbols" file has size 0.
When objcopy parses a --keep-symbols file, it has a special case for
0-sized files where it silently fails (exits with status 1, no error
message). On the other hand, objcopy is happy with a file containing no
symbols, as long as there is some whitespace or a comment. Avoid the
special case by appending a newline to keep_symbols.
Bug: b/62815515
Bug: b/77242617
Test: manual
Change-Id: I90fd3258426176dc18aa5a8c19389c55fe6329c7
(cherry picked from commit afefacf196)
Test: use it for healthd, it is not installed.
Bug: 77541952
Change-Id: I170a31d1b4d15f20de6a6b6279a2eeda49ca7447
Merged-In: I170a31d1b4d15f20de6a6b6279a2eeda49ca7447
This commit changes the VNDK-SP dependencies check. With the commit,
VNDK-SP-Ext can link to non-VNDK vendor shared libs. This commit also
refines the "cc_test" so that more error handling cases are properly
tested.
Before this commit, VNDK-SP-Ext could not depend on vendor libs. It
was disallowed because there were no correct way to load vendor libs.
The fallback link had to specify the shared lib names. On the other
hand, adding "/vendor/${LIB}" to search paths will lead to
double-loading issue.
In aosp/595067, "allow_all_shared_libs" was added to bionic dynamic
linker. Now, we can link the "vndk" namespace to "sphal" namespace.
Thus, like VNDK-Ext, VNDK-SP-Ext can link to vendor libs now.
Bug: 77249955
Test: lunch aosp_walleye-userdebug && make -j8 # runs unit tests
Test: lunch aosp_sailfish-userdebug && make -j8 # runs unit tests
Test: Create a VNDK-SP-Ext, link to vendor libs, and run it.
Change-Id: I5511204539a22c998528111076f46756807faf29
Merged-In: I5511204539a22c998528111076f46756807faf29
(cherry picked from commit d3c59a2b3a)
Normally, when building with VNDK, platform modules are not allowed to
link against vendor libraries, because the ABI of the vendor libraries
are not guaranteed to be stable and may differ across multiple vendor
images.
However, the vendor public libraries are the exceptions. Vendor public
libraries are vendor libraries that are exposed to 3rd party apps and
listed in /vendor/etc/public.libraries.txt. Since they are intended to
be exposed to public, their ABI stability is guaranteed (by definition,
though it is up to the vendor to actually guarantee it).
This change provides a way to make a vendor lib as public by defining a
module of type 'vendor_public_library' with a map file that enumerates
public symbols that are publicized:
cc_library {
name: "libvendor",
proprietary: true,
...
}
vendor_public_library {
name: "libvendor",
symbol_file: "libvendor.map.txt",
}
This defines a stub library module named libvendor.vendorpublic from the
map file. `shared_libs: ["libvendor"]` is redirected to the stub library
when it is from the outside of the vendor partition.
Bug: 74275385
Test: m -j
Test: cc_test.go passes
Merged-In: I5bed94d7c4282b777632ab2f0fb63c203ee313ba
Change-Id: I5bed94d7c4282b777632ab2f0fb63c203ee313ba
(cherry picked from commit 374510bcb6)
cfiExportsMap was reinitialized for every module, which caused
data races. Create the path from the string on each use
instead.
Bug: 77234104
Test: m nothing with race detector turned on
Change-Id: Ibca3149dcbe8a9d4d9f7ec6dd0b164697e7ae5cd
Merged-In: Ibca3149dcbe8a9d4d9f7ec6dd0b164697e7ae5cd
(cherry picked from commit 1218a19f0d)
When building vendor modules with BOARD_VNDK_VERSION=current, the
API of the vendor modules will be current PLATFORM_VNDK_VERSION.
__ANDROID_API_FUTURE__ will be used as before if the version is a
CODENAME.
If BOARD_VNDK_VERSION is not "current", that means the VNDK version
of the vendor modules is BOARD_VNDK_VERSION.
Bug: 74833244
Test: Build and check boot.
Change-Id: I383c76a36101e39c70575b463880b52d3e9d90bb
Merged-In: I383c76a36101e39c70575b463880b52d3e9d90bb
(cherry picked from commit 732aa6afdf)
ExpandSourcesSubDir was calling SourceFileProducer.Srcs(), and then
doing:
moduleSrcs = append(moduleSrcs[:j], moduleSrcs[j+1:]...)
This modifies the backing store of the slice, which may affect the
original data stored in the SourceFileProducer. Make all Srcs
implementations return slice that points to a copy of the backing
array.
Test: m out/target/common/obj/PACKAGING/checkpublicapi-current-timestamp
Bug: b/76179848 b/76397326
Change-Id: I2432ce196984814daafc5aa9a2746e81de74494c
Merged-In: I2432ce196984814daafc5aa9a2746e81de74494c
(cherry picked from commit e42777a05a)
We omit vendor unavailable modules. This should not apply to llndk
libraries since currently, we do abi checks on their system variants.
Bug: 77101345
Test: m -j libc creates libc.so.lsdump
Test: m -j libjpeg.vendor creates libjpeg.so.lsdump
Test: m -j external/cblas still does not create libblas.so.lsdump
Merged-In: I5522c1cd471bfba8a1f632270ab2f167b4b17117
Change-Id: I5522c1cd471bfba8a1f632270ab2f167b4b17117
(cherry picked from commit fa920fabda)