Skip to content

Commit 1392d61

Browse files
committed
[infra] Modify 2.7.0 make_version hack so that it also works on other branches
The logic only worked on the 'be' branch but if Flutter uses a dev branch hash they would get a dev release version rather than the hardcoded 2.7.0 version. Change-Id: I6be3b3a115a10dfb6e2a6d1407d27f96c6d88396 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126823 Reviewed-by: Siva Annamalai <[email protected]>
1 parent 4fe27fd commit 1392d61

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

tools/make_version.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ def debugLog(message):
4747

4848
def MakeVersionString(quiet, no_git_hash, custom_for_pub=None):
4949
channel = utils.GetChannel()
50+
if custom_for_pub:
51+
# TODO(athom): remove the custom 2.7.0 logic post release.
52+
# For 2.7.0, we want flutter to claim Dart is 2.7.0 even before it is
53+
# decided what exactly 2.7.0 will be. Dart & Flutter stable releases
54+
# will be synced, so that what will be released as Dart 2.7.0 will also
55+
# be what will be packaged with Flutter.
56+
version = utils.ReadVersionFile()
57+
custom_version_string = "%s.%s.%s" % (version.major, version.minor,
58+
version.patch)
59+
if custom_version_string == "2.7.0" and custom_for_pub == "flutter":
60+
return "2.7.0"
61+
5062
if custom_for_pub and channel == 'be':
5163
latest = utils.GetLatestDevTag()
5264
if not latest:
@@ -57,16 +69,6 @@ def MakeVersionString(quiet, no_git_hash, custom_for_pub=None):
5769
else:
5870
git_hash = utils.GetShortGitHash()
5971
version_string = ("%s.%s-%s" % (latest, custom_for_pub, git_hash))
60-
# TODO(athom): remove the custom 2.7.0 logic post release.
61-
# For 2.7.0, we want flutter to claim Dart is 2.7.0 even before it is
62-
# decided what exactly 2.7.0 will be. Dart & Flutter stable releases
63-
# will be synced, so that what will be released as Dart 2.7.0 will also
64-
# be what will be packaged with Flutter.
65-
version = utils.ReadVersionFile()
66-
custom_version_string = "%s.%s.%s" % (version.major, version.minor, version.patch)
67-
if custom_version_string == "2.7.0" and custom_for_pub == "flutter":
68-
version_string = "2.7.0"
69-
7072
else:
7173
version_string = utils.GetSemanticSDKVersion(no_git_hash=no_git_hash)
7274
if not quiet:

0 commit comments

Comments
 (0)