forked from qt-creator/qt-creator
Device: Add prepareForBuild()
Change-Id: I505c4e660838bc94dcdc83ba91ec225910b8f60d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -14,11 +14,14 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/devicesupport/idevicewidget.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
|
||||
@@ -145,6 +148,8 @@ public:
|
||||
|
||||
CommandLine withDockerExecCmd(const CommandLine &cmd, bool interactive = false) const;
|
||||
|
||||
bool prepareForBuild(const Target *target);
|
||||
|
||||
private:
|
||||
bool createContainer();
|
||||
void startContainer();
|
||||
@@ -443,6 +448,14 @@ static QString getLocalIPv4Address()
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool DockerDevicePrivate::prepareForBuild(const Target *target)
|
||||
{
|
||||
QTC_ASSERT(QThread::currentThread() == thread(), return false);
|
||||
|
||||
return ensureReachable(target->project()->projectDirectory())
|
||||
&& ensureReachable(target->activeBuildConfiguration()->buildDirectory());
|
||||
}
|
||||
|
||||
bool DockerDevicePrivate::createContainer()
|
||||
{
|
||||
if (!m_settings)
|
||||
@@ -1355,4 +1368,9 @@ void DockerDevicePrivate::setData(const DockerDeviceData &data)
|
||||
}
|
||||
}
|
||||
|
||||
bool DockerDevice::prepareForBuild(const Target *target)
|
||||
{
|
||||
return d->prepareForBuild(target);
|
||||
}
|
||||
|
||||
} // namespace Docker::Internal
|
||||
|
||||
Reference in New Issue
Block a user