Commit Graph

96 Commits

Author SHA1 Message Date
Paul Duffin
193c594c05 Merge "Allow permission to be treated as optional at build time" am: 855f323a68
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2151273

Change-Id: I6c3f7e74cb8f0d3248006e536536ae8b0771979b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-13 14:13:21 +00:00
Paul Duffin
db8df6a21a Allow permission to be treated as optional at build time
Although Permission is not an optional module on GMS capable devices it
is optional for non-GMS capable devices and so needs to support being
treated as optional at build time. Which means that an OEM needs to be
able to choose whether to use the prebuilt Permission module or build
their own module from source.

This is safe even though permission is not an optional mainline
module because devices that support mainline must pass GTS and
testModulesSignedCorrectly and testModulesPreloadedCorrectly in GTS
currently tests this, along with testMainlineApprovedTrain which checks
mandatory/optional, signing keys, and if what's preloaded are part of
approved trains.

Bug: 238175656
Test: packages/modules/common/build/mainline_modules_sdks.sh
      # Check that permission sdk snapshot uses a permission specific
      # Soong config variable.
Change-Id: I8278622fedbba0292f7cab1114170394cf429849
2022-07-12 16:31:02 +00:00
William Escande
637c7ce91b Change Bluetooth apex mountpoint am: 358806ae4c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/common/+/19038607

Change-Id: I5f02e57f20081740d39dd70604b626ee150503f6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-23 10:33:36 +00:00
William Escande
358806ae4c Change Bluetooth apex mountpoint
Apex name has been changed to com.android.btservices
Changing mount point accordingly
Bug: 235892590
Test: Flash / boot bt / look logs & pair a device
Ignore-AOSP-First: Apex name change not propagate to AOSP yet
Change-Id: Ie8d4c73d9601d36e1ae8f74f9bdf791e8c1e42da
2022-06-22 21:53:22 +00:00
Gurpreet Singh
e30f4d231f Merge "Generating api diff files for each module sdk." am: 6e31252b35 am: 67a4838ca0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2120161

Change-Id: I1ab37adbc23f2721e5fcbd35a11b00a69ca813bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 17:16:11 +00:00
Gurpreet Singh
6e31252b35 Merge "Generating api diff files for each module sdk." 2022-06-14 12:54:26 +00:00
Paul Duffin
da980b1dad Add bluetooth and uwb as optional modules am: 350760127f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/common/+/18839975

Change-Id: I2e8057b6b3fb8f66f597203a8be4b12fb23f2a55
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 15:30:16 +00:00
Paul Duffin
350760127f Add bluetooth and uwb as optional modules
Bug: 233965247
Test: packages/modules/common/build/mainline_modules_sdks.sh
      # Check the output to ensure that uwb/bluetooth uses the
      # module specific  Soong config.
      # Unpack the bluetooth/uwb snapshots into prebuilts/module_sdk/...
      m nothing
Ignore-AOSP-First: Bluetooth and uwb are not present in AOSP
Change-Id: I09c7b2ef95f941e61eba933b4e9b3625c01adfeb
2022-06-13 12:55:00 +00:00
Gurpreet Singh
a61770fed2 Generating api diff files for each module sdk.
In order to detect the addition of any new APIs in any mainline module,
an API diff file (current module sdk vs the last finalized module sdk)
needs to be generated correpsonding to each module sdk.

This CL generates the API diff files corresponding to each module sdk
and copy that to the out/dist directory.

This CL also contains the tests to verify the generation of api diff
files.

Bug: 230609867
Test: builds successfully. Generates API diff files for each module sdk
"atest mainline_modules_sdks_test" passes.

Change-Id: I1d8276a4054b92490ccca3dae36c48c639925f46
2022-06-10 14:55:28 +00:00
Paul Duffin
f6a01d24d6 Optional modules need a module specific soong config variable am: d20edd6c69 am: 8a3d8102d0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2120157

Change-Id: Ie26230b142fcc02fa514ffcd17217e940330c5ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 20:11:02 +00:00
Paul Duffin
e75e7c57e7 Optional modules need a module specific soong config variable
Optional modules, i.e. those modules which may be provided by Google or
vendors depending on the vendor, need to have its own Soong config
variable that controls whether prebuilts are used or not. Without that
the build will always attempt to use the Google prebuilt module instead
of the vendor provided module.

