2016-01-15 14:57:40 +01:00
|
|
|
/****************************************************************************
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com>
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2012-04-18 20:30:57 +03:00
|
|
|
|
|
|
|
|
#include "androidqtversionfactory.h"
|
|
|
|
|
#include "androidqtversion.h"
|
|
|
|
|
#include "androidconstants.h"
|
|
|
|
|
#include <qtsupport/qtsupportconstants.h>
|
|
|
|
|
#include <utils/qtcassert.h>
|
|
|
|
|
#include <proparser/profileevaluator.h>
|
|
|
|
|
|
|
|
|
|
#include <QFileInfo>
|
|
|
|
|
|
|
|
|
|
namespace Android {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
AndroidQtVersionFactory::AndroidQtVersionFactory(QObject *parent)
|
|
|
|
|
: QtSupport::QtVersionFactory(parent)
|
|
|
|
|
{
|
2019-02-13 18:45:41 +01:00
|
|
|
setQtVersionCreator([] { return new AndroidQtVersion; });
|
2012-04-18 20:30:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool AndroidQtVersionFactory::canRestore(const QString &type)
|
|
|
|
|
{
|
|
|
|
|
return type == QLatin1String(Constants::ANDROIDQT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int AndroidQtVersionFactory::priority() const
|
|
|
|
|
{
|
|
|
|
|
return 90;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QtSupport::BaseQtVersion *AndroidQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
|
|
|
|
|
{
|
2015-10-29 18:03:28 +01:00
|
|
|
QFileInfo fi = qmakePath.toFileInfo();
|
2012-04-18 20:30:57 +03:00
|
|
|
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
|
2018-07-25 12:19:15 +02:00
|
|
|
return nullptr;
|
2013-03-06 11:55:52 +01:00
|
|
|
if (!evaluator->values(QLatin1String("CONFIG")).contains(QLatin1String("android"))
|
|
|
|
|
&& evaluator->value(QLatin1String("QMAKE_PLATFORM")) != QLatin1String("android"))
|
2018-07-25 12:19:15 +02:00
|
|
|
return nullptr;
|
2013-03-13 16:53:17 +01:00
|
|
|
if (evaluator->values(QLatin1String("CONFIG")).contains(QLatin1String("android-no-sdk")))
|
2018-07-25 12:19:15 +02:00
|
|
|
return nullptr;
|
2012-04-18 20:30:57 +03:00
|
|
|
return new AndroidQtVersion(qmakePath, isAutoDetected, autoDetectionSource);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // Internal
|
|
|
|
|
} // Android
|