Commit graph

1367 commits

Author SHA1 Message Date
William Escande
cfbdc3bb69 Clear apex.go entries for bluetooth libs
The module availability to Bluetooth is currently hard-coded in apex.go.
We are in the process of cleaning the apex.go by adding the availability
in each required module

Test: Build + TH + boot phone & use bluetooth
Bug: 216433795
Change-Id: I545ad6039e501c70e3ff5d9fc74fabfd37067145
2022-06-04 02:13:54 +00:00
Wei Li
607978227e Convert the property "manifest" properly for override_apex. am: 40f9873612 am: e577ddd482
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2100361

Change-Id: I6baaa602a3d591974b68ac3d9362f8adc0529470
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 05:34:22 +00:00
Wei Li
40f9873612 Convert the property "manifest" properly for override_apex.
1) When it is not set in base apex, default file name should be set explicitly in bp2build converter of apex
2) The manifest file path should be used as-is when base apex and override_apex is in the same Android.bp
3) The manifest file path should be prepended with package of base apex when base apex and override_apex is in different Android.bp

Bug: 216442475
Test: m nothing
Change-Id: Icd3523ebc31d885f67bea02aec05dbfc77671e87
2022-05-23 17:22:35 -07:00
Oriol Prieto Gascó
c17b70053d Merge "Revert "Append APEX version instead of build ID for APK-in-APEX ..."" into tm-dev 2022-05-23 19:49:32 +00:00
Oriol Prieto Gascó
a70425fb2f Revert "Append APEX version instead of build ID for APK-in-APEX ..."
Revert "Make apexer replace instances of version placeholder str..."

Revert submission 17944887-apk-in-apex

Reason for revert: Caused a regression (b/230873680)
Reverted Changes:
Ic37eeba8b:Make apexer replace instances of version placehold...
I9cef1418c:Append APEX version instead of build ID for APK-in...

Change-Id: I3da8bcb782baf71cddce9e4e92fe3894fc187b5c
2022-05-20 13:05:34 +00:00
Liz Kammer
dbd8eb11f4 Remove unused uses_sdks property for apexes
(cherry picked from commit 7eed538208)

Bug: 232546567
Test: m nothing & compare build.ninja before/after
Merged-In: I3f1199af338e1d2e48ec29cf9f59b6b36236c4cc
Change-Id: I3f1199af338e1d2e48ec29cf9f59b6b36236c4cc
2022-05-20 07:45:48 +00:00
Paul Duffin
1c29093729 Merge "Pass pointer to dependencyTag instead of copying struct" am: 4dd76eb26c am: fe844bb3f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2096446

Change-Id: Iea6ea2f668a11c8ef0ea3ab6822987c7bcb2d373
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 22:50:02 +00:00
Spandan Das
91250b1ae4 Enforce updatable=true on apps of updatable apexes
- Update apex_info (a topdown mutator) so that it sets updatable=true on
  apps of updatable apexes
- Write a unit test that tests different combinations of
  updatable/non-updatable apks-in-apexes
- Update an existing unit test that asserts a different error

Test: go test ./java
Test: m nothing (in internal)
Bug: 209409604

Change-Id: Ie8881b857afcec44addf27fc360c5b8abf726bd2
Merged-In: Ie8881b857afcec44addf27fc360c5b8abf726bd2
(cherry picked from commit 42e89508ee)
2022-05-13 19:16:23 +00:00
Paul Duffin
520917af9d Pass pointer to dependencyTag instead of copying struct
A follow up change will add some more fields to the tag which will make
passing the struct around by value will get more expensive. Switching
to pointers will make this slightly more efficient.

Changing the type of the tags from dependencyTag to *dependencyTag
broke a test. Rather than simply patch the test and then maybe have to
patch it again in the next change this adds a a String() method that
will insulate the test from being affected by changes in the
dependencyTag contents.

Bug: 232401814
Test: m nothing
Change-Id: I23da742ebffb74ef3b9b68f772519ceb38332f5f
2022-05-13 16:06:36 +00:00
Treehugger Robot
7ee1422274 Merge "Clean up hard-coded min_sdk_version/apex_available" am: 1c87db50ca am: 793c10dcc7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2089563

Change-Id: I789fa4687a2bdac6f0130543b21c58cd7707d12f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 10:21:55 +00:00
Treehugger Robot
1c87db50ca Merge "Clean up hard-coded min_sdk_version/apex_available" 2022-05-13 04:56:59 +00:00
Wei Li
366fae54a1 Merge "Add bp2build converter for override_apex." am: 49611b39a9 am: 9acec92f04
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2092595

Change-Id: I4bcef1a0da29197a01dea449997e533a37e330cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 08:02:05 +00:00
Wei Li
1c66fc74d2 Add bp2build converter for override_apex.
Bug: 216442475
Test: m nothing
Change-Id: I2f106d15c1d235583b8b1a8f0ac4b48162ff4fdd
2022-05-11 22:22:04 -07:00
Spandan Das
f454194692 Merge changes Ie8881b85,I6c064f8a am: f923333a93 am: e41be189f0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2090231

Change-Id: I1eebfc246a05fdb728d1c9460f322f657f7d36df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:47:28 +00:00
Spandan Das
f923333a93 Merge changes Ie8881b85,I6c064f8a
* changes:
  Enforce updatable=true on apps of updatable apexes
  Update sdk_version check for jni_libs of updatable apps
2022-05-10 18:20:27 +00:00
Spandan Das
42e89508ee Enforce updatable=true on apps of updatable apexes
- Update apex_info (a topdown mutator) so that it sets updatable=true on
  apps of updatable apexes
- Write a unit test that tests different combinations of
  updatable/non-updatable apks-in-apexes
- Update an existing unit test that asserts a different error

Test: go test ./java
Test: m nothing (in internal)
Bug: 209409604

Change-Id: Ie8881b857afcec44addf27fc360c5b8abf726bd2
2022-05-10 00:01:34 +00:00
Treehugger Robot
32b22ed6e1 Merge "Revert "Append APEX version instead of build ID for APK-in-APEX ..."" am: beccdcdff2 am: da3367e8cf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2087883

Change-Id: Icf30af7b6fe6e1a6e6043bfe38f522ca3c0a9245
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-06 04:01:12 +00:00
Jooyung Han
932d2c1932 Clean up hard-coded min_sdk_version/apex_available
Set min_sdk_version/apex_available for modules used by
com.android.permission APEX.

Bug: 147364041
Bug: 158059172
Test: m
Change-Id: I93ff72ed765354d44a2ccb5105b5f2820f0358f5
2022-05-06 12:21:04 +09:00
Treehugger Robot
beccdcdff2 Merge "Revert "Append APEX version instead of build ID for APK-in-APEX ..."" 2022-05-06 03:17:24 +00:00
Oriol Prieto Gasco
17e2290e9f Revert "Append APEX version instead of build ID for APK-in-APEX ..."
Revert submission 2067907-apk-in-apex

Bug: 230873680

Reason for revert: Change broke aab generation b/230873680
Reverted Changes:
I9cef1418c:Append APEX version instead of build ID for APK-in...
Ic37eeba8b:Make apexer replace instances of version placehold...

Change-Id: Ib113d56901e815435f71bf878049cdabd210503c
2022-05-05 14:32:37 +00:00
Treehugger Robot
ef758eca54 Merge "Remove unused uses_sdks property for apexes" am: a6fcf9fd92 am: 9a37c9bb75
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2071390

Change-Id: Icb6dec841f99bfafb4238255bf80934f6600d059
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-03 05:52:36 +00:00
Treehugger Robot
a6fcf9fd92 Merge "Remove unused uses_sdks property for apexes" 2022-05-03 03:24:59 +00:00
Treehugger Robot
38d7429735 Merge "Update locations of apex bzl files" am: a704eb1469 am: 1873bb0b18
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2081644

Change-Id: I5cd4b83307f4d53c6b42ae13b0b52423b86174c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-30 01:03:43 +00:00
Cole Faust
5f90da372e Update locations of apex bzl files
Bug: 230893497
Test: ./build/bazel/vendor/google/build_mainline_modules.sh
Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Change-Id: Ib16bece720a9167d02d2ddd8c4f11257634d382b
2022-04-29 13:37:43 -07:00
Treehugger Robot
50da2c4530 Merge "Prototype changes for multitree" am: 184a6b87e5 am: 91255a653f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2076401

Change-Id: Icf425fdcfddcb1267d241175ec86758117e53afc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 18:09:34 +00:00
Inseob Kim
5eb7ee9fad Prototype changes for multitree
This change contains a prototype implementation for multitree. Several
interfaces and modules are added.

1. Imported/Exported
Modules implementing Exportable interface can export artifacts to other
components. "imported_filegroup" modules can import generated artifacts from other exported modules.

2. Multitree metadata
It contains information about imported/exported modules in each
component, and can be generated via "m update-meta".

3. cc library stub
It's based on prototype stub libraries. It uses imported/exported
mechanism to expose a C API, with a map.txt file and header files.

Bug: 230448564
Test: m
Change-Id: Id7ff7618e2c630c5617a564d8b23b60a1cc9c8e8
2022-04-28 08:20:10 +00:00
Jingwen Chen
3b1dcf4f46 Append APEX version instead of build ID for APK-in-APEX paths.
This CL removes the build_id.mk suffix and replaces it with a hardcoded
placeholder string that will be replaced with the actual version in
apex_manifest.json by apexer at apex construction time.

This means that as long as the apex version is incremented, the
APK-in-APEX will be installed to a new directory path from the package
manager's perspective.

Fixes: 229574810
Bug: 229625490
Bug: 226559955
Bug: 224589412
Bug: 227417611
Bug: 228157333
Bug: 228803590
Bug: 229136249

Test: atest StrictJavaPackagesTest
Test: soong tests
Test: deapexer list out/dist/com.google.android.permission.apex
Ignore-AOSP-First: this is an cherrypick
Change-Id: I9cef1418c3fc7e0970d96995b8398f5e82f479e0
Merged-In: I9cef1418c3fc7e0970d96995b8398f5e82f479e0
2022-04-26 12:54:50 +00:00
Jingwen Chen
97fbc24443 Merge "Append APEX version instead of build ID for APK-in-APEX paths." am: d21a8a5a42 am: 4eb789da50
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2067907

Change-Id: Ib5c681d03dc12c5f4839b810b79ef4800235ea30
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-25 12:41:18 +00:00
Liz Kammer
7eed538208 Remove unused uses_sdks property for apexes
Test: m nothing & compare build.ninja before/after
Change-Id: I3f1199af338e1d2e48ec29cf9f59b6b36236c4cc
2022-04-21 11:13:45 -04:00
Jingwen Chen
6cb124b8d9 Append APEX version instead of build ID for APK-in-APEX paths.
This CL removes the build_id.mk suffix and replaces it with a hardcoded
placeholder string that will be replaced with the actual version in
apex_manifest.json by apexer at apex construction time.

This means that as long as the apex version is incremented, the
APK-in-APEX will be installed to a new directory path from the package
manager's perspective.

Fixes: 229574810
Bug: 229625490
Bug: 226559955
Bug: 224589412
Bug: 227417611
Bug: 228157333
Bug: 228803590
Bug: 229136249

Test: atest StrictJavaPackagesTest
Test: soong tests
Test: deapexer list out/dist/com.google.android.permission.apex
Change-Id: I9cef1418c3fc7e0970d96995b8398f5e82f479e0
2022-04-21 10:20:51 +00:00
Jingwen Chen
8ce1efc5af Suffix the build ID to the dirname of APK-in-APEX files.
This fixes an issue with package manager's cache invalidation.

Test: CI

Bug: 226559955
Bug: 224589412
Change-Id: I8af49d51ff99cf8184d0e4d1136fff1cdb29c23e
Merged-In: I8af49d51ff99cf8184d0e4d1136fff1cdb29c23e
2022-04-19 13:57:01 +00:00
Albert Martin
eefabcf321 Flag to globally override apexes' min_sdk_version
Override all mainline updateable apexes' min_sdk_version
to same version to get single shared native libs on DCLA.

Test: Run "vendor/google/build/go/mainline_go_modules_arm.sh" and inspect built apexes
Bug: 212609891
Change-Id: Ide7d3f2bc772ac6240f1c917b87285d051d6f605
Merged-In: Ide7d3f2bc772ac6240f1c917b87285d051d6f605
2022-04-08 17:51:07 +00:00
Albert Martin
5b0f6b9717 Merge "Flag to globally override apexes' min_sdk_version" into tm-dev 2022-04-08 16:05:23 +00:00
Albert Martin
55ccba2f61 Flag to globally override apexes' min_sdk_version
Override all mainline updateable apexes' min_sdk_version
to same version to get single shared native libs on DCLA.

Test: Run "vendor/google/build/go/mainline_go_modules_arm.sh" and inspect built apexes
Bug: 212609891
Change-Id: Ide7d3f2bc772ac6240f1c917b87285d051d6f605
2022-04-06 17:39:50 +00:00
Jingwen Chen
60a1ff9328 Suffix the build ID to the dirname of APK-in-APEX files. am: 11cca671ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/17508450

Change-Id: If1ddcbebf2f746fd345a29ba966bf5ac8c02c41f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-05 19:44:58 +00:00
Spandan Das
f14e254a28 Change permitted_packages check to be per-jar rather than per-apex
(cherry-pick of ag/17524387 into aosp)

Summary:
- updates the Q and R maps, the new keys are the bcp jars and not the
apexes. neverallow build rules ensure that these bcp jars have a
restricted set of permitted_packages
- remove BootclasspathJar from the neverallow rule. This is no longer
necessary since the keys in the maps are the bootjars themselves, and
not apexes

Bug: 205289292
Test: In build/soong, go test ./apex
Change-Id: Icb91de934181a8b6f085e03a0ce8c5e08504ff94
Merged-In: Icb91de934181a8b6f085e03a0ce8c5e08504ff94
(cherry picked from commit 440ff96728)
2022-04-04 17:42:00 +00:00
Anton Hansson
e1b1836939 Revert "Relax apex package restriction for T+ jars"
This reverts commit 1fdd6ca88a.

Reason for revert: b/205289292 tracks the real fix for this