This change:
1. Adds support for specifying which modules are optional and will
   generate a module specific soong_config_module_type that uses a
   module specific Soong config variable.

2. Generates the soong_config_module_type for optional modules inline
   in the snapshot Android.bp file (instead of importing from a
   manually curated definitions files). That simplifies the cost of
   adding optional modules.

3. Adds some extra tests to ensure that S and Tiramisu behave the
   same way.

Bug: 233965247
Test: atest mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      # Check the output to ensure that wifi uses the wifi specific
      # Soong config but ipsec (as a non-optional module) does not.
      # Unpack the wifi snapshot into prebuilts/module_sdk/Wifi
Change-Id: I6a85b6f9877fc251010ff2bbee75fe8fa99db9b4
(cherry picked from commit d20edd6c69)
Merged-In: I6a85b6f9877fc251010ff2bbee75fe8fa99db9b4
2022-06-09 19:08:18 +00:00
Paul Duffin
a826b9c7b0 Revert "Generate soong_config_module_type inline in the snapshot" am: e363782a5c am: b8132b4af7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2120162

Change-Id: I58397406391d1bec668a3fcf9c8bfc5add501501
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 17:23:55 +00:00
Paul Duffin
d20edd6c69 Optional modules need a module specific soong config variable
Optional modules, i.e. those modules which may be provided by Google or
vendors depending on the vendor, need to have its own Soong config
variable that controls whether prebuilts are used or not. Without that
the build will always attempt to use the Google prebuilt module instead
of the vendor provided module.

This change:
1. Adds support for specifying which modules are optional and will
   generate a module specific soong_config_module_type that uses a
   module specific Soong config variable.

2. Generates the soong_config_module_type for optional modules inline
   in the snapshot Android.bp file (instead of importing from a
   manually curated definitions files). That simplifies the cost of
   adding optional modules.

3. Adds some extra tests to ensure that S and Tiramisu behave the
   same way.

Bug: 233965247
Test: atest mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      # Check the output to ensure that wifi uses the wifi specific
      # Soong config but ipsec (as a non-optional module) does not.
      # Unpack the wifi snapshot into prebuilts/module_sdk/Wifi
Change-Id: I6a85b6f9877fc251010ff2bbee75fe8fa99db9b4
2022-06-09 16:32:33 +00:00
Paul Duffin
edf94011ac Generate soong_config_module_type inline in the snapshot am: d29f8e0597 am: cb49a23528
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2120156

Change-Id: I6cf80cf139d89aab6bffef554ab2460cfa6258da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 15:11:33 +00:00
Paul Duffin
e363782a5c Revert "Generate soong_config_module_type inline in the snapshot"
This reverts commit d29f8e0597.

Although I tested this well using unit tests they don't test 
everything and although I tested the unpacking of some snapshots I did
not test what happens when all the ART sdk/module_exports
snapshots are unpacked. I just did and the build broke.

The build broke because while the soong_config_module_type modules are
marked as being Nameless (and so according to the documentation do not
have to have unique names) it turns out that is not true.

There is at least one place in the build where the names of Nameless
modules are checked and as a result this breaks.

I could fix the build breakage reasonably easily but the problem is 
that I would have to apply that fix on all partners otherwise they
wouldn't be able to receive the next set of snapshots which is too 
high a cost.

So, I am reverting this and will limit the use of inline 
soong_config_module_type modules to optional modules.

Reason for revert: Breaks the build when snapshots are unpacked.

Bug: 233965247
Change-Id: I1faae863c48f1fbfd49d2545f242401bdd4f8f8a
2022-06-09 14:58:54 +00:00
Paul Duffin
d29f8e0597 Generate soong_config_module_type inline in the snapshot
Previously, this imported the soong_config_module_type definitions from
a manually curated file. That had a couple of problems:
1. It required that the file be manually updated everytime that a new
   module_type was added to an sdk snapshot controlled by a specific
   config variable.
2. Adding a new config variable required creating another file to be
   manually curated.
3. It made a snapshot that was generated for an earlier release
   dependent on an additional file from that release which was in a
   separate repository and would require a lot of extra work to update
   if necessary.

