forked from qt-creator/qt-creator
ProjectExplorer: Introduce some BuildStep convenience accessors
... and use in ProcessStep and related classes. Change-Id: Ie6f1403d0aa2b9f5bcde06e994809466700b1357 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -86,13 +86,13 @@ const char VerboseOutputKey[] = "VerboseOutput";
|
|||||||
const char UseMinistroKey[] = "UseMinistro";
|
const char UseMinistroKey[] = "UseMinistro";
|
||||||
|
|
||||||
static void setupProcessParameters(ProcessParameters *pp,
|
static void setupProcessParameters(ProcessParameters *pp,
|
||||||
BuildConfiguration *bc,
|
BuildStep *step,
|
||||||
const QStringList &arguments,
|
const QStringList &arguments,
|
||||||
const QString &command)
|
const QString &command)
|
||||||
{
|
{
|
||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(step->macroExpander());
|
||||||
pp->setWorkingDirectory(bc->buildDirectory());
|
pp->setWorkingDirectory(step->buildDirectory());
|
||||||
Utils::Environment env = bc->environment();
|
Utils::Environment env = step->buildEnvironment();
|
||||||
pp->setEnvironment(env);
|
pp->setEnvironment(env);
|
||||||
pp->setCommandLine({command, arguments});
|
pp->setCommandLine({command, arguments});
|
||||||
}
|
}
|
||||||
@@ -152,8 +152,6 @@ AndroidBuildApkStep::AndroidBuildApkStep(BuildStepList *parent, Core::Id id)
|
|||||||
|
|
||||||
bool AndroidBuildApkStep::init()
|
bool AndroidBuildApkStep::init()
|
||||||
{
|
{
|
||||||
ProjectExplorer::BuildConfiguration *bc = buildConfiguration();
|
|
||||||
|
|
||||||
if (m_signPackage) {
|
if (m_signPackage) {
|
||||||
qCDebug(buildapkstepLog) << "Signing enabled";
|
qCDebug(buildapkstepLog) << "Signing enabled";
|
||||||
// check keystore and certificate passwords
|
// check keystore and certificate passwords
|
||||||
@@ -162,7 +160,7 @@ bool AndroidBuildApkStep::init()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bc->buildType() != ProjectExplorer::BuildConfiguration::Release)
|
if (buildType() != BuildConfiguration::Release)
|
||||||
emit addOutput(tr("Warning: Signing a debug or profile package."),
|
emit addOutput(tr("Warning: Signing a debug or profile package."),
|
||||||
OutputFormat::ErrorMessage);
|
OutputFormat::ErrorMessage);
|
||||||
}
|
}
|
||||||
@@ -208,7 +206,7 @@ bool AndroidBuildApkStep::init()
|
|||||||
|
|
||||||
QFileInfo sourceDirInfo(sourceDirName);
|
QFileInfo sourceDirInfo(sourceDirName);
|
||||||
parser->setSourceDirectory(Utils::FilePath::fromString(sourceDirInfo.canonicalFilePath()));
|
parser->setSourceDirectory(Utils::FilePath::fromString(sourceDirInfo.canonicalFilePath()));
|
||||||
parser->setBuildDirectory(bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY));
|
parser->setBuildDirectory(buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY));
|
||||||
setOutputParser(parser);
|
setOutputParser(parser);
|
||||||
|
|
||||||
m_openPackageLocationForRun = m_openPackageLocation;
|
m_openPackageLocationForRun = m_openPackageLocation;
|
||||||
@@ -224,7 +222,7 @@ bool AndroidBuildApkStep::init()
|
|||||||
command += '/';
|
command += '/';
|
||||||
command += Utils::HostOsInfo::withExecutableSuffix("androiddeployqt");
|
command += Utils::HostOsInfo::withExecutableSuffix("androiddeployqt");
|
||||||
|
|
||||||
QString outputDir = bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY).toString();
|
QString outputDir = buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY).toString();
|
||||||
|
|
||||||
if (node)
|
if (node)
|
||||||
m_inputFile = node->data(Constants::AndroidDeploySettingsFile).toString();
|
m_inputFile = node->data(Constants::AndroidDeploySettingsFile).toString();
|
||||||
@@ -273,18 +271,18 @@ bool AndroidBuildApkStep::init()
|
|||||||
// Must be the last option, otherwise androiddeployqt might use the other
|
// Must be the last option, otherwise androiddeployqt might use the other
|
||||||
// params (e.g. --sign) to choose not to add gdbserver
|
// params (e.g. --sign) to choose not to add gdbserver
|
||||||
if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0)) {
|
if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0)) {
|
||||||
if (m_addDebugger || bc->buildType() == ProjectExplorer::BuildConfiguration::Debug)
|
if (m_addDebugger || buildType() == ProjectExplorer::BuildConfiguration::Debug)
|
||||||
arguments << "--gdbserver";
|
arguments << "--gdbserver";
|
||||||
else
|
else
|
||||||
arguments << "--no-gdbserver";
|
arguments << "--no-gdbserver";
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::ProcessParameters *pp = processParameters();
|
ProjectExplorer::ProcessParameters *pp = processParameters();
|
||||||
setupProcessParameters(pp, bc, arguments, command);
|
setupProcessParameters(pp, this, arguments, command);
|
||||||
|
|
||||||
// Generate arguments with keystore password concealed
|
// Generate arguments with keystore password concealed
|
||||||
ProjectExplorer::ProcessParameters pp2;
|
ProjectExplorer::ProcessParameters pp2;
|
||||||
setupProcessParameters(&pp2, bc, argumentsPasswordConcealed, command);
|
setupProcessParameters(&pp2, this, argumentsPasswordConcealed, command);
|
||||||
m_command = pp2.effectiveCommand().toString();
|
m_command = pp2.effectiveCommand().toString();
|
||||||
m_argumentsPasswordConcealed = pp2.prettyArguments();
|
m_argumentsPasswordConcealed = pp2.prettyArguments();
|
||||||
|
|
||||||
@@ -381,13 +379,12 @@ void AndroidBuildApkStep::doRun()
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto setup = [this] {
|
auto setup = [this] {
|
||||||
auto bc = buildConfiguration();
|
|
||||||
const auto androidAbis = AndroidManager::applicationAbis(target());
|
const auto androidAbis = AndroidManager::applicationAbis(target());
|
||||||
for (const auto &abi : androidAbis) {
|
for (const auto &abi : androidAbis) {
|
||||||
Utils::FilePath androidLibsDir = bc->buildDirectory()
|
Utils::FilePath androidLibsDir = buildDirectory()
|
||||||
.pathAppended("android-build/libs")
|
.pathAppended("android-build/libs")
|
||||||
.pathAppended(abi);
|
.pathAppended(abi);
|
||||||
if (!androidLibsDir.exists() && !QDir{bc->buildDirectory().toString()}.mkpath(androidLibsDir.toString()))
|
if (!androidLibsDir.exists() && !QDir{buildDirectory().toString()}.mkpath(androidLibsDir.toString()))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,7 +413,7 @@ void AndroidBuildApkStep::doRun()
|
|||||||
if (version->qtVersion() < QtSupport::QtVersionNumber(5, 14, 0)) {
|
if (version->qtVersion() < QtSupport::QtVersionNumber(5, 14, 0)) {
|
||||||
QTC_ASSERT(androidAbis.size() == 1, return false);
|
QTC_ASSERT(androidAbis.size() == 1, return false);
|
||||||
applicationBinary = target()->activeRunConfiguration()->buildTargetInfo().targetFilePath.toString();
|
applicationBinary = target()->activeRunConfiguration()->buildTargetInfo().targetFilePath.toString();
|
||||||
Utils::FilePath androidLibsDir = bc->buildDirectory().pathAppended("android-build/libs").pathAppended(androidAbis.first());
|
Utils::FilePath androidLibsDir = buildDirectory().pathAppended("android-build/libs").pathAppended(androidAbis.first());
|
||||||
for (const auto &target : targets) {
|
for (const auto &target : targets) {
|
||||||
if (!copyFileIfNewer(target, androidLibsDir.pathAppended(QFileInfo{target}.fileName()).toString()))
|
if (!copyFileIfNewer(target, androidLibsDir.pathAppended(QFileInfo{target}.fileName()).toString()))
|
||||||
return false;
|
return false;
|
||||||
@@ -434,7 +431,7 @@ void AndroidBuildApkStep::doRun()
|
|||||||
applicationBinary.remove(0, 3).chop(targetSuffix.size());
|
applicationBinary.remove(0, 3).chop(targetSuffix.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePath androidLibsDir = bc->buildDirectory()
|
Utils::FilePath androidLibsDir = buildDirectory()
|
||||||
.pathAppended("android-build/libs")
|
.pathAppended("android-build/libs")
|
||||||
.pathAppended(abi);
|
.pathAppended(abi);
|
||||||
for (const auto &target : targets) {
|
for (const auto &target : targets) {
|
||||||
|
@@ -256,7 +256,7 @@ QWidget *AndroidBuildApkWidget::createCreateTemplatesGroup()
|
|||||||
|
|
||||||
auto createAndroidTemplatesButton = new QPushButton(tr("Create Templates"));
|
auto createAndroidTemplatesButton = new QPushButton(tr("Create Templates"));
|
||||||
connect(createAndroidTemplatesButton, &QAbstractButton::clicked, this, [this] {
|
connect(createAndroidTemplatesButton, &QAbstractButton::clicked, this, [this] {
|
||||||
CreateAndroidManifestWizard wizard(m_step->buildConfiguration()->buildSystem());
|
CreateAndroidManifestWizard wizard(m_step->buildSystem());
|
||||||
wizard.exec();
|
wizard.exec();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -348,7 +348,7 @@ void AndroidBuildApkWidget::setCertificates()
|
|||||||
|
|
||||||
void AndroidBuildApkWidget::updateSigningWarning()
|
void AndroidBuildApkWidget::updateSigningWarning()
|
||||||
{
|
{
|
||||||
bool nonRelease = m_step->buildConfiguration()->buildType() != BuildConfiguration::Release;
|
bool nonRelease = m_step->buildType() != BuildConfiguration::Release;
|
||||||
bool visible = m_step->signPackage() && nonRelease;
|
bool visible = m_step->signPackage() && nonRelease;
|
||||||
m_signingDebugWarningLabel->setVisible(visible);
|
m_signingDebugWarningLabel->setVisible(visible);
|
||||||
}
|
}
|
||||||
|
@@ -60,24 +60,23 @@ AndroidPackageInstallationStep::AndroidPackageInstallationStep(BuildStepList *bs
|
|||||||
|
|
||||||
bool AndroidPackageInstallationStep::init()
|
bool AndroidPackageInstallationStep::init()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
QString dirPath = buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY).toString();
|
||||||
QString dirPath = bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY).toString();
|
|
||||||
if (HostOsInfo::isWindowsHost())
|
if (HostOsInfo::isWindowsHost())
|
||||||
if (bc->environment().searchInPath("sh.exe").isEmpty())
|
if (buildEnvironment().searchInPath("sh.exe").isEmpty())
|
||||||
dirPath = QDir::toNativeSeparators(dirPath);
|
dirPath = QDir::toNativeSeparators(dirPath);
|
||||||
|
|
||||||
ToolChain *tc = ToolChainKitAspect::cxxToolChain(target()->kit());
|
ToolChain *tc = ToolChainKitAspect::cxxToolChain(target()->kit());
|
||||||
QTC_ASSERT(tc, return false);
|
QTC_ASSERT(tc, return false);
|
||||||
|
|
||||||
CommandLine cmd{tc->makeCommand(bc->environment())};
|
CommandLine cmd{tc->makeCommand(buildEnvironment())};
|
||||||
const QString innerQuoted = QtcProcess::quoteArg(dirPath);
|
const QString innerQuoted = QtcProcess::quoteArg(dirPath);
|
||||||
const QString outerQuoted = QtcProcess::quoteArg("INSTALL_ROOT=" + innerQuoted);
|
const QString outerQuoted = QtcProcess::quoteArg("INSTALL_ROOT=" + innerQuoted);
|
||||||
cmd.addArgs(outerQuoted + " install", CommandLine::Raw);
|
cmd.addArgs(outerQuoted + " install", CommandLine::Raw);
|
||||||
|
|
||||||
ProcessParameters *pp = processParameters();
|
ProcessParameters *pp = processParameters();
|
||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(macroExpander());
|
||||||
pp->setWorkingDirectory(bc->buildDirectory());
|
pp->setWorkingDirectory(buildDirectory());
|
||||||
Environment env = bc->environment();
|
Environment env = buildEnvironment();
|
||||||
Environment::setupEnglishOutput(&env);
|
Environment::setupEnglishOutput(&env);
|
||||||
pp->setEnvironment(env);
|
pp->setEnvironment(env);
|
||||||
pp->setCommandLine(cmd);
|
pp->setCommandLine(cmd);
|
||||||
|
@@ -86,12 +86,10 @@ AutogenStep::AutogenStep(BuildStepList *bsl, Core::Id id) : AbstractProcessStep(
|
|||||||
});
|
});
|
||||||
|
|
||||||
setSummaryUpdater([this] {
|
setSummaryUpdater([this] {
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
|
||||||
|
|
||||||
ProcessParameters param;
|
ProcessParameters param;
|
||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(macroExpander());
|
||||||
param.setEnvironment(bc->environment());
|
param.setEnvironment(buildEnvironment());
|
||||||
param.setWorkingDirectory(bc->target()->project()->projectDirectory());
|
param.setWorkingDirectory(project()->projectDirectory());
|
||||||
param.setCommandLine({FilePath::fromString("./autogen.sh"),
|
param.setCommandLine({FilePath::fromString("./autogen.sh"),
|
||||||
m_additionalArgumentsAspect->value(),
|
m_additionalArgumentsAspect->value(),
|
||||||
CommandLine::Raw});
|
CommandLine::Raw});
|
||||||
@@ -102,12 +100,10 @@ AutogenStep::AutogenStep(BuildStepList *bsl, Core::Id id) : AbstractProcessStep(
|
|||||||
|
|
||||||
bool AutogenStep::init()
|
bool AutogenStep::init()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
|
||||||
|
|
||||||
ProcessParameters *pp = processParameters();
|
ProcessParameters *pp = processParameters();
|
||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(macroExpander());
|
||||||
pp->setEnvironment(bc->environment());
|
pp->setEnvironment(buildEnvironment());
|
||||||
pp->setWorkingDirectory(bc->target()->project()->projectDirectory());
|
pp->setWorkingDirectory(project()->projectDirectory());
|
||||||
pp->setCommandLine({FilePath::fromString("./autogen.sh"),
|
pp->setCommandLine({FilePath::fromString("./autogen.sh"),
|
||||||
m_additionalArgumentsAspect->value(),
|
m_additionalArgumentsAspect->value(),
|
||||||
CommandLine::Raw});
|
CommandLine::Raw});
|
||||||
@@ -117,10 +113,8 @@ bool AutogenStep::init()
|
|||||||
|
|
||||||
void AutogenStep::doRun()
|
void AutogenStep::doRun()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
|
||||||
|
|
||||||
// Check whether we need to run autogen.sh
|
// Check whether we need to run autogen.sh
|
||||||
const QString projectDir = bc->target()->project()->projectDirectory().toString();
|
const QString projectDir = project()->projectDirectory().toString();
|
||||||
const QFileInfo configureInfo(projectDir + "/configure");
|
const QFileInfo configureInfo(projectDir + "/configure");
|
||||||
const QFileInfo configureAcInfo(projectDir + "/configure.ac");
|
const QFileInfo configureAcInfo(projectDir + "/configure.ac");
|
||||||
const QFileInfo makefileAmInfo(projectDir + "/Makefile.am");
|
const QFileInfo makefileAmInfo(projectDir + "/Makefile.am");
|
||||||
|
@@ -84,12 +84,10 @@ AutoreconfStep::AutoreconfStep(BuildStepList *bsl, Core::Id id)
|
|||||||
});
|
});
|
||||||
|
|
||||||
setSummaryUpdater([this] {
|
setSummaryUpdater([this] {
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
|
||||||
|
|
||||||
ProcessParameters param;
|
ProcessParameters param;
|
||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(macroExpander());
|
||||||
param.setEnvironment(bc->environment());
|
param.setEnvironment(buildEnvironment());
|
||||||
param.setWorkingDirectory(bc->target()->project()->projectDirectory());
|
param.setWorkingDirectory(project()->projectDirectory());
|
||||||
param.setCommandLine({Utils::FilePath::fromString("autoreconf"),
|
param.setCommandLine({Utils::FilePath::fromString("autoreconf"),
|
||||||
m_additionalArgumentsAspect->value(),
|
m_additionalArgumentsAspect->value(),
|
||||||
Utils::CommandLine::Raw});
|
Utils::CommandLine::Raw});
|
||||||
@@ -100,12 +98,10 @@ AutoreconfStep::AutoreconfStep(BuildStepList *bsl, Core::Id id)
|
|||||||
|
|
||||||
bool AutoreconfStep::init()
|
bool AutoreconfStep::init()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
|
||||||
|
|
||||||
ProcessParameters *pp = processParameters();
|
ProcessParameters *pp = processParameters();
|
||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(macroExpander());
|
||||||
pp->setEnvironment(bc->environment());
|
pp->setEnvironment(buildEnvironment());
|
||||||
pp->setWorkingDirectory(bc->target()->project()->projectDirectory());
|
pp->setWorkingDirectory(project()->projectDirectory());
|
||||||
pp->setCommandLine({Utils::FilePath::fromString("autoreconf"),
|
pp->setCommandLine({Utils::FilePath::fromString("autoreconf"),
|
||||||
m_additionalArgumentsAspect->value(), Utils::CommandLine::Raw});
|
m_additionalArgumentsAspect->value(), Utils::CommandLine::Raw});
|
||||||
|
|
||||||
@@ -114,10 +110,8 @@ bool AutoreconfStep::init()
|
|||||||
|
|
||||||
void AutoreconfStep::doRun()
|
void AutoreconfStep::doRun()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
|
||||||
|
|
||||||
// Check whether we need to run autoreconf
|
// Check whether we need to run autoreconf
|
||||||
const QString projectDir(bc->target()->project()->projectDirectory().toString());
|
const QString projectDir(project()->projectDirectory().toString());
|
||||||
|
|
||||||
if (!QFileInfo::exists(projectDir + "/configure"))
|
if (!QFileInfo::exists(projectDir + "/configure"))
|
||||||
m_runAutoreconf = true;
|
m_runAutoreconf = true;
|
||||||
|
@@ -109,9 +109,9 @@ ConfigureStep::ConfigureStep(BuildStepList *bsl, Core::Id id)
|
|||||||
BuildConfiguration *bc = buildConfiguration();
|
BuildConfiguration *bc = buildConfiguration();
|
||||||
|
|
||||||
ProcessParameters param;
|
ProcessParameters param;
|
||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(macroExpander());
|
||||||
param.setEnvironment(bc->environment());
|
param.setEnvironment(buildEnvironment());
|
||||||
param.setWorkingDirectory(bc->buildDirectory());
|
param.setWorkingDirectory(buildDirectory());
|
||||||
param.setCommandLine({FilePath::fromString(projectDirRelativeToBuildDir(bc) + "configure"),
|
param.setCommandLine({FilePath::fromString(projectDirRelativeToBuildDir(bc) + "configure"),
|
||||||
m_additionalArgumentsAspect->value(),
|
m_additionalArgumentsAspect->value(),
|
||||||
CommandLine::Raw});
|
CommandLine::Raw});
|
||||||
@@ -125,9 +125,9 @@ bool ConfigureStep::init()
|
|||||||
BuildConfiguration *bc = buildConfiguration();
|
BuildConfiguration *bc = buildConfiguration();
|
||||||
|
|
||||||
ProcessParameters *pp = processParameters();
|
ProcessParameters *pp = processParameters();
|
||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(macroExpander());
|
||||||
pp->setEnvironment(bc->environment());
|
pp->setEnvironment(buildEnvironment());
|
||||||
pp->setWorkingDirectory(bc->buildDirectory());
|
pp->setWorkingDirectory(buildDirectory());
|
||||||
pp->setCommandLine({FilePath::fromString(projectDirRelativeToBuildDir(bc) + "configure"),
|
pp->setCommandLine({FilePath::fromString(projectDirRelativeToBuildDir(bc) + "configure"),
|
||||||
m_additionalArgumentsAspect->value(),
|
m_additionalArgumentsAspect->value(),
|
||||||
CommandLine::Raw});
|
CommandLine::Raw});
|
||||||
@@ -137,12 +137,10 @@ bool ConfigureStep::init()
|
|||||||
|
|
||||||
void ConfigureStep::doRun()
|
void ConfigureStep::doRun()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
|
||||||
|
|
||||||
//Check whether we need to run configure
|
//Check whether we need to run configure
|
||||||
const QString projectDir(bc->target()->project()->projectDirectory().toString());
|
const QString projectDir(project()->projectDirectory().toString());
|
||||||
const QFileInfo configureInfo(projectDir + "/configure");
|
const QFileInfo configureInfo(projectDir + "/configure");
|
||||||
const QFileInfo configStatusInfo(bc->buildDirectory().toString() + "/config.status");
|
const QFileInfo configStatusInfo(buildDirectory().toString() + "/config.status");
|
||||||
|
|
||||||
if (!configStatusInfo.exists()
|
if (!configStatusInfo.exists()
|
||||||
|| configStatusInfo.lastModified() < configureInfo.lastModified()) {
|
|| configStatusInfo.lastModified() < configureInfo.lastModified()) {
|
||||||
|
@@ -213,11 +213,11 @@ void CMakeBuildStep::doRun()
|
|||||||
QTC_ASSERT(bc, return);
|
QTC_ASSERT(bc, return);
|
||||||
|
|
||||||
m_waiting = false;
|
m_waiting = false;
|
||||||
auto bs = static_cast<CMakeBuildSystem *>(buildConfiguration()->buildSystem());
|
auto bs = static_cast<CMakeBuildSystem *>(buildSystem());
|
||||||
if (bs->persistCMakeState()) {
|
if (bs->persistCMakeState()) {
|
||||||
emit addOutput(tr("Persisting CMake state..."), BuildStep::OutputFormat::NormalMessage);
|
emit addOutput(tr("Persisting CMake state..."), BuildStep::OutputFormat::NormalMessage);
|
||||||
m_waiting = true;
|
m_waiting = true;
|
||||||
} else if (buildConfiguration()->buildSystem()->isWaitingForParse()) {
|
} else if (buildSystem()->isWaitingForParse()) {
|
||||||
emit addOutput(tr("Running CMake in preparation to build..."), BuildStep::OutputFormat::NormalMessage);
|
emit addOutput(tr("Running CMake in preparation to build..."), BuildStep::OutputFormat::NormalMessage);
|
||||||
m_waiting = true;
|
m_waiting = true;
|
||||||
}
|
}
|
||||||
@@ -359,7 +359,7 @@ Utils::CommandLine CMakeBuildStep::cmakeCommand(RunConfiguration *rc) const
|
|||||||
|
|
||||||
QStringList CMakeBuildStep::knownBuildTargets()
|
QStringList CMakeBuildStep::knownBuildTargets()
|
||||||
{
|
{
|
||||||
auto bc = qobject_cast<CMakeBuildSystem *>(buildConfiguration()->buildSystem());
|
auto bc = qobject_cast<CMakeBuildSystem *>(buildSystem());
|
||||||
return bc ? bc->buildTargetTitles() : QStringList();
|
return bc ? bc->buildTargetTitles() : QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -535,9 +535,9 @@ void CMakeBuildStepConfigWidget::updateDetails()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ProcessParameters param;
|
ProcessParameters param;
|
||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(m_buildStep->macroExpander());
|
||||||
param.setEnvironment(bc->environment());
|
param.setEnvironment(m_buildStep->buildEnvironment());
|
||||||
param.setWorkingDirectory(bc->buildDirectory());
|
param.setWorkingDirectory(m_buildStep->buildDirectory());
|
||||||
param.setCommandLine(m_buildStep->cmakeCommand(nullptr));
|
param.setCommandLine(m_buildStep->cmakeCommand(nullptr));
|
||||||
|
|
||||||
setSummaryText(param.summary(displayName()));
|
setSummaryText(param.summary(displayName()));
|
||||||
|
@@ -145,12 +145,10 @@ private:
|
|||||||
|
|
||||||
void updateDetails()
|
void updateDetails()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = m_buildStep->buildConfiguration();
|
|
||||||
|
|
||||||
ProcessParameters param;
|
ProcessParameters param;
|
||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(m_buildStep->macroExpander());
|
||||||
param.setWorkingDirectory(bc->buildDirectory());
|
param.setWorkingDirectory(m_buildStep->buildDirectory());
|
||||||
param.setEnvironment(bc->environment());
|
param.setEnvironment(m_buildStep->buildEnvironment());
|
||||||
param.setCommandLine({m_buildStep->buildCommand(), m_buildStep->allArguments()});
|
param.setCommandLine({m_buildStep->buildCommand(), m_buildStep->allArguments()});
|
||||||
|
|
||||||
setSummaryText(param.summary(displayName()));
|
setSummaryText(param.summary(displayName()));
|
||||||
@@ -252,8 +250,7 @@ QStringList IosBuildStep::defaultArguments() const
|
|||||||
case BuildConfiguration::Unknown :
|
case BuildConfiguration::Unknown :
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qCWarning(iosLog) << "IosBuildStep had an unknown buildType "
|
qCWarning(iosLog) << "IosBuildStep had an unknown buildType " << buildType();
|
||||||
<< buildConfiguration()->buildType();
|
|
||||||
}
|
}
|
||||||
if (tc->typeId() == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID
|
if (tc->typeId() == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID
|
||||||
|| tc->typeId() == ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID) {
|
|| tc->typeId() == ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID) {
|
||||||
@@ -262,7 +259,7 @@ QStringList IosBuildStep::defaultArguments() const
|
|||||||
}
|
}
|
||||||
if (!SysRootKitAspect::sysRoot(kit).isEmpty())
|
if (!SysRootKitAspect::sysRoot(kit).isEmpty())
|
||||||
res << "-sdk" << SysRootKitAspect::sysRoot(kit).toString();
|
res << "-sdk" << SysRootKitAspect::sysRoot(kit).toString();
|
||||||
res << "SYMROOT=" + buildConfiguration()->buildDirectory().toString();
|
res << "SYMROOT=" + buildDirectory().toString();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -67,12 +67,10 @@ IosDsymBuildStep::IosDsymBuildStep(BuildStepList *parent, Id id) :
|
|||||||
|
|
||||||
bool IosDsymBuildStep::init()
|
bool IosDsymBuildStep::init()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
|
||||||
|
|
||||||
ProcessParameters *pp = processParameters();
|
ProcessParameters *pp = processParameters();
|
||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(macroExpander());
|
||||||
pp->setWorkingDirectory(bc->buildDirectory());
|
pp->setWorkingDirectory(buildDirectory());
|
||||||
Utils::Environment env = bc->environment();
|
Utils::Environment env = buildEnvironment();
|
||||||
Utils::Environment::setupEnglishOutput(&env);
|
Utils::Environment::setupEnglishOutput(&env);
|
||||||
pp->setEnvironment(env);
|
pp->setEnvironment(env);
|
||||||
pp->setCommandLine({command(), arguments()});
|
pp->setCommandLine({command(), arguments()});
|
||||||
@@ -255,12 +253,10 @@ IosDsymBuildStepConfigWidget::~IosDsymBuildStepConfigWidget()
|
|||||||
|
|
||||||
void IosDsymBuildStepConfigWidget::updateDetails()
|
void IosDsymBuildStepConfigWidget::updateDetails()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = m_buildStep->buildConfiguration();
|
|
||||||
|
|
||||||
ProcessParameters param;
|
ProcessParameters param;
|
||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(m_buildStep->macroExpander());
|
||||||
param.setWorkingDirectory(bc->buildDirectory());
|
param.setWorkingDirectory(m_buildStep->buildDirectory());
|
||||||
param.setEnvironment(bc->environment());
|
param.setEnvironment(m_buildStep->buildEnvironment());
|
||||||
param.setCommandLine({m_buildStep->command(), m_buildStep->arguments()});
|
param.setCommandLine({m_buildStep->command(), m_buildStep->arguments()});
|
||||||
|
|
||||||
setSummaryText(param.summary(displayName()));
|
setSummaryText(param.summary(displayName()));
|
||||||
|
@@ -111,8 +111,8 @@ bool NimbleBuildStep::init()
|
|||||||
setOutputParser(parser);
|
setOutputParser(parser);
|
||||||
|
|
||||||
ProcessParameters* params = processParameters();
|
ProcessParameters* params = processParameters();
|
||||||
params->setEnvironment(buildConfiguration()->environment());
|
params->setEnvironment(buildEnvironment());
|
||||||
params->setMacroExpander(buildConfiguration()->macroExpander());
|
params->setMacroExpander(macroExpander());
|
||||||
params->setWorkingDirectory(project()->projectDirectory());
|
params->setWorkingDirectory(project()->projectDirectory());
|
||||||
params->setCommandLine({QStandardPaths::findExecutable("nimble"), {"build", m_arguments}});
|
params->setCommandLine({QStandardPaths::findExecutable("nimble"), {"build", m_arguments}});
|
||||||
return AbstractProcessStep::init();
|
return AbstractProcessStep::init();
|
||||||
@@ -156,13 +156,12 @@ QVariantMap NimbleBuildStep::toMap() const
|
|||||||
|
|
||||||
QString NimbleBuildStep::defaultArguments() const
|
QString NimbleBuildStep::defaultArguments() const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(buildConfiguration(), return {}; );
|
switch (buildType()) {
|
||||||
switch (buildConfiguration()->buildType()) {
|
case BuildConfiguration::Debug:
|
||||||
case ProjectExplorer::BuildConfiguration::Debug:
|
|
||||||
return {"--debugger:native"};
|
return {"--debugger:native"};
|
||||||
case ProjectExplorer::BuildConfiguration::Unknown:
|
case BuildConfiguration::Unknown:
|
||||||
case ProjectExplorer::BuildConfiguration::Profile:
|
case BuildConfiguration::Profile:
|
||||||
case ProjectExplorer::BuildConfiguration::Release:
|
case BuildConfiguration::Release:
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@@ -47,7 +47,7 @@ NimbleTaskStep::NimbleTaskStep(BuildStepList *parentList, Core::Id id)
|
|||||||
|
|
||||||
bool NimbleTaskStep::init()
|
bool NimbleTaskStep::init()
|
||||||
{
|
{
|
||||||
processParameters()->setEnvironment(buildConfiguration()->environment());
|
processParameters()->setEnvironment(buildEnvironment());
|
||||||
processParameters()->setWorkingDirectory(project()->projectDirectory());
|
processParameters()->setWorkingDirectory(project()->projectDirectory());
|
||||||
return validate() && AbstractProcessStep::init();
|
return validate() && AbstractProcessStep::init();
|
||||||
}
|
}
|
||||||
|
@@ -106,7 +106,7 @@ NimCompilerBuildStep::NimCompilerBuildStep(BuildStepList *parentList, Core::Id i
|
|||||||
this, &NimCompilerBuildStep::updateProcessParameters);
|
this, &NimCompilerBuildStep::updateProcessParameters);
|
||||||
connect(this, &NimCompilerBuildStep::outFilePathChanged,
|
connect(this, &NimCompilerBuildStep::outFilePathChanged,
|
||||||
bc, &NimBuildConfiguration::outFilePathChanged);
|
bc, &NimBuildConfiguration::outFilePathChanged);
|
||||||
connect(bc->target()->project(), &ProjectExplorer::Project::fileListChanged,
|
connect(project(), &ProjectExplorer::Project::fileListChanged,
|
||||||
this, &NimCompilerBuildStep::updateTargetNimFile);
|
this, &NimCompilerBuildStep::updateTargetNimFile);
|
||||||
updateProcessParameters();
|
updateProcessParameters();
|
||||||
}
|
}
|
||||||
@@ -208,17 +208,13 @@ void NimCompilerBuildStep::updateProcessParameters()
|
|||||||
|
|
||||||
void NimCompilerBuildStep::updateOutFilePath()
|
void NimCompilerBuildStep::updateOutFilePath()
|
||||||
{
|
{
|
||||||
auto bc = qobject_cast<NimBuildConfiguration *>(buildConfiguration());
|
|
||||||
QTC_ASSERT(bc, return);
|
|
||||||
const QString targetName = Utils::HostOsInfo::withExecutableSuffix(m_targetNimFile.toFileInfo().baseName());
|
const QString targetName = Utils::HostOsInfo::withExecutableSuffix(m_targetNimFile.toFileInfo().baseName());
|
||||||
setOutFilePath(bc->buildDirectory().pathAppended(targetName));
|
setOutFilePath(buildDirectory().pathAppended(targetName));
|
||||||
}
|
}
|
||||||
|
|
||||||
void NimCompilerBuildStep::updateWorkingDirectory()
|
void NimCompilerBuildStep::updateWorkingDirectory()
|
||||||
{
|
{
|
||||||
auto bc = qobject_cast<NimBuildConfiguration *>(buildConfiguration());
|
processParameters()->setWorkingDirectory(buildDirectory());
|
||||||
QTC_ASSERT(bc, return);
|
|
||||||
processParameters()->setWorkingDirectory(bc->buildDirectory());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NimCompilerBuildStep::updateCommand()
|
void NimCompilerBuildStep::updateCommand()
|
||||||
@@ -257,9 +253,7 @@ void NimCompilerBuildStep::updateCommand()
|
|||||||
|
|
||||||
void NimCompilerBuildStep::updateEnvironment()
|
void NimCompilerBuildStep::updateEnvironment()
|
||||||
{
|
{
|
||||||
auto bc = qobject_cast<NimBuildConfiguration *>(buildConfiguration());
|
processParameters()->setEnvironment(buildEnvironment());
|
||||||
QTC_ASSERT(bc, return);
|
|
||||||
processParameters()->setEnvironment(bc->environment());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NimCompilerBuildStep::updateTargetNimFile()
|
void NimCompilerBuildStep::updateTargetNimFile()
|
||||||
|
@@ -51,14 +51,14 @@ NimCompilerCleanStep::NimCompilerCleanStep(BuildStepList *parentList, Core::Id i
|
|||||||
workingDirectory->setDisplayStyle(BaseStringAspect::LineEditDisplay);
|
workingDirectory->setDisplayStyle(BaseStringAspect::LineEditDisplay);
|
||||||
|
|
||||||
setSummaryUpdater([this, workingDirectory] {
|
setSummaryUpdater([this, workingDirectory] {
|
||||||
workingDirectory->setFilePath(buildConfiguration()->buildDirectory());
|
workingDirectory->setFilePath(buildDirectory());
|
||||||
return displayName();
|
return displayName();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NimCompilerCleanStep::init()
|
bool NimCompilerCleanStep::init()
|
||||||
{
|
{
|
||||||
FilePath buildDir = buildConfiguration()->buildDirectory();
|
FilePath buildDir = buildDirectory();
|
||||||
bool result = buildDir.exists();
|
bool result = buildDir.exists();
|
||||||
if (result)
|
if (result)
|
||||||
m_buildDir = buildDir;
|
m_buildDir = buildDir;
|
||||||
|
@@ -349,10 +349,7 @@ void AbstractProcessStep::processReadyReadStdOutput()
|
|||||||
if (!d->m_process)
|
if (!d->m_process)
|
||||||
return;
|
return;
|
||||||
d->m_process->setReadChannel(QProcess::StandardOutput);
|
d->m_process->setReadChannel(QProcess::StandardOutput);
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
const bool utf8Output = buildEnvironment().hasKey("VSLANG");
|
||||||
if (!bc)
|
|
||||||
bc = target()->activeBuildConfiguration();
|
|
||||||
const bool utf8Output = bc && bc->environment().hasKey("VSLANG");
|
|
||||||
d->readData(&AbstractProcessStep::stdOutput, utf8Output);
|
d->readData(&AbstractProcessStep::stdOutput, utf8Output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
#include "deployconfiguration.h"
|
#include "deployconfiguration.h"
|
||||||
#include "kitinformation.h"
|
#include "kitinformation.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
|
#include "projectexplorerconstants.h"
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
|
|
||||||
#include <coreplugin/variablechooser.h>
|
#include <coreplugin/variablechooser.h>
|
||||||
@@ -117,6 +118,8 @@
|
|||||||
This signal needs to be emitted if the build step runs in the GUI thread.
|
This signal needs to be emitted if the build step runs in the GUI thread.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
static const char buildStepEnabledKey[] = "ProjectExplorer.BuildStep.Enabled";
|
static const char buildStepEnabledKey[] = "ProjectExplorer.BuildStep.Enabled";
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -216,6 +219,27 @@ BuildSystem *BuildStep::buildSystem() const
|
|||||||
return target()->buildSystem();
|
return target()->buildSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Environment BuildStep::buildEnvironment() const
|
||||||
|
{
|
||||||
|
if (auto bc = buildConfiguration())
|
||||||
|
return bc->environment();
|
||||||
|
return Environment::systemEnvironment();
|
||||||
|
}
|
||||||
|
|
||||||
|
FilePath BuildStep::buildDirectory() const
|
||||||
|
{
|
||||||
|
if (auto bc = buildConfiguration())
|
||||||
|
return bc->buildDirectory();
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildConfiguration::BuildType BuildStep::buildType() const
|
||||||
|
{
|
||||||
|
if (auto bc = buildConfiguration())
|
||||||
|
return bc->buildType();
|
||||||
|
return BuildConfiguration::Unknown;
|
||||||
|
}
|
||||||
|
|
||||||
Utils::MacroExpander *BuildStep::macroExpander() const
|
Utils::MacroExpander *BuildStep::macroExpander() const
|
||||||
{
|
{
|
||||||
if (auto bc = buildConfiguration())
|
if (auto bc = buildConfiguration())
|
||||||
@@ -223,6 +247,13 @@ Utils::MacroExpander *BuildStep::macroExpander() const
|
|||||||
return Utils::globalMacroExpander();
|
return Utils::globalMacroExpander();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString BuildStep::fallbackWorkingDirectory() const
|
||||||
|
{
|
||||||
|
if (auto bc = buildConfiguration())
|
||||||
|
return Constants::DEFAULT_WORKING_DIR;
|
||||||
|
return Constants::DEFAULT_WORKING_DIR_ALTERNATE;
|
||||||
|
}
|
||||||
|
|
||||||
void BuildStep::reportRunResult(QFutureInterface<bool> &fi, bool success)
|
void BuildStep::reportRunResult(QFutureInterface<bool> &fi, bool success)
|
||||||
{
|
{
|
||||||
fi.reportResult(success);
|
fi.reportResult(success);
|
||||||
|
@@ -26,6 +26,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "projectconfiguration.h"
|
#include "projectconfiguration.h"
|
||||||
|
|
||||||
|
#include "buildconfiguration.h"
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
|
|
||||||
#include <utils/optional.h>
|
#include <utils/optional.h>
|
||||||
@@ -38,7 +40,11 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace Utils { class MacroExpander; }
|
namespace Utils {
|
||||||
|
class Environment;
|
||||||
|
class FilePath;
|
||||||
|
class MacroExpander;
|
||||||
|
} // Utils
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
@@ -79,7 +85,11 @@ public:
|
|||||||
ProjectConfiguration *projectConfiguration() const;
|
ProjectConfiguration *projectConfiguration() const;
|
||||||
|
|
||||||
BuildSystem *buildSystem() const;
|
BuildSystem *buildSystem() const;
|
||||||
|
Utils::Environment buildEnvironment() const;
|
||||||
|
Utils::FilePath buildDirectory() const;
|
||||||
|
BuildConfiguration::BuildType buildType() const;
|
||||||
Utils::MacroExpander *macroExpander() const;
|
Utils::MacroExpander *macroExpander() const;
|
||||||
|
QString fallbackWorkingDirectory() const;
|
||||||
|
|
||||||
enum class OutputFormat {
|
enum class OutputFormat {
|
||||||
Stdout, Stderr, // These are for forwarded output from external tools
|
Stdout, Stderr, // These are for forwarded output from external tools
|
||||||
|
@@ -95,9 +95,9 @@ bool MakeStep::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ProcessParameters *pp = processParameters();
|
ProcessParameters *pp = processParameters();
|
||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(macroExpander());
|
||||||
pp->setWorkingDirectory(bc->buildDirectory());
|
pp->setWorkingDirectory(buildDirectory());
|
||||||
pp->setEnvironment(environment(bc));
|
pp->setEnvironment(buildEnvironment());
|
||||||
pp->setCommandLine(make);
|
pp->setCommandLine(make);
|
||||||
pp->resolveAll();
|
pp->resolveAll();
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ FilePath MakeStep::defaultMakeCommand() const
|
|||||||
BuildConfiguration *bc = buildConfiguration();
|
BuildConfiguration *bc = buildConfiguration();
|
||||||
if (!bc)
|
if (!bc)
|
||||||
return {};
|
return {};
|
||||||
const Utils::Environment env = environment(bc);
|
const Utils::Environment env = makeEnvironment();
|
||||||
for (const ToolChain *tc : preferredToolChains(target()->kit())) {
|
for (const ToolChain *tc : preferredToolChains(target()->kit())) {
|
||||||
FilePath make = tc->makeCommand(env);
|
FilePath make = tc->makeCommand(env);
|
||||||
if (!make.isEmpty())
|
if (!make.isEmpty())
|
||||||
@@ -225,7 +225,7 @@ static Utils::optional<int> argsJobCount(const QString &str)
|
|||||||
|
|
||||||
bool MakeStep::makeflagsJobCountMismatch() const
|
bool MakeStep::makeflagsJobCountMismatch() const
|
||||||
{
|
{
|
||||||
const Utils::Environment env = environment(buildConfiguration());
|
const Environment env = makeEnvironment();
|
||||||
if (!env.hasKey(MAKEFLAGS))
|
if (!env.hasKey(MAKEFLAGS))
|
||||||
return false;
|
return false;
|
||||||
Utils::optional<int> makeFlagsJobCount = argsJobCount(env.expandedValueForKey(MAKEFLAGS));
|
Utils::optional<int> makeFlagsJobCount = argsJobCount(env.expandedValueForKey(MAKEFLAGS));
|
||||||
@@ -234,7 +234,7 @@ bool MakeStep::makeflagsJobCountMismatch() const
|
|||||||
|
|
||||||
bool MakeStep::makeflagsContainsJobCount() const
|
bool MakeStep::makeflagsContainsJobCount() const
|
||||||
{
|
{
|
||||||
const Utils::Environment env = environment(buildConfiguration());
|
const Environment env = makeEnvironment();
|
||||||
if (!env.hasKey(MAKEFLAGS))
|
if (!env.hasKey(MAKEFLAGS))
|
||||||
return false;
|
return false;
|
||||||
return argsJobCount(env.expandedValueForKey(MAKEFLAGS)).has_value();
|
return argsJobCount(env.expandedValueForKey(MAKEFLAGS)).has_value();
|
||||||
@@ -245,9 +245,9 @@ bool MakeStep::userArgsContainsJobCount() const
|
|||||||
return argsJobCount(m_userArguments).has_value();
|
return argsJobCount(m_userArguments).has_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::Environment MakeStep::environment(BuildConfiguration *bc) const
|
Environment MakeStep::makeEnvironment() const
|
||||||
{
|
{
|
||||||
Utils::Environment env = bc ? bc->environment() : Utils::Environment::systemEnvironment();
|
Environment env = buildEnvironment();
|
||||||
Utils::Environment::setupEnglishOutput(&env);
|
Utils::Environment::setupEnglishOutput(&env);
|
||||||
if (makeCommand().isEmpty()) {
|
if (makeCommand().isEmpty()) {
|
||||||
// We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
|
// We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
|
||||||
@@ -494,10 +494,10 @@ void MakeStepConfigWidget::updateDetails()
|
|||||||
m_ui->disableInSubDirsCheckBox->setChecked(!m_makeStep->enabledForSubDirs());
|
m_ui->disableInSubDirsCheckBox->setChecked(!m_makeStep->enabledForSubDirs());
|
||||||
|
|
||||||
ProcessParameters param;
|
ProcessParameters param;
|
||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(m_makeStep->macroExpander());
|
||||||
param.setWorkingDirectory(bc->buildDirectory());
|
param.setWorkingDirectory(m_makeStep->buildDirectory());
|
||||||
param.setCommandLine(make);
|
param.setCommandLine(make);
|
||||||
param.setEnvironment(m_makeStep->environment(bc));
|
param.setEnvironment(m_makeStep->buildEnvironment());
|
||||||
|
|
||||||
if (param.commandMissing())
|
if (param.commandMissing())
|
||||||
setSummaryText(tr("<b>Make:</b> %1 not found in the environment.")
|
setSummaryText(tr("<b>Make:</b> %1 not found in the environment.")
|
||||||
|
@@ -87,7 +87,7 @@ public:
|
|||||||
bool enabledForSubDirs() const { return m_enabledForSubDirs; }
|
bool enabledForSubDirs() const { return m_enabledForSubDirs; }
|
||||||
void setEnabledForSubDirs(bool enabled) { m_enabledForSubDirs = enabled; }
|
void setEnabledForSubDirs(bool enabled) { m_enabledForSubDirs = enabled; }
|
||||||
|
|
||||||
Utils::Environment environment(BuildConfiguration *bc) const;
|
Utils::Environment makeEnvironment() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool fromMap(const QVariantMap &map) override;
|
bool fromMap(const QVariantMap &map) override;
|
||||||
|
@@ -92,19 +92,13 @@ bool ProcessStep::init()
|
|||||||
|
|
||||||
void ProcessStep::setupProcessParameters(ProcessParameters *pp)
|
void ProcessStep::setupProcessParameters(ProcessParameters *pp)
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
|
||||||
|
|
||||||
QString workingDirectory = m_workingDirectory->value();
|
QString workingDirectory = m_workingDirectory->value();
|
||||||
if (workingDirectory.isEmpty()) {
|
if (workingDirectory.isEmpty())
|
||||||
if (bc)
|
workingDirectory = fallbackWorkingDirectory();
|
||||||
workingDirectory = Constants::DEFAULT_WORKING_DIR;
|
|
||||||
else
|
|
||||||
workingDirectory = Constants::DEFAULT_WORKING_DIR_ALTERNATE;
|
|
||||||
}
|
|
||||||
|
|
||||||
pp->setMacroExpander(bc ? bc->macroExpander() : Utils::globalMacroExpander());
|
pp->setMacroExpander(macroExpander());
|
||||||
pp->setEnvironment(bc ? bc->environment() : Utils::Environment::systemEnvironment());
|
pp->setEnvironment(buildEnvironment());
|
||||||
pp->setWorkingDirectory(Utils::FilePath::fromString(workingDirectory));
|
pp->setWorkingDirectory(FilePath::fromString(workingDirectory));
|
||||||
pp->setCommandLine({m_command->filePath(), m_arguments->value(), CommandLine::Raw});
|
pp->setCommandLine({m_command->filePath(), m_arguments->value(), CommandLine::Raw});
|
||||||
pp->resolveAll();
|
pp->resolveAll();
|
||||||
}
|
}
|
||||||
|
@@ -234,7 +234,7 @@ QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) co
|
|||||||
Constants::QBS_CONFIG_QUICK_COMPILER_KEY);
|
Constants::QBS_CONFIG_QUICK_COMPILER_KEY);
|
||||||
|
|
||||||
if (variableHandling == ExpandVariables) {
|
if (variableHandling == ExpandVariables) {
|
||||||
const MacroExpander * const expander = buildConfiguration()->macroExpander();
|
const MacroExpander * const expander = macroExpander();
|
||||||
for (auto it = config.begin(), end = config.end(); it != end; ++it) {
|
for (auto it = config.begin(), end = config.end(); it != end; ++it) {
|
||||||
const QString rawString = it.value().toString();
|
const QString rawString = it.value().toString();
|
||||||
const QString expandedString = expander->expand(rawString);
|
const QString expandedString = expander->expand(rawString);
|
||||||
@@ -273,7 +273,7 @@ Utils::FilePath QbsBuildStep::installRoot(VariableHandling variableHandling) con
|
|||||||
return Utils::FilePath::fromString(root);
|
return Utils::FilePath::fromString(root);
|
||||||
QString defaultInstallDir = QbsSettings::defaultInstallDirTemplate();
|
QString defaultInstallDir = QbsSettings::defaultInstallDirTemplate();
|
||||||
if (variableHandling == VariableHandling::ExpandVariables)
|
if (variableHandling == VariableHandling::ExpandVariables)
|
||||||
defaultInstallDir = buildConfiguration()->macroExpander()->expand(defaultInstallDir);
|
defaultInstallDir = macroExpander()->expand(defaultInstallDir);
|
||||||
return FilePath::fromString(defaultInstallDir);
|
return FilePath::fromString(defaultInstallDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,7 +411,7 @@ QString QbsBuildStep::buildVariant() const
|
|||||||
|
|
||||||
QbsBuildSystem *QbsBuildStep::qbsBuildSystem() const
|
QbsBuildSystem *QbsBuildStep::qbsBuildSystem() const
|
||||||
{
|
{
|
||||||
return static_cast<QbsBuildSystem *>(buildConfiguration()->buildSystem());
|
return static_cast<QbsBuildSystem *>(buildSystem());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsBuildStep::setBuildVariant(const QString &variant)
|
void QbsBuildStep::setBuildVariant(const QString &variant)
|
||||||
@@ -644,9 +644,7 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
|
|||||||
auto chooser = new Core::VariableChooser(this);
|
auto chooser = new Core::VariableChooser(this);
|
||||||
chooser->addSupportedWidget(propertyEdit);
|
chooser->addSupportedWidget(propertyEdit);
|
||||||
chooser->addSupportedWidget(installDirChooser->lineEdit());
|
chooser->addSupportedWidget(installDirChooser->lineEdit());
|
||||||
chooser->addMacroExpanderProvider([step] {
|
chooser->addMacroExpanderProvider([step] { return step->macroExpander(); });
|
||||||
return step->buildConfiguration()->macroExpander();
|
|
||||||
});
|
|
||||||
propertyEdit->setValidationFunction([this](FancyLineEdit *edit, QString *errorMessage) {
|
propertyEdit->setValidationFunction([this](FancyLineEdit *edit, QString *errorMessage) {
|
||||||
return validateProperties(edit, errorMessage);
|
return validateProperties(edit, errorMessage);
|
||||||
});
|
});
|
||||||
@@ -868,7 +866,7 @@ bool QbsBuildStepConfigWidget::validateProperties(Utils::FancyLineEdit *edit, QS
|
|||||||
}
|
}
|
||||||
|
|
||||||
QList<Property> properties;
|
QList<Property> properties;
|
||||||
const MacroExpander * const expander = step()->buildConfiguration()->macroExpander();
|
const MacroExpander * const expander = step()->macroExpander();
|
||||||
foreach (const QString &rawArg, argList) {
|
foreach (const QString &rawArg, argList) {
|
||||||
int pos = rawArg.indexOf(':');
|
int pos = rawArg.indexOf(':');
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
|
@@ -109,7 +109,7 @@ QbsInstallStep::~QbsInstallStep()
|
|||||||
|
|
||||||
bool QbsInstallStep::init()
|
bool QbsInstallStep::init()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!buildConfiguration()->buildSystem()->isParsing() && !m_session, return false);
|
QTC_ASSERT(!buildSystem()->isParsing() && !m_session, return false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -107,7 +107,7 @@ bool QmakeMakeStep::init()
|
|||||||
// for file builds, since the rules for that are
|
// for file builds, since the rules for that are
|
||||||
// only in those files.
|
// only in those files.
|
||||||
if (subProFile->isDebugAndRelease() && bc->fileNodeBuild()) {
|
if (subProFile->isDebugAndRelease() && bc->fileNodeBuild()) {
|
||||||
if (bc->buildType() == QmakeBuildConfiguration::Debug)
|
if (buildType() == QmakeBuildConfiguration::Debug)
|
||||||
makefile += ".Debug";
|
makefile += ".Debug";
|
||||||
else
|
else
|
||||||
makefile += ".Release";
|
makefile += ".Release";
|
||||||
@@ -162,7 +162,7 @@ bool QmakeMakeStep::init()
|
|||||||
makeCmd.addArg(objectFile);
|
makeCmd.addArg(objectFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
pp->setEnvironment(environment(bc));
|
pp->setEnvironment(makeEnvironment());
|
||||||
pp->setCommandLine(makeCmd);
|
pp->setCommandLine(makeCmd);
|
||||||
pp->resolveAll();
|
pp->resolveAll();
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ bool QmakeMakeStep::init()
|
|||||||
appendOutputParser(new QMakeParser); // make may cause qmake to be run, add last to make sure
|
appendOutputParser(new QMakeParser); // make may cause qmake to be run, add last to make sure
|
||||||
// it has a low priority.
|
// it has a low priority.
|
||||||
|
|
||||||
auto rootNode = dynamic_cast<QmakeProFileNode *>(bc->project()->rootProjectNode());
|
auto rootNode = dynamic_cast<QmakeProFileNode *>(project()->rootProjectNode());
|
||||||
QTC_ASSERT(rootNode, return false);
|
QTC_ASSERT(rootNode, return false);
|
||||||
m_scriptTarget = rootNode->projectType() == ProjectType::ScriptTemplate;
|
m_scriptTarget = rootNode->projectType() == ProjectType::ScriptTemplate;
|
||||||
m_unalignedBuildDir = !bc->isBuildDirAtSafeLocation();
|
m_unalignedBuildDir = !bc->isBuildDirAtSafeLocation();
|
||||||
|
@@ -86,7 +86,7 @@ QString AbstractPackagingStep::cachedPackageDirectory() const
|
|||||||
|
|
||||||
QString AbstractPackagingStep::packageDirectory() const
|
QString AbstractPackagingStep::packageDirectory() const
|
||||||
{
|
{
|
||||||
return buildConfiguration()->buildDirectory().toString();
|
return buildDirectory().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AbstractPackagingStep::isPackagingNeeded() const
|
bool AbstractPackagingStep::isPackagingNeeded() const
|
||||||
|
@@ -187,7 +187,7 @@ bool WinRtPackageDeploymentStep::init()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
params->setCommandLine(windeployqt);
|
params->setCommandLine(windeployqt);
|
||||||
params->setEnvironment(buildConfiguration()->environment());
|
params->setEnvironment(buildEnvironment());
|
||||||
|
|
||||||
return AbstractProcessStep::init();
|
return AbstractProcessStep::init();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user