Test: presubmit
Change-Id: I5a2edaf4f930dafa26659f85d9425e9041c72275
Merged-In: I5a2edaf4f930dafa26659f85d9425e9041c72275
2022-04-04 17:27:43 +00:00
Spandan Das
451c6d461b Merge changes I473731a6,Icb91de93,I5a2edaf4 into tm-dev
* changes:
  Remove android.safetycenter from framework-permission bcp permitted_packges
  Change permitted_packages check to be per-jar rather than per-apex
  Revert "Relax apex package restriction for T+ jars"
2022-04-04 14:50:56 +00:00
Bob Badour
0a6539dd21 Merge "Revert "Revert "Build notice files from license metadata.""" am: 3aae38d451 am: b0489dec23 am: bf82573d27
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2051564

Change-Id: I0a1a9a0ea0ccd052dbc84cc6b2cce0b128393f63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-02 01:48:21 +00:00
Bob Badour
de6a087d2d Revert "Revert "Build notice files from license metadata.""
This reverts commit 77807b3c27.

Reason for revert: fix and roll forward again

Change-Id: I80c796ca81ecf29df9522babe54d684a0d11b9e6
2022-04-01 18:00:00 +00:00
Wei Sheng Shih
67c0b63929 Revert "Build notice files from license metadata." am: 77807b3c27 am: 72f9cdb599 am: 6c698e406d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2052565

Change-Id: I7e4f410833a4b8349e476d6fca4b2161c8f254f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-01 17:26:29 +00:00
Wei Sheng Shih
77807b3c27 Revert "Build notice files from license metadata."
This reverts commit 43c2dcaef6.

Reason for revert: suspect build break

Bug: 227682036

Test: TARGET_BUILD_VARIANT=userdebug UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_bundles.sh -j97


Change-Id: Ibfb8b4fefc264f52f32ba661c269a9cd625d800a
2022-04-01 14:10:53 +00:00
Bob Badour
8d17118d5a Build notice files from license metadata. am: 43c2dcaef6 am: 6f7de5b1a9 am: cbcf8d9b05
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2047886

Change-Id: I6a76eee6321538b70c331a2e2a9cb1e5b644ac04
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-31 23:13:51 +00:00
TreeHugger Robot
86aa11c043 Merge "Clear apex.go entries for bluetooth libs" into tm-dev 2022-03-31 21:37:02 +00:00
Bob Badour
43c2dcaef6 Build notice files from license metadata.
Switch from generate-notice-files.py and mergenotice.py to htmlnotice.

Bug: 151177513
Bug: 213388645
Bug: 210912771

Test: m droid dist reportmissinglicenses
Change-Id: I6cac049d24f35ec358c6f341a04f4ba6161703bf
2022-03-31 17:29:01 +00:00
Jingwen Chen
11cca671ac Suffix the build ID to the dirname of APK-in-APEX files.
This fixes an issue with package manager's cache invalidation.

Test: CI

Bug: 226559955
Bug: 224589412
Change-Id: I8af49d51ff99cf8184d0e4d1136fff1cdb29c23e
Merged-In: I8af49d51ff99cf8184d0e4d1136fff1cdb29c23e
2022-03-31 16:28:37 +00:00
Spandan Das
d3fae5f2ed Remove android.safetycenter from framework-permission bcp permitted_packges
The permitted_packages check is now per jar and not per apex. Remove
safetycenter from the map since this package prefix cannot be in
framework-permission

Bug: 205719989
Bug: 205289292
Test: TH
Change-Id: I473731a697fb09319037536dead97f5abf4bd6ea
2022-03-31 15:48:24 +00:00
Spandan Das
440ff96728 Change permitted_packages check to be per-jar rather than per-apex
(This CL has been implemented in master to prevent a merge conflict with
ag/16222633. It will be cherry-picked to AOSP)

Summary:
- updates the Q and R maps, the new keys are the bcp jars and not the
apexes. neverallow build rules ensure that these bcp jars have a
restricted set of permitted_packages
- remove BootclasspathJar from the neverallow rule. This is no longer
necessary since the keys in the maps are the bootjars themselves, and
not apexes

Bug: 205289292
Test: In build/soong, go test ./apex
Change-Id: Icb91de934181a8b6f085e03a0ce8c5e08504ff94
2022-03-31 15:47:45 +00:00
Anton Hansson
ddf8c1bed9 Revert "Relax apex package restriction for T+ jars"
This reverts commit 1fdd6ca88a.

Reason for revert: b/205289292 tracks the real fix for this

Test: presubmit
Change-Id: I5a2edaf4f930dafa26659f85d9425e9041c72275
(cherry picked from commit 1d016c50d0ee18ebc81ce7966e616b9936befd5a)
2022-03-31 15:47:12 +00:00
Spandan Das
d4cb14b66e Merge "Do not propagate strict_updatability linting to conscrypt and framework-media java_sdk_libraries" am: 183ed1044c am: d2f5f1c690 am: 667639eda2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2043123

Change-Id: Ice8dce7d620ee8ecf71c9b701a884289230f7aa5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 17:38:47 +00:00
Spandan Das
2cf278e75b Do not propagate strict_updatability linting to conscrypt
and framework-media java_sdk_libraries

Tmp fix for
https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=errorprone&lkgb=8352129&lkbb=8353967&fkbb=8352538

Test: m
out/soong/.intermediates/external/conscrypt/conscrypt.module.public.api.stubs.system/android_common/lint/lint-baseline.xml
Test: (internal CI target) https://android-build.googleplex.com/builds/abtd/run/L67700000953708519
Bug: 182349282
Bug: 226637002
Bug: 226608044

Change-Id: I17e540877200f59bfd51e69e57d8bcca6cf3850f
2022-03-25 02:31:20 +00:00
Spandan Das
a1ec6ead90 Merge changes I4c373b29,I9ccda6fc,I1b390b0e,I30151217 am: ad40fffa64 am: 3dd2985871 am: db71cd071c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1977412

Change-Id: Ibbbeaaffb3a8baad67f50699d10a499155c3fd88
2022-03-24 17:59:24 +00:00
Spandan Das
ad40fffa64 Merge changes I4c373b29,I9ccda6fc,I1b390b0e,I30151217
* changes:
  Do not propagate strict updatability linting to libcore/
  Create allowlist to skip strict updatability lint check
  Propagate strict_updatability_linting to transitive deps of updatable apexes
  Export LintDepSetsIntf from java package
2022-03-24 16:38:20 +00:00
Colin Cross
4c4c1be915 Use single module for clang runtime libraries
The clang prebuilts now provide a single module with per-architecture
variants instead of a module per architecture.

Bug: 220019988
Test: m checkbuild
Change-Id: I39e2cf8ae14edf8510276dab38011afaef85822c
Merged-In: I39e2cf8ae14edf8510276dab38011afaef85822c
2022-03-07 14:56:32 -08:00
Remi NGUYEN VAN
6817192157 Merge "Support overriding APEX java contents" am: 979b652dec am: 285ce79db5 am: e355a8aefb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2005472

Change-Id: I7ff2ac2325960e012d40d0398b26faf1d98e82ab
2022-03-03 02:42:21 +00:00
Remi NGUYEN VAN
e355a8aefb Merge "Support overriding APEX java contents" am: 979b652dec am: 285ce79db5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2005472

Change-Id: Iab09a8281fd0306b7c02255d9f465004a4c05a64
2022-03-03 02:21:33 +00:00
William Escande
5e48389e0f Clear apex.go entries for bluetooth libs
Test: Build + TH + boot phone & use bluetooth
Bug: 216433795
Change-Id: I53652c4c46bf1019a8062210b2503cf0a34d94cc
2022-03-02 20:23:11 +01:00
Remi NGUYEN VAN
be90172f0a Support overriding APEX java contents
In addition to the current "apps", support overriding
bootclasspath_fragments, systemserverclasspath_fragments, and java_libs.

This is useful to build APEXes with slightly different contents, for
example where the base APEX could contain libraries that only use stable
APIs, but the overriding APEX could contain a variant that also uses
non-finalized APIs.

Bug: 222247869
Test: m (runs apex tests)
Change-Id: I14da6f835c58b44be31e517598695ec8ff830648
2022-03-02 21:23:15 +09:00
Colin Cross
655be5dba9 Merge "Use single module for clang runtime libraries" into sc-v2-dev-plus-aosp am: 135513ae65
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/17036885

Change-Id: I72d5cdd315cad007f6f6a1a1a91f8ca272014f9c
2022-03-01 01:20:47 +00:00
Colin Cross
fc0df95df5 Use single module for clang runtime libraries
The clang prebuilts now provide a single module with per-architecture
variants instead of a module per architecture.

Bug: 220019988
Test: m checkbuild
Change-Id: I39e2cf8ae14edf8510276dab38011afaef85822c
(cherry picked from commit 386ee59a23)
Merged-In:I39e2cf8ae14edf8510276dab38011afaef85822c
2022-02-28 21:01:05 +00:00
Treehugger Robot
7a866cbf3b Merge "apex: track transitive dependencies of rust jni lib" am: 7ff6e3d257 am: 3a2f53e559 am: 831b04f0b4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1998313

Change-Id: I083a0d1a176df5c59804ee8bcf5e15cb85b28966
2022-02-25 01:03:49 +00:00
Treehugger Robot
7ff6e3d257 Merge "apex: track transitive dependencies of rust jni lib" 2022-02-24 23:50:14 +00:00
Jooyung Han
11f70d68ed Merge "apex supports ".apex" tag" am: 4c696f2a89 am: 58eccbde83 am: 8427919e24
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1998312

Change-Id: I97efcc6b15faaf92d061701e2f7af33d07cd1124
2022-02-24 12:46:14 +00:00
Jiyong Park
34d5c33529 apex: track transitive dependencies of rust jni lib
dependencies of rust library registered as jni_lib are correctly
tracked.

Bug: 220397949
Test: m nothing
Change-Id: I43016a77656d04f59f798b02d541c6a19288ec9c
2022-02-24 18:02:44 +09:00
Jooyung Han
a6d3667b67 apex supports ".apex" tag
Tests can embed non-compressed .apex output with the tag.

Bug: 221024307
Test: soong test
Change-Id: Id4a239d1897237105a064cea8c97029f5b996a98
2022-02-24 13:59:45 +09:00
Spandan Das
d9c23abeca Do not propagate strict updatability linting to libcore/
propogation of this flag is determined by the location of the Android.bp
where a library is defined.
libcore/ libraries that are transtive deps of updatable apexes will
- inherit strict_updatability_linting:true if defined in libcore root
- not inherit strict_updatability_linting:true if defined in libcore
  subdir

