forked from qt-creator/qt-creator
Project managers: Replace various uses of ProjectConfiguration::target()
Some were wrong, others unneeded. Change-Id: I308288e75f8d1b192863171661d72d27f1e6da07 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -909,7 +909,7 @@ Tasking::GroupItem AndroidBuildApkStep::runRecipe()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto androidAbis = applicationAbis(target());
|
const auto androidAbis = applicationAbis(kit());
|
||||||
const QString buildKey = buildConfiguration()->activeBuildKey();
|
const QString buildKey = buildConfiguration()->activeBuildKey();
|
||||||
const FilePath buildDir = buildDirectory();
|
const FilePath buildDir = buildDirectory();
|
||||||
const FilePath androidBuildDir = androidBuildDirectory(buildConfiguration());
|
const FilePath androidBuildDir = androidBuildDirectory(buildConfiguration());
|
||||||
@@ -956,7 +956,7 @@ Tasking::GroupItem AndroidBuildApkStep::runRecipe()
|
|||||||
if (targets.isEmpty())
|
if (targets.isEmpty())
|
||||||
return inputExists; // qmake does this job for us
|
return inputExists; // qmake does this job for us
|
||||||
|
|
||||||
QJsonObject deploySettings = deploymentSettings(target());
|
QJsonObject deploySettings = deploymentSettings(kit());
|
||||||
QString applicationBinary;
|
QString applicationBinary;
|
||||||
if (!version->supportsMultipleQtAbis()) {
|
if (!version->supportsMultipleQtAbis()) {
|
||||||
QTC_ASSERT(androidAbis.size() == 1, return false);
|
QTC_ASSERT(androidAbis.size() == 1, return false);
|
||||||
@@ -1164,7 +1164,7 @@ QVariant AndroidBuildApkStep::data(Utils::Id id) const
|
|||||||
return QVariant::fromValue(AndroidConfig::sdkLocation());
|
return QVariant::fromValue(AndroidConfig::sdkLocation());
|
||||||
|
|
||||||
if (id == Constants::AndroidMkSpecAbis)
|
if (id == Constants::AndroidMkSpecAbis)
|
||||||
return applicationAbis(target());
|
return applicationAbis(kit());
|
||||||
|
|
||||||
return AbstractProcessStep::data(id);
|
return AbstractProcessStep::data(id);
|
||||||
}
|
}
|
||||||
|
@@ -176,7 +176,7 @@ bool AndroidDeployQtStep::init()
|
|||||||
|
|
||||||
m_androiddeployqtArgs = {};
|
m_androiddeployqtArgs = {};
|
||||||
|
|
||||||
const QStringList androidABIs = applicationAbis(target());
|
const QStringList androidABIs = applicationAbis(kit());
|
||||||
if (androidABIs.isEmpty()) {
|
if (androidABIs.isEmpty()) {
|
||||||
reportWarningOrError(Tr::tr("No Android architecture (ABI) is set by the project."),
|
reportWarningOrError(Tr::tr("No Android architecture (ABI) is set by the project."),
|
||||||
Task::Error);
|
Task::Error);
|
||||||
@@ -189,10 +189,6 @@ bool AndroidDeployQtStep::init()
|
|||||||
RunConfiguration *rc = buildConfiguration()->activeRunConfiguration();
|
RunConfiguration *rc = buildConfiguration()->activeRunConfiguration();
|
||||||
QTC_ASSERT(rc, reportWarningOrError(Tr::tr("The kit's run configuration is invalid."), Task::Error);
|
QTC_ASSERT(rc, reportWarningOrError(Tr::tr("The kit's run configuration is invalid."), Task::Error);
|
||||||
return false);
|
return false);
|
||||||
BuildConfiguration *bc = target()->activeBuildConfiguration();
|
|
||||||
QTC_ASSERT(bc, reportWarningOrError(Tr::tr("The kit's build configuration is invalid."),
|
|
||||||
Task::Error);
|
|
||||||
return false);
|
|
||||||
|
|
||||||
const int minTargetApi = minimumSDK(buildConfiguration());
|
const int minTargetApi = minimumSDK(buildConfiguration());
|
||||||
qCDebug(deployStepLog) << "Target architecture:" << androidABIs
|
qCDebug(deployStepLog) << "Target architecture:" << androidABIs
|
||||||
@@ -297,7 +293,7 @@ bool AndroidDeployQtStep::init()
|
|||||||
if (buildType() == BuildConfiguration::Release)
|
if (buildType() == BuildConfiguration::Release)
|
||||||
m_androiddeployqtArgs.addArgs({"--release"});
|
m_androiddeployqtArgs.addArgs({"--release"});
|
||||||
|
|
||||||
auto androidBuildApkStep = bc->buildSteps()->firstOfType<AndroidBuildApkStep>();
|
auto androidBuildApkStep = stepList()->firstOfType<AndroidBuildApkStep>();
|
||||||
if (androidBuildApkStep && androidBuildApkStep->signPackage()) {
|
if (androidBuildApkStep && androidBuildApkStep->signPackage()) {
|
||||||
// The androiddeployqt tool is not really written to do stand-alone installations.
|
// The androiddeployqt tool is not really written to do stand-alone installations.
|
||||||
// This hack forces it to use the correct filename for the apk file when installing
|
// This hack forces it to use the correct filename for the apk file when installing
|
||||||
@@ -307,7 +303,7 @@ bool AndroidDeployQtStep::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_environment = bc->environment();
|
m_environment = buildConfiguration()->environment();
|
||||||
|
|
||||||
m_adbPath = AndroidConfig::adbToolPath();
|
m_adbPath = AndroidConfig::adbToolPath();
|
||||||
return true;
|
return true;
|
||||||
@@ -537,11 +533,8 @@ QWidget *AndroidDeployQtStep::createConfigWidget()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: Write error messages on all the early returns below.
|
// TODO: Write error messages on all the early returns below.
|
||||||
Target *currentTarget = target();
|
|
||||||
if (currentTarget == nullptr)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const QStringList appAbis = applicationAbis(currentTarget);
|
const QStringList appAbis = applicationAbis(kit());
|
||||||
if (appAbis.isEmpty())
|
if (appAbis.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -595,7 +588,7 @@ QWidget *AndroidDeployQtStep::createConfigWidget()
|
|||||||
};
|
};
|
||||||
|
|
||||||
TaskTreeRunner *runner = new TaskTreeRunner;
|
TaskTreeRunner *runner = new TaskTreeRunner;
|
||||||
runner->setParent(currentTarget);
|
runner->setParent(target());
|
||||||
runner->start(recipe);
|
runner->start(recipe);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -223,9 +223,9 @@ QString buildTargetSDK(const BuildConfiguration *bc)
|
|||||||
return fallback;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList applicationAbis(const Target *target)
|
QStringList applicationAbis(const Kit *k)
|
||||||
{
|
{
|
||||||
auto qt = dynamic_cast<AndroidQtVersion *>(QtSupport::QtKitAspect::qtVersion(target->kit()));
|
auto qt = dynamic_cast<AndroidQtVersion *>(QtSupport::QtKitAspect::qtVersion(k));
|
||||||
return qt ? qt->androidAbis() : QStringList();
|
return qt ? qt->androidAbis() : QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,13 +241,13 @@ QString archTriplet(const QString &abi)
|
|||||||
return {"arm-linux-androideabi"};
|
return {"arm-linux-androideabi"};
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject deploymentSettings(const Target *target)
|
QJsonObject deploymentSettings(const Kit *k)
|
||||||
{
|
{
|
||||||
QtSupport::QtVersion *qt = QtSupport::QtKitAspect::qtVersion(target->kit());
|
QtSupport::QtVersion *qt = QtSupport::QtKitAspect::qtVersion(k);
|
||||||
if (!qt)
|
if (!qt)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
auto tc = ToolchainKitAspect::cxxToolchain(target->kit());
|
auto tc = ToolchainKitAspect::cxxToolchain(k);
|
||||||
if (!tc || tc->typeId() != Constants::ANDROID_TOOLCHAIN_TYPEID)
|
if (!tc || tc->typeId() != Constants::ANDROID_TOOLCHAIN_TYPEID)
|
||||||
return {};
|
return {};
|
||||||
QJsonObject settings;
|
QJsonObject settings;
|
||||||
@@ -256,7 +256,7 @@ QJsonObject deploymentSettings(const Target *target)
|
|||||||
settings["ndk"] = AndroidConfig::ndkLocation(qt).toFSPathString();
|
settings["ndk"] = AndroidConfig::ndkLocation(qt).toFSPathString();
|
||||||
settings["sdk"] = AndroidConfig::sdkLocation().toFSPathString();
|
settings["sdk"] = AndroidConfig::sdkLocation().toFSPathString();
|
||||||
if (!qt->supportsMultipleQtAbis()) {
|
if (!qt->supportsMultipleQtAbis()) {
|
||||||
const QStringList abis = applicationAbis(target);
|
const QStringList abis = applicationAbis(k);
|
||||||
QTC_ASSERT(abis.size() == 1, return {});
|
QTC_ASSERT(abis.size() == 1, return {});
|
||||||
settings["stdcpp-path"] = (AndroidConfig::toolchainPath(qt) / "sysroot/usr/lib"
|
settings["stdcpp-path"] = (AndroidConfig::toolchainPath(qt) / "sysroot/usr/lib"
|
||||||
/ archTriplet(abis.first()) / "libc++_shared.so")
|
/ archTriplet(abis.first()) / "libc++_shared.so")
|
||||||
|
@@ -49,7 +49,7 @@ int minimumSDK(const ProjectExplorer::BuildConfiguration *bc);
|
|||||||
int minimumSDK(const ProjectExplorer::Kit *kit);
|
int minimumSDK(const ProjectExplorer::Kit *kit);
|
||||||
int defaultMinimumSDK(const QtSupport::QtVersion *qtVersion);
|
int defaultMinimumSDK(const QtSupport::QtVersion *qtVersion);
|
||||||
|
|
||||||
QStringList applicationAbis(const ProjectExplorer::Target *target);
|
QStringList applicationAbis(const ProjectExplorer::Kit *k);
|
||||||
QString archTriplet(const QString &abi);
|
QString archTriplet(const QString &abi);
|
||||||
|
|
||||||
bool isQt5CmakeProject(const ProjectExplorer::Target *target);
|
bool isQt5CmakeProject(const ProjectExplorer::Target *target);
|
||||||
@@ -64,7 +64,7 @@ bool skipInstallationAndPackageSteps(const ProjectExplorer::BuildConfiguration *
|
|||||||
|
|
||||||
QString androidNameForApiLevel(int x);
|
QString androidNameForApiLevel(int x);
|
||||||
|
|
||||||
QJsonObject deploymentSettings(const ProjectExplorer::Target *target);
|
QJsonObject deploymentSettings(const ProjectExplorer::Kit *k);
|
||||||
bool isQtCreatorGenerated(const Utils::FilePath &deploymentFile);
|
bool isQtCreatorGenerated(const Utils::FilePath &deploymentFile);
|
||||||
|
|
||||||
QStringList adbSelector(const QString &serialNumber);
|
QStringList adbSelector(const QString &serialNumber);
|
||||||
|
@@ -2139,7 +2139,7 @@ static BuildConfiguration::BuildType startupBuildType()
|
|||||||
{
|
{
|
||||||
BuildConfiguration::BuildType buildType = BuildConfiguration::Unknown;
|
BuildConfiguration::BuildType buildType = BuildConfiguration::Unknown;
|
||||||
if (RunConfiguration *runConfig = activeRunConfigForActiveProject()) {
|
if (RunConfiguration *runConfig = activeRunConfigForActiveProject()) {
|
||||||
if (const BuildConfiguration *buildConfig = runConfig->target()->activeBuildConfiguration())
|
if (const BuildConfiguration *buildConfig = runConfig->buildConfiguration())
|
||||||
buildType = buildConfig->buildType();
|
buildType = buildConfig->buildType();
|
||||||
}
|
}
|
||||||
return buildType;
|
return buildType;
|
||||||
|
@@ -39,8 +39,7 @@ namespace Debugger::Internal {
|
|||||||
|
|
||||||
static bool isLocal(RunConfiguration *runConfiguration)
|
static bool isLocal(RunConfiguration *runConfiguration)
|
||||||
{
|
{
|
||||||
Target *target = runConfiguration ? runConfiguration->target() : nullptr;
|
Kit *kit = runConfiguration ? runConfiguration->kit() : nullptr;
|
||||||
Kit *kit = target ? target->kit() : nullptr;
|
|
||||||
return RunDeviceTypeKitAspect::deviceTypeId(kit) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
return RunDeviceTypeKitAspect::deviceTypeId(kit) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -51,11 +51,9 @@ private:
|
|||||||
const FilePath projectDirectory = project()->projectDirectory();
|
const FilePath projectDirectory = project()->projectDirectory();
|
||||||
ProcessRunData r;
|
ProcessRunData r;
|
||||||
QStringList args;
|
QStringList args;
|
||||||
if (BuildConfiguration *buildConfiguration = target()->activeBuildConfiguration()) {
|
args << "--work-dir"
|
||||||
args << "--work-dir"
|
<< QDir(projectDirectory.toUrlishString()).relativeFilePath(
|
||||||
<< QDir(projectDirectory.toUrlishString()).relativeFilePath(
|
buildConfiguration()->buildDirectory().toUrlishString());
|
||||||
buildConfiguration->buildDirectory().toUrlishString());
|
|
||||||
}
|
|
||||||
args << "exec" << executable();
|
args << "exec" << executable();
|
||||||
if (!arguments.arguments().isEmpty())
|
if (!arguments.arguments().isEmpty())
|
||||||
args << "--" << arguments.arguments();
|
args << "--" << arguments.arguments();
|
||||||
|
@@ -127,86 +127,83 @@ FilePath IosRunConfiguration::bundleDirectory() const
|
|||||||
}
|
}
|
||||||
FilePath res;
|
FilePath res;
|
||||||
bool shouldAppendBuildTypeAndPlatform = true;
|
bool shouldAppendBuildTypeAndPlatform = true;
|
||||||
if (BuildConfiguration *bc = target()->activeBuildConfiguration()) {
|
if (ProjectNode *node = project()->findNodeForBuildKey(buildKey())) {
|
||||||
Project *project = bc->project();
|
QString pathStr = node->data(Constants::IosBuildDir).toString();
|
||||||
if (ProjectNode *node = project->findNodeForBuildKey(buildKey())) {
|
const QString cmakeGenerator = node->data(Constants::IosCmakeGenerator).toString();
|
||||||
QString pathStr = node->data(Constants::IosBuildDir).toString();
|
|
||||||
const QString cmakeGenerator = node->data(Constants::IosCmakeGenerator).toString();
|
|
||||||
|
|
||||||
if (cmakeGenerator.isEmpty()) {
|
if (cmakeGenerator.isEmpty()) {
|
||||||
// qmake node gives absolute IosBuildDir
|
// qmake node gives absolute IosBuildDir
|
||||||
res = FilePath::fromString(pathStr);
|
res = FilePath::fromString(pathStr);
|
||||||
} else {
|
} else {
|
||||||
// CMake node gives IosBuildDir relative to root build directory
|
// CMake node gives IosBuildDir relative to root build directory
|
||||||
|
|
||||||
bool useCmakePath = true;
|
bool useCmakePath = true;
|
||||||
|
|
||||||
if (pathStr.isEmpty())
|
if (pathStr.isEmpty())
|
||||||
|
useCmakePath = false;
|
||||||
|
|
||||||
|
if (useCmakePath && cmakeGenerator == "Xcode") {
|
||||||
|
// When generating Xcode project, CMake may put a "${EFFECTIVE_PLATFORM_NAME}" macro,
|
||||||
|
// which is expanded by Xcode at build time.
|
||||||
|
// To get an actual executable path at configure time, replace this macro here
|
||||||
|
// depending on the device type.
|
||||||
|
|
||||||
|
const QString before = "${EFFECTIVE_PLATFORM_NAME}";
|
||||||
|
|
||||||
|
int idx = pathStr.indexOf(before);
|
||||||
|
|
||||||
|
if (idx == -1) {
|
||||||
useCmakePath = false;
|
useCmakePath = false;
|
||||||
|
|
||||||
if (useCmakePath && cmakeGenerator == "Xcode") {
|
|
||||||
// When generating Xcode project, CMake may put a "${EFFECTIVE_PLATFORM_NAME}" macro,
|
|
||||||
// which is expanded by Xcode at build time.
|
|
||||||
// To get an actual executable path at configure time, replace this macro here
|
|
||||||
// depending on the device type.
|
|
||||||
|
|
||||||
const QString before = "${EFFECTIVE_PLATFORM_NAME}";
|
|
||||||
|
|
||||||
int idx = pathStr.indexOf(before);
|
|
||||||
|
|
||||||
if (idx == -1) {
|
|
||||||
useCmakePath = false;
|
|
||||||
} else {
|
|
||||||
QString after;
|
|
||||||
if (isDevice)
|
|
||||||
after = "-iphoneos";
|
|
||||||
else
|
|
||||||
after = "-iphonesimulator";
|
|
||||||
|
|
||||||
pathStr.replace(idx, before.length(), after);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (useCmakePath) {
|
|
||||||
// With Ninja generator IosBuildDir may be just "." when executable is in the root directory,
|
|
||||||
// so use canonical path to ensure that redundand dot is removed.
|
|
||||||
res = bc->buildDirectory().pathAppended(pathStr).canonicalPath();
|
|
||||||
// All done with path provided by CMake
|
|
||||||
shouldAppendBuildTypeAndPlatform = false;
|
|
||||||
} else {
|
} else {
|
||||||
res = bc->buildDirectory();
|
QString after;
|
||||||
|
if (isDevice)
|
||||||
|
after = "-iphoneos";
|
||||||
|
else
|
||||||
|
after = "-iphonesimulator";
|
||||||
|
|
||||||
|
pathStr.replace(idx, before.length(), after);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (res.isEmpty()) {
|
if (useCmakePath) {
|
||||||
// Fallback
|
// With Ninja generator IosBuildDir may be just "." when executable is in the root directory,
|
||||||
res = bc->buildDirectory();
|
// so use canonical path to ensure that redundand dot is removed.
|
||||||
shouldAppendBuildTypeAndPlatform = true;
|
res = buildConfiguration()->buildDirectory().pathAppended(pathStr).canonicalPath();
|
||||||
}
|
// All done with path provided by CMake
|
||||||
|
shouldAppendBuildTypeAndPlatform = false;
|
||||||
if (shouldAppendBuildTypeAndPlatform) {
|
} else {
|
||||||
switch (bc->buildType()) {
|
res = buildConfiguration()->buildDirectory();
|
||||||
case BuildConfiguration::Debug :
|
|
||||||
case BuildConfiguration::Unknown :
|
|
||||||
if (isDevice)
|
|
||||||
res = res / "Debug-iphoneos";
|
|
||||||
else
|
|
||||||
res = res.pathAppended("Debug-iphonesimulator");
|
|
||||||
break;
|
|
||||||
case BuildConfiguration::Profile :
|
|
||||||
case BuildConfiguration::Release :
|
|
||||||
if (isDevice)
|
|
||||||
res = res.pathAppended("Release-iphoneos");
|
|
||||||
else
|
|
||||||
res = res.pathAppended("Release-iphonesimulator");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
qCWarning(iosLog) << "IosBuildStep had an unknown buildType "
|
|
||||||
<< target()->activeBuildConfiguration()->buildType();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res.isEmpty()) {
|
||||||
|
// Fallback
|
||||||
|
res = buildConfiguration()->buildDirectory();
|
||||||
|
shouldAppendBuildTypeAndPlatform = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldAppendBuildTypeAndPlatform) {
|
||||||
|
switch (buildConfiguration()->buildType()) {
|
||||||
|
case BuildConfiguration::Debug :
|
||||||
|
case BuildConfiguration::Unknown :
|
||||||
|
if (isDevice)
|
||||||
|
res = res / "Debug-iphoneos";
|
||||||
|
else
|
||||||
|
res = res.pathAppended("Debug-iphonesimulator");
|
||||||
|
break;
|
||||||
|
case BuildConfiguration::Profile :
|
||||||
|
case BuildConfiguration::Release :
|
||||||
|
if (isDevice)
|
||||||
|
res = res.pathAppended("Release-iphoneos");
|
||||||
|
else
|
||||||
|
res = res.pathAppended("Release-iphonesimulator");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
qCWarning(iosLog) << "IosBuildStep had an unknown buildType "
|
||||||
|
<< buildConfiguration()->buildType();
|
||||||
|
}
|
||||||
|
}
|
||||||
return res.pathAppended(applicationName() + ".app");
|
return res.pathAppended(applicationName() + ".app");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,10 +22,9 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace McuSupport::Internal {
|
namespace McuSupport::Internal {
|
||||||
|
|
||||||
static FilePath cmakeFilePath(const Target *target)
|
static FilePath cmakeFilePath(const Kit *k)
|
||||||
{
|
{
|
||||||
const CMakeProjectManager::CMakeTool *tool = CMakeProjectManager::CMakeKitAspect::cmakeTool(
|
const CMakeProjectManager::CMakeTool *tool = CMakeProjectManager::CMakeKitAspect::cmakeTool(k);
|
||||||
target->kit());
|
|
||||||
return tool->filePath();
|
return tool->filePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +82,7 @@ FlashRunWorkerFactory::FlashRunWorkerFactory()
|
|||||||
auto worker = new ProcessRunner(runControl);
|
auto worker = new ProcessRunner(runControl);
|
||||||
worker->setStartModifier([worker, runControl] {
|
worker->setStartModifier([worker, runControl] {
|
||||||
const BuildConfiguration *bc = runControl->buildConfiguration();
|
const BuildConfiguration *bc = runControl->buildConfiguration();
|
||||||
worker->setCommandLine({cmakeFilePath(bc->target()),
|
worker->setCommandLine({cmakeFilePath(bc->kit()),
|
||||||
runControl->aspectData<StringAspect>()->value, CommandLine::Raw});
|
runControl->aspectData<StringAspect>()->value, CommandLine::Raw});
|
||||||
worker->setWorkingDirectory(bc->buildDirectory());
|
worker->setWorkingDirectory(bc->buildDirectory());
|
||||||
worker->setEnvironment(bc->environment());
|
worker->setEnvironment(bc->environment());
|
||||||
|
@@ -569,8 +569,8 @@ BuildForRunConfigStatus BuildManager::potentiallyBuildForRunConfig(RunConfigurat
|
|||||||
if (!isBuilding()) {
|
if (!isBuilding()) {
|
||||||
switch (projectExplorerSettings().buildBeforeDeploy) {
|
switch (projectExplorerSettings().buildBeforeDeploy) {
|
||||||
case BuildBeforeRunMode::AppOnly:
|
case BuildBeforeRunMode::AppOnly:
|
||||||
if (rc->target()->activeBuildConfiguration())
|
if (rc->buildConfiguration())
|
||||||
rc->target()->activeBuildConfiguration()->restrictNextBuild(rc);
|
rc->buildConfiguration()->restrictNextBuild(rc);
|
||||||
Q_FALLTHROUGH();
|
Q_FALLTHROUGH();
|
||||||
case BuildBeforeRunMode::WholeProject:
|
case BuildBeforeRunMode::WholeProject:
|
||||||
stepIds << Id(Constants::BUILDSTEPS_BUILD);
|
stepIds << Id(Constants::BUILDSTEPS_BUILD);
|
||||||
@@ -586,8 +586,8 @@ BuildForRunConfigStatus BuildManager::potentiallyBuildForRunConfig(RunConfigurat
|
|||||||
Project * const pro = rc->project();
|
Project * const pro = rc->project();
|
||||||
const int queueCount = queue(projectWithDependencies(pro, stepIds),
|
const int queueCount = queue(projectWithDependencies(pro, stepIds),
|
||||||
ConfigSelection::Active, rc);
|
ConfigSelection::Active, rc);
|
||||||
if (rc->target()->activeBuildConfiguration())
|
if (rc->buildConfiguration())
|
||||||
rc->target()->activeBuildConfiguration()->restrictNextBuild(nullptr);
|
rc->buildConfiguration()->restrictNextBuild(nullptr);
|
||||||
|
|
||||||
if (queueCount < 0)
|
if (queueCount < 0)
|
||||||
return BuildForRunConfigStatus::BuildFailed;
|
return BuildForRunConfigStatus::BuildFailed;
|
||||||
|
@@ -173,8 +173,9 @@ Environment BuildStep::buildEnvironment() const
|
|||||||
{
|
{
|
||||||
if (const auto bc = qobject_cast<BuildConfiguration *>(projectConfiguration()))
|
if (const auto bc = qobject_cast<BuildConfiguration *>(projectConfiguration()))
|
||||||
return bc->environment();
|
return bc->environment();
|
||||||
if (const auto bc = target()->activeBuildConfiguration())
|
if (const auto dc = qobject_cast<DeployConfiguration *>(projectConfiguration()))
|
||||||
return bc->environment();
|
return dc->buildConfiguration()->environment();
|
||||||
|
QTC_CHECK(false);
|
||||||
return Environment::systemEnvironment();
|
return Environment::systemEnvironment();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3818,7 +3818,7 @@ void ProjectExplorerPluginPrivate::openTerminalHereWithRunEnv()
|
|||||||
const ProcessRunData runnable = runConfig->runnable();
|
const ProcessRunData runnable = runConfig->runnable();
|
||||||
IDevice::ConstPtr device = DeviceManager::deviceForPath(runnable.command.executable());
|
IDevice::ConstPtr device = DeviceManager::deviceForPath(runnable.command.executable());
|
||||||
if (!device)
|
if (!device)
|
||||||
device = RunDeviceKitAspect::device(bc->target()->kit());
|
device = RunDeviceKitAspect::device(bc->kit());
|
||||||
QTC_ASSERT(device && device->canOpenTerminal(), return);
|
QTC_ASSERT(device && device->canOpenTerminal(), return);
|
||||||
|
|
||||||
FilePath workingDir = device->type() == Constants::DESKTOP_DEVICE_TYPE
|
FilePath workingDir = device->type() == Constants::DESKTOP_DEVICE_TYPE
|
||||||
|
@@ -50,7 +50,7 @@ QbsInstallStep::QbsInstallStep(BuildStepList *bsl, Id id)
|
|||||||
|
|
||||||
bool QbsInstallStep::init()
|
bool QbsInstallStep::init()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!target()->buildSystem()->isParsing(), return false);
|
QTC_ASSERT(!buildSystem()->isParsing(), return false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ FilePath QbsInstallStep::installRoot() const
|
|||||||
|
|
||||||
const QbsBuildConfiguration *QbsInstallStep::buildConfig() const
|
const QbsBuildConfiguration *QbsInstallStep::buildConfig() const
|
||||||
{
|
{
|
||||||
return static_cast<QbsBuildConfiguration *>(target()->activeBuildConfiguration());
|
return static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *QbsInstallStep::createConfigWidget()
|
QWidget *QbsInstallStep::createConfigWidget()
|
||||||
|
@@ -108,7 +108,7 @@ void QmlPreviewRunner::start()
|
|||||||
{
|
{
|
||||||
if (m_translationUpdater)
|
if (m_translationUpdater)
|
||||||
m_translationUpdater->start();
|
m_translationUpdater->start();
|
||||||
m_connectionManager.setTarget(runControl()->buildConfiguration()->target());
|
m_connectionManager.setTarget(runControl()->target());
|
||||||
m_connectionManager.connectToServer(runControl()->qmlChannel());
|
m_connectionManager.connectToServer(runControl()->qmlChannel());
|
||||||
reportStarted();
|
reportStarted();
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ void AppManagerDeployConfigurationAutoSwitcher::onActiveDeployConfigurationChang
|
|||||||
{
|
{
|
||||||
if (m_deployConfiguration != deployConfiguration) {
|
if (m_deployConfiguration != deployConfiguration) {
|
||||||
m_deployConfiguration = deployConfiguration;
|
m_deployConfiguration = deployConfiguration;
|
||||||
if (deployConfiguration && deployConfiguration->target()) {
|
if (deployConfiguration) {
|
||||||
if (auto runConfiguration = deployConfiguration->buildConfiguration()->activeRunConfiguration()) {
|
if (auto runConfiguration = deployConfiguration->buildConfiguration()->activeRunConfiguration()) {
|
||||||
m_deployConfigurationsUsageHistory.insert(runConfiguration, deployConfiguration);
|
m_deployConfigurationsUsageHistory.insert(runConfiguration, deployConfiguration);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user