Index: build/android/binary_size/apk_downloader.py |
diff --git a/build/android/binary_size/update_apks.py b/build/android/binary_size/apk_downloader.py |
similarity index 95% |
rename from build/android/binary_size/update_apks.py |
rename to build/android/binary_size/apk_downloader.py |
index a197e64a12675e47c5583878e17ff81080b47a2f..b90fe5f92c98870f5c9aa7218bc14e8188e68109 100755 |
--- a/build/android/binary_size/update_apks.py |
+++ b/build/android/binary_size/apk_downloader.py |
@@ -23,13 +23,16 @@ DEFAULT_APK = 'MonochromePublic.apk' |
def MaybeDownloadApk(builder, milestone, apk, download_path, bucket): |
+ """Returns path to the downloaded APK or None if not found.""" |
apk_path = os.path.join(download_path, builder, milestone, apk) |
sha1_path = apk_path + '.sha1' |
base_url = os.path.join(bucket, builder, milestone) |
if os.path.exists(apk_path): |
print '%s already exists' % apk_path |
+ return apk_path |
elif not os.path.exists(sha1_path): |
print 'Skipping %s, file not found' % sha1_path |
+ return None |
else: |
download_from_google_storage.download_from_google_storage( |
input_filename=sha1_path, |
@@ -46,6 +49,7 @@ def MaybeDownloadApk(builder, milestone, apk, download_path, bucket): |
verbose=True, |
auto_platform=False, |
extract=False) |
+ return apk_path |
def main(): |