Commit Graph

82 Commits

Author SHA1 Message Date
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
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
Paul Duffin
5c78b6d3d6 Merge "Move populate_stubs into LEGACY BuildRelease" am: 2a5e1b5e4e am: f319429eae
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032131

Change-Id: I410cce669f16fac8ee6a30c08a7d312718b5a06b
2022-03-23 10:07:22 +00:00
Paul Duffin
6e6569d1ab Merge "Decouple population of the dist dir from the SnapshotBuilder" am: 726f9ab1bf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032132

Change-Id: Iebaf30eb3d8b4b8435d6ed201229ed3a44a4e058
2022-03-23 09:50:25 +00:00
Paul Duffin
f319429eae Merge "Move populate_stubs into LEGACY BuildRelease" am: 2a5e1b5e4e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032131

Change-Id: I3ca94c8308138e7a3a467e671fc86db137237a28
2022-03-23 09:50:13 +00:00
Paul Duffin
6a07a5309f Extract unzip_current_stubs from SdkDistProducer am: dc0c4c5d3f am: fbcf0717cc
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032130

Change-Id: I0005af509de48a6ce284bc0ac48545ffe1fed0fe
2022-03-21 14:39:37 +00:00
Paul Duffin
cee7573bc6 Add --build-release option to mainline_modules_sdks.sh am: 14c6bd8c38 am: aee5bf605a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032129

Change-Id: I755749ceef97928aa9d962e9de81770dfc9ec23d
2022-03-21 14:39:28 +00:00
Paul Duffin
fbcf0717cc Extract unzip_current_stubs from SdkDistProducer am: dc0c4c5d3f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032130

Change-Id: I7455692f354b4feb729c5c5934cef1a1a61310ff
2022-03-21 14:24:27 +00:00
Paul Duffin
aee5bf605a Add --build-release option to mainline_modules_sdks.sh am: 14c6bd8c38
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032129

Change-Id: I754e7e884cf926e8657d9c8b176628bb780da9d9
2022-03-21 14:24:18 +00:00
Paul Duffin
48e7f7d7d0 Decouple population of the dist dir from the SnapshotBuilder
Previously, the code for populating the dist directory, e.g.
populate_dist and create_legacy_dist_structures assumed that the sdk
snapshot files they needed could be found in the directory referenced
by SnapshotBuilder.mainline_sdks_dir. This change removes that
assumption and instead passes the snapshot_dirs directory into the
populate_dist method and uses it in the create_legacy_dist_structures
function.

This refactoring is needed to allow a follow up change to construct a
set of sdk snapshot files in a different directory while still using
the populate_dist method to copy them into the correct location in the
dist directory.

Bug: 218685706
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: I9fb659df28d7688b3f081bf84f5fae8ee85dc534
2022-03-21 12:53:16 +00:00
Paul Duffin
04b51993d5 Move populate_stubs into LEGACY BuildRelease
Previously, the populate_stubs was handled specially in produce_dist.
However, it is LEGACY behavior and so it makes sense to move the
code into the LEGACY BuildRelease's creator function.

While testing, the script failed because the LEGACY BuildRelease does
not build the snapshots, it assumes that the LEGACY is always run after
LATEST. This change makes the LEGACY build the snapshots. In normal use
it will not cause any increase in build time as it will always run
after LATEST and build the snapshots with the same environment turning
the build command into a no-op.

Bug: 218685706
Test: rm -fr out/soong/mainline-sdks
      packages/modules/common/build/mainline_modules_sdks.sh --build-release=LEGACY
      # Before this change it fails due to missing files, after it works.
      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: Iaa2f9f71dd5085965d3ad32110b324453df87ee6
2022-03-21 12:53:16 +00:00
Paul Duffin
dc0c4c5d3f Extract unzip_current_stubs from SdkDistProducer
A minor refactoring that generalizes the method, making it usable for
other cases and decouples it from SdkDistProducer and SnapshotBuilder.

Bug: 218685706
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: I885b7d0e792691f7028cdfb91e72896be48333a1
2022-03-21 12:53:16 +00:00
Paul Duffin
14c6bd8c38 Add --build-release option to mainline_modules_sdks.sh
This change makes it easier to test the behavior of specific build
releases.

Bug: 218685706
Test: atest --host mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      packages/modules/common/build/mainline_modules_sdks.sh --build-release=S --build-release=latest
      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: Ib9ef2f35d27d10cd960c4b6225417d930cb10afc
2022-03-21 12:53:14 +00:00
Paul Duffin
f9fd1430c5 Improve testing of mainline_modules_sdks.py am: de60aeb525 am: 54573b92c4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032128

Change-Id: Idded48ba06edd50485e9ac2b8c8231ef3b0519ac
2022-03-21 12:35:08 +00:00
Paul Duffin
dab41503d5 Cleanup pylint errors in mainline_modules_sdks*.py am: 4f192a156b am: 1a02635227
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032127

Change-Id: Ic261a74a102d46c9cca6986bf8172475c62582d4
2022-03-21 12:35:06 +00:00
Paul Duffin
54573b92c4 Improve testing of mainline_modules_sdks.py am: de60aeb525
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2032128

Change-Id: Id3c26e1876d532a398eec54013349c1834eea99f
2022-03-21 12:00:34 +00:00