Commit Graph

175 Commits

Author SHA1 Message Date
Gurpreet Singh
2677fdad04 Revert "Use fixed timestamps before performing api diff operation." am: 28a0ee3240
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2265384

Change-Id: I174120c09a6dcc467d519d00c54a23b602393daa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-21 13:43:49 +00:00
Gurpreet Singh
71883fca02 Remove timestamps from api diff files by using labels.
The api diff files contain the timestamp of files which are being
diffed. This results in different diffs getting generated everytime
even if all the APIs are the same.
In order to generate same diffs, timestamps have been removed by
using the label flag while performing the diff operation.

Bug: 238757360
Test: The builds passed and the api diff files does not contain
timestamps.

Change-Id: If894f5a6632542b566eb0657d22d4c4b2f6afa83
2022-10-21 13:14:49 +00:00
Gurpreet Singh
28a0ee3240 Revert "Use fixed timestamps before performing api diff operation."
This reverts commit a772ee4cb1.

Reason for revert: The timestamps can be completely avoid by using labels instead.

Change-Id: If72a9e8aba6209ebe81d11cae1ed6defb43d6079
2022-10-21 11:13:29 +00:00
Amos Bianchi
678a907829 Add Device Lock module.
Bug: b/241442337
Test: service successfully starts
Test: atest DeviceLockUnitTests
Test: cts-tradefed run cts -m CtsDeviceLockTestCases
Ignore-AOSP-First: Module for U, developed internally

Change-Id: I445cadcabf70381b08b499c4360967c54faeacff
2022-10-20 20:17:53 -07:00
Gurpreet Singh
95d56c8e3c Use fixed timestamps before performing api diff operation. am: a772ee4cb1 am: f35a4eb4ad
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2259607

Change-Id: Ic789ecd9145e543a2b713494d306babe093adf0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-19 20:48:04 +00:00
Gurpreet Singh
f35a4eb4ad Use fixed timestamps before performing api diff operation. am: a772ee4cb1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2259607

Change-Id: Ie2271f9e70bb711e598243c482f23f5683c573bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-19 20:16:04 +00:00
Gurpreet Singh
a772ee4cb1 Use fixed timestamps before performing api diff operation.
The api diff files contain the timestamp of files which are being
diffed. This results in different diffs getting generated everytime
even if all the APIs are the same.
In order to generate same diffs, fixed timestamps are assigned to the
files being diffed before the diff operation.

Bug: 238757360
Test: The builds passed and the api diff files contain the fixed
timestamps.

Change-Id: I89f88aa709b5a7a7f52d610b2f8ddf501712e529
2022-10-19 15:25:49 +00:00
Anna Zhuravleva
84c610bbfa Add HealthConnect to mainline_modules_sdks.py
Ignore-AOSP-First: The module is not in AOSP yet
Bug: 251393380
Test: TARGET_BUILD_APPS=com.android.healthconnect
packages/modules/common/build/mainline_modules_sdks.sh

Change-Id: I3019b599d61643e35d986448be7b34fd891535d0
2022-10-17 16:06:51 +00:00
Treehugger Robot
be223f7537 Merge "Exclude test_com.android.tethering from R snapshot" am: 9113931152 am: a0c16be5dd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2251415

Change-Id: I023e7b57f87ebed2bc289a8be04c97099ccf49c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-12 20:23:46 +00:00
Treehugger Robot
a0c16be5dd Merge "Exclude test_com.android.tethering from R snapshot" am: 9113931152
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2251415

Change-Id: Ib953643f5f7af0fa0854e75e8b04c0c627c03e4b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-12 19:54:49 +00:00
Paul Duffin
378d990a95 Exclude test_com.android.tethering from R snapshot
Bug: 218685706
Test: BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdks.sh --build-release=R
      # Run before and after making this change and verify that the
      # only difference is to remove test_com.android.tethering.
      atest --no-bazel-mode --host mainline_modules_sdks_test
Change-Id: Ic24ce4afbe9f84b1afd65dca9cee2154dc436646
2022-10-12 18:47:30 +01:00
Paul Duffin
77869eacad Add UpsideDownCake to releases that need snapshots to be built
Bug: 249769908
Test: packages/modules/common/mainline_modules_sdks.sh
Change-Id: I2b945f9db628c90b3823972787713dce39b9df75
Merged-In: I39804d89ad15109da47b5caa4a20ca2ef74b0e37
(cherry picked from commit 5fc8511dff)
Merged-In: I2b945f9db628c90b3823972787713dce39b9df75
2022-10-03 10:49:53 +00:00
Paul Duffin
5fc8511dff Add UpsideDownCake to releases that need snapshots to be built
Bug: 249769908
Test: packages/modules/common/mainline_modules_sdks.sh
Change-Id: I2b945f9db628c90b3823972787713dce39b9df75
Merged-In: I39804d89ad15109da47b5caa4a20ca2ef74b0e37
2022-10-03 10:48:10 +00:00
Anton Hansson
2e9dd0fae5 Revert "Use inline soong_config_module_type for Tiramisu"
This reverts commit 2a3ad4c9ee.

Reason for revert: Not going for this after all

DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/tests/hub?filter=highFailureRate&tab=clusterView&clusterId=5071029569483450748

Bug: 249572758

Change-Id: Id8e87d05afe4297e0c5735c67c15935a6a34d9ca
2022-09-28 20:52:13 +00:00
Paul Duffin
2a3ad4c9ee Use inline soong_config_module_type for Tiramisu
Previously, Tiramisu snapshots would use the use_source_config_var
property but that does not properly without r.android.com/2234128 so
this switches Tiramisu to use inline soong_config_module_type just like
is used by S.

Bug: 249192297
Test: m nothing
      BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdk.sh
      # Run above with and without this change and make sure that it
      # only changes the for-Tiramisu-build contents and switches to
      # using inline soong_config_module_type modules to set the prefer
      # property.
Change-Id: I429aeac064c986de654a49258a5f31d7bd9fc3a7
2022-09-27 18:11:10 +01:00
Paul Duffin
69c064b1c2 Bluetooth was not released as a mainline module in Tiramisu
Bug: 240406019
Test: m nothing
Change-Id: I0b3efdcc7665b5d2d18e313db086a87bd7c7eb48
2022-09-14 17:54:44 +01:00
Anton Hansson
648be3371c Don't delete the output dirs in prepare
In some builds, this script is invoked several times in a single
target. The removal of the dist dirs leads to the output of the
first invocation to be deleted at the beginning of the second
invocation.

Test: atest mainline_modules_sdks_test
Change-Id: I39620b849ae8029719dc6cf150dae5092a093ea9
Merged-In: I39620b849ae8029719dc6cf150dae5092a093ea9
2022-09-12 14:47:13 +00:00
Paul Duffin
574c7d88e8 Retry: Generate soong_config_module_type inline in the snapshot am: f3c17ef416
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2165046

Change-Id: If90ccbc28cdc8ed17cca58a126d8d8d6bc187cc5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-27 00:51:36 +00:00
Paul Duffin
d5b0d18b43 Create SdkType to encapsulate behavioral differences of sdk and exports am: d7b7cddf54
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2165045

Change-Id: I3f7f5034c97739c5352bb2d06301cc92bd119646
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 19:36:24 +00:00
Paul Duffin
957ba765e5 Switch T+ sdk snapshots to use use_source_config_var property am: db3a3c7df6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2165043

Change-Id: I17a489e2def737629711be6bc10f49a3e4a8ebd8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 19:36:17 +00:00
Paul Duffin
a807cdf6ae Clean up pylint warnings am: 6f5c8d7afb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2165044

Change-Id: I71de5234b01a72eb5f359d1288d7c968f7d11277
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 18:35:46 +00:00
Paul Duffin
f3c17ef416 Retry: 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 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.

Due to bug 235475711 each soong_config_module_type has to be unique
across all mainline modules so this uses both the module short name
and a prefix associated with the SdkType to generate unique module
names. However, that only affects the S snapshots as from T onwards is
is not necessary to use soong_config_module_type modules at all.

Bug: 233965247
Test: atest --host mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      # Extract art sdk and module_exports snapshots into
      # prebuilts/module_sdk/art and then run "m nothing"
