/****************************************************************************
**
** Copyright (C) 2012 - 2014 Jolla Ltd.
** Contact: http://jolla.com/
**
** This file is part of Qt Creator.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Digia.
**
****************************************************************************/

#include "nxtrunconfigurationfactory.h"

#include <nxtconstants.h>
#include <device/nxtdevicefactory.h>
#include <steps/run/nxtrunconfiguration.h>
#include <steps/run/nxtrunrestconfiguration.h>

#include <projectexplorer/buildtargetinfo.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/target.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <utils/qtcassert.h>

using namespace Nxt::Constants;
using namespace ProjectExplorer;
using namespace QmakeProjectManager;
using namespace Utils;

namespace Nxt {
namespace Internal {

NxtRunConfigurationFactory::NxtRunConfigurationFactory(QObject *parent)
    : IRunConfigurationFactory(parent)
{
    setObjectName("NxtRunConfigurationFactory");
#if 0
    registerRunConfiguration<NxtRunConfiguration>(NXT_RUNCONFIGURATION_PREFIX);
#else
    registerRunConfiguration<NxtRunRestConfiguration>(NXT_RUNRESTCONFIGURATION_PREFIX);
#endif
    setSupportedTargetDeviceTypes({NXT_DEVICE_TYPE});
    setDisplayNamePattern(tr("%1 (on IDS NXT Device)"));
}

bool NxtRunConfigurationFactory::canCreateHelper(Target *parent, const QString &buildTarget) const
{
    return parent->applicationTargets().hasTarget(buildTarget);
}

} // namespace Internal
} // namespace Nxt
