Commit Graph

163 Commits

Author SHA1 Message Date
Paul Duffin
19e34a43a1 Move MAINLINE_MODULE_BY_APEX into the test file am: 300ec921e5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/1957400

Change-Id: I67d0b71ba28450ea254080e293d5a5994d7f9fbe
2022-01-24 14:06:33 +00:00
Paul Duffin
13e3e100e1 Split populate_stubs out of populate_dist am: 661845d4ec
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/1957399

Change-Id: If7b7efe09606f7fa2f9219d360baa74fcada825e
2022-01-24 14:06:32 +00:00
Paul Duffin
86ef162110 Extract logic for building the snapshots to improve testability am: f5245ce53d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/1954695

Change-Id: Ia8be7376929a0cc29074b31562c7e888fce371d5
2022-01-24 14:06:31 +00:00
Paul Duffin
d2b40e7550 Extract subprocess run calls into SubprocessRunner am: b349358ae2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/1954694

Change-Id: I5f65d36f33595f90f24f565a7c2dc9eceb602ac2
2022-01-24 14:06:31 +00:00
Paul Duffin
300ec921e5 Move MAINLINE_MODULE_BY_APEX into the test file
The variable is only used by the tests.

Test: atest mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      tree out/dist/mainline-sdks out/dist/stubs
      - check that it is identical to before this change
Bug: 204763318
Change-Id: I38c4ce218825d79de831868af814c43ce8a6d60f
2022-01-21 19:36:46 +00:00
Paul Duffin
661845d4ec Split populate_stubs out of populate_dist
Separates the logic from populate_dist which handles the legacy stubs
directory into its own populate_stubs directory. That is in preparation
for calling populate_dist multiple times to create sdk snapshots for
different build releases.

Test: atest mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      tree out/dist/mainline-sdks out/dist/stubs
      - check that it is identical to before this change
Bug: 204763318
Change-Id: Idada531b7f88dee3fea861a059a0773bc983853d
2022-01-21 19:36:46 +00:00
Paul Duffin
f5245ce53d Extract logic for building the snapshots to improve testability
Previously, the produce_dist() method of SdkDistProducer was not
testable because it attempted to invoke Soong to build the sdk
snapshots. So, the TestPopulateDist tested the populate_dist() method
instead. That was a problem because it meant that future changes to
the produce_dist() method could not be tested, at least not without
duplicating its functionality.

This change extracts the logic for building the snapshots (i.e. the
code that invokes soong to build the snapshot files) from the
SdkDistProducer into a separate SnapshotBuilder class. That allows
the test to substitute a FakeSnapshotBuilder that generates some fake
sdk snapshot zip files and call produce_dist() instead of calling
populate_dist() and populate_stubs().

It also renames the test to TestProduceDist to reflect that change.

This is part of a larger refactoring to improve the testability of the
mainline_modules_sdks.py file in preparation for adding support for
building build release specific snapshots.

Test: atest mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      tree out/dist/mainline-sdks out/dist/stubs
      - check that it is identical to before this change
Bug: 204763318
Change-Id: Icf2e4b0200cc53863e45cf68208fbc8ec13c6f2c
2022-01-21 19:36:46 +00:00
Paul Duffin
b349358ae2 Extract subprocess run calls into SubprocessRunner
The SdkDistProducer has special stdout/stderr objects to pass to the
subprocess.run. This change extracts the handling of stdout/stderr into
the SubprocessRunner class to allow it to be more easily reused.

This is part of a larger refactoring to improve the testability of the
mainline_modules_sdks.py file in preparation for adding support for
building build release specific snapshots.

Test: atest mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      tree out/dist/mainline-sdks out/dist/stubs
      - check that it is identical to before this change
Change-Id: If40199551934b0620953a2e4e3cefcb61282f051
2022-01-21 19:36:46 +00:00
Paul Duffin
092b9fdcfc Add internal only modules to standard module list
Adds the com.android.uwb and com.android.scheduling modules to the
standard list of modules. This ensures that when they are released to
AOSP that the packages/modules/common/build/mainline_modules_sdks.sh
build script will build them correctly.

Ignore-AOSP-First: internal only changes.

Bug: 204763318
Test: vendor/google/build/mainline_modules_sdks.sh
      atest mainline_modules_sdks_test
Merged-In: Idd83a71c477422ddf35d32f0f72293ac6f8626cd
Change-Id: Idd83a71c477422ddf35d32f0f72293ac6f8626cd
(cherry picked from commit adb67d1944)
2022-01-19 12:41:41 +00:00
Paul Duffin
adb67d1944 Add internal only modules to standard module list
Adds the com.android.uwb and com.android.scheduling modules to the
standard list of modules. This ensures that when they are released to
AOSP that the packages/modules/common/build/mainline_modules_sdks.sh
build script will build them correctly.

Ignore-AOSP-First: internal only changes.

Bug: 204763318
Test: vendor/google/build/mainline_modules_sdks.sh
      atest mainline_modules_sdks_test
Change-Id: Idd83a71c477422ddf35d32f0f72293ac6f8626cd
2022-01-19 10:04:06 +00:00
satayev
5511d9becd Simplify main function for mainline_modules_sdks.py
Bug: 205100626
Test: presubmit
Change-Id: I2fdd371aad6a9c37703a190754604da2d86975b2
Merged-In: I2fdd371aad6a9c37703a190754604da2d86975b2
(cherry picked from commit a584ab5dc0)
2021-11-26 12:36:52 +00:00
satayev
a584ab5dc0 Simplify main function for mainline_modules_sdks.py
Bug: 205100626
Test: presubmit
Ignore-AOSP-First: internal topic. will cp later
Change-Id: I2fdd371aad6a9c37703a190754604da2d86975b2
2021-11-24 18:58:21 +00:00
satayev
51133ffa60 Add mainline_modules_sdks to packages/modules/common/.
Change the list of modules to match AOSP list.

Bug: 205100626
Test: atest mainline_modules_sdks_test
Change-Id: I250c4aafcda5c3c1d636dac27ff5ffaa78b69b2a
2021-11-04 14:48:39 +00:00