This change generates the soong_config_module_type inline in the
snapshot Android.bp file and while it makes it slightly bigger and does
duplicate some of these definitions in snapshots that use the same
config variable it makes each snapshot much more self contained and
makes it easier to add module specific config variables.

The latter is the main driver for this change as follow up changes will
add module specific variables for the optional modules.

Bug: 233965247
Test: atest mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      # Compare before and after to make sure that they are
      # consistent.
Change-Id: Ie6b6d99e1fcb17ebd8ed291a5bc7d4664fceea92
2022-06-09 11:29:01 +00:00
Gurpreet Singh
d3ebbc6402 Fix build_release comparison condition. am: 2c7c723d38 am: d9b1189262
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2120152

Change-Id: If88d20c5be2b6f8139b931c9c5818d621be68853
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 20:15:00 +00:00
Gurpreet Singh
7bb8870a6e Build scope targets corresponding to each module sdk. am: 571ce869cc am: 6225526452
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2102113

Change-Id: I4ab6a68da4b3b9d6a8b46b64a1f1962907289a7b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 18:17:37 +00:00
Gurpreet Singh
2c7c723d38 Fix build_release comparison condition.
The build_release needs to be compared instead of build_release.name.

Bug: 230609867
Test: builds successfully.
Change-Id: I1610dbfbeec9bd1a3c6c0b45fe6ec87d2091749f
2022-06-08 17:27:17 +00:00
Gurpreet Singh
0c8b8a8d9d Formatting fix. am: 1ce8f0edaf am: d617385e76
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2119230

Change-Id: I5ebd900b1ca47d0885158156bd31883b85fb8e75
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 15:37:11 +00:00
Gurpreet Singh
571ce869cc Build scope targets corresponding to each module sdk.
In order to detect the addition of any new APIs in any mainline module,
an API diff file (current module sdk vs the last finalized module sdk)
needs to be generated correpsonding to each module sdk.

To obtain the list of APIs in the last finalized module sdk, the latest
build targets correpsonding to each scope of each module sdk are
obtained and needs to be built.

This CL is fetching all the module sdk scope targets from the .info
file corresponding to each module sdk file and then building all those
targets.

This CL is also adding changes to the test file
mainline_modules_sdks_test.py to mock the generation of module sdk
snapshot info files and the latest api text files for module sdk
scope targets.

The follow up CLs will generate the API diff files corresponding to
each module sdk and copy that to the out/dist directory. And will
also contain the tests to verify the generation of api diff files.

Bug: 230609867
Test: build packages/modules/common/build/mainline_modules_sdks.py
successfully and builds all the scope targets for each module sdk.
"atest mainline_modules_sdks_test" passes

Change-Id: I9e0c08d3a8bbf60e9b5cb61389c155948c4c171e
2022-06-08 15:11:37 +00:00
Treehugger Robot
ea8654fe76 Merge "Code refactoring to build targets in a separate method." am: c21ce9240c am: 6bc7c406f4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2119227

Change-Id: I840fea1c4d191763c81ffa5a5dc96d2e289bc196
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 14:28:22 +00:00
Gurpreet Singh
1ce8f0edaf Formatting fix.
Fixed the formatting.

Bug: 230609867
Test: code is building successfully.
Change-Id: Ie91d92e89a0914d079c73ffb4f0bbbb90749313e
2022-06-08 13:38:56 +00:00
Gurpreet Singh
d7a929c3e2 Code refactoring to build targets in a separate method.
The build_snapshot method is creating a list of targets and building
them by calling soong.
The code sets some environment variables and builds the targets. This
code can be made reusable by putting it into a separate method and
passing the list of targets to be built. This will avoid code
redundancy.

Bug: 230609867
Test: The code builds on the intellij and successfully builds all the
targets passed to this newly added method.

Change-Id: I22566ca438b2da0cf832416466f4e3affb1c976e
2022-06-08 12:05:00 +00:00
Paul Duffin
869ad7eeb0 Merge "mainline_modules_sdks: Remove legacy build support" am: 310b9f3650 am: 565d719aaf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2095744

