The with open() method creates the file if it does not exist, but
gives a FileNotFound error if the path does not exist.
Hence, creating the path directories before using the file.
Bug: N/A
Test: the build passes.
Change-Id: Id5b285ea5581f7ef526876fb6e13a3bf69098acd
Currently, the SDK finalization script consumes the SDK snapshots from
the `for-latest-build` directory. However, in trunk stable that is no
longer viable as that directory will include flagged APIs but the
finalized SDK cannot use flagged APIs. It is not possible to remove
flagged APIs from `for-latest-build` as the snapshots in there are
dropped into Android itself and so must include flagged APIs.
This change adds a new `NEXT` `BuildRelease` which will create a
`for-next-build` that will contain SDK snapshots that do not contain
flagged APIs. It also adds an `include_flagged_apis` property which
is `False` for everything except `LATEST`. For now that property is
for informational purposes but a follow up change will use it to
determine whether the SDK snapshots include flagged APIs.
A separate follow up change will modify the finalize script to use
the `for-next-build` directory. It is done separately as it will
take a while for this change to have an impact on the build targets
that the finalize script consumes.
Bug: 313065235
Test: packages/modules/common/build/mainline_modules_sdks.sh
# Make sure that out/dist/mainline-sdks/for-next-build is
# identical to for-latest-build.
Change-Id: Ib6d18fda129d081e8bbc8bf148cb5d7f38c070ba
The original idea of using module specific soong variable was for the modules when they start off as optional module (before transition to mandatory). However, practically at build time, it can remain optional. For now, we will keep self.last_optional_release as the condition and the module can have their specific variable (for enabling/disabling prebuilts) by setting last_optional_release.
Bug: 301183608
Test: atest mainline_modules_sdks_test --host
packages/modules/common/build/mainline_modules_sdks.sh
Change-Id: I8af5d3dd8733d244c2ade1d9b5118308b3c00622
This is for use on thin manifests where there are `apex` Soong modules
in the tree that lack dependencies to be built. Since the APEX
singleton in Soong adds all such modules to the apex-allowed-deps-check
target it won't work, even if SOONG_ALLOW_MISSING_DEPENDENCIES is used.
Also use the apex-allowed-deps-check phony target rather than
referencing the check file directly.
Test: env TARGET_BUILD_VARIANT=userdebug \
TARGET_BUILD_APPS="com.android.art com.android.art.debug" \
BUILD_BROKEN_DISABLE_BAZEL=true \
packages/modules/common/build/mainline_modules_sdks.sh \
--skip-allowed-deps-check
on master-art with https://r.android.com/2743421, which adds a
project with the com.andoid.tethering APEX, which cannot be built on
master-art.
Test: env TARGET_BUILD_VARIANT=userdebug \
TARGET_BUILD_APPS="com.android.art com.android.art.debug" \
packages/modules/common/build/mainline_modules_sdks.sh \
--build-release latest
on AOSP main with libbase removed from allowed_deps.txt, and verify
that it fails.
Bug: 300072791
Change-Id: I313905e1f00614b263d8240d01504805380e3076
Add list of all the sdk supported modules in sdk-modules.txt. This file
should generate for all builds (even when only non-sdk modules build is
requested).
The file only contains modules which are requested by the build, and
supports sdk.
Bug: 242316893
Test: Generate sdk-modules.txt in the dist directory root.
Test: atest --host mainline_modules_sdks_test --no-bazel-mode
Change-Id: Ic8aa3c63209717e1076c4c51f1232dd5afcdd6d4
The metadata files are downloaded by gantry gate and hence their size
should not be too high.
On discussion with Gantry team, 1 MB size was decided for the time
being. This size can possibly be increased, if the download only
happens once per build in gantry.
Bug: 242316893
Test: Build passes. Throws build error if metadata file size increases
1 MB.
atest --host mainline_modules_sdks_test --no-bazel-mode
Change-Id: I2f7a3cc55a34cd2c94a3ce4f20af96be757690c2
This CL builds the .latest.version target which contains the last
finalized version. This version is read and populated inside the
metadata file.
The CL also verifies whether all the java sdk libraries under a module,
which has been finalized atleast once, have the same extension version.
Bug: 242316893
Test: atest --host mainline_modules_sdks_test --no-bazel-mode
Change-Id: I94acf448b25d76c45a4bfd3d54fc276e2f01c7cc
Change https://r.android.com/2507369 accidentally reverted some of the
changes from https://r.android.com/2507370 and that broke the script.
Unfortunately, that was not picked up by TH.
This change reapplies those changes.
Test: atest mainline_modules_sdks_test --host
packages/modules/common/build/mainline_modules_sdks.sh
Bug: 254111089
Bug: 275471775
Merged-In: I94989519011e31c7db33656c6730c4f8fd5e0a4f
Change-Id: I42f9cdc7ada0ec9cafbfc381db67e4942a29421a
Add additional_transformations for module sdk build. This feature is
only supported by S+ releases.
Bug: 254111089
Test: atest mainline_modules_sdks_test --host
Ignore-AOSP-First: Check into internal branch first to make sure all
testing works.
Merged-In: I94989519011e31c7db33656c6730c4f8fd5e0a4f
Change-Id: Idc8bd682550f59e086c431b0be38bfbdf8a75127
Pass BuildRelease to apply and _apply_transformation methods in class of
transformations, so that transformation could use the build_release
information to decide whether certain steps of the transformation should
be performed.
Test: atest mainline_modules_sdks_test --host
Bug: 254111089
Merged-In: If71a921752f4c481030efb0fd391fb328b5dffb6
Change-Id: I8341541572072ef72ab37dfe816296a1375e4cea
Add additional_transformations for module sdk build. This feature is
only supported by S+ releases.
Bug: 254111089
Test: atest mainline_modules_sdks_test --host
Ignore-AOSP-First: Check into internal branch first to make sure all
testing works.
Change-Id: I94989519011e31c7db33656c6730c4f8fd5e0a4f
Pass BuildRelease to apply and _apply_transformation methods in class of
transformations, so that transformation could use the build_release
information to decide whether certain steps of the transformation should
be performed.
Test: atest mainline_modules_sdks_test --host
Ignore-AOSP-First: Check into internal branch first to make sure all
testing works.
Bug: 254111089
Change-Id: If71a921752f4c481030efb0fd391fb328b5dffb6
This CL creates a metadata json file for each module that support java
APIs. The metadata file contains the information about -
1. the api-diff file name
2. the size of the api-diff file
3. module extension version
More information will be added to this metadata file, which will be
used by the mainline module api checks gantry gate to improve its
functionality.
Bug: 242316893
Test: Generate metadata file for each module. Passes all tests.
Test: atest --host mainline_modules_sdks_test --no-bazel-mode
Change-Id: I517e59e5a7bb0f6675950d7455a724816d599692
This will generate SDK snapshots that use an rkpd specific Soong config
variable to allow a product to select whether to build from sources or
prebuilts.
Ignore-AOSP-First: rkpd is internal only
Bug: 266683341
Test: TARGET_BUILD_APPS=com.android.rkpd packages/modules/common/build/mainline_modules_sdks.sh --build-release=UpsideDownCake
# Check the Android.bp file in out/dist/mainline-sdks/for-UpsideDownCake-build/current/com.android.rkpd/sdk/rkpd-sdk-current.zip
# uses the rkpd_module/source_build Soong config variable and not
# ANDROID/module_build_from_source.
Change-Id: Ib59b60eefef0d1e893e77aa93f911e80ecb696e3
Ignore-AOSP-First: need to prevent it from being merged into tm-mainline-prod
Bug: 259958590
Test: Build
Change-Id: Ifb5284a9a0057611aaee32a28273f9583c3cad42
Add configinfrastructure to he list of MainlineModule objects in packages/modules/common/build/mainline_modules_sdks.py
Test: m
Bug: 248552678
Ignore-AOSP-First: this module is available for internal master will be merged
to aosp after completing the development.
Change-Id: I63e7d7c0ca2298e4f9b50961619cd56852f4cdf5
Soong no longer supports the SOONG_SDK_SNAPSHOT_VERSION environment
variable so there is no need to set it. This change removes the setting
of that environment variable and stops passing the sdk_version around.
The few places that need to access the sdk_version in order to
construct file names just use the SDK_VERSION global variable which is
always "current" for legacy purposes.
Bug: 259095197
Test: BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdks.sh
# Run the above before and after this change and compare the
# out/dist/*mainline-sdks directory contents to ensure that there are no
# changes.
Change-Id: I9554eb48dfd04877d09d7e8101129d0fe1724101
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
This reverts commit a772ee4cb1.
Reason for revert: The timestamps can be completely avoid by using labels instead.
Change-Id: If72a9e8aba6209ebe81d11cae1ed6defb43d6079
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
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
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