AppMan: Use device specific tool paths

This makes sure the RunConfiguration is correctly executed on the remote
device.
For steps executed on the host, a nullptr can be passed as device.

Change-Id: Ide5aa5a06402b137494c10108d09a4e7ffa32ec9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Dominik Holland
2024-01-24 09:25:12 +01:00
parent fdb0ba0389
commit 707886faac
4 changed files with 5 additions and 8 deletions

View File

@@ -40,9 +40,7 @@ public:
setDisplayName(Tr::tr("Create Application Manager package"));
packager.setSettingsKey(SETTINGSPREFIX "Executable");
packager.setDefaultValue(getToolFilePath(Constants::APPMAN_PACKAGER,
kit(),
DeviceKitAspect::device(kit())));
packager.setDefaultValue(getToolFilePath(Constants::APPMAN_PACKAGER, kit()));
arguments.setSettingsKey(SETTINGSPREFIX "Arguments");
arguments.setResetter([] { return QLatin1String(ArgumentsDefault); });

View File

@@ -49,9 +49,7 @@ AppManagerInstallPackageStep::AppManagerInstallPackageStep(BuildStepList *bsl, I
{
setDisplayName(Tr::tr("Install Application Manager package"));
controller.setDefaultValue(getToolFilePath(Constants::APPMAN_CONTROLLER,
kit(),
DeviceKitAspect::device(kit())));
controller.setDefaultValue(getToolFilePath(Constants::APPMAN_CONTROLLER, kit()));
arguments.setSettingsKey(SETTINGSPREFIX "Arguments");
arguments.setResetter([] { return QLatin1String(ArgumentsDefault); });

View File

@@ -44,7 +44,8 @@ QString getToolFilePath(const QString &toolname, const Kit *kit, const IDevice::
const FilePath path = local ? getToolPathByQtVersion(QtKitAspect::qtVersion(kit))
: FilePath(Constants::REMOTE_DEFAULT_BIN_PATH);
const QString name = getToolNameByDevice(toolname, device);
return !path.isEmpty() ? path.pathAppended(name).toString() : name;
const QString filePath = !path.isEmpty() ? path.pathAppended(name).toString() : name;
return !device ? filePath : device->filePath(filePath).toUserOutput();
}
QString getToolNameByDevice(const QString &baseName, const QSharedPointer<const IDevice> &device)

View File

@@ -10,6 +10,6 @@
namespace AppManager::Internal {
QString getToolNameByDevice(const QString &baseName, const QSharedPointer<const ProjectExplorer::IDevice> &device = nullptr);
QString getToolFilePath(const QString &toolname, const ProjectExplorer::Kit *kit, const ProjectExplorer::IDevice::ConstPtr &device);
QString getToolFilePath(const QString &toolname, const ProjectExplorer::Kit *kit, const ProjectExplorer::IDevice::ConstPtr &device = nullptr);
} // AppManager::Internal