Skip Android SDK extras version check on bots
Bots have the sdk library delivered in a different way than
the devs. The version they get is explicitely set in the build
files while devs have to download the extras themselves.
Running this check would not allow for example to download an
already processed version of split client libraries
BUG=490091
Review URL: https://codereview.chromium.org/1229883002
Cr-Commit-Position: refs/heads/master@{#338262}
CrOS-Libchrome-Original-Commit: f3937ecb9f221c129a853ec11eb66dc68e095ad7
diff --git a/build/check_sdk_extras_version.py b/build/check_sdk_extras_version.py
index 7488f8b..9b2f10d 100755
--- a/build/check_sdk_extras_version.py
+++ b/build/check_sdk_extras_version.py
@@ -62,8 +62,9 @@
args = parser.parse_args()
- minimum_version = GetRequiredMinimumVersion(args.package_id)
- CheckPackageVersion(args.package_id, args.package_location, minimum_version)
+ if not ShouldSkipVersionCheck():
+ minimum_version = GetRequiredMinimumVersion(args.package_id)
+ CheckPackageVersion(args.package_id, args.package_location, minimum_version)
# Create the stamp file.
if args.stamp:
@@ -74,7 +75,7 @@
def ExitError(msg):
sys.exit(colorama.Fore.MAGENTA + colorama.Style.BRIGHT + msg +
- colorama.Fore.RESET)
+ colorama.Style.RESET_ALL)
def GetRequiredMinimumVersion(package_id):
@@ -119,6 +120,12 @@
# Everything looks ok, print nothing.
+def ShouldSkipVersionCheck():
+ '''
+ Bots should not run the version check, since they download the sdk extras
+ in a different way.
+ '''
+ return bool(os.environ.get('CHROME_HEADLESS'))
if __name__ == '__main__':
main()