Add optional version_file param
Change-Id: I7ff1d6dc7a492bfce3e1458b51b92dd47f6de674
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101681
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
diff --git a/tools/utils.py b/tools/utils.py
index 7b69465..a8f96f6 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -340,8 +340,8 @@
version.prerelease_patch))
-def GetSemanticSDKVersion(no_git_hash=False):
- version = ReadVersionFile()
+def GetSemanticSDKVersion(no_git_hash=False, version_file=None):
+ version = ReadVersionFile(version_file)
if not version:
return None
@@ -356,8 +356,8 @@
return '%s.%s.%s%s' % (version.major, version.minor, version.patch, postfix)
-def GetVersion(no_git_hash=False):
- return GetSemanticSDKVersion(no_git_hash)
+def GetVersion(no_git_hash=False, version_file=None):
+ return GetSemanticSDKVersion(no_git_hash, version_file)
# The editor used to produce the VERSION file put on gcs. We now produce this