Note that the module can explicitly list `lint:{strict_updatability_linting: true}'
in their Android.bp file, in which case they will not be allowed to
baseline NewApi errors

Test: m lint-check
Test: TH
Bug: 208656169
Bug: 182349282

Change-Id: I4c373b2960a7af16301d7f06aab448f39b937ea9
2022-02-23 21:49:56 +00:00
Ray Essick
de1e300802 Clean auto-allowed modules for media mainline
Cleans out the remaining modules that build system
auto-allowed for the media mainline modules com.android.media
and com.android.media.swcodec. With this change, both lists
are empty and all needed modules are documented with explicit
apex_available clauses.

Bug: 215589022
Bug: 147364041
Test: build
Change-Id: I7d809ae72ad21f6b2ed8b05613c44019a974f6fd
2022-02-10 17:37:51 -08:00
Spandan Das
08c911f4eb Create allowlist to skip strict updatability lint check
As of Jan 2022, some updatable mainline modules have (transitive) deps with
NewApi in their respective lint-baseline.xml. Create an allowlist to
relax this check temporarily for those mainline modules.

Test: m lint-check
Test: TH
Bug: 182349282

Change-Id: I9ccda6fccb973e9100e31b7e559f5642289ac717
2022-02-10 02:25:21 +00:00
Spandan Das
6677325124 Propagate strict_updatability_linting to transitive deps of updatable apexes
Create a topdown mutator to walk the deps of updatable apexes. If a dep
is lintable, set its strictUpdatabilityLinting to true

Creating a new mutator after apexInfoMutator makes it easy to maintain
an allowlist (e.g. override_apex does not require an entry in the
allowlist, its canonical name can be retrieved using ApexVariationName())

Test: In build/soong/, go test ./apex
Test: TH
Bug: 182349282

Change-Id: I1b390b0e3a8fb20754ce50c6b253d68d2b3f263b
2022-02-08 19:25:37 +00:00
Jooyung Han
35dc3aca98 Merge changes I11693286,I8d79a434 am: 472be14f26 am: 601cb3422d am: 4749d6884d am: c909932b23
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1972300

Change-Id: I21afcefa5fa7ee98efef8fad035463ba292909b7
2022-02-08 02:12:55 +00:00
Ray Essick
5d240fb8ad Clean auto-allowed modules for media mainline
Clean out list of modules automatically allowed to be used in the media
mainline modules, now that those modules have explicit apex_available
clauses in their Android.bp files.

Bug: 215589022
Bug: 147364041
Test: build
Change-Id: I2d3f57621796c99a119acc98e1ead358aebedc5d
2022-02-07 11:01:32 -08:00
Jooyung Han
c5a967630e use_vndk_as_stable APEX shouldn't include VNDK lib
Even though a vendor APEX sets use_vndk_as_stable:true it was possible
to include a VNDK lib by directly depending on it with
native_shared_libs.

But it's contradictory to have a VNDK lib while declaring not to include
VNDK libs. It was missing since pruning dependencies on VNDK libs was
done only for transitive deps.

Added a check to reject this.

Bug: 216847402
Test: m nothing(running soong tests)
Change-Id: I8d79a434b1bfe8e563cf8968fa76830b0e582f66
2022-02-04 13:07:11 +09:00
Wei Li
66b42aeb20 Merge "Add bp2build support for property "compressible" of apex module." am: a61dbd457e am: c311b19b3a am: 254b753da8 am: 7e82c20b19
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1956876

Change-Id: Ie5033ec7691a8613548ba124822cb272831bd5c7
2022-01-26 02:39:59 +00:00
Wei Li
f034cb4d7b Add bp2build support for property "compressible" of apex module.
Bug: 214466457
Bug: 207551677
Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Test: b test //build/bazel/tests/apex:build.bazel.examples.apex.minimal_apex
Test: b test //build/bazel/tests/apex:build.bazel.examples.apex.minimal_capex

Change-Id: I6bf12c1b0c52d4486968bb430a67a3c3110766db
2022-01-25 19:42:43 +00:00
Oriol Prieto Gasco
a07099d858 Make 'Compressible' an overridable property
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 2c4a96375a)
2022-01-22 00:45:58 +00:00
Jiakai Zhang
9d92964ddd Ignore some properties for T and above.
As requested by reminv@, their team wants the source code in
sc-mainline-prod to be strictly the same as the code in AOSP. Therefore,
we need to ignore `standalone_contents` in the
`systemserverclasspath_fragment` module and
`systemserverclasspath_fragments` in the `sdk` module in order to merge
aosp/1925682 into sc-mainline-prod.

- `standalone_contents` in the `systemserverclasspath_fragment` module
  does nothing but adds its contents as dependencies of the APEX.
- `systemserverclasspath_fragments` in the `sdk` module does nothing.

Bug: 203198541
Test: TARGET_BUILD_APPS=com.android.tethering vendor/google/build/mainline_modules_bundles.sh
Change-Id: I56ca22aa91a807cd113dfda2fabaeb49ecabe289
Merged-In: I09a6fd1d3db85c194330da9b751702a9bf069e26
2022-01-21 16:30:44 +00:00
Treehugger Robot
ff61c8a357 Merge "Improve apex build check explanation" am: c85964a734 am: ae0306f79d am: 80a95575bc am: 99857fc2c8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1954236

Change-Id: Id571592efb2d63455e5c65868fc399eabc98ca51
2022-01-20 22:24:18 +00:00
Treehugger Robot
c85964a734 Merge "Improve apex build check explanation" 2022-01-20 21:06:39 +00:00
Andrei Onea
d967aee96f Improve apex build check explanation
Discourage jarjaring code where there are alternatives with
better system health implications.

Test: m
Bug: 215233995
Change-Id: I1b076d00e1ad6aa32b41da6bda1033978b5e829d
2022-01-19 16:07:21 +00:00
Jingwen Chen
eefba215b9 Merge "Support multilib in apex." am: 539d41b686 am: 2cda5749f4 am: e1fc6a20ca am: 3ded2c64ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1932025

Change-Id: I214abe526ce8cb21dfba6b00ffa1ed284504644b
2022-01-19 12:13:09 +00:00
Jingwen Chen
539d41b686 Merge "Support multilib in apex." 2022-01-19 11:11:05 +00:00
Treehugger Robot
ad6fae4930 Merge "[NETD-BPF#34] Add a tag for bpf to specify the install folder" am: a9a5d36884 am: 9624d183f4 am: 7b49b608f6 am: 1a1604f9c6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1888356

Change-Id: Ic82782a7a0f56a34881961cdee2b4c82bff893e5
2022-01-19 10:51:55 +00:00
Treehugger Robot
a9a5d36884 Merge "[NETD-BPF#34] Add a tag for bpf to specify the install folder" 2022-01-19 09:41:57 +00:00
Ken Chen
6320efb56e [NETD-BPF#34] Add a tag for bpf to specify the install folder
Currently, the bpf module netd.o (source system/netd/bpf_progs/netd.c)
will be built to /system/etc/bpf/netd.o. In Android T, it will be moved
to mainline module com.android.tethering.

The expected behavior is:
- In T device, it uses the netd.o in mainline module.
- In pre-T devices, it uses the original netd, built from platform.

However, netd.o will be double loaded if the tethering module is
installed in Pre-T devices. Because:
1. bpf in apex is packed into /apex/MAINLINE_MODULE/etc/bpf/
2. bpf in platform is packed into /system/etc/bpf/
3. bpfloader in pre-T loads ANY bpf modules under
/apex/com.android.tethering/etc/bpf/ and /system/etc/bpf/.

We can't change the behavior of bpfloader in pre-T devices. We can't
delete the /system/etc/bpf/netd.o from pre-T devices. Both of them are
not mainline modules. So the mainlined netd.o needs to be packed into a
folder other than /apex/com.android.tethering/etc/bpf/ or
/system/etc/bpf/.

This commit adds a tag 'sub_dir' for bpf module. The installation path
of bpf modules will be:
- /system/etc/bpf/SUB_DIR/     (for platform code)
- /apex/MAINLINE_MODULE/etc/bpf/SUB_DIR/     (for mainline module)

Bug: 202086915
Test: add test in apex_test.go and build
Merged-In: Icc6619768ab006de9f86620a7df1bb2853eaba13
Change-Id: Icc6619768ab006de9f86620a7df1bb2853eaba13
2022-01-19 08:04:00 +00:00
Ken Chen
fad7f9d8b7 [NETD-BPF#34] Add a tag for bpf to specify the install folder
Currently, the bpf module netd.o (source system/netd/bpf_progs/netd.c)
will be built to /system/etc/bpf/netd.o. In Android T, it will be moved
to mainline module com.android.tethering.

The expected behavior is:
- In T device, it uses the netd.o in mainline module.
- In pre-T devices, it uses the original netd, built from platform.

However, netd.o will be double loaded if the tethering module is
installed in Pre-T devices. Because:
1. bpf in apex is packed into /apex/MAINLINE_MODULE/etc/bpf/
2. bpf in platform is packed into /system/etc/bpf/
3. bpfloader in pre-T loads ANY bpf modules under
/apex/com.android.tethering/etc/bpf/ and /system/etc/bpf/.

We can't change the behavior of bpfloader in pre-T devices. We can't
delete the /system/etc/bpf/netd.o from pre-T devices. Both of them are
not mainline modules. So the mainlined netd.o needs to be packed into a
folder other than /apex/com.android.tethering/etc/bpf/ or
/system/etc/bpf/.

This commit adds a tag 'sub_dir' for bpf module. The installation path
of bpf modules will be:
- /system/etc/bpf/SUB_DIR/     (for platform code)
- /apex/MAINLINE_MODULE/etc/bpf/SUB_DIR/     (for mainline module)

Bug: 202086915
Test: add test in apex_test.go and build
Change-Id: Icc6619768ab006de9f86620a7df1bb2853eaba13
2022-01-19 04:02:29 +00:00
Yu Liu
4ae55d17f6 Support multilib in apex.
Bug: b/208325023
Test: Added unit tests, also tested with adbd apex build manually.
Change-Id: I47e04cd4eb5d05227f0a84683dcb66dff00e3514
2022-01-18 10:38:05 -08:00
Jiakai Zhang
594ed5022a Merge "Allow installing boot images outside of APEX." am: 0cd2a0e2bf am: c1744ee0a0 am: d437de134a am: 91c7d55489
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1947127

Change-Id: Id50d66720662cf5e06b2a8441feab2c5300aaf60
2022-01-14 18:51:40 +00:00
Jiakai Zhang
6decef916c Allow installing boot images outside of APEX.
After this change, `bootImageConfig.installDirOnDevice` can be set to a
path outside of the APEX, in which case, the boot image will not be
installed in the APEX. Instead, it will be installed to the given path
by Make.

This is a no-op change. Current behavior is not affected.

Bug: 211973309
Test: m nothing
Test: -
  1. m com.android.art
  2. See the boot image still being installed in the ART APEX.
Test: -
  1. Change `installDirOnDevice` of the ART boot image config to
     `system/framework`.
  2. See the boot image being installed in `/system/framework/<arch>`.
Change-Id: Ib13b17cc9e94dc5754c9b51b04df3307323b8783
2022-01-13 14:50:05 +00:00
Jiyong Park
b90099d84e Merge changes from topic "canned_fs_config" am: ae9cf26353 am: 33fd601118 am: a214351987 am: 7cc9a75156
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918606
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918605


Change-Id: I484e46ff819a5266c1e8046dae337e18ef3fefea
Merged-In: I484e46ff819a5266c1e8046dae337e18ef3fefea
Merged-In: I7f2576ff99c65bdb6c9ce4ace61bc783eea2f0d4
(cherry picked from commit 755e3808b2)
2022-01-04 12:54:44 +00:00
Treehugger Robot
dbd3553d83 Merge "Remove InstallBypassMake and ToMakePath" am: f1228f570a am: a9f335cf5a am: fd865c6688 am: 8ef2179a6e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1889722

Change-Id: If49c894804c5ca0dfd197ca848ff1c9ac79556f4
2021-12-17 07:36:53 +00:00
Treehugger Robot
f1228f570a Merge "Remove InstallBypassMake and ToMakePath" 2021-12-17 06:15:16 +00:00
Etienne Ruffieux
849c5e1c8b Merge "Renamed bluetooth apex name to com.android.bluetooth" am: a447c0973b am: c29e4fc462 am: 072039402d am: 8e91f00181
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1924343

Change-Id: Id911065a6223ce56c3e566e848bb5db32260ce5f
2021-12-16 23:31:19 +00:00
Etienne Ruffieux
a447c0973b Merge "Renamed bluetooth apex name to com.android.bluetooth" 2021-12-16 18:10:45 +00:00
Colin Cross
c68db4b305 Remove InstallBypassMake and ToMakePath
InstallBypassMake and ToMakePath are obsolete, remove them.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
2021-12-15 15:22:53 -08:00
Etienne Ruffieux
1651267c9c Renamed bluetooth apex name to com.android.bluetooth
Tag: #feature
Bug: 206614050
Test: Compiles
Change-Id: I4dc9f3d12ddc12e320a97c68144d5b642d6ab29b
2021-12-15 15:49:04 +00:00
Jiyong Park
755e3808b2 Merge changes from topic "canned_fs_config" am: ae9cf26353 am: 33fd601118 am: a214351987 am: 7cc9a75156
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918606

Change-Id: I4846d0483dcd3e712ddb027d7c6c335654021cee
2021-12-15 11:08:07 +00:00
Jiyong Park
ae9cf26353 Merge changes from topic "canned_fs_config"
* changes:
  Add canned_fs_config to apex module type
  Build canned_fs_config using RuleBuilder
2021-12-15 09:57:42 +00:00
Jiyong Park
038e852ce1 Add canned_fs_config to apex module type
The property is used to customize uid/gid/mode/capabilities of files in
an APEX.

Bug: 209971551
Test: m
Change-Id: I484e46ff819a5266c1e8046dae337e18ef3fefea
2021-12-15 09:11:15 +09:00
Liz Kammer
6299b235bb Merge "Use one mutator for all bp2build conversion." am: 92344259c5 am: 782f37eaee am: 5f4df317ee am: 037105c0f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1878397

Change-Id: I56073dc653947ebf69d7a74e97c1092f06aab139
2021-12-14 20:25:04 +00:00
Liz Kammer
be46fccc40 Use one mutator for all bp2build conversion.
Each conversion required defining a separate mutator, which will each
operate on _all_ modules and requires each to repeat checks whether the
mutator should operator. Instead, we introduce a single mutator and
modules can define a ConvertWithBp2build to implement bp2build
conversion for that module.

Test: bp2build.sh
Bug: 183079158
Change-Id: I99d4b51f441c2903879092c5b56313d606d4338d
2021-12-14 09:37:45 -05:00
Jingwen Chen
b9b1c18cda Merge "bp2build: Fix apex.binaries to be a LabelListAttribute." am: 8d0bd355fd am: d6b0aab0cd am: ed10ce524f am: 825f5eb8a9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1913474

Change-Id: I63b7ebb53243bcc0ba2b822421221a81c6744462
2021-12-13 11:21:27 +00:00
Jingwen Chen
8d0bd355fd Merge "bp2build: Fix apex.binaries to be a LabelListAttribute." 2021-12-13 10:03:50 +00:00
Remi NGUYEN VAN
efb49afc8a Relax apex package restriction for T+ jars
The ART AOT exemption only applies to Q/R/S, so module jars that have
min_sdk T+ do not need to follow the module package restriction, even if
they are part of a Q/R/S module (but not loaded on Q/R/S).

Relax the restriction to only apply to jars that have min_sdk before T.

(clean cherry-pick)

Bug: 208773835
Change-Id: Ib41ab443e36a694e3fac5f2ab0acabb3009f40a9
Test: m (runs apex tests)
Merged-In: I2c3ad8984ca05ad763bf6162bd478f93ab4ee650
2021-12-10 10:52:01 +00:00
Remi NGUYEN VAN
e27821b48e Merge "Relax apex package restriction for T+ jars" am: 4d5cd1f267 am: b68677917b am: 5d704c695e am: 4f2a9cb427
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908871

Change-Id: I46dc567ed74ff40e45418bffd128e6301ae7acf0
2021-12-10 01:34:41 +00:00
TreeHugger Robot
aa7b36e681 Merge changes from topics "presubmit-am-0a046d9514b34cc1a3b2b3584e857f6c", "presubmit-am-22410ea0b46e4a3d961d51518c65514d", "presubmit-am-2646dd78e751450296e76a7e6fac60eb", "presubmit-am-2762d254a366481180c66eefcb7b8c53", "presubmit-am-36ef44194069468da39e59065e3b9d39", "presubmit-am-6e59a6b21a5047bd940a9bff59c79228", "presubmit-am-855c4e732f2645568065c3c870ecd0da", "presubmit-am-dae9703bfd65425b8b44605c42e9d5b9" into sc-mainline-prod
* changes:
  Allow java_sdk_library in an APEX to have higher min_sdk_version.
  Perform CheckMinSdkVersion for java_sdk_library.
  Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
  Add ModuleWithMinSdkVersionCheck type.
  Use textproto format for classpaths.proto generation.
  Propagate min and max sdk versions to classpaths.proto configs.
  Introduce max_sdk_version device property.
  Test SdkSpecForm.
2021-12-09 15:54:26 +00:00
satayev
477a7baa79 Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
Bug: 205923322
Test: presubmit
Change-Id: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
Merged-In: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
(cherry picked from commit ad99149a62)
2021-12-09 14:35:32 +00:00
satayev
cb0977f67e Add ModuleWithMinSdkVersionCheck type.
This is to help following refactor for individual modules to have their
own version of checking where needed.

For example, apk in apex may want to enforce it's own version of
CheckMinSdkVersion.

Bug: 205923322
Test: presubmit
Change-Id: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
Merged-In: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
(cherry picked from commit b3fd411465)
2021-12-09 14:35:32 +00:00
Remi NGUYEN VAN
1fdd6ca88a Relax apex package restriction for T+ jars
The ART AOT exemption only applies to Q/R/S, so module jars that have
min_sdk T+ do not need to follow the module package restriction, even if
they are part of a Q/R/S module (but not loaded on Q/R/S).

Relax the restriction to only apply to jars that have min_sdk before T.

Bug: 208773835
Test: m (runs apex tests)
Change-Id: I2c3ad8984ca05ad763bf6162bd478f93ab4ee650
2021-12-09 18:28:47 +09:00
Dan Willemsen
d98c144f21 Merge "Add Darwin x86_64+arm64 universal binary support" am: ce69757379 am: 1bd7543d6e am: b2a6b903fb am: 4d913d8528
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1884611

Change-Id: I0b2e79c1ea2c2889c859fbbcd4ffb964531cf046
2021-12-09 00:04:21 +00:00
Treehugger Robot
a548a1c1c5 Merge changes I08ec0b44,I79b5a1fc,I469d6558 am: 6abfb33784 am: 3bcefabfeb am: dc2accaba0 am: a0b46c1d06
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907862

Change-Id: I0ffda740f28a4f1309fae0be43f40904ef4f2168
2021-12-09 00:03:32 +00:00
Dan Willemsen
ce69757379 Merge "Add Darwin x86_64+arm64 universal binary support" 2021-12-08 21:08:43 +00:00
satayev
ad99149a62 Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
Bug: 205923322
Test: presubmit
Change-Id: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
2021-12-08 11:36:31 +00:00
Jingwen Chen
b07c901e0d bp2build: Fix apex.binaries to be a LabelListAttribute.
apex.binaries accepts a list of module names, which should be resolved to
their fully qualified labels. Bazel treats string_list and label_list
attributes differently, most notably with the latter adding dependency edges.

Test: apex_conversion_test.go
Bug: 209743852
Change-Id: Iafdc5c728e8658cce0e99d42f32e7bb6fe2f3168
2021-12-08 10:10:19 +00:00
sophiez
2965f45751 Java APIs used by Mainline modules.
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

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Change-Id: Id539cbe1b7306ace69c047f95ffc02265a467511
Merged-In: Id539cbe1b7306ace69c047f95ffc02265a467511
2021-12-08 07:35:37 +00:00
Dan Willemsen
4745007bb1 Add Darwin x86_64+arm64 universal binary support
This is configured from Make by setting up Darwin+Arm64 as a HOST_CROSS
target (which is largely true, as binaries can't be executed on X86_64
machines). On the Soong side, it's a bit blurier, as we don't current
have any other users that are the same OS but not natively executable
(Linux/musl is executable, Windows/x86 is a different OS).

Instead of requiring cc_binary/etc to become multi-architecture-aware
and using something like common_first/MultiTarget, this defaults all
non-multi-architecture-aware modules to be built with both
architectures. It then adds a dependency with the
DarwinUniversalVariantTag so that supporting modules can get the outputs
of the other variant.

Cc uses that dependency tag to run lipo on shared libraries and binaries
so that the output of the x86_64 variant is actually a fat binary
including both architectures.

Bug: 203607969
Test: build sdk-repo targets on a Mac
Change-Id: Icbddb0a177c0ba19d3e0d11f8cf568e0d1ea3245
2021-12-07 22:01:25 -08:00
Jiakai Zhang
204d111865 Merge "Add ART boot image profile to the ART APEX." am: e6f63be764 am: 255734a03a am: c0adf3ba1c am: 5195a30de9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1904290

Change-Id: I9ceaeca0de9f290a41ba416eb862b7be147cb874
2021-12-07 16:29:34 +00:00
Jiakai Zhang
e6f63be764 Merge "Add ART boot image profile to the ART APEX." 2021-12-07 15:22:37 +00:00
Artur Satayev
6e8071d17a Merge "Add ModuleWithMinSdkVersionCheck type." am: a4fc08d204 am: 25f5783263 am: fe55ffd190 am: 44d0ef55da
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907860

Change-Id: I147da371d445f09ca2f131df1be91545eba37772
2021-12-06 18:09:34 +00:00
satayev
b3fd411465 Add ModuleWithMinSdkVersionCheck type.
This is to help following refactor for individual modules to have their
own version of checking where needed.

For example, apk in apex may want to enforce it's own version of
CheckMinSdkVersion.

Bug: 205923322
Test: presubmit
Change-Id: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
2021-12-06 12:05:48 +00:00
Jiyong Park
a119a182bd Merge "Add future_updatable to the apex module" am: 103d511117 am: 88589cf238 am: 82a851b155 am: d0ce5a0925
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1904291

Change-Id: I83e1efce2f1464a30eb3bad406ce4d96dd419630
2021-12-06 10:58:43 +00:00
Jiyong Park
f402058d2c Add future_updatable to the apex module
The new property is used to mimic some of the build behaviors that
currently are applied only when an APEX is `updatable: true`. This
property is helpful to minimize the sudden impact (e.g. change in size)
when an APEX becomes updatable.

Currently, the behavior that this property mimics is the disabling of
the size optimization.

Bug: 207336449
Test: m
Change-Id: I500306afa1221625fda3e89a8d12d5d341791a1f
2021-12-06 02:18:13 +00:00
Jiakai Zhang
49b1eb6b04 Add ART boot image profile to the ART APEX.
We will need the profile when we generate the primary boot image on
device.

Bug: 203492478
Test: Run `banchan com.android.art x86_64 && m` and see
  `$ANDROID_PRODUCT_OUT/apex/com.android.art/etc/boot-image.prof`.
Test: Run `lunch aosp_cf_x86_64_phone-userdebug && m` and see both
  `$ANDROID_PRODUCT_OUT/apex/com.android.art/etc/boot-image.prof` and
  `$ANDROID_PRODUCT_OUT/system/etc/boot-image.prof`, in different
  sizes.
Test: Start Cuttlefish with the built image and see both
  `/apex/com.android.art/etc/boot-image.prof` and
  `/system/etc/boot-image.prof` on device.
Change-Id: Id879dc49b234133dfbb9563814328661a1f4a6c0
2021-12-03 20:02:10 +00:00
Daniel Norman
6879cf5c53 Merge "Forbid updatable: true on vendor APEXes." am: 7260025670 am: c046926ac5 am: ab360daa03 am: 917cdf20b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908986

Change-Id: Ic4df53e320891a24c5798f897ce10db8caec778a
2021-12-03 19:07:56 +00:00
Daniel Norman
6910911c64 Forbid updatable: true on vendor APEXes.
Vendor APEXes do not formally support updates outside of the main OTA
process. We should clarify this at build time.

Test: set vendor apex to updatable, observe failure
Test: apex_test.go
Change-Id: Ife8d242a42415ebf00d7dced72c07cda1fde1839
2021-12-02 12:53:12 -08:00
Liz Kammer
01cebf606b Merge "Support empty strings in bp2build" am: a9351ef6e6 am: 7cb87525ef am: 3044f94f32 am: 8ac1619830
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907331

Change-Id: I510c1b3e833a4d279fea7e2a34d125b6c5e6842d
2021-12-02 17:27:12 +00:00
Liz Kammer
a9351ef6e6 Merge "Support empty strings in bp2build" 2021-12-02 15:35:10 +00:00
Treehugger Robot
1e168fece0 Merge "Add Sh_binaries property" am: abd43ec406 am: eea12c1be9 am: e5d333f7e1 am: 9839c0cf56
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899131

Change-Id: Iff3cdfe7c26af27ddb46adbacdc73f0fc82e6b90
2021-12-02 02:18:03 +00:00
Treehugger Robot
abd43ec406 Merge "Add Sh_binaries property" 2021-12-02 00:52:23 +00:00
Benjamin Brittain
aedf01bd62 Merge "Add support for Rust JNI Libraries" am: 7c721018bb am: 9915e2dfc6 am: f842076481 am: 66ddbf9e23
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1906713

Change-Id: I399a929010ecc54ea62542f5d64c2d279aec2dc9
2021-12-01 15:36:45 +00:00
Liz Kammer
46fb7aba4d Support empty strings in bp2build
Previously, could not set an empty string as a value of an attribute;
however, this is necessary in some cases. To not unnecessarily create an
empty string, use string pointers for attributes rather than strings.

Test: go test bp2build tests
Change-Id: I03b3a3567452d455246d22d81f86c317d06b7c39
2021-12-01 10:14:49 -05:00
Benjamin Brittain
9edc375a06 Add support for Rust JNI Libraries
Test: Verified Rust JNI lib is in apex

Change-Id: Icb013d7b2f4c5d8ec009ea4937185689cc0cac16
2021-11-30 13:38:15 -05:00
Sundong Ahn
80c04891de Add Sh_binaries property
The sh_binary module is not supported the vendor variant. So, even if
there is "vendor: true" in sh_binary module, the image variant is
"image:" instead of "image:vendor.Tiramisu".
But the vendor APEX has vendor variant, so vendor APEX module and
sh_binary module have different variants and the sh_binary cannot be
added to vendor apex.
So the Sh_binaries property is added, and the image variant is removed
at DepsMutator.

Bug: 205065320
Test: make -j40 && sh_binary is added to vendor APEX && install check
Change-Id: I30e2d96a73b45e7b06eff24550542cb010008c41
2021-11-25 03:43:57 +00:00
Jooyung Han
09925634f5 Remove libsync from apex_available allowlist am: 9876c5eaab am: 6f323db66b am: 57440917f1 am: 7fb5afdd2a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899132

Change-Id: I3b0ae777ef2584d2fe7b8f07bd94b5da3cca9536
2021-11-23 04:51:12 +00:00
Jooyung Han
9876c5eaab Remove libsync from apex_available allowlist
As libsync is NDK/LLNDK, it doesn't need to be aded to allowlist as
apex_available.

Bug: n/a
Test: m
Change-Id: I16cfb258a24bde4def428f1e6277f5d3c95c228c
2021-11-23 11:06:16 +09:00
Colin Cross
cf96429713 Merge "Move apex module installation into Soong" am: ab6db81276 am: a0c4b45669 am: e5046710c6 am: 4431bebf1f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1897972

Change-Id: Ib5501953f604920391965150fe0f67d1c6fa4502
2021-11-22 18:29:50 +00:00
Colin Cross
de6cbce98f Merge "Revert "Move apex module installation into Soong"" am: 500bba1b20 am: d4ce0c64f5 am: 85d3c93a85 am: 834649db81
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1897971

Change-Id: I9551b9160616b509f7a3b609f3bf7f9530f13d94
2021-11-20 02:45:58 +00:00
Colin Cross
377f028841 Merge "Move apex module installation into Soong" am: 50f6f869a2 am: a3675380c6 am: 0cc52a39ba am: 0118e502de
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1896051

Change-Id: I312ee4233409590097b4461ded2cc6846fb15d03
2021-11-20 02:44:38 +00:00
Colin Cross
6340ea50d4 Move apex module installation into Soong
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-19 13:37:36 -08:00
Colin Cross
555c52491d Revert "Move apex module installation into Soong"
This reverts commit 246e3eed67.

Reason for revert: broke aosp_bonito-userdebug build

Change-Id: Ib613f8f22532fe4588d3ec96aa001de869f8a633
2021-11-19 21:32:54 +00:00
Colin Cross
246e3eed67 Move apex module installation into Soong
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.

Bug: 204136549
Test: m checkbuild
Change-Id: I606286e971b55d9d1fc4dcd0fbd476962de5fa79
2021-11-18 13:13:44 -08:00
Daniel Norman
aabdbd31e1 Revert "Revert "Adds multi_install_skip_symbol_files field (defa..." am: 6cfb37af56 am: 33f4a18254 am: 79454a7405 am: a4aab6c90d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1894202

Change-Id: Ief8ef8b15dbb3d3c97b60c98bfddb2053bb803c2
2021-11-17 23:04:25 +00:00
Daniel Norman
6cfb37af56 Revert "Revert "Adds multi_install_skip_symbol_files field (defa..."
Revert submission 1893459-revert-1869814-vapex-multi-config-VKODFOVCWY

Reason for revert: Fix-forward in https://r.android.com/1894088
Reverted Changes:
I087bfe0dc:Revert "Adds a new prop context for choosing betwe...
I27a498506:Revert "Load persist props before starting apexd."...
Ib5344edc0:Revert "Allow users to choose between multi-instal...
If09bf590e:Revert "Adds multi_install_skip_symbol_files field...
I905dac14c:Revert "Demonstrate multi-installed APEXes."

Change-Id: I33210c8d3199338f9c898d719ed1797b629317af
2021-11-17 19:12:21 +00:00
Oriol Prieto Gasco
2c4a96375a Make 'Compressible' an overridable property
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
2021-11-16 21:49:02 +00:00
Owen Kim
d96921eb6f Merge "Revert "Adds multi_install_skip_symbol_files field (default fals..."" am: a10ebe60ab am: dcf7a82e43 am: 4c51ab52a6 am: eda61e7ead
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1893457

Change-Id: Ia3c97cd817f7b3fc171d9602614d50cbe60d6f25
2021-11-16 09:50:55 +00:00
Owen Kim
a10ebe60ab Merge "Revert "Adds multi_install_skip_symbol_files field (default fals..."" 2021-11-16 08:39:27 +00:00
Owen Kim
065fbeb146 Revert "Adds multi_install_skip_symbol_files field (default fals..."
Revert submission 1869814-vapex-multi-config

Bug: 206551398
Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/tests/view?invocationId=I55600009996329947&testResultId=TR93527797572038984, bug b/206551398
Reverted Changes:
I0cd9d748d:Adds multi_install_skip_symbol_files field (defaul...
I5912a18e3:Demonstrate multi-installed APEXes.
I0e6881e3a:Load persist props before starting apexd.
I932442ade:Adds a new prop context for choosing between multi...
I754ecc3f7:Allow users to choose between multi-installed vend...

Change-Id: If09bf590e3ad93e14fbf89299f80d497c9604a78
2021-11-16 07:08:15 +00:00
Daniel Norman
ab5d708f3f Merge "Adds multi_install_skip_symbol_files field (default false) to apex." am: f012790f32 am: 6ddcbb7b26 am: 3e1d66958d am: 1417a11d82
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1874413

Change-Id: Ia60d798366671bca001ae70ba93f8163fdae5239
2021-11-16 01:44:45 +00:00
Daniel Norman
f012790f32 Merge "Adds multi_install_skip_symbol_files field (default false) to apex." 2021-11-16 00:45:32 +00:00
Sophie Zheng
8e0dadadba Merge "Java APIs used by Mainline modules." am: 7b5fa4277f am: 2a27e47fbd am: 587dbb8553 am: a31ea43aaa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1887228

Change-Id: I1d3842b422b1de4faa5d0fd7b3b3035006f0d75d
2021-11-15 07:37:18 +00:00
sophiez
0234737f30 Java APIs used by Mainline modules.
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-11-12 23:39:35 +00:00
Daniel Norman
e19437e8f7 Adds multi_install_skip_symbol_files field (default false) to apex.
Multi-installed APEXes share the same apex_name and are installed
at the same time.

Should be set to true for all multi-installed APEXes except the singular
default version within the multi-installed group.
Only the default version can install symbol files in $(PRODUCT_OUT}/apex,
or else conflicting build rules may be created.

Bug: 199290365
Test: see https://r.android.com/1872018
Change-Id: I0cd9d748d7be3a2de40ed14f13bad71912457ddc
2021-11-12 20:45:50 +00:00
Colin Cross
32b9cd0fc2 Merge "Revert "Move apex module installation into Soong"" am: 152911f807 am: 35ee47dcbf am: ca03de2828 am: 21d7f625c3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1890806

Change-Id: I2647b410bb76f237367d127490193249ce04324d
2021-11-12 20:08:22 +00:00
Colin Cross
ccba23db44 Revert "Move apex module installation into Soong"
This reverts commit e3d156a622.

Reason for revert: b/206119621

Bug: 204136549
Change-Id: I380223b86660c27bea8f5dcc2d61f32df2704c02
Fixes: 206119621
2021-11-12 19:01:29 +00:00
Colin Cross
66f1ef1e46 Merge "Move apex module installation into Soong" am: 4e278e5f68 am: 8dfdabc4c9 am: f24e7a7f4e am: 2098ff63f4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1880605

Change-Id: I63132d59c3dc63e78b9cca1cb075bedc106b793b
2021-11-12 18:13:03 +00:00
Colin Cross
e3d156a622 Move apex module installation into Soong
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.

Bug: 204136549
Test: m checkbuild
Change-Id: If65d283abc86f18ad266da0bf16fe95971a0bf9c
2021-11-11 17:44:42 -08:00
Laura Tsai
89c5e3a402 Merge "Revert "Add scripts to generate java APIs used by Mainline modules."" am: 33b60e4983 am: 463f87c7c5 am: fb1e24c1c7 am: 2883262457 am: 5f49af419f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1885670

Change-Id: Ib9e95d6a0ce32be7d059a09a863cc1bb6edb70dc
2021-11-10 08:13:51 +00:00
Laura Tsai
be3c7eacfe Revert "Add scripts to generate java APIs used by Mainline modules."
This reverts commit c92380f001.

Reason for revert:
DroidMonitor:

DroidMonitor-triggered revert due to breakage
https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=mainline_modules_arm64-userdebug&lkgb=7898389&lkbb=7900541&fkbb=7898474,
bug 205746850

Change-Id: Ibd84dfe68dfe150b7e05b4287364d1946375bf72
2021-11-10 06:59:37 +00:00
Spandan Das
efd3f2b7f3 Merge "Add android.safetycenter to permission module permitted_packges" 2021-11-09 19:44:16 +00:00
Spandan Das
79e332c02d Add android.safetycenter to permission module permitted_packges
Currently the permitted_packages check is per apex and not per jar.
Adding android.safetycenter to the allowlist to unblock ag/16182563

Bug: 205289292
Test: TH
Change-Id: I9fc315a987af937a527872f24bf73263d2c9c9f2
2021-11-09 18:01:42 +00:00
sophiez
c92380f001 Add scripts to generate java APIs used by Mainline modules.
Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only

Change-Id: Icd854fd40c3026ae9aae6dc30c9e79027e1303a0
2021-11-05 15:38:09 -07:00
Colin Cross
91eaa6316a Merge changes I04f2f558,Ie16a6264,I83a3be9f,Icb3eeef3
* changes:
  Rename amod variable in AndroidMkEntries.fillInEntries to base
  Make HostToolPath, HostJNIToolPath and sboxPathForToolRel use pathForInstall
  Add PathForGoBinary
  Remove PathForOutput from InstallPathToOnDevicePath
2021-10-30 19:19:53 +00:00
Colin Cross
a44551fec6 Add PathForGoBinary
Add PathForGoBinary that uses pathForInstall to return the install
path of a GoBinaryTool.  This will replace various places that used
PathForOutput to reconstruct a path to a Go tool, and will support
moving Go tools to the Make install directory outside of the
PathForOutput directory in a future patch.

Bug: 204136549
Test: m checkbuild
Change-Id: I83a3be9f5c621975540f5ed601a0b9e2611c98b9
2021-10-29 16:34:55 -07:00
Jooyung Han
09c11adf51 apex.custom_sign_tool property
A new property indicates a CLI tool to sign the APEX contents. The value
is stored in apexkeys.txt so that releasetool (sign_target_files_apks)
can use it to invoke the tool to re-sign the apex contents.

Bug: 193504286
Test: m out/soong/apexkeys.txt
      com.android.virt.apex line has sign_tool value
Change-Id: Ifd472049b75b5b87c1ed320f5e1190ff65ed54f2
2021-10-27 04:02:48 +09:00
Paul Duffin
eb8051d80d Remove artApex parameter from ApexBundleFactory
Since coverage support was added to bootclasspath_fragment in
https://r.android.com/1684807 and bootclasspath_fragments were
integrated into the ART APEX it is no longer necessary to treat ART
APEXes differently to other APEXes.

Change https://r.android.com/1684807 added coverage support, follow
up changes integrated

Bug: 177892522
Test: m droid
      m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true
Change-Id: I4800a003c7459c4686607e16f4c5bde0be105f16
2021-10-20 10:29:14 +00:00
Dan Willemsen
47e1a75851 Fix mac/allowmissingdeps builds
This WalkDeps loop was expecting the dependencies to be fully filled
out, which isn't necessarily true on AllowMissingDependencies builds,
especially on Mac when the modules may exist, but not be enabled.

This was triggered when make_erofs was added to an apex, but wasn't
enabled on Mac.

It shouldn't be a problem to skip the disabled dependencies, since we'll
have already marked the current module as missing dependencies, which
means it won't actually get built.

Test: `m nothing` on a mac
Change-Id: Icd6d597117be4cde5bff041be3fd47361c54cad9
2021-10-17 01:40:34 +00:00
Mohammad Islam
214a923f0d Merge "Add EROFS support for APEX build system" 2021-10-15 15:44:47 +00:00
Treehugger Robot
3e745e63f3 Merge "Bp2Build common properties auto-handling" am: d905146590
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1815376

Change-Id: I38f1063302ea90583a51e625076e6232b4364ab7
2021-10-04 19:20:28 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
447f6c99c9 Bp2Build common properties auto-handling
Introduce `commonAttributes` & `fillCommonBp2BuildModuleAttrs used in
CreateBazelTargetModule

