Android: Automatically download SDK tools and essential packages

Automatically download Android SDK Tools to default path
used by Android Studio, then essential packages will be installed
using the sdkmanager tool. Automatic installation can also be
triggered by an added button in the settings page.

Essentials packages include NDK Bundle and other NDK versions
required by previous Qt versions.

An sdk_definitions.json file holds download paths for SDK Tools,
and other (Qt version <-> essential packages) combinations.

[ChangeLog][Android] Automatically download SDK Tools, NDKs and
all essential packages for Android builds.

Task-number: QTCREATORBUG-23285
Change-Id: I90e7aafecd017d2bdc959e403711d9d440a6bbb2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Assam Boudjelthia
2019-12-23 16:13:23 +02:00
parent 8bef0c9155
commit f46099d21e
18 changed files with 844 additions and 97 deletions

View File

@@ -53,9 +53,11 @@ public:
SdkPlatformPackage = 1 << 4,
SystemImagePackage = 1 << 5,
EmulatorToolsPackage = 1 << 6,
ExtraToolsPackage = 1 << 7,
NDKPackage = 1 << 7,
ExtraToolsPackage = 1 << 8,
AnyValidType = SdkToolsPackage | BuildToolsPackage | PlatformToolsPackage |
SdkPlatformPackage | SystemImagePackage | EmulatorToolsPackage | ExtraToolsPackage
SdkPlatformPackage | SystemImagePackage | EmulatorToolsPackage | NDKPackage |
ExtraToolsPackage
};
enum PackageState {
@@ -196,6 +198,23 @@ public:
PackageType type() const override;
};
class Ndk : public AndroidSdkPackage
{
public:
Ndk(QVersionNumber revision, QString sdkStylePathStr, QObject *parent = nullptr);
// AndroidSdkPackage Overrides
bool isValid() const override;
PackageType type() const override;
bool isNdkBundle() const;
void setAsNdkBundle(const bool isBundle);
private:
bool m_isBundle = false;
};
using NdkList = QList<Ndk *>;
class ExtraTools : public AndroidSdkPackage
{
public: