Add current build release
Previously, the build releases only included named releases so did not
have a way to represent the latest build release. This adds the current
build release (named after the current API level) to represent that.
Bug: 240406019
Test: m nothing
Change-Id: Ib8336da716b447448b23bc9684ce3be1ab78648a
(cherry picked from commit 42a49f1278b50b6cd4971f9d40505a278461154e)
Merged-In: Ib8336da716b447448b23bc9684ce3be1ab78648a
diff --git a/sdk/update.go b/sdk/update.go
index c555ddc..5c9376b 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -387,12 +387,11 @@
// Always add -current to the end
snapshotFileSuffix := "-current"
- currentBuildRelease := latestBuildRelease()
- targetBuildReleaseEnv := config.GetenvWithDefault("SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE", currentBuildRelease.name)
+ targetBuildReleaseEnv := config.GetenvWithDefault("SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE", buildReleaseCurrent.name)
targetBuildRelease, err := nameToRelease(targetBuildReleaseEnv)
if err != nil {
ctx.ModuleErrorf("invalid SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE: %s", err)
- targetBuildRelease = currentBuildRelease
+ targetBuildRelease = buildReleaseCurrent
}
builder := &snapshotBuilder{
@@ -472,7 +471,7 @@
contents := bp.content.String()
// If the snapshot is being generated for the current build release then check the syntax to make
// sure that it is compatible.
- if targetBuildRelease == currentBuildRelease {
+ if targetBuildRelease == buildReleaseCurrent {
syntaxCheckSnapshotBpFile(ctx, contents)
}