Add search logic to find android tools automagically, which we ship

* We search first in specified folders by the user (they can browse to
  the android SDK and java JDK).
* If the tools we want aren't found there, we look relative to the UI
  as we now distribute the required tools with windows builds.
* If we still don't find them, we prefer to look in PATH since the user
  has 'opted in' to any tools found in there. If the tool isn't in PATH
  either then we look relative to known environment variables.
This commit is contained in:
baldurk
2017-12-14 14:38:39 +00:00
parent f62096f986
commit b3e48a7576
9 changed files with 466 additions and 91 deletions
@@ -191,11 +191,13 @@ void PersistantConfig::AddAndroidHosts()
}
}
QString adbExePath =
QFile::exists(Android_AdbExecutablePath) ? QString(Android_AdbExecutablePath) : QString();
QString androidSDKPath = QFile::exists(Android_SDKPath) ? QString(Android_SDKPath) : QString();
// Set the config setting as it will be reused when we start the remoteserver etc.
SetConfigSetting("adbExePath", adbExePath);
SetConfigSetting("androidSDKPath", androidSDKPath);
QString androidJDKPath = QFile::exists(Android_JDKPath) ? QString(Android_JDKPath) : QString();
SetConfigSetting("androidJDKPath", androidJDKPath);
SetConfigSetting("MaxConnectTimeout", QString::number(Android_MaxConnectTimeout));