Change-Id: I7b400e70eb862609055b4d99ccaedb245130818e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-13 16:41:04 +00:00
Paul Duffin
310b9f3650 Merge "mainline_modules_sdks: Remove legacy build support" 2022-05-13 15:39:52 +00:00
Paul Duffin
d3cceec723 Make first_release required
(cherry picked from commit 33e9399445)

Defaulting the first_release to LATEST is dangerous because it is easy
to forget and any module that does not provide it will not be built for
a release specific build.

Adds Tiramisu for the mainline modules that were missing it and
defaults it to LATEST for BundledMainlineModules as they don't need to
be built for a previous release.

Bug: 228807460
Test: packages/modules/common/build/mainline_modules_sdks.py
Merged-In: I151773f80e37a6dd7de7b6df9cfa3f0a624d38f4
Change-Id: I151773f80e37a6dd7de7b6df9cfa3f0a624d38f4
2022-05-12 15:13:00 +00:00
Paul Duffin
33e9399445 Make first_release required
Defaulting the first_release to LATEST is dangerous because it is easy
to forget and any module that does not provide it will not be built for
a release specific build.

Adds Tiramisu for the mainline modules that were missing it and
defaults it to LATEST for BundledMainlineModules as they don't need to
be built for a previous release.

Ignore-AOSP-First: tm-dev does not merge from AOSP.

Bug: 228807460
Test: packages/modules/common/build/mainline_modules_sdks.py
Change-Id: I151773f80e37a6dd7de7b6df9cfa3f0a624d38f4
2022-05-12 15:12:26 +00:00
Paul Duffin
d268f7f22c mainline_modules_sdks: Remove legacy build support
This change will stop building the following directories:
* mainline-sdks/current
* stubs

Bug: 204763318
Test: packages/modules/common/build/mainline_modules_sdks.sh
Change-Id: I9ed17ff472bfd36d1b5baa365ba33b9e2e283412
2022-05-11 15:59:03 +00:00
Roopa Sattiraju
881b94ad91 Adding bluetooth to mainline_modules_sdks.py
Bug: 231582349
Test: m
Ignore-AOSP-First: BT apex is not present on AOSP yet
Change-Id: I4b8a5a3c23e9d6a8c006234c31581a6e79db9063
2022-05-10 23:14:39 +00:00
Alexander Dorokhine
c7a5e53509 Add AppSearch to mainline_modules_sdks.py.
Bug: 228981572
Test: Presubmit
Ignore-AOSP-First: Merge conflict if submitted in AOSP
Change-Id: Iac4d4c6afee3f170416a94c95b082871dd2abaf1
2022-04-13 18:09:27 -07:00
Paul Duffin
e029d7cc08 Merge "Copy the out/soong/build_number.txt file into sdk snapshots for R" am: b1e623fd6d am: 1332595b84
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2056031

Change-Id: I612df016b6c9e03ee6aa49a34ed52f3d99ab35c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 17:23:54 +00:00
Paul Duffin
1332595b84 Merge "Copy the out/soong/build_number.txt file into sdk snapshots for R" am: b1e623fd6d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2056031

Change-Id: I895a3516b2774e98edf4d3818961b8fc9a21aeb0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07 17:01:29 +00:00
Paul Duffin
4899f98a91 Copy the out/soong/build_number.txt file into sdk snapshots for R
This change adds the build_number.txt file into the sdk snapshot for R
to make it easier to debug issues arising in partner builds caused by
the snapshots.

The file is added to the root of the snapshot and is called:
    snapshot-creation-build-number.txt

Bug: 201295663
Test: atest --host mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh --build-release=R
      # Check the contents of various snapshots.
Change-Id: I6cabf16754c73fc87ee4e9d00bf6ddb8349809f1
2022-04-06 15:03:42 +00:00
Paul Duffin
94deeded84 mainline_modules_sdks.py: Optimize snapshot build order am: b3805c1d35 am: 249b1dcf6f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2047367

Change-Id: I6bca60d80ae05c92ce9b1c08b2ec79471e0e1915
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 18:05:56 +00:00
Paul Duffin
19afde65a1 mainline_modules_sdks.py: Fix issues with r snapshot am: fa90e1e5e0 am: 11c3bd80e0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2047364

Change-Id: I18b314bfdfde88c2fae89ceb9eb24af9e9418b71
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 18:05:40 +00:00
Paul Duffin
c44a9cd835 mainline_modules_sdks.py: Reformat am: 2ef33a4d65 am: 7a561d6ed1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2047365

Change-Id: Ibcb8e6da32de018eeeb3fd052eac48360ada1cbe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 18:05:31 +00:00
Paul Duffin
249b1dcf6f mainline_modules_sdks.py: Optimize snapshot build order am: b3805c1d35
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2047367

Change-Id: I46b8bea13ccaa1a72f1031f6c6c503b984753f24
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 17:47:12 +00:00
Paul Duffin
11c3bd80e0 mainline_modules_sdks.py: Fix issues with r snapshot am: fa90e1e5e0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2047364

Change-Id: Ibc188124362c2a2bbb026512cf234c7a7231e3e0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 17:46:55 +00:00
Paul Duffin
7a561d6ed1 mainline_modules_sdks.py: Reformat am: 2ef33a4d65
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2047365

Change-Id: I0fa0e0d947aee5959058539e0f2d907eaed4f522
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 17:46:46 +00:00
Paul Duffin
b3805c1d35 mainline_modules_sdks.py: Optimize snapshot build order
Previously, the snapshots would be built in the order in which the
build releases were defined. This change groups the snapshots with the
same build environment and builds them in sequence in order to minimize
the regeneration of the ninja files.

The test revealed that the produce_bundled_dist_for_build_release
method would call build_snapshots even if there were no bundled
snapshots needed which was a waste so that was also optimized as part
of this change.

Test: atest --host mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      pyformat -s 4 --force_quote_type double -i build/mainline_modules_sdks*.py
      /usr/bin/pylint --rcfile $ANDROID_BUILD_TOP/tools/repohooks/tools/pylintrc build/mainline_modules_sdks*.py
Change-Id: I5bb8d864a50318b4b5390a8e5a3601aa33c18fef
2022-03-30 09:44:03 +00:00
Paul Duffin
fa90e1e5e0 mainline_modules_sdks.py: Fix issues with r snapshot
Moves the generated Android.bp file from the root of the snapshot zip
file into the sdk_library/ sub-directory to allow the zip to be
unpacked in a directory that already contains an Android.bp file that
defines the apex_set for the corresponding APEX.

Also, removes the stubs_src property from the generated Android.bp
file.

Bug: 218685706
Test: packages/modules/common/build/mainline_modules_sdks.sh --build-release=R
      atest --host mainline_modules_sdks_test
      # deleted vendor/unbundled_google/modules/IpSecGooglePrebuilt from rvc-dev checkout.
      # unpacked out/soong/mainline-sdks/for-R-build/ipsec-module-sdk-current.zip
      # ran "m nothing"
Change-Id: I03e2060dc06338a8d0102744f79c75d33d567a17
2022-03-30 09:44:02 +00:00
Paul Duffin
2ef33a4d65 mainline_modules_sdks.py: Reformat
Test: atest --host mainline_modules_sdks_test
      pyformat -s 4 --force_quote_type double -i build/mainline_modules_sdks*.py
      /usr/bin/pylint --rcfile $ANDROID_BUILD_TOP/tools/repohooks/tools/pylintrc build/mainline_modules_sdks*.py
Change-Id: I7f7b5f6e41c6a8cec02ec547a9b61c7922700880
2022-03-30 09:44:02 +00:00
Martin Stjernholm
7b5e3a6031 Merge changes I8bc68d10,Ie6182fa4 am: 8fa5ddae14 am: b3f8ed74cb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2046463

Change-Id: I8aa82d1940f989c98a4e8b2d59d6a393dc87a5a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-29 10:31:19 +00:00
Martin Stjernholm
b3f8ed74cb Merge changes I8bc68d10,Ie6182fa4 am: 8fa5ddae14
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2046463

Change-Id: Ia46c9466fdd242f69bec23b39006e09d82eeaa3e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-29 09:59:26 +00:00
Martin Stjernholm
576e65c512 Add support for building SDKs for bundled modules and platform SDKs for
Mainline.

These are used in the ART thin manifest. They are added here to allow
using the common module build scripts for them as well.

