2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2010-11-12 17:23:55 +01:00
|
|
|
|
2016-02-02 18:26:51 +01:00
|
|
|
#pragma once
|
2010-11-12 17:23:55 +01:00
|
|
|
|
|
|
|
|
#include "projectexplorer_export.h"
|
|
|
|
|
|
2023-08-17 14:08:06 +02:00
|
|
|
#include <utils/processinterface.h>
|
2010-11-12 17:23:55 +01:00
|
|
|
|
2019-05-29 17:41:15 +02:00
|
|
|
namespace Utils {
|
|
|
|
|
class MacroExpander;
|
|
|
|
|
} // Utils
|
2010-11-12 17:23:55 +01:00
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
|
2011-04-14 12:58:14 +02:00
|
|
|
// Documentation inside.
|
2010-11-12 17:23:55 +01:00
|
|
|
class PROJECTEXPLORER_EXPORT ProcessParameters
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ProcessParameters();
|
|
|
|
|
|
2019-05-29 17:41:15 +02:00
|
|
|
void setCommandLine(const Utils::CommandLine &cmdLine);
|
2023-08-17 14:08:06 +02:00
|
|
|
Utils::CommandLine command() const { return m_runData.command; }
|
2010-11-12 17:23:55 +01:00
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
void setWorkingDirectory(const Utils::FilePath &workingDirectory);
|
2023-08-17 14:08:06 +02:00
|
|
|
Utils::FilePath workingDirectory() const { return m_runData.workingDirectory; }
|
2010-11-12 17:23:55 +01:00
|
|
|
|
2023-08-17 14:08:06 +02:00
|
|
|
void setEnvironment(const Utils::Environment &env) { m_runData.environment = env; }
|
|
|
|
|
Utils::Environment environment() const { return m_runData.environment; }
|
2010-11-12 17:23:55 +01:00
|
|
|
|
2014-10-15 14:45:31 +02:00
|
|
|
void setMacroExpander(Utils::MacroExpander *mx) { m_macroExpander = mx; }
|
|
|
|
|
Utils::MacroExpander *macroExpander() const { return m_macroExpander; }
|
2010-11-12 17:23:55 +01:00
|
|
|
|
|
|
|
|
/// Get the fully expanded working directory:
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath effectiveWorkingDirectory() const;
|
2010-11-12 17:23:55 +01:00
|
|
|
/// Get the fully expanded command name to run:
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath effectiveCommand() const;
|
2010-11-12 17:23:55 +01:00
|
|
|
/// Get the fully expanded arguments to use:
|
|
|
|
|
QString effectiveArguments() const;
|
|
|
|
|
|
|
|
|
|
/// True if effectiveCommand() would return only a fallback
|
|
|
|
|
bool commandMissing() const;
|
|
|
|
|
|
|
|
|
|
QString prettyCommand() const;
|
|
|
|
|
QString prettyArguments() const;
|
|
|
|
|
QString summary(const QString &displayName) const;
|
|
|
|
|
QString summaryInWorkdir(const QString &displayName) const;
|
|
|
|
|
|
|
|
|
|
private:
|
2023-08-17 14:08:06 +02:00
|
|
|
Utils::ProcessRunData m_runData;
|
2020-10-05 14:43:23 +02:00
|
|
|
Utils::MacroExpander *m_macroExpander = nullptr;
|
2010-11-12 17:23:55 +01:00
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
mutable Utils::FilePath m_effectiveWorkingDirectory;
|
|
|
|
|
mutable Utils::FilePath m_effectiveCommand;
|
2010-11-12 17:23:55 +01:00
|
|
|
mutable QString m_effectiveArguments;
|
2020-10-05 14:43:23 +02:00
|
|
|
mutable bool m_commandMissing = false;
|
2010-11-12 17:23:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace ProjectExplorer
|