Adapt `bp2BuildInfo` to use `commonAttrs` instead of `Name`.
And thus also all downstream users of `CreateBazelTargetModule`.

As initial user, the Soong `required` property will be
translated to Bazel's `data`.

Bug: 198146582, 196091467
Test: build_converstion_test.go:TestCommonBp2BuildModuleAttrs
Test: go test
Test: mixed_{libc,droid}.sh
Change-Id: Ib500e40f7e2cb48c459f1ebe3188962fc41ec124
2021-10-04 14:43:04 +00:00
Martin Stjernholm
40fc93fb3c Merge changes I957f3df8,I68986dcc am: cf6bf37d04
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1829372

Change-Id: Ifcf471f2746c1037b83c2a11b8f5120b86fd6cb2
2021-09-24 09:44:00 +00:00
Martin Stjernholm
8be1e6db16 Propagate the dex jar path as an OptionalPath which is either valid or
invalid with a message.

This will allow propagating any error from the deapexer module for
prebuilt APEXes to the location where the dex jars get used. It's only
at those points that we can raise errors about not being able to
extract files from the deapexer modules if they are invalid, and this
way we avoid encoding knowledge there about why they may be invalid.

To keep the refactoring limited it intentionally does not change any of
the existing logic for when dexJarFiles are set or not (non-nil vs nil
prior to this change), although there may be opportunity to use this
for more conditions when dex jars aren't available.

