From 900fb3a463c7c17d75d4850e4522f35e185913b2 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Thu, 1 Feb 2018 09:59:23 -0500 Subject: [PATCH] Bug 1412006 - part 1 - have a single point of truth for the NDK version; r=nalexander ...at least in mozboot/android.py. --- python/mozboot/mozboot/android.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/mozboot/mozboot/android.py b/python/mozboot/mozboot/android.py index bd1d544dc7fa..6a1a3ba9fee0 100644 --- a/python/mozboot/mozboot/android.py +++ b/python/mozboot/mozboot/android.py @@ -11,6 +11,11 @@ import stat import subprocess import sys +# We need the NDK version in multiple different places, and it's inconvenient +# to pass down the NDK version to all relevant places, so we have this global +# variable. +NDK_VERSION = 'r15c' + ANDROID_NDK_EXISTS = ''' Looks like you have the Android NDK installed at: %s @@ -137,7 +142,7 @@ def get_paths(os_name): sdk_path = os.environ.get('ANDROID_SDK_HOME', os.path.join(mozbuild_path, 'android-sdk-{0}'.format(os_name))) ndk_path = os.environ.get('ANDROID_NDK_HOME', - os.path.join(mozbuild_path, 'android-ndk-r15c')) + os.path.join(mozbuild_path, 'android-ndk-{0}'.format(NDK_VERSION))) return (mozbuild_path, sdk_path, ndk_path) @@ -260,7 +265,7 @@ def suggest_mozconfig(os_name, artifact_mode=False): print(MOBILE_ANDROID_MOZCONFIG_TEMPLATE % (sdk_path, ndk_path)) -def android_ndk_url(os_name, ver='r15c'): +def android_ndk_url(os_name, ver=NDK_VERSION): # Produce a URL like # 'https://dl.google.com/android/repository/android-ndk-$VER-linux-x86_64.zip base_url = 'https://dl.google.com/android/repository/android-ndk'