Add next BuildRelease for use by SDK finalization
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
This commit is contained in:
@@ -708,6 +708,10 @@ class BuildRelease:
|
||||
preferHandling: PreferHandling = \
|
||||
PreferHandling.USE_SOURCE_CONFIG_VAR_PROPERTY
|
||||
|
||||
# Whether the generated snapshots should include flagged APIs. Defaults to
|
||||
# false because flagged APIs are not suitable for use outside Android.
|
||||
include_flagged_apis: bool = False
|
||||
|
||||
def __post_init__(self):
|
||||
# The following use object.__setattr__ as this object is frozen and
|
||||
# attempting to set the fields directly would cause an exception to be
|
||||
@@ -809,6 +813,15 @@ UpsideDownCake = BuildRelease(
|
||||
# Insert additional BuildRelease definitions for following releases here,
|
||||
# before LATEST.
|
||||
|
||||
# A build release for the latest build excluding flagged apis.
|
||||
NEXT = BuildRelease(
|
||||
name="next",
|
||||
creator=create_latest_sdk_snapshots,
|
||||
# There are no build release specific environment variables to pass to
|
||||
# Soong.
|
||||
soong_env={},
|
||||
)
|
||||
|
||||
# The build release for the latest build supported by this build, i.e. the
|
||||
# current build. This must be the last BuildRelease defined in this script.
|
||||
LATEST = BuildRelease(
|
||||
@@ -817,6 +830,9 @@ LATEST = BuildRelease(
|
||||
# There are no build release specific environment variables to pass to
|
||||
# Soong.
|
||||
soong_env={},
|
||||
# Latest must include flagged APIs because it may be dropped into the main
|
||||
# Android branches.
|
||||
include_flagged_apis=True,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user