The refactoring is also not extended to
dexpreopt.ClassLoaderContextMap.

Test: m nothing
Bug: 192006406
Change-Id: I68986dccd9a9b3fee4d24caa1947ea17a36caedc
2021-09-23 17:19:55 +01:00
Jiakai Zhang
dc2c1c2625 Merge "Revert^2 "Preopt APEX system server jars."" am: c9f9d56ed4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1828115

Change-Id: I2a991341934af96455f136cbe44ef824f5e3e7f5
2021-09-17 11:33:13 +00:00
Jiakai Zhang
519c5c82e5 Revert^2 "Preopt APEX system server jars."
This reverts commit 92346c4832.

Reason for revert: Fixed build error.

The build error is fixed by ag/15841934. This CL remains unchanged. This
CL will be submitted AFTER ag/15841934 is submitted.

Bug: 200024131
Test: 1. Patch this CL and ag/15841934 into internal master.
  2. sudo vendor/google/build/build_test.bash

Change-Id: I5f2b8357846fc7dda56e25ebe6ffb095e8047ec8
2021-09-16 06:25:26 +00:00
Adrian Roos
755a09490f Merge "Revert "Preopt APEX system server jars."" am: 79839d94c1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1827535

Change-Id: I2281010a93a89b69b859272627c7eac0d7e6d3ed
2021-09-15 14:53:58 +00:00
Adrian Roos
92346c4832 Revert "Preopt APEX system server jars."
This reverts commit ca9bc98e0c.

Reason for revert: breaks build
Bug: 200024131

Change-Id: Ide07b4c4d267370ae31107b1598b2f878c701282
2021-09-15 14:11:07 +00:00
Jiakai Zhang
83d0d8ac1c Preopt APEX system server jars. am: ca9bc98e0c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821984

Change-Id: If42b905c0636b10881b372efafd3e2f9bc84923c
2021-09-15 10:48:53 +00:00
Jiakai Zhang
ca9bc98e0c Preopt APEX system server jars.
The path to the artifacts will in the form of
/system/framework/oat/<arch>/<encoded-jar-path>@classes.{odex,vdex,art},
where <encoded-jar-path> is the path to the jar file with "/" replaced
by "@". For example,
/system/framework/oat/x86_64/apex@com.android.art@javalib@service-art.jar@classes.odex

There will be a follow-up CL to update ART runtime to recognize
artifacts in that path.

Test: m com.android.art
Bug: 194150908
Change-Id: Ic89fd63c4b1cd565684cead83fc91dae3bc97a4c
2021-09-15 09:01:07 +00:00
Mohammad Islam
17544fe23a Merge "Relax restriction on suffix of apex_set filename to include .capex" am: 385cde82d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1821656

Change-Id: I91189bd060d0c365892234daab5a59b70a8018c7
2021-09-09 09:08:51 +00:00
Samiul Islam
7c02e26cba Relax restriction on suffix of apex_set filename to include .capex
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-09-08 18:29:47 +01:00
Treehugger Robot
b8d4e69927 Merge "Allows prebuilts in override_apex." am: e267bc8f74
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1811097

Change-Id: I732915686e54509c30f6855ea29d562bc83cf680
2021-09-03 16:13:56 +00:00
Daniel Norman
5a3ce13c6a Allows prebuilts in override_apex.
Bug: 197787336
Test: Create an override_apex that uses a different `prebuilts` than its
      base. Observe built contents.
Test: apex_test.go
Change-Id: I7666ed6cfe3f2fa5dd81e5f8c1961477dabbbd3c
2021-09-02 09:28:52 -07:00
Treehugger Robot
a88fc3e79e Merge "Make bpfs properties overridable" am: 60dc5c0db2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1810456

Change-Id: Ib8196d660983d724e4ecde5c08a9ab2da979df99
2021-08-27 05:07:16 +00:00
markchien
7c803b8746 Make bpfs properties overridable
To support different variable bpfs file between mainline module and
non-updatable module(e.g. Android GO). Make bpfs properties overridable.

Test: m
Bug: 190523685
Change-Id: I4c63e35f74230de94b21f3ceb2beb90f0f9ddb11
2021-08-27 03:03:45 +00:00
Liz Kammer
680bd2dd0a Merge "Don't create a new module for bp2build conversion." am: 380dbb9327
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1792714

Change-Id: Ie7d6d5908d06f14121691f7aa0f57c7c7303e67a
2021-08-18 19:44:01 +00:00
Liz Kammer
380dbb9327 Merge "Don't create a new module for bp2build conversion." 2021-08-18 19:28:20 +00:00
Martin Stjernholm
50c2a30ffa Merge "Remove fallback workaround for APEX variants which is now unnecessary." am: 3931b8c70d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1756730

Change-Id: If29fac31f319229cd877d38b3852698815664e54
2021-08-18 08:56:47 +00:00
Liz Kammer
2ada09a546 Don't create a new module for bp2build conversion.
A performance improvement for bp2build as Blueprint/Soong no longer have
the overhead of additional modules. The creation of these modules
results in:
* traversal of additional modules for each subsequent mutator
* synchronization over a go channel to collect newly created modules:
https://cs.android.com/android/platform/superproject/+/master:build/blueprint/context.go;l=2594,2600;drc=1602226f23181b8c3fbfcaf3358f0297e839d7d3

We avoid both of these by storing the information directly in the
underlying module.

Also as a fringe benefit, removes some necessary boilerplate for
conversion.

For benchmarks, reduces runtime ~1% for 1% converted, ~24% for 100%
converted. See more: go/benchmarks-for-https:-r.android.com-1792714

Test: ran benchmarks/tests in bp2build
Test: build/bazel/ci/bp2build.sh
Change-Id: Ie9273b8cbab5bc6edac1728067ce184382feb211
2021-08-17 15:57:09 -04:00
Martin Stjernholm
0e17c1a57e Remove fallback workaround for APEX variants which is now unnecessary.
Test: m nothing
Bug: 191269918
Change-Id: I13091d5ffdd46947899db273b9cb2399dda23907
2021-08-15 22:32:37 +01:00
Colin Cross
89f7a63e3f [automerge] Collect lint reports from apps in apexes 2p: 192221b55e
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15531885

