Make Android build optional on Nix (#31231)

* Make Android build optional on Nix

I want to build Servo without also installing the entire Android SDK.
This makes it so Android support is only built if `buildAndroid` is
true.

Signed-off-by: syvb <me@iter.ca>

* Add Android support to nix-shell if SERVO_ANDROID_BUILD set

---------

Signed-off-by: syvb <me@iter.ca>
This commit is contained in:
Smitty 2024-02-01 21:13:24 -05:00 committed by GitHub
parent 92af41cfeb
commit f27227b1db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 13 deletions

View file

@ -537,6 +537,9 @@ class CommandBase(object):
if os.path.isdir(default):
env.setdefault(f"ANDROID_{kind.upper()}_ROOT", default)
if "IN_NIX_SHELL" in env and ("ANDROID_NDK_ROOT" not in env or "ANDROID_SDK_ROOT" not in env):
print("Please set SERVO_ANDROID_BUILD=1 when starting the Nix shell to include the Android SDK/NDK.")
sys.exit(1)
if "ANDROID_NDK_ROOT" not in env:
print("Please set the ANDROID_NDK_ROOT environment variable.")
sys.exit(1)