2013-04-25 16:02:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** 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.
|
2013-04-25 16:02:17 +02: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.
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "iosplugin.h"
|
|
|
|
|
|
2017-03-03 16:21:55 +01:00
|
|
|
#include "iosbuildconfiguration.h"
|
2013-11-04 11:11:56 +01:00
|
|
|
#include "iosbuildstep.h"
|
2013-04-25 16:02:17 +02:00
|
|
|
#include "iosconfigurations.h"
|
2013-11-04 11:11:56 +01:00
|
|
|
#include "iosconstants.h"
|
2019-01-30 17:30:24 +01:00
|
|
|
#include "iosdeploystep.h"
|
2013-04-25 16:02:17 +02:00
|
|
|
#include "iosdevicefactory.h"
|
2014-03-12 21:25:28 +01:00
|
|
|
#include "iosdsymbuildstep.h"
|
2013-11-04 11:11:56 +01:00
|
|
|
#include "iosqtversionfactory.h"
|
2017-07-14 10:12:37 +02:00
|
|
|
#include "iosrunner.h"
|
2013-04-25 16:02:17 +02:00
|
|
|
#include "iossettingspage.h"
|
2013-11-04 11:11:56 +01:00
|
|
|
#include "iossimulator.h"
|
|
|
|
|
#include "iossimulatorfactory.h"
|
2013-10-08 15:27:45 +02:00
|
|
|
#include "iostoolhandler.h"
|
2017-07-14 10:12:37 +02:00
|
|
|
#include "iosrunconfiguration.h"
|
2013-11-04 11:11:56 +01:00
|
|
|
|
2019-01-30 17:30:24 +01:00
|
|
|
#include <projectexplorer/deployconfiguration.h>
|
2017-07-14 10:12:37 +02:00
|
|
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
|
|
|
|
#include <projectexplorer/runconfiguration.h>
|
|
|
|
|
|
2019-01-30 17:30:24 +01:00
|
|
|
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
|
|
|
|
|
|
2017-07-14 10:12:37 +02:00
|
|
|
using namespace ProjectExplorer;
|
2018-02-08 09:24:22 +01:00
|
|
|
using namespace QtSupport;
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
namespace Ios {
|
2014-07-07 09:24:17 +02:00
|
|
|
namespace Internal {
|
2018-02-08 09:24:22 +01:00
|
|
|
|
2018-10-12 09:33:30 +03:00
|
|
|
Q_LOGGING_CATEGORY(iosLog, "qtc.ios.common", QtWarningMsg)
|
2013-04-25 16:02:17 +02:00
|
|
|
|
2019-01-30 17:30:24 +01:00
|
|
|
class IosDeployStepFactory : public BuildStepFactory
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
IosDeployStepFactory()
|
|
|
|
|
{
|
|
|
|
|
registerStep<IosDeployStep>(IosDeployStep::stepId());
|
|
|
|
|
setDisplayName(IosDeployStep::tr("Deploy to iOS device or emulator"));
|
|
|
|
|
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
|
|
|
|
|
setSupportedDeviceTypes({Constants::IOS_DEVICE_TYPE, Constants::IOS_SIMULATOR_TYPE});
|
|
|
|
|
setRepeatable(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class IosDeployConfigurationFactory : public DeployConfigurationFactory
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
IosDeployConfigurationFactory()
|
|
|
|
|
{
|
|
|
|
|
setConfigBaseId("Qt4ProjectManager.IosDeployConfiguration");
|
|
|
|
|
setSupportedProjectType(QmakeProjectManager::Constants::QMAKEPROJECT_ID);
|
|
|
|
|
addSupportedTargetDeviceType(Constants::IOS_DEVICE_TYPE);
|
|
|
|
|
addSupportedTargetDeviceType(Constants::IOS_SIMULATOR_TYPE);
|
|
|
|
|
setDefaultDisplayName(QCoreApplication::translate("Ios::Internal", "Deploy on iOS"));
|
|
|
|
|
addInitialStep(IosDeployStep::stepId());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2018-02-08 09:24:22 +01:00
|
|
|
class IosPluginPrivate
|
2013-10-08 15:27:45 +02:00
|
|
|
{
|
2018-02-08 09:24:22 +01:00
|
|
|
public:
|
|
|
|
|
IosBuildConfigurationFactory buildConfigurationFactory;
|
|
|
|
|
IosToolChainFactory toolChainFactory;
|
|
|
|
|
IosRunConfigurationFactory runConfigurationFactory;
|
|
|
|
|
IosSettingsPage settingsPage;
|
|
|
|
|
IosQtVersionFactory qtVersionFactory;
|
|
|
|
|
IosDeviceFactory deviceFactory;
|
|
|
|
|
IosSimulatorFactory simulatorFactory;
|
|
|
|
|
IosBuildStepFactory buildStepFactory;
|
|
|
|
|
IosDeployStepFactory deployStepFactory;
|
|
|
|
|
IosDsymBuildStepFactory dsymBuildStepFactory;
|
|
|
|
|
IosDeployConfigurationFactory deployConfigurationFactory;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IosPlugin::~IosPlugin()
|
|
|
|
|
{
|
|
|
|
|
delete d;
|
2013-10-08 15:27:45 +02:00
|
|
|
}
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
bool IosPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|
|
|
|
{
|
|
|
|
|
Q_UNUSED(arguments);
|
|
|
|
|
Q_UNUSED(errorMessage);
|
|
|
|
|
|
2018-02-08 09:24:22 +01:00
|
|
|
qRegisterMetaType<Ios::IosToolHandler::Dict>("Ios::IosToolHandler::Dict");
|
|
|
|
|
|
|
|
|
|
IosConfigurations::initialize();
|
2013-04-25 16:02:17 +02:00
|
|
|
|
2018-02-08 09:24:22 +01:00
|
|
|
d = new IosPluginPrivate;
|
2013-11-04 11:11:56 +01:00
|
|
|
|
2017-07-14 10:12:37 +02:00
|
|
|
auto constraint = [](RunConfiguration *runConfig) {
|
2018-02-08 09:24:22 +01:00
|
|
|
return qobject_cast<IosRunConfiguration *>(runConfig) != nullptr;
|
2017-07-14 10:12:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
RunControl::registerWorker<Internal::IosRunSupport>
|
|
|
|
|
(ProjectExplorer::Constants::NORMAL_RUN_MODE, constraint);
|
|
|
|
|
RunControl::registerWorker<Internal::IosDebugSupport>
|
|
|
|
|
(ProjectExplorer::Constants::DEBUG_RUN_MODE, constraint);
|
|
|
|
|
RunControl::registerWorker<Internal::IosQmlProfilerSupport>
|
|
|
|
|
(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, constraint);
|
|
|
|
|
|
2018-02-08 09:24:22 +01:00
|
|
|
return true;
|
2013-04-25 16:02:17 +02:00
|
|
|
}
|
|
|
|
|
|
2018-02-08 09:24:22 +01:00
|
|
|
} // namespace Internal
|
2013-04-25 16:02:17 +02:00
|
|
|
} // namespace Ios
|