summaryrefslogtreecommitdiff
path: root/apex/builder.go
AgeCommit message (Collapse)Author
2022-02-09Geneate AndroidManifest file if the apex_test module does not have one. Gurpreet Singh
If the build file contains the apex_test module, but the apex_test module does not contain the AndroindManifest file, then create the AndroidManifest file. In such case, the apexer tool is already generating an AndroidManifest file. In order to handle the testOnly attribute for apex_test modules, a --test_only flag is appended to the opt flags. The apexer tool reads the opt flags and if the --test_only flag is present then it generate the AndroidManifest file with testOnly attribute. Bug: 213310150 Test: m nothing && m test_com.android.sdkext Test: manually checked the generation of AndroidManifest file in the unsigned zip file mentioned in the description. This command allows to read the attribute of the binary xml file - aapt2 dump xmltree test_com.android.sdkext.apex.unsigned --file AndroidManifest.xml Verified the presence of testOnly flag in the output. Change-Id: Ic47378428b2dba51d73e75d912546c2374f68d57
2022-02-01Add testOnly attribute to AndroidManifest file of apex_test Gurpreet Singh
If the build file contains the apex_test module, add the testOnly attribute to the application element of the corresponding AndroidManifest file and set its value to true. If the testOnly attribute is already present and has value false, then do nothing. Tests added in manifest_fixer_test.py to check if the updated AndroidManifest file has the testOnly attribute set to true or not. Bug: 213310150 Test: atest --host manifest_fixer_test Test: m nothing Test: manually checked the AndroidManifest file generated Change-Id: I36247dbe0261c342d451a4422c314fd8fe0c2369
2022-01-22Make 'Compressible' an overridable property Oriol Prieto Gasco
This is needed to allow the Android Go versions of modules (com.google.android.go.*) to select a different compression toggle than their non-Go (com.google.android.*) conterparts. go/go-updatability Bug: 203024418 Test: Preloaded go variants on wembley, booted Android. Change-Id: Ic96aff5fafb65fbd08e8a69d47c994532e27819e Merged-In: Ic96aff5fafb65fbd08e8a69d47c994532e27819e (cherry picked from commit 2c4a96375aef7570076770474b5b73341455570d)
2021-12-15Add canned_fs_config to apex module type Jiyong Park
The property is used to customize uid/gid/mode/capabilities of files in an APEX. Bug: 209971551 Test: m Change-Id: I484e46ff819a5266c1e8046dae337e18ef3fefea
2021-12-15Build canned_fs_config using RuleBuilder Jiyong Park
... in preparation for adding the support for custom canned fs config Bug: 209971551 Test: m nothing Change-Id: I7f2576ff99c65bdb6c9ce4ace61bc783eea2f0d4
2021-12-10Revert^2 "Build license metadata files in Soong" Colin Cross
b3264f20905792e553561e9e0076eaf95d80a25d Change-Id: I5ea5f7e29eb1dbc72b8b30f010006a25f5f72fac
2021-12-10Revert "Build license metadata files in Soong" Colin Cross
Revert submission 1899703 Reason for revert: b/210158272 Reverted Changes: I142c19284:Reuse license metadata files from Soong Ife89b8f23:Add dependency license annotations I8e7410837:Build license metadata files in Soong Change-Id: I48f2bf2e2797ac9d38f7ece35ba616b823035607
2021-12-08Build license metadata files in Soong Colin Cross
Soong has enough information to build the license metadata files without resorting to the fixups required in Make. Bug: 207445310 Test: m checkbuild Change-Id: I8e74108376162b8fdb87ba098ebe94350aa1f7c4
2021-11-19Move apex module installation into Soong Colin Cross
Move apex module installation rules into Soong by overriding InstallBypassMake. Soong installs don't support post install commands, so move the symlinks into separate rules and add dependencies on them. This relands If65d283abc86f18ad266da0bf16fe95971a0bf9c with fixes to install files into $OUT/apex and I606286e971b55d9d1fc4dcd0fbd476962de5fa79 with a fix for reversed logic. Bug: 204136549 Test: m checkbuild Change-Id: Ie65c53ebc7911efacdb8e11ba49059448f03c658
2021-11-17Extract primary apk from apk set zip Colin Cross
Extract and install the primary apk normally, and then unzip the rest of them as a post install command. Bug: 204136549 Test: app_set_test.go Change-Id: I17437ff27f49df6bc91bdbbea6173b46c7d3ec4e
2021-11-12Java APIs used by Mainline modules. sophiez
Add scripts to generate java APIs used by Mainline modules. This is aosp/1879177 with fixed build error that caused by dexdeps analyzing resource only APKs which doesn't contains any .dex files. Now skip the error generates in that case in gen_java_usedby_apex.sh Forrest run:https://android-build.googleplex.com/builds/abtd/run/L38900000951898586 Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only Change-Id: Id539cbe1b7306ace69c047f95ffc02265a467511
2021-10-30Merge changes I04f2f558,Ie16a6264,I83a3be9f,Icb3eeef3 Colin Cross
* changes: Rename amod variable in AndroidMkEntries.fillInEntries to base Make HostToolPath, HostJNIToolPath and sboxPathForToolRel use pathForInstall Add PathForGoBinary Remove PathForOutput from InstallPathToOnDevicePath
2021-10-29Make HostToolPath, HostJNIToolPath and sboxPathForToolRel use pathForInstall Colin Cross
Use pathForInstall instead of PathForOutput for HostToolPath, HostJNIToolPath and sboxPathForToolRel so that they internally produce an InstallPath that can later support being converted to Make install path. Bug: 204136549 Test: m checkbuild Change-Id: Ie16a62641d113873daeec4d1dd4261251bc0d0eb
2021-10-28Merge "Make a pass over our codebase cleaning up non-precise / non-inclusive ↵ Treehugger Robot
language."
2021-10-28Make a pass over our codebase cleaning up non-precise / non-inclusive language. Joe Onorato
Test: treehugger Bug: 204369779 Change-Id: I6e63cae824d323535cdb14b493edd868df47738d
2021-10-19Save all the detected native shared library backing by mainline modules. sophiez
Test: TARGET_BUILD_APPS=com.google.android.adbd m dist apps_only Change-Id: I510292542bf2550c9244e9374cd6f7b40a971486
2021-10-15Merge "Add EROFS support for APEX build system" Mohammad Islam
2021-09-28Call InstallFile even when !installable Jiyong Park
Not calling InstallFile when !installable prevents the module not only from being installed to the partition, but also from being packaged for a packaging_base. InstallFile already has a routine for not generating the install rule when the module is not installable. So, the check for can be safely omitted at the call site. Bug: 199674764 Test: m com.android.virt. the virt apex has com.android.runtime.64only.apex in system/apex Change-Id: I0249f5916496ed136dbf1978e04e2971852de244
2021-09-14Add system/sepolicy/apex to bp2build allowlist Liz Kammer
Technically, tzdata apex depends on //system/sepolicy/apex:com.android.tzdata-file_contexts. Builds suceeded regardless due to bp2build generating a filegroup for all files in a directory. This also requires an update to the check in apex/builder.go to address the fact that outputs (including filegroups) from Bazel in mixed builds will be in a Bazel out subdirectory. This change also corrects a potential bug that would not support all subdirectories under system/sepolicy as golang's path.Match does not treat ** as recursive. Test: go test apex tests Test: build/bazel/ci/mixed_droid.sh Change-Id: I1076d60cf271e4cdd1ea990156ab0a39fcfa6535
2021-09-08Relax restriction on suffix of apex_set filename to include .capex Samiul Islam
Compressed APEX files generated by the build system have the .capex extension. This CL allows us using those .capex files with their actual suffix. Bug: 197258691 Test: manual + unit test added Change-Id: I79173ef942326b48b5e659f1873d80f12b212339
2021-08-10Merge "Improve handling of errors from zipinfo" LaMont Jones
2021-08-09Improve handling of errors from zipinfo LaMont Jones
Bug: 153900481 Test: manual Change-Id: Ib60578ead4ccaa7ba09f628a6c9281c0cc70e6ce
2021-08-02Add EROFS support for APEX build system Huang Jianan
Bug: 195274797 Test: mmm system/apex/apexer/testdata Change-Id: I21dbe8b1bfe02d267c710f3c0dd4abaa737cffe0 Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-07-12apex: pass --align-file-size to signapk Jooyung Han
APEX files are sized as 4K-aligned so that they can be passed to Guest OS via block apexes. Bug: 192991318 Test: check size of built APEX files Change-Id: I32d988f3cdf2717dbebd87b2ced01840e07a3a9b
2021-06-10Rename test_only_no_hashtree to generate_hashtree Nikita Ioffe
In order not to introduce any changes in the system image default value of generate_hashtree is currently set to false. Once all the APEXes that shouldn't have hashtree enable (i.e. non-updatable ones) explicitly set `generate_hashtree: false` default value will be switched to true. Test: checked that are no diffs between ${OUT}/system/apex without this change and with this change. Test: m Bug: 190621617 Change-Id: I5a3144f8f6ea7dee25678af43e2b07a8c85daa9e Merged-In: I5a3144f8f6ea7dee25678af43e2b07a8c85daa9e (cherry picked from commit da6dc313892bab29ea919e3937dc48e805d5913f)
2021-05-27Use fingerprint when min_sdk is current or none Liz Kammer
We have versions of the same apex targetting different min_sdk_versions; however, fingerprint is overriding the hardcoded min_sdk_version. We should only be overriding if it is current or unset. Test: go test apex soong tests Change-Id: Id030a5ba7d8edebb806ce83d318132fd839a00a5
2021-04-22Merge "Make apex.key and certificate overridable." Jaewoong Jung
2021-04-20Make apex.key and certificate overridable. Jaewoong Jung
Test: apex_test.go Fixes: 185477325 Change-Id: I8992ac5606fa92f53f07e6870a034f2d3352e618
2021-04-20Don't compress apexes when building in unbundled mode Nikita Ioffe
Test: TARGET_BUILD_APPS=com.android.neuralnetworks m apps_only Bug: 185708645 Change-Id: I3fdf96f2b8decdff1422549bca413e7660ffb706
2021-04-14Generate hashtree for compressed apexes Nikita Ioffe
Bug: 184615428 Test: flashed build on device, checked compressed apex has hashtree Change-Id: I83828f581e84504c47047e7692817da5c44a6ec1
2021-04-14Don't compress apexes produced by apex_test module Nikita Ioffe
AFAIU, apex_test is used by modules to create a test version of their apex for e2e testing of the update flow. Since it's a regular pattern for test_apex to use the same apex_defaults as the "production" apex, and due to the fact that we are only going to compress pre-installed version of the apex, it makes sense to explicitly not compress test apexes. Bug: 185082717 Test: build test_com.android.media verified it's not compressed Test: atest sdkextensions_e2e_tests Change-Id: I1179235efe068fefc582369a4218ba967e7efbf3
2021-04-08SdkSpec is fully using ApiLevel Jiyong Park
Previously, SdkSpec was constructed only from the user string. It didn't make use of the Config struct where information about the latest stable SDK version, etc. is recorded. As a result, the build system couldn't check if the sdk version "current" is referring to the in-development (i.e. not-yet-frozen) SDK version or the latest stable version. "current" was always assumed to be in-development (IsPreview() returns true) even when Platform_sdk_final == true. As the first step for fixing that, this change requires android.EarlyModuleContext to be passed when constructing SdkSpec from the user string. In the following changes, "current" will be mapped to either FutureApiLevel (10000) or one of the FinalApiLevels() depending on whether the platform SDK was finalized or not. Bug: 175678607 Test: m Change-Id: Ifea12ebf147ecccf12e7266dd382819806571543
2021-04-03Move java.sdkSpec to the android package Jiyong Park
... in preparation for making the handling of sdk versions consistent across java and cc modules. Bug: 175678607 Test: m Change-Id: I598f0454bce9b7320621022115412fbe97403945
2021-03-11Don't track modules that are only available to APEXes. Artur Satayev
Modules that are not available for platform are developed with updatability in mind, and do not require manual approvals. Bug: 181223240 Test: checkbuild Change-Id: I10b91053b3ef5a9ff5400d9d7a68fae3144a671c
2021-02-08Pass list of module libraries to gen_ndk_backed_by_apex.sh Colin Cross
Running find on the entire module directory can lead to flaky failures when a directory is modified by another rule while find is traversing it. Pass a list of libraries in the module into the script instead of finding them on disk. Fixes: 178509901 Test: TARGET_BUILD_APPS=com.android.runtime dist Change-Id: Ie4bf288f0e3d99cbbed5ca8770687a9bbe5377e4
2021-01-28Turn apex compression from opt-out into opt-in Nikita Ioffe
Compression is useful only for big enough apexes. We can manually opt-in them, instead of trying to find list of apexes that should be opted-out. Test: m Bug: 178713634 Change-Id: Ice86fabb7c1db4a1e21e4c983d595cfd3a1c0b7a
2021-01-26apex: checks min_sdk_version for preview/current Jooyung Han
If we don't check "current", it won't be checked even in the finalized branch. If we don't check "preview", it should be done during the SDK finalization. It'd be better done before the SDK finalization regarding that setting min_sdk_version is to get approval from deps library owners. Bug: 177833148 Test: m (soong tests) Change-Id: I712b61cfe5a134fbb69c73956d26fb3a1e5c011e
2021-01-26Merge "Revert "Revert "Automated NDK API coverage used by Mainline modules ↵ Sophie Zheng
build integration."""
2021-01-25Revert "Revert "Automated NDK API coverage used by Mainline modules build ↵ sophiez
integration."" This reverts commit 556b2ad77e31956cbc2a329553c8ad7692639708. Original change-id: Ib1b2f0dd2f9ae85b1545c6cc5bb4c5bbdfac1c15 Reason for revert: Add excutable permission to the gen_ndk_backedby_apex.sh. Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only Change-Id: Ib587ba200cd7f2f61d478452b43c329d72b2de06
2021-01-25Merge "Revert "Automated NDK API coverage used by Mainline modules build ↵ Riddle Hsu
integration.""
2021-01-25Revert "Automated NDK API coverage used by Mainline modules build integration." Riddle Hsu
This reverts commit 87ff51db84afb6c1510de4835df56b1008688ee5. Reason for revert: build breakage b/178327796 Change-Id: I51c56938540794097eda579ebe47fa5c0a4d8c12
2021-01-22Merge "Automated NDK API coverage used by Mainline modules build integration." Sophie Zheng
2021-01-21Automated NDK API coverage used by Mainline modules build integration. sophiez
Add gen_ndk_usedby_apex.sh script to generate NDK API list used by Mainlain modules when modules get build. Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only Change-Id: Ib1b2f0dd2f9ae85b1545c6cc5bb4c5bbdfac1c15
2021-01-19Fix capex build rule when building using RBE Mohammad Samiul Islam
Presubmit builds were failing cause they were being built using RBE. Bug: 172911362 Test: presubmit-builds are passing now Change-Id: I65ffd912ccf2f4fb8cb9824e7a9579f66908d7b3
2021-01-12Merge "Add property to apex soong modules to forcefully compress an APEX" Mohammad Islam
2020-12-29Skip apex dep check when sanitizer diag is enabled Cindy Zhou
To avoid adding ubsan to the apex allowed_dep list, this commit adds a check on depedency tags to see if apex check should be skipped. The check is only used on sharedLib dependencies when diag mode are enabled for sanitizers. Bug: 158010610 Test: make build for aosp-sargo and aosp_cf_x86_phone-userdebug Change-Id: I3d7dbb70d8c80ffae1854819cf8cf9e6b0b15c00
2020-12-22Remove unnecessary snake case variables. Jaewoong Jung
Test: m nothing + TreeHugger Change-Id: I99f7162944daa6c57c6ae4763261e108bb5cb6b1
2020-12-22Add property to apex soong modules to forcefully compress an APEX Mohammad Samiul Islam
This makes creating compressed APEX artifacts for testing simpler. Bug: 172911820 Test: atest apex_compression_platform_tests Change-Id: I77b8bea4662c273420e7b37d5fde181b86c9cb78
2020-12-08Enable soong build tool to handle APEX compression Mohammad Samiul Islam
1. Soong can now detect PRODUCT_COMPRESSED_APEX flag We don't want APEX to be compressed on all devices. Only those that have explicitely set PRODUCT_COMPRESSED_APEX flag. 2. Handle "compressible" field in soong build rule On devices that supports APEX compression, all APEX will be compressed by default. If any apex does not want to be compressed, they will need to state that by setting "compressible" field to false 3. Can use apex_compression_tool to compress APEX Note we compress the APEX after it has been signed. That way, when we decompress we will get a signed APEX. 4. Place the compressed APEX in system with .capex extension This makes it easy to identify. We still preserve the original extension so that when we decompress, we can just rename by cuttif off the .capex extension. Note: with this change, we can create a system image with compressed APEX, but we cannot boot with it since platform doesn't know how to handle .capex files. Platform support will be added on follow up CLs. Bug: 172911362 Test: OVERRIDE_PRODUCT_COMPRESSED_APEX=true m (apex_test.go) Test: observed $OUT/system/apex has .capex files Change-Id: I20ac4c4ceb521924c751a6017f979b2d808fdded
2020-12-03Merge "Automated NDK API coverage used by Mainline modules build integration." Sophie Zheng