Files
qt-creator/src/plugins/android/androidqtversion.h
Alessandro Portale b73d6f3be8 Android: Read NDK and api versions from modules/Core.json
Qt 6.5+ writes the NDK version that was used for building Qt into
modules/Core.json. With this change, Qt Creator, now reads this version
and (if present) prefers it over the respective NDK version defined by
Qt Creator's own sdk_definition.json.

The order of preference for an NDK version being required and used for a
Qt version is now:

1) NDK that was manually set as "Default"
2) NDK defined by Qt's modules/Core.json
3) NDK version defined for a Qt version by sdk_definition.json
4) Default/fallback NDK version defined by sdk_definition.json

Task-number: QTCREATORBUG-28629
Change-Id: I2a0a9b3a1719139dc937d468e1dd3643289510a1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-01-24 17:15:11 +00:00

60 lines
1.6 KiB
C++

// Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtversionfactory.h>
#include <QCoreApplication>
namespace Android {
namespace Internal {
class AndroidQtVersion : public QtSupport::QtVersion
{
public:
AndroidQtVersion();
bool isValid() const override;
QString invalidReason() const override;
bool supportsMultipleQtAbis() const override;
ProjectExplorer::Abis detectQtAbis() const override;
void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const override;
void setupQmakeRunEnvironment(Utils::Environment &env) const override;
QSet<Utils::Id> availableFeatures() const override;
QSet<Utils::Id> targetDeviceTypes() const override;
QString description() const override;
const QStringList &androidAbis() const;
int minimumNDK() const;
static Utils::FilePath androidDeploymentSettings(const ProjectExplorer::Target *target);
struct BuiltWith {
int apiVersion = -1;
QVersionNumber ndkVersion;
};
static BuiltWith parseBuiltWith(const QByteArray &modulesCoreJsonData, bool *ok = nullptr);
BuiltWith builtWith(bool *ok = nullptr) const;
protected:
void parseMkSpec(ProFileEvaluator *) const override;
private:
std::unique_ptr<QObject> m_guard;
mutable QStringList m_androidAbis;
mutable int m_minNdk = -1;
};
class AndroidQtVersionFactory : public QtSupport::QtVersionFactory
{
public:
AndroidQtVersionFactory();
};
} // namespace Internal
} // namespace Android