The Python script is extended to work for these modules, and their SDKs
end up in DIST_DIR/bundled-mainline-sdks, so DIST_DIR/mainline-sdks
only carries the SDKs for unbundled modules that are to be distributed
to partners etc.

This change has the effect to (re)enable building these SDKs in CI.

Test: env TARGET_BUILD_APPS="com.android.i18n com.android.runtime com.android.tzdata" \
        packages/modules/common/build/mainline_modules_sdks.sh \
        --build-platform-sdks-for-mainline --build-release=latest
  Replace SDK snapshots under prebuilts/runtime/mainline with
  those produced in out/dist/bundled-mainline-sdks
  in a master-art tree, with https://r.android.com/2046463 applied,
  then `banchan com.android.art && m`
Test: env -u TARGET_BUILD_APPS \
        packages/modules/common/build/mainline_modules_sdks.sh \
        --build-release=latest
  Check that all SDKs are built, and that the bundled SDKs get copied
  to out/dist/bundled-mainline-sdks so the contents of
  out/dist/mainline-sdks and out/dist/stubs remain unchanged.
Test: env -u TARGET_BUILD_APPS \
        packages/modules/common/build/mainline_modules_sdks.sh \
        --build-release=S
  Check that out/dist/bundled-mainline-sdks isn't producted.
Test: env -u TARGET_BUILD_APPS \
        vendor/google/build/mainline_modules_sdks.sh
  Check that all SDKs are built, and that the bundled SDKs get copied
  to out/dist/bundled-mainline-sdks so the contents of
  out/dist/mainline-sdks and out/dist/stubs remain unchanged.
Test: atest --host mainline_modules_sdks_test
Bug: 216762037
Change-Id: Ie6182fa42dc9c2c7f35ed95a040c05be0f0e878a
2022-03-28 12:30:46 +01:00
Paul Duffin
85771027a8 Generate sdk snapshots for the R build am: ffa89fd0a0 am: a1f299e3ab
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032133

Change-Id: Idb9e1c7a4347eb1877e5d979c03f7fb01381d742
2022-03-24 16:45:50 +00:00
Paul Duffin
a1f299e3ab Generate sdk snapshots for the R build am: ffa89fd0a0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032133

Change-Id: Ib62d90c195a606d33457d68ec44a304324e542f9
2022-03-24 15:57:24 +00:00
Paul Duffin
ffa89fd0a0 Generate sdk snapshots for the R build
This change replicates the behavior of the generate_ml_bundle.sh that
creates an Android.bp file along with the necessary file structure for
an R build.

It adds the information needed to a ForRBuild object which is set on
those MainlineModules that need to provide SDKs for R. That includes
a list of SdkLibrary objects each of which has a name and a flag that
indicates whether it is a shared library.

The R BuildRelease creator function builds the sdk snapshots as normal
and then extracts information from those snapshot files to construct
snapshots suitable for an R build. It then passes the directory
containing those new snapshot files to populate_dist() which will then
copy them into the correct location in the dist directory.

For each MainlineModule that provides an SDK for R the following is
created in the out/soong/mainline-sdks/for-R-build directory:
* A sub-directory using the apex name containing:
 * An Android.bp file with definitions for each SdkLibrary.
 * A file structure containing API txt file, removed API txt file,
   a srcjar containing the stub sources and a stubs jar.
* A zip file containing the contents of the previous directory whose
  name is <sdk-name>-current.zip, to match the files that are
  generated by Soong when building sdk snapshots.

As R does not support the Soong config boilerplate code that
transformation is disabled for R.

Test: atest --host mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      pyformat -s 4 --force_quote_type double -i build/mainline_modules_sdks*.py
      /usr/bin/pylint --rcfile $ANDROID_BUILD_TOP/tools/repohooks/tools/pylintrc build/mainline_modules_sdks*.py
Change-Id: I70001782496a3e9805bf56181c0e08419e31e191
2022-03-23 15:45:15 +00:00
Paul Duffin
45f7051eff Merge "Decouple population of the dist dir from the SnapshotBuilder" am: 726f9ab1bf am: 6e6569d1ab
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032132

Change-Id: Iedcf4cb032dcaa398df49577fc3bacaed7446ba7
2022-03-23 10:07:37 +00:00