Files
qt-creator/src/plugins/android/androidqtversion.h
Alessandro Portale 44bf71169c Revert "Android: Speed up startup by using existing Qt6 Information"
This reverts commit 16c12f71ff.

Reason for revert: Introduces bugs.

AndroidQtVersion::addToEnvironment() set varying ANDROID_NDK_PLATFORM
values in successive calls. Only after a call of
QtVersion::ensureMkSpecParsed, a consistent value is set.

The symptom could be fixed by adding QtVersion::ensureMkSpecParsed calls
in strategic places (e.g. in the beginning of
AndroidQtVersion::addToEnvironment), but it does not make me confident
that this covers all potential code paths. The change that introduces
the issue is 16c12f71ff and will therefore
be reverted. It may be resurrected in QtC 14, but with much caution.

This issue seems to be specific to qmake. It hardens my impression, that
there are no easy gains to be made in the current state of the Android
plugin. An improvement for one use-case will break another use-case
which may be fixed only after two release cycles. It is Mikado code:
"Only touch if needed and safe".

Change-Id: I6ad860f6af8848a900d9421837a03929f9a57645
Fixes: QTCREATORBUG-30554
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-03-26 13:38:34 +00:00

58 lines
1.7 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>
namespace Android::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 QString androidDeploymentSettingsFileName(const ProjectExplorer::Target *target);
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;
};
void setupAndroidQtVersion();
#ifdef WITH_TESTS
QObject *createAndroidQtVersionTest();
#endif
} // Android::Internal