Change-Id: Ia49cf6a8f6f6588bc2a95b3443208ab56a2b5adf
2021-08-11 16:09:03 +00:00
Colin Cross
192221b55e Collect lint reports from apps in apexes
Lint reports were only being collected from jars in apexes, not
apps.

Bug: 188772607
Test: mainline_modules_arm64 build
Change-Id: Ie84819343f8b8ab3f43496bbc9b7876d0d0d8e70
Merged-In: Ie84819343f8b8ab3f43496bbc9b7876d0d0d8e70
(cherry picked from commit 8355c1524f)
2021-08-11 09:07:57 -07:00
Colin Cross
390babfeae Merge "Collect lint reports from apps in apexes" am: 7131982a76 am: 3dc9d726ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1792871

Change-Id: Ibc44f45a5a8a5ecb977943a2beb26e6e1e465862
2021-08-11 14:44:08 +00:00
Colin Cross
8355c1524f Collect lint reports from apps in apexes
Lint reports were only being collected from jars in apexes, not
apps.

Bug: 188772607
Test: mainline_modules_arm64 build
Change-Id: Ie84819343f8b8ab3f43496bbc9b7876d0d0d8e70
2021-08-10 19:25:59 -07:00
satayev
ffe797109a Add classpath fragment property to skip proto generation.
This must always be true for updatable apexes, but is not necessary
for non-updatable apexes like com.android.i18n.

In a follow up this will be used to figure out whether apex boot jars
should be bundled into platform_bootclasspath.

Bug: 191127295
Test: atest CtsClasspathsTestCases derive_classpath_test
Change-Id: Ib7dc5b057cb24955222fb97f3ff9da079f30ed77
Merged-In: Ib7dc5b057cb24955222fb97f3ff9da079f30ed77
2021-08-05 11:22:19 +01:00
Treehugger Robot
69c6143138 Merge changes Ie2012adb,Ib0283ca6 am: 03beb0ec77 am: 47992dd860
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1784476

Change-Id: I7e41072eaf3e953591232b6bb8df6a7c1b961c2a
2021-08-04 05:06:04 +00:00
Treehugger Robot
03beb0ec77 Merge changes Ie2012adb,Ib0283ca6
* changes:
  static rust binaries are also prohibited in APEXes
  Revert "Revert "Prohibit static executable in APEX""
2021-08-04 04:35:20 +00:00
Jiyong Park
a9baefe81f Merge "Revert "Prohibit static executable in APEX"" am: 2fe71a5165 am: 2af22b8729
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1784474

Change-Id: I125a2dfb96277064ff7daa195d4a80c315655879
2021-08-03 08:19:22 +00:00
Jiyong Park
d12979d09a static rust binaries are also prohibited in APEXes
Also fixes a bug that the test runs for host APEXes like
com.android.art.host.

Bug: 185971244
Test: m
Test: build mainline_modules target on aosp-master
Change-Id: Ie2012adbf2f4eda5454d5eaa30f128fb1e20ad37
2021-08-03 07:52:46 +00:00
Jiyong Park
192600a7d0 Revert "Revert "Prohibit static executable in APEX""
This reverts commit 2125aab504.

Reason for revert: relanding along with a forward fix

Change-Id: Ib0283ca6beefa2f3073860287d00553ad0af6317
2021-08-03 07:52:17 +00:00
Jiyong Park
2fe71a5165 Merge "Revert "Prohibit static executable in APEX"" 2021-08-03 07:50:26 +00:00
Yen-Chao Chen
2125aab504 Revert "Prohibit static executable in APEX"
This reverts commit 3a8130c797.

Reason for revert: Build failed.

Change-Id: I28c72c8c3adaeb23bff9bffe3994971aa3f2e4f4
2021-08-03 04:51:12 +00:00
Jiyong Park
42a7f17aa1 Merge "Prohibit static executable in APEX" am: d8a3513155 am: 7986f564b6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1779746

Change-Id: Iefdcf93ceb0d0b9654afffe0c03be28af33a9eaf
2021-08-03 04:16:24 +00:00
Jiyong Park
d8a3513155 Merge "Prohibit static executable in APEX" 2021-08-03 03:48:01 +00:00
Huang Jianan
13cac63cc7 Add EROFS support for APEX build system
Bug: 195274797
Test: mmm system/apex/apexer/testdata
Change-Id: I21dbe8b1bfe02d267c710f3c0dd4abaa737cffe0
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-08-02 18:47:25 +08:00
Rupert Shuttleworth
e317474f43 Merge "Add support for prebuilts attribute to the bp2build APEX converter." am: 36a3ef297f am: 5d80f5a189
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1781087

Change-Id: Ib5250493dd8f92befedd654d5dda1c517f6657d1
2021-07-28 12:48:38 +00:00
Rupert Shuttleworth
9447e1ee12 Add support for prebuilts attribute to the bp2build APEX converter.
Test: Updated unit test.

Change-Id: I73dfa84d7a55c0b94393ad6257b5f16313422852
2021-07-28 06:03:17 -04:00
Jiyong Park
3a8130c797 Prohibit static executable in APEX
If a library is statically included in a static executable, it's
behavior is different from the case where the same library is statically
(or dynamically) linked to a non-static executable. To reduce the number
of test configs that we need to consider, it is required to prohibit
static executables in APEXes.

Bug: 185971244
Test: m
Change-Id: I0cd8fca669d55088e2329fef1f859eeb297502dd
2021-07-27 22:42:23 +09:00
Rupert Shuttleworth
d0ec532fa6 Add some more properties to the bp2build APEX converter (second try) am: 6e4950a061 am: 6de2c9b72b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1778212

Change-Id: Ic13b56e93a31357887d37c21952d5a2fe8d85d87
2021-07-27 10:57:03 +00:00
Rupert Shuttleworth
6e4950a061 Add some more properties to the bp2build APEX converter (second try)
In particular:

- AndroidManifest
- file_contexts
- key
- certificate
- min_sdk_version
- updatable
- installable
- native_shared_libs
- binaries

Test: Updated unit test

Change-Id: I1c6e8c4b6b24ce487f64e5d37bd594dbb000fe6f
2021-07-27 05:02:50 -04:00
Rupert Shuttleworth
53b662e2f3 Merge "Revert "Add some more properties to the bp2build APEX converter."" am: d0e6ad1ab3 am: 8ed074029d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1778407

Change-Id: I732ad6808d71b32642fb5892387a6500c31af9d3
2021-07-27 03:25:29 +00:00
Treehugger Robot
b97add46c7 Merge "Add some more properties to the bp2build APEX converter." am: 57dd3c40e8 am: 23c45bb446
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1778085

Change-Id: I7274c07caeee96306b69172793a9c9699839b35b
2021-07-27 03:02:43 +00:00
Rupert Shuttleworth
0358478150 Revert "Add some more properties to the bp2build APEX converter."
This reverts commit 69bf4c0d60.

Reason for revert: Possibly broke CI (https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master-bazel&target=bp2build-incremental&lkgb=7266256&fkbb=7237028), rolling back just in case...

Change-Id: I14ebac4f47576a73285d1f724ae4499036e8e678
2021-07-27 02:37:32 +00:00
Rupert Shuttleworth
69bf4c0d60 Add some more properties to the bp2build APEX converter.
In particular:

- AndroidManifest
- file_contexts
- key
- certificate
- min_sdk_version
- updatable
- installable
- native_shared_libs
- binaries

Test: Updated unit test

Change-Id: I9ea13f021d63ec0f75006b3b0b23ec8178c7e9da
2021-07-26 07:32:36 -04:00
Jingwen Chen
5c2e25258a Merge "Fix apex bp2build." am: 8bdc1bb3d7 am: d3f17aed08
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1769290

Change-Id: I7c2eb2c283537bbde02db9701e869d9aa46674fc
2021-07-19 05:36:19 +00:00
Jingwen Chen
f59a8e117e Fix apex bp2build.
apexBundle was missing InitBazelModule for it to have bazel_module properties.

Test: soong unit test
Fixes: 193866723
Change-Id: I5fb38c8b2e8edaecef44162491d399c0223d3fb1
2021-07-16 09:32:49 +00:00
Rupert Shuttleworth
268466707b Add partial bp2build support for APEX targets (second try). am: a9d76dd423 am: 37b29c925c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1755109

Change-Id: Id29697a17140dccf5ca9764a95f6f5db51a8783a
2021-07-02 13:38:14 +00:00
Rupert Shuttleworth
a9d76dd423 Add partial bp2build support for APEX targets (second try).
Test: Added unit test
Change-Id: Icbf0475251aac5d1f13bd35a18f90b6c70f3ae29
2021-07-02 07:36:07 -04:00
Weng Su
eb8a7b740a Revert "Add partial bp2build support for APEX targets." am: 7ce730b90c am: 9bc2ee5ca0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1753900

Change-Id: Iff2f0d358658098ccfd06bdca58a20b72db16de7
2021-07-01 08:00:41 +00:00
Rupert Shuttleworth
50be2a3716 Add partial bp2build support for APEX targets. am: 22b606b5f0 am: 356b7ca109
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1733232

Change-Id: Ia301f78ab5e9ad38d0eee2a525a4eb2895ae5722
2021-07-01 06:57:23 +00:00
Weng Su
7ce730b90c Revert "Add partial bp2build support for APEX targets."
Revert submission 1733232-roboleaf-apex

Reason for revert: b/192523357 Broken build 7512065 on aosp-master on sdk_x86_64-sdk
Reverted Changes:
Ie82c263f6:Add a stub rule for building APEX bundles.
I93e2a25fa:Add partial bp2build support for APEX targets.

Change-Id: I8e836fe7f466e02f3108680f9653412299e929e0
2021-07-01 06:51:11 +00:00
Rupert Shuttleworth
22b606b5f0 Add partial bp2build support for APEX targets.
Test: Added unit test

Change-Id: I93e2a25fa43eec1ffb8fb30c346a9b523195a0fd
2021-06-30 22:20:23 -04:00
Treehugger Robot
a2792263fa Merge "Fix inconsistencies in the apex names used for the apex variations." am: f46e95899b am: 28bbdf23f7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748294

Change-Id: I930769a7d48eedace77d12cf51f1e50ebb874cbb
2021-06-25 23:33:49 +00:00
Martin Stjernholm
d8da28ea9c Fix inconsistencies in the apex names used for the apex variations.
Add an apex_name property to prebuilt APEX modules to allow specifying
the "runtime" name of the APEX, i.e. the one it gets mounted as in /apex/,
which is also the one used for the apex variations.

Introduce a callback to retrieve that name consistently for all APEX
modules (apex, override_apex, prebuilt_apex, and apex_set), and update
some apex mutator code paths to use it.

For APEX source modules (apex and override_apex), it's necessary to add
a new field in apexBundle, since the name property gets overridden for
the override variant that override_apex creates.

Cherry-picked from https://r.android.com/1748294.

Test: m nothing
Bug: 191269918
Change-Id: If8612639bffdf91cbcab3387b0603bf5dffef1f5
Merged-In: If8612639bffdf91cbcab3387b0603bf5dffef1f5
2021-06-25 21:27:14 +01:00
Martin Stjernholm
bfffae7bec Fix inconsistencies in the apex names used for the apex variations.
Add an apex_name property to prebuilt APEX modules to allow specifying
the "runtime" name of the APEX, i.e. the one it gets mounted as in /apex/,
which is also the one used for the apex variations.

Introduce a callback to retrieve that name consistently for all APEX
modules (apex, override_apex, prebuilt_apex, and apex_set), and update
some apex mutator code paths to use it.

For APEX source modules (apex and override_apex), it's necessary to add
a new field in apexBundle, since the name property gets overridden for
the override variant that override_apex creates.

Test: m nothing
Bug: 191269918
Change-Id: If8612639bffdf91cbcab3387b0603bf5dffef1f5
2021-06-25 16:41:05 +01:00
Jiyong Park
1bc8412d37 Add platform_apis property to APEX module type
The property is used to allow non-updatable APEXes to use platform APIs
(e.g. symbols marked as "# platform-only").

Bug: 191637950
Test: m com.android.virt com.android.compos
Merged-In: Id2410b4e38a78ec2146a42298840954381a7c472
Change-Id: Id2410b4e38a78ec2146a42298840954381a7c472
(cherry picked from commit fb63625a7f)
2021-06-24 19:50:32 +09:00
Jiyong Park
9477c26f6c Add platform_apis property to APEX module type
The property is used to allow non-updatable APEXes to use platform APIs
(e.g. symbols marked as "# platform-only").

Bug: 191637950
Test: m com.android.virt com.android.compos
Merged-In: Id2410b4e38a78ec2146a42298840954381a7c472
Change-Id: Id2410b4e38a78ec2146a42298840954381a7c472
(cherry picked from commit fb63625a7f)
2021-06-24 11:28:33 +09:00
Treehugger Robot
f2d15a6921 Merge "AIDEGen: Collect dependencies info from APEX module." am: 348f20be0e am: 3ccb991a31
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1729192

Change-Id: Ie79c4757cd3e190c1bd9a03a8ee6302306fc9952
2021-06-21 07:50:24 +00:00
Treehugger Robot
348f20be0e Merge "AIDEGen: Collect dependencies info from APEX module." 2021-06-21 07:17:28 +00:00
Nikita Ioffe
5476c95e50 Merge "Set default value of generate_hashtree property to true" into sc-dev 2021-06-19 00:12:16 +00:00
Nikita Ioffe
cd3654f9fe Set default value of generate_hashtree property to true
Test: presubmit
Test: m
Bug: 190621617
Change-Id: I546730f168632c5d5d41c686853bde93a8ba7911
Merged-In: I546730f168632c5d5d41c686853bde93a8ba7911
(cherry picked from commit e261ae64e2)
2021-06-18 15:06:06 +01:00
Nikita Ioffe
3b0b1bd798 Merge "Set default value of generate_hashtree property to true" am: f932613c3f am: 59b8d28cf6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1736785

Change-Id: Ic44e048dc70adb79f94db056ad8969f656e43d1e
2021-06-18 13:43:02 +00:00
Nikita Ioffe
f932613c3f Merge "Set default value of generate_hashtree property to true" 2021-06-18 13:14:22 +00:00
Paul Duffin
5ec165d755 Create APEX variant for prebuilt_apex/apex_set
Previously, the prebuilt_apex/apex_set did not have an apex specific
variant created which meant that they depended upon the platform
variant of the modules it depended upon. This change creates an
apex variant for them just as is done for the apex module type which
causes it to depend upon the apex specific variant of the modules it
depends upon.

Test: m droid
Bug: 179354495
Merged-In: I7d6f3609c267b3e90b90b9befe7d76f351a0c2bd
Change-Id: I7d6f3609c267b3e90b90b9befe7d76f351a0c2bd
(cherry picked from commit 6717d88f46)
2021-06-18 12:02:43 +01:00
satayev
cbe33a0233 Merge "Add classpath fragment property to skip proto generation." am: f45966f35b am: 6ea9e45d9c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1738336

Change-Id: I8382015b96a37117e62735a6d5a682c3645c397f
2021-06-18 10:45:32 +00:00
satayev
b98371cc13 Add classpath fragment property to skip proto generation.
This must always be true for updatable apexes, but is not necessary
for non-updatable apexes like com.android.i18n.

In a follow up this will be used to figure out whether apex boot jars
should be bundled into platform_bootclasspath.

Bug: 191127295
Test: atest CtsClasspathsTestCases derive_classpath_test
Change-Id: Ib7dc5b057cb24955222fb97f3ff9da079f30ed77
2021-06-17 12:59:33 +01:00
Paul Duffin
dc998efc9f Merge "Create APEX variant for prebuilt_apex/apex_set" am: 2960e9bdf2 am: 70fc36a6fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1738034

Change-Id: I0cf928c7649040fe588ae8ff9d7db55f4f6c7610
2021-06-17 07:04:27 +00:00
Paul Duffin
6717d88f46 Create APEX variant for prebuilt_apex/apex_set
Previously, the prebuilt_apex/apex_set did not have an apex specific
variant created which meant that they depended upon the platform
variant of the modules it depended upon. This change creates an
apex variant for them just as is done for the apex module type which
causes it to depend upon the apex specific variant of the modules it
depends upon.

Test: m droid
Bug: 179354495
Change-Id: I7d6f3609c267b3e90b90b9befe7d76f351a0c2bd
2021-06-16 18:54:19 +01:00
Nikita Ioffe
e261ae64e2 Set default value of generate_hashtree property to true
Test: presubmit
Test: m
Bug: 190621617
Change-Id: I546730f168632c5d5d41c686853bde93a8ba7911
2021-06-16 18:15:03 +01:00
bralee
b0c1f0c45a AIDEGen: Collect dependencies info from APEX module.
Add apex dependencies.

Bug: 188004865
Test: 1. aidegen frameworks/base/apex/appsearch frameworks/base/apex/appsearch/testing   frameworks/base/services/tests/servicestests   frameworks/base/core/tests/coretests   cts/tests/appsearch   external/icing   vendor/google_testing/integration/tests/scenarios
      2. The dependency graph shows it is workable to provide the result to let IDE's [Project structure] to include the service-appsearch as source directory.
Change-Id: Ifd1548f0a86c1c73f8279e8ecea67756aeb1281e
2021-06-15 08:35:13 +08:00
Nikita Ioffe
0f02adec5e Merge "Rename test_only_no_hashtree to generate_hashtree" into sc-dev am: dce0713739
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/14920581

Change-Id: If41297bae4bff155224fe9c13d704c615fec3ac0
2021-06-10 16:27:25 +00:00
Nikita Ioffe
9d9960f240 Rename test_only_no_hashtree to generate_hashtree
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 da6dc31389)
2021-06-10 16:54:53 +01:00
Nikita Ioffe
da6dc31389 Rename test_only_no_hashtree to generate_hashtree
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
2021-06-09 19:43:46 +01:00
Martin Stjernholm
7e6cf31742 Merge "Move logic to disable flattening in unbundled app mode from Soong to make." am: 0770a175a1 am: 8f8a1abeb7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1714380

Change-Id: I7d8b1ddd5fd18468430a0b0be0686d6f365ab021
2021-05-26 19:15:59 +00:00
Martin Stjernholm
cb3ff1e412 Move logic to disable flattening in unbundled app mode from Soong to
make.

Avoids TARGET_FLATTEN_APEX lying about it, so we can trust it in
scripts, e.g. in art/build/apex/runtests.sh.

Test: banchan com.android.art; art/build/apex/runtests.sh
Bug: 179900989
Change-Id: I5361957c448e61634689968424450420479f6111
2021-05-25 00:28:27 +01:00
Martin Stjernholm
63c1912ec2 Merge "Fix indexing bug when config.Arches() returns an empty array." am: 22053dcbf2 am: 029005ee20
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1716108

Change-Id: I16798dc8a2d554c8f8562471d75227e8e807704d
2021-05-22 19:28:15 +00:00
Martin Stjernholm
df298b3bed Fix indexing bug when config.Arches() returns an empty array.
This happens when com.android.art.host is not disabled in
prebuilts/build-tools/build-prebuilts.sh.

Test: m nothing
Test: env OUT_DIR=out prebuilts/build-tools/build-prebuilts.sh
  on the aosp-build-tools branch
Bug: 188922057
Change-Id: Ib21d17bb627e4cf7faee320febe65e1bb4566d4e
2021-05-21 21:07:26 +01:00
Martin Stjernholm
f7a62e6c73 Merge changes I4e7a7ac5,I0c73361b into sc-dev
* changes:
  Record the actual APEXes that a module is part of.
  Rename InApexes -> InApexVariants
2021-05-21 19:22:15 +00:00
Paul Duffin
7555fcbab3 Store dex jar paths in bootclasspath_fragment's apex content info
Previously, the DexBootJarPathForContentModule(module) simply called
directly through to the module to retrieve the dex jar path. This
change changes it so the bootclasspath_fragment retrieves the dex
jars from the module and stores them in the info structure for this
method to retrieve directly.

This makes it easier for the bootclasspath_fragment to stop retrieving
hidden API encoded dex jars from the module and perform the encoding
itself.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Merged-In: Ic79dea080f10f4017f1a75d6d1fb5a3bfe04c2ce
Change-Id: Ic79dea080f10f4017f1a75d6d1fb5a3bfe04c2ce
(cherry picked from commit 1a8010a241)
2021-05-21 09:34:53 +01:00
Jiyong Park
59b9f14173 Record the actual APEXes that a module is part of.
Consider this case:

apex {
    name: "com.android.foo",
    native_libs: ["foo"],
}

override_apex {
    name: "com.mycompany.android.foo",
    base: "com.android.foo",
}

cc_library {
    name: "foo",
}

There are two APEXes defined: "com.android.foo" and
"com.mycompany.android.foo" which is a copy of "com.android.foo" with
some properties overridden (e.g. signing keys).

The module "foo" is mutated into two variants by the apex mutator: the
platform variant and the apex variant. The former has the variation name
"" and the later has "apex<min_api_ver>" which usually is "apex10000".

Internally, the apex variant has an alias "com.android.foo".

ApexInfo.InApexVariants() returns only "com.android.foo" when called for
the module "foo".

We can see that the information that "foo" is also part of
"com.mycompany.android.foo" is completely lost. This is causing problem
when we compare the apex membership by their "soong module name", not
the "apex name". In the example above, the two modules have different
soone module names, but have the same apex name: "com.android.foo".

To fix that, this CL introduces a new field `InApexes` to the `ApexInfo`
struct. It has the actual name of the APEXes that the module is part of.
With the example above, `InApexes` is ["com.android.foo",
"com.mycompany.android.foo"].

Cherry-picked from https://r.android.com/1710529.

Bug: 180325915
Test: m nothing
Test: m nothing on non-AOSP targets with ag/13740887 applied.

Change-Id: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e
Merged-In: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e
2021-05-20 17:36:22 +01:00
Jiyong Park
712e8b5b1b Rename InApexes -> InApexVariants
.. in preparation for the upcoming change. This change doesn't alter any
behavior.

InApexes is a misleading name. People expects that it has the list of
soong module names of the APEXes that a module is part of. So, for
example, `core-oj` is a part of both `com.android.art` and
`com.google.android.art`. However, in reality, that's not true. The
field has `com.android.art` only. This is because the two APEXes
(android and Google) have the same apex name which is `com.android.art`.
That apex name is used in various places like the `apex_available` and
allows us to keep using the same name regardless of whether the APEX is
overridden or not.

However, this is causing problems in some cases where the exact list of
soong module names is required. The upcoming change will add a new field
to handle the case and the new field actually will get the name
'InApexes'. So, the existing field is renamed to a less misleading name
`InApexVariants`.

Cherry-picked from https://r.android.com/1710528.

Bug: 180325915
Test: m nothing

Change-Id: I0c73361b452eddb812acd5ebef5dcedaab382436
Merged-In: I0c73361b452eddb812acd5ebef5dcedaab382436
2021-05-20 17:36:22 +01:00
Paul Duffin
41b91fad5b Merge "Store dex jar paths in bootclasspath_fragment's apex content info" am: bf4e6ec8a7 am: 02d4f36f2c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1710510

Change-Id: I751375cd9d4f4c40f776ceb858ecd83e992e4b04
2021-05-20 13:34:41 +00:00
Paul Duffin
bf4e6ec8a7 Merge "Store dex jar paths in bootclasspath_fragment's apex content info" 2021-05-20 12:46:48 +00:00
Jiyong Park
1df9944677 Merge changes I4e7a7ac5,I0c73361b am: 6fae608181 am: 058b7332db
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1710529

Change-Id: I45f947f67305801b2389c2dcb84b66caf997cea1
2021-05-20 10:42:10 +00:00
Paul Duffin
1a8010a241 Store dex jar paths in bootclasspath_fragment's apex content info
Previously, the DexBootJarPathForContentModule(module) simply called
directly through to the module to retrieve the dex jar path. This
change changes it so the bootclasspath_fragment retrieves the dex
jars from the module and stores them in the info structure for this
method to retrieve directly.

This makes it easier for the bootclasspath_fragment to stop retrieving
hidden API encoded dex jars from the module and perform the encoding
itself.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
Change-Id: Ic79dea080f10f4017f1a75d6d1fb5a3bfe04c2ce
2021-05-19 16:17:30 +01:00
satayev
2f45f4eec1 Add systemserverclasspath_fragments property to apex.
- All contents of the fragment are added as java_lib dependencies.
- Generated classpaths.proto is added into etc as required.

Bug: 180105615
Test: m nothing
Merged-In: I8e8e8b019c4ca2909182f205a47deffa946de6da
Change-Id: I8e8e8b019c4ca2909182f205a47deffa946de6da
(cherry picked from commit 333a1732b1)
2021-05-18 10:37:52 +01:00
satayev
72ede0fac5 Move classpaths.proto related info into a separate provider.
The new info struct can be easily shared with systemserverclasspath
fragments.

Bug: 180105615
Test: m nothing
Merged-In: I9986e64fdf19f4168da63c156de3dc9bcafac8d8
Change-Id: I9986e64fdf19f4168da63c156de3dc9bcafac8d8
(cherry picked from commit 14e49130bb)
2021-05-18 10:37:51 +01:00
Jiyong Park
78349b56a0 Record the actual APEXes that a module is part of.
Consider this case:

apex {
    name: "com.android.foo",
    native_libs: ["foo"],
}

override_apex {
    name: "com.mycompany.android.foo",
    base: "com.android.foo",
}

cc_library {
    name: "foo",
}

There are two APEXes defined: "com.android.foo" and
"com.mycompany.android.foo" which is a copy of "com.android.foo" with
some properties overridden (e.g. signing keys).

The module "foo" is mutated into two variants by the apex mutator: the
platform variant and the apex variant. The former has the variation name
"" and the later has "apex<min_api_ver>" which usually is "apex10000".

Internally, the apex variant has an alias "com.android.foo".

ApexInfo.InApexVariants() returns only "com.android.foo" when called for
the module "foo".

We can see that the information that "foo" is also part of
"com.mycompany.android.foo" is completely lost. This is causing problem
when we compare the apex membership by their "soong module name", not
the "apex name". In the example above, the two modules have different
soone module names, but have the same apex name: "com.android.foo".

To fix that, this CL introduces a new field `InApexes` to the `ApexInfo`
struct. It has the actual name of the APEXes that the module is part of.
With the example above, `InApexes` is ["com.android.foo",
"com.mycompany.android.foo"].

Bug: 180325915
Test: m nothing
Test: m nothing on non-AOSP targets with ag/13740887 applied.

Change-Id: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e
2021-05-18 16:05:29 +09:00
Jiyong Park
ab50b0795a Rename InApexes -> InApexVariants
.. in preparation for the upcoming change. This change doesn't alter any
behavior.

InApexes is a misleading name. People expects that it has the list of
soong module names of the APEXes that a module is part of. So, for
example, `core-oj` is a part of both `com.android.art` and
`com.google.android.art`. However, in reality, that's not true. The
field has `com.android.art` only. This is because the two APEXes
(android and Google) have the same apex name which is `com.android.art`.
That apex name is used in various places like the `apex_available` and
allows us to keep using the same name regardless of whether the APEX is
overridden or not.

However, this is causing problems in some cases where the exact list of
soong module names is required. The upcoming change will add a new field
to handle the case and the new field actually will get the name
'InApexes'. So, the existing field is renamed to a less misleading name
`InApexVariants`.

Bug: 180325915
Test: m nothing

Change-Id: I0c73361b452eddb812acd5ebef5dcedaab382436
2021-05-18 16:05:14 +09:00
satayev
4af127c516 Merge changes I8e8e8b01,Ifb1f54d5,I9986e64f am: f1d8819d7d am: a32917788f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1709693

Change-Id: Ia4f81dda014c3eca2355c9b5a7e6fe5d8a05fce7
2021-05-17 23:00:02 +00:00
satayev
333a1732b1 Add systemserverclasspath_fragments property to apex.
- All contents of the fragment are added as java_lib dependencies.
- Generated classpaths.proto is added into etc as required.

Bug: 180105615
Test: m nothing
Change-Id: I8e8e8b019c4ca2909182f205a47deffa946de6da
2021-05-17 21:46:08 +01:00
satayev
14e49130bb Move classpaths.proto related info into a separate provider.
The new info struct can be easily shared with systemserverclasspath
fragments.

