ANDROID_SDK_ROOT support (#2106)

Summary:
According to Google, ANDROID_HOME is deprecated.
This means, that having only ANDROID_SDK_ROOT as environment variable leading to Android SDK is enough.
Flipper supports only ANDROID_HOME, so I would like to add ANDROID_SDK_ROOT support.
However, there is a set of rules of ANDROID_HOME and ANDROID_SDK_ROOT priority.
Everything is mentioned on a this page: https://developer.android.com/studio/command-line/variables

## Changelog
Added ANDROID_SDK_ROOT environment variable support

Pull Request resolved: https://github.com/facebook/flipper/pull/2106

Test Plan: Probably I would need a help with this

Reviewed By: mweststrate

Differential Revision: D27505024

Pulled By: passy

fbshipit-source-id: 8bdc66a9652c673fd44944d87af1efc9e93d0f1b
This commit is contained in:
Mykyta Sikriier
2021-04-07 03:18:40 -07:00
committed by Facebook GitHub Bot
parent ebcb535fd3
commit c9b6f6c7d9
3 changed files with 63 additions and 19 deletions

View File

@@ -162,7 +162,7 @@ function setProcessState(store: Store) {
const androidHome = settings.androidHome;
const idbPath = settings.idbPath;
if (!process.env.ANDROID_HOME) {
if (!process.env.ANDROID_HOME && !process.env.ANDROID_SDK_ROOT) {
process.env.ANDROID_HOME = androidHome;
}