From 177ad5806d2eabf14697c3b248a259d724c39889 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 7 Jun 2019 22:20:48 +0000 Subject: [PATCH] Bug 1557855 - Change how --with-android-sdk is handled. r=nalexander We make it have a default value only if the corresponding directory exists, and make it throw a more explicit error when the explicitly given directory doesn't exist. Differential Revision: https://phabricator.services.mozilla.com/D34250 --HG-- extra : moz-landing-system : lando --- build/moz.configure/android-sdk.configure | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/moz.configure/android-sdk.configure b/build/moz.configure/android-sdk.configure index 31a97b99342f..6b790c10f8d8 100644 --- a/build/moz.configure/android-sdk.configure +++ b/build/moz.configure/android-sdk.configure @@ -15,10 +15,10 @@ def default_android_sdk_root(host, mozbuild_state_path, _): 'Linux': 'android-sdk-linux', 'WINNT': 'android-sdk-windows', }.get(host.kernel) - if sdk_basename is None: - log.warning("%s is unsupported host" % host.kernel) - return None - return os.path.join(mozbuild_state_path, sdk_basename) + if sdk_basename: + path = os.path.join(mozbuild_state_path, sdk_basename) + if os.path.isdir(path): + return path option('--with-android-sdk', nargs=1, @@ -29,7 +29,10 @@ option('--with-android-sdk', nargs=1, @depends('--with-android-sdk') @imports(_from='os.path', _import='isdir') def android_sdk_root(value): - if value and isdir(value[0]): + if value: + if not isdir(value[0]): + die("The path you specified with --with-android-sdk (%s) is not " + "a directory" % value[0]) return value[0] die("You must specify --with-android-sdk=/path/to/sdk when targeting Android, "