Change-Id: Ib0e2ece1779451dffff6dfaca7ca39b264004b5b
2022-07-26 16:40:25 +00:00
Paul Duffin
d7b7cddf54 Create SdkType to encapsulate behavioral differences of sdk and exports
Previously, the differences in behavior between the sdk and
module_exports modules was implemented by checking the sdk name
everywhere that it was needed. This change encapsulates the differences
in a new SdkType dataclass which is itself determined from the sdk name
when needed.

Bug: 238203992
Test: atest --host 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: Ia00069a70fda421dff4aeaa1f833b93e95574b98
2022-07-26 16:40:25 +00:00
Paul Duffin
db3a3c7df6 Switch T+ sdk snapshots to use use_source_config_var property
Previously, T+ sdk snapshots used soong_config_module_type boilerplate
like for S. This change switches T+ sdk snapshots to use the
use_source_config_var property that was added in T.

Bug: 235455192
Test: atest --host mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      # Extract art sdk and module_exports snapshots into
      # prebuilts/module_sdk/art and then run "m nothing"
Change-Id: I65cd462358bceede493623e6a51ffdb36bfc1885
2022-07-26 16:40:23 +00:00
Gurpreet Singh
d682e225e2 Remove service-art exception to build latest api targets. am: 113e7e63a9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2138813

Change-Id: Ic0f1de5726920db26c4cf9d5774b17bdd0c5da52
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 15:38:43 +00:00
Paul Duffin
6f5c8d7afb Clean up pylint warnings
Bug: 232546567
Test: atest --host mainline_modules_sdks_test
      /usr/bin/pylint --rcfile $ANDROID_BUILD_TOP/tools/repohooks/tools/pylintrc build/mainline_modules_sdks*.py
Change-Id: I114104805f85d7bc1cb5a3b94f076f39c1ddd38e
2022-07-26 15:25:07 +00:00
Gurpreet Singh
113e7e63a9 Remove service-art exception to build latest api targets.
The service-art java_sdk_library was not generating the latest api
targets as mentioned in the bug - b/235330409.
Hence an exception was added to avoid building latest api targets for
service-art java_sdk_library.

The bug has been fixed now and this exception can be safely removed.

Bug: 235330409
Test: built mainline_modules_sdks.py successfully.
mainline_modules_sdks_test.py passes
The .info files corresponding to art module has latest api fields
populated for service-art java_sdk_library.

Change-Id: Idd13df1410cb3ced8c347a78a48d8524923f3da5
Merged-In: Ib4dd01b64e4e8edc90c8cb992cc3e65681da39bc
2022-07-26 12:54:47 +00:00
Paul Duffin
4421d6a215 Merge "Used fixed timestamps for the zip contents" am: 898dd8159e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2151419

Change-Id: I008526e8b92b5495cd9df3dcdcdef69e27bb8aa1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 09:51:41 +00:00
Paul Duffin
f4042ebd85 Used fixed timestamps for the zip contents
Previously, while the snapshot zip files generated by Soong had entries
with fixed timestamps the zip files produced by this script did not
which meant that the contents of the zip files depended on when the zip
file was created. That meant that in order to compare a change affected
the zip file contents it was necessary to unpack the before and after
zip files in order to compare them.

This change causes all zip files created by the script to use the same
fixed timestamp for each of its entries as soong_zip and ziptime do so
it is now possible to check that the contents of sdk snapshot zip files
are the same without unpacking them.

Bug: 232401814
Test: BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdks.sh
      # Remove api diff files as they contain file stamps of generated files so
      # differ every time they are generated.
      find out/dist/mainline-sdks -name \*txt | xargs rm
      # Save the snapshots away.
      mv out/dist/mainline-sdks before-changes
      # Repeat the first two steps above and then run the following to verify
      # that simply running the script twice results in different sdk contents.
      meld before-changes out/dist/mainline-sdks
      # Apply this change and then run the above again but this time the sdks
      # will be identical.
Change-Id: I28bf78783c827abffa6b715c62ca5948b3ee19b5
2022-07-18 13:31:31 +00:00
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