Bug: 180105615
Test: m nothing
Change-Id: I9986e64fdf19f4168da63c156de3dc9bcafac8d8
2021-05-17 21:46:04 +01:00
Paul Duffin
b18537443e Order apex files by destination path not source path
The destination path, i.e. the path the file will occupy in the APEX is
more stable and less likely to change than the source path, i.e. the
path of the file in the out or source directories. This makes it easier
to diff changes in the copy commands.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
      - verify that this does change the order of copy_commands for the above apexes
Merged-In: Ia9ebe8418c59903cd738ee0fb9262b3f32a4ddbf
Change-Id: Ia9ebe8418c59903cd738ee0fb9262b3f32a4ddbf
(cherry picked from commit 5606029007)
2021-05-17 21:19:51 +01:00
Treehugger Robot
77ba8a2f7c Merge "Order apex files by destination path not source path" am: 37ef223972 am: 9945b3a989
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1708563

Change-Id: I7eaf6d4568e348256a02b559ebd7f16aa1fa6225
2021-05-17 04:53:48 +00:00
Paul Duffin
5606029007 Order apex files by destination path not source path
The destination path, i.e. the path the file will occupy in the APEX is
more stable and less likely to change than the source path, i.e. the
path of the file in the out or source directories. This makes it easier
to diff changes in the copy commands.

Bug: 179354495
Test: m com.android.art com.android.ipsec com.android.os.statsd com.android.conscrypt
      - verify that this does not change the contents of the apex files
      - verify that this does change the order of copy_commands for the above apexes
Change-Id: Ia9ebe8418c59903cd738ee0fb9262b3f32a4ddbf
2021-05-16 22:28:26 +01:00
Paul Duffin
b8e0b473a1 Merge "Move markPlatformAvailability mutator before apexMutator" am: c75bf688cb am: 2b7d228aac am: d7d657a5c6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705264

Change-Id: I1be6f516b354d84b7802be69044429db03fe3c20
2021-05-13 10:39:51 +00:00
Paul Duffin
c75bf688cb Merge "Move markPlatformAvailability mutator before apexMutator" 2021-05-13 09:50:56 +00:00
Paul Duffin
b964b24a51 Merge "Allow module types to force creation of a default APEX variant" am: 9896b3424b am: 05ca6f6919 am: 5c45498964
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705263

Change-Id: I4365d9d1dfbfcd8bf9aa3f6381ec9470b7ff9921
2021-05-13 09:06:26 +00:00
Paul Duffin
9896b3424b Merge "Allow module types to force creation of a default APEX variant" 2021-05-13 08:07:19 +00:00
Ivan Lozano
a072c5ae56 Merge "Refactor vendor snapshot to use LinkableInterface." am: 7ce2dee09e am: 61c475060a am: 001c11e93a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1680606

Change-Id: Ifff15886dba6bda0754d086456a1db3b7524e4ed
2021-05-12 21:13:41 +00:00
Ivan Lozano
d7586b6526 Refactor vendor snapshot to use LinkableInterface.
Refactors the vendor snapshot support to use the LinkableInterface
so that support can be extended to Rust. This CL does not add
vendor snapshot support for Rust; that is left for a follow-on CL.

Bug: 184042776
Test: m nothing
Change-Id: Id0c4970ca00053484a52677d182153cbc454c301
2021-05-12 14:01:10 -04:00
Paul Duffin
28bf7ee2ad Move markPlatformAvailability mutator before apexMutator
This will allow the apexMutator to use the NotAvailableForPlatform()
method initialized by the markPlatformAvailability mutator to help
determine whether to create a platform variant or not.

Bug: 187910671
Test: m droid
Change-Id: I745b4428afc68e7ca4cd2f4cbe810b8df1eebdb7
2021-05-12 16:41:35 +01:00
Paul Duffin
b5769c15a3 Allow module types to force creation of a default APEX variant
Bug: 187910671
Test: m droid
Change-Id: I797d4ab60d15b526744fe6e4df1b55c8b75b0310
2021-05-12 16:16:51 +01:00
Treehugger Robot
ddcf758f8c Merge "Generate empty classpaths.proto for bootclasspath_fragment.go." am: a556647c50 am: 3e51be492f am: 613e4c502a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699193

Change-Id: Ia92df6204946e3e28341cd27a75d108b657754cc
2021-05-11 13:44:08 +00:00
Treehugger Robot
a556647c50 Merge "Generate empty classpaths.proto for bootclasspath_fragment.go." 2021-05-11 12:53:23 +00:00
satayev
3db3547d1f Generate empty classpaths.proto for bootclasspath_fragment.go.
- Adds all required details for bootclasspath_fragment to implement
  classpath_fragment.
- Keeps the actual boot jars in platform-bootclasspath to begin with.
- Makes sure to put the file in apex/etc/classpath on device. Note that
  for platform versions of classpath fragment AndroidMkEntries perform
  the installation, while for APEXes it must be plumbed via apex.go.

Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: I6101ebdf5b8bcbe95c0b7ce21f3f67a2685aef50
2021-05-11 10:34:47 +01:00
Paul Duffin
909dc2222a Merge "Move creation of deapexer modules to separate mutator" am: b60def6def am: c9b695b6d7 am: 366800572f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697057

Change-Id: I2aa8dec28f1ac5b8e123d099a167c8e1562e16d6
2021-05-10 15:19:11 +00:00
Paul Duffin
5dda3e387e Move creation of deapexer modules to separate mutator
Previously, deapexer modules were created by the LoadHook which meant
that the deapexer module could not use any information derived from the
dependencies of the prebuilt_apex/apex_set modules. This change moves
the creation into a separate mutator that runs after
ComponentDepsMutator and before DepsMutator. That means that a follow
up change can use information from dependencies added by the former
mutator in order to create the deapexer module and the deapexer module
can itself add dependencies onto other modules.

This change also dedups the logic to determine whether a deapexer
module is needed by pushing it down into the createDeapexerModule
method which was renamed to createDeapexerModuleIfNeeded to reflect its
conditional nature.

Bug: 187266082
Test: m nothing
      m SOONG_CONFIG_art_module_source_build=false nothing
Change-Id: I65316473ff1e4b2827ff48ab5a870a8ce5c0475a
2021-05-10 11:41:40 +01:00
Steven Moreland
2c4000c7a6 apex: remove use_vendor
Should manually cut dependencies instead. Previously, this was used to
take advantage of the limited dependencies of variant libs in some APEXes.

Fixes: 175318864
Test: m nothing
Change-Id: Id559fd1bea5c8b8696cf7ab8acc711a7c3844d14
2021-04-27 02:08:49 +00:00
Paul Duffin
3f81c1c71c Merge "Delegate retrieval of dex boot jar for apex to the bootclasspath_fragment" am: 46e4a9e6b1 am: 8745a28532 am: d905f6818a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686218

Change-Id: Ifea7de140ee9c69cd6afe85bbc1dfab24e446160
2021-04-26 17:04:45 +00:00
Paul Duffin
d2ffb9f670 Merge "Extract bootclasspathFragment related code into separate functions" am: 9768678344 am: c73637a975 am: b1c2ea3c70
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686217

Change-Id: Ie1063fe890d284a561ea8a1c1d62156aa42105d1
2021-04-26 17:04:41 +00:00
Paul Duffin
3a351c3dbe Merge "Rename BootImageInfo to BootclasspathFragmentApexContentInfo" am: 71c84696f9 am: 8067ee44b3 am: 9e55ae0bd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686216

Change-Id: I2a559dbb5dc14cfcf52407e371a0e628ac693634
2021-04-26 17:04:27 +00:00
Paul Duffin
190fdef294 Delegate retrieval of dex boot jar for apex to the bootclasspath_fragment
The dex boot jar for the apex must have had hidden API flags encoded
into it. Currently, the hidden API processing is done within the java
modules themselves so the apex gets the dex boot jar from them.

However, as part of the hidden API modularization work the hidden API
encoding will be performed by the bootclasspath_fragment so this change
prepares for that by delegating the retrieval of the dex boot jars to
the bootclasspath_fragment, via BootclasspathFragmentApexContentInfo.

For the moment that simply delegates straight back to the java module
so this change does not change the build. It will however make it
easier to switch hidden API encoding to the bootclasspath_fragment in
future.

Bug: 179354495
Test: m com.android.art
      - verify that this change does not change its contents
Change-Id: I12eba333749be976bcc72661bb9d6be6cc3c56e3
2021-04-26 11:09:25 +01:00
Paul Duffin
cc33ec8838 Extract bootclasspathFragment related code into separate functions
The apexBundle.GenerateAndroidBuildActions is 400+ lines long which
makes it difficult to understand what is happening.

Bug: 177892522
Test: m com.android.art
      - verify that this change does not change its contents
Change-Id: I07cb31d246377869771bdb18fdc6291365adf399
2021-04-26 11:09:02 +01:00
Paul Duffin
e946b327f4 Rename BootImageInfo to BootclasspathFragmentApexContentInfo
Currently, it only contains ART boot image related information, i.e.
.art, .oat and .vdex files. However, follow up changes will extend that
to include other information from bootclasspath_fragment.

Bug: 177892522
Test: m nothing
Change-Id: I2b226131c0eccff0c739a18f265f90caa10a91d9
2021-04-26 10:05:27 +01:00
Paul Duffin
94993d5ce5 Rename BootImageModule to BootclasspathFragmentModule am: 7771eba88e am: 687425b0af am: 30b9c47cb7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1685589

Change-Id: I1898516696beb6049ee1467832455dc1bfdab6f2
2021-04-23 18:57:27 +00:00
Paul Duffin
7771eba88e Rename BootImageModule to BootclasspathFragmentModule
Also renames files, tests, module types in a similar fashion.

There are still some references to image and boot image. They are kept
for the following reasons:
* image_name - this is the name of an ART boot image, i.e. the
  collection of .art/.oat/.vdex files.
* BootImageInfo - again this is related to the ART boot image.
* .../art_boot_images/... paths - ditto.

Bug: 177892522
Test: m nothing
Change-Id: Ie1f4738061d131fee75de48bc26a7601481bad4d
2021-04-23 16:59:26 +01:00
Jaewoong Jung
78ec488af0 Merge "Make apex.key and certificate overridable." am: 6a328ff8ac am: 78939b2bc6 am: e3f8cfe47e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682218

Change-Id: I81a07e4acd1bbc29413996d3f3b22f3050fd08f9
2021-04-22 16:18:13 +00:00
Jaewoong Jung
6a328ff8ac Merge "Make apex.key and certificate overridable." 2021-04-22 15:37:22 +00:00
Paul Duffin
677de9427b Merge changes I67589bcc,Ibcfae390 am: 7cbdf81e95 am: 33f495f305 am: 13b9d25ed4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683868

Change-Id: Idb4d7af1bf9914bf7bf0306d04daf74ee992fc5e
2021-04-22 15:05:03 +00:00
Paul Duffin
6589805e2a bootclasspath_fragment must only depend on source contents
This change ensures that bootclasspath_fragment only depends on source
modules and prebuilt_bootclasspath_fragment only depends on prebuilt
modules.

It does that in two ways:
1. It adds the dependencies in ComponentDepsMutator method which is
   called before any renaming of prebuilts is done which makes it very
   easy to add a dependency directly onto either the source or prebuilt
   as required.
2. It uses a tag which prevents dependencies on a source module from
   being replaced with a dependency on a prebuilt module which ensures
   that a dependency on the source modules is not replaced with a
   dependency on a prebuilt module.

Bug: 177892522
Test: m nothing
Change-Id: Ibcfae39083afbc07fcf729ead3ed5f5d020845bf
2021-04-21 19:05:37 +01:00
Paul Duffin
b5cbdbb7c0 Merge "Remove unused boot_images property and rename tag" am: d353f20179 am: 0d5f158d87 am: 714ecad749
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1679776

Change-Id: I781c934d5ab43da00bb956ab8b4f45c11ae71bf9
2021-04-20 23:54:04 +00:00
Jaewoong Jung
4cfdf7de26 Make apex.key and certificate overridable.
Test: apex_test.go
Fixes: 185477325
Change-Id: I8992ac5606fa92f53f07e6870a034f2d3352e618
2021-04-20 16:21:24 -07:00
Paul Duffin
94f1963b6d Remove unused boot_images property and rename tag
Bug: 177892522
Test: m nothing
Change-Id: I9ffd6dda23aefea183f87e22497c17fb8a276ece
2021-04-20 14:46:08 +01:00
Jiyong Park
cc7628c5fa Merge changes Ib07d4410,I0b306292 am: 7b4fb51919 am: 24f37728ee am: 08956ce9b5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675766

Change-Id: If2a5d89e4e51b6a8813daf082a910f2dea91f604
2021-04-16 00:27:39 +00:00
Jiyong Park
4eab21d5a2 ApexInfo doesn't pass MinSdkVersion as string, but as ApiLevel
ApexInfo is not part of the properties struct. It can handle structs
having private fields.

Bug: 1663140
Test: m
Change-Id: Ib07d4410f0ce187c9de347da34b84b814b2eb537
2021-04-15 15:17:54 +09:00
Jiyong Park
f398995a64 Merge "SdkSpec is fully using ApiLevel" 2021-04-14 13:27:05 +00:00
Jiyong Park
dbd710c426 SdkSpec is fully using ApiLevel
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-12 13:46:21 +09:00
Jiyong Park
46e02a3f26 Merge "Shared lib dependencies from rlib are included in APEX" am: a417f881bd am: ced4152db6 am: e1525dc164
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1669725

Change-Id: I91fcc6ffe4f618e45f9ae1cc4f56318cce0d5415
2021-04-09 01:28:36 +00:00
Jiyong Park
94e22fd35e Shared lib dependencies from rlib are included in APEX
This change fixes a bug that shared lib dependencies of an rlib is not
installed to the APEX even when the rlib is part of the APEX.

Bug: N/A
Test: m
Change-Id: I88fe461584499839d8018d6b4292374592e7562b
2021-04-08 18:20:39 +09:00
Jiyong Park
9231537fe2 SdkSpec is fully using ApiLevel
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-08 11:27:24 +09:00
Ryan Prichard
a467ea4870 Merge "Remove libgcc toolchain libs for Android" am: 3f3bb83f81 am: f72c6f2e44 am: a5934e3408
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1663859

Change-Id: Ia4b0f7de3bac88ab90a3ca0a6dd647117275aa7c
2021-04-07 00:15:50 +00:00
Ryan Prichard
3f3bb83f81 Merge "Remove libgcc toolchain libs for Android" 2021-04-06 21:43:33 +00:00