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:
hjk
2020-02-19 11:55:48 +01:00
parent 3f68292dbe
commit 3fe1911d46
24 changed files with 146 additions and 148 deletions

View File

@@ -60,24 +60,23 @@ AndroidPackageInstallationStep::AndroidPackageInstallationStep(BuildStepList *bs
bool AndroidPackageInstallationStep::init()
{
BuildConfiguration *bc = buildConfiguration();
QString dirPath = bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY).toString();
QString dirPath = buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY).toString();
if (HostOsInfo::isWindowsHost())
if (bc->environment().searchInPath("sh.exe").isEmpty())
if (buildEnvironment().searchInPath("sh.exe").isEmpty())
dirPath = QDir::toNativeSeparators(dirPath);
ToolChain *tc = ToolChainKitAspect::cxxToolChain(target()->kit());
QTC_ASSERT(tc, return false);
CommandLine cmd{tc->makeCommand(bc->environment())};
CommandLine cmd{tc->makeCommand(buildEnvironment())};
const QString innerQuoted = QtcProcess::quoteArg(dirPath);
const QString outerQuoted = QtcProcess::quoteArg("INSTALL_ROOT=" + innerQuoted);
cmd.addArgs(outerQuoted + " install", CommandLine::Raw);
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setWorkingDirectory(bc->buildDirectory());
Environment env = bc->environment();
pp->setMacroExpander(macroExpander());
pp->setWorkingDirectory(buildDirectory());
Environment env = buildEnvironment();
Environment::setupEnglishOutput(&env);
pp->setEnvironment(env);
pp->setCommandLine(cmd);