forked from qt-creator/qt-creator
RemoteLinux: Fix look-up of remote file path in deployment data
If the deployment configuration contains an "install into temp dir" step, then the local file paths of the binaries built by the build tool will not be in the list of deployable files, because all deployables come from the temporary install dir. Therefore, look for just a file name match as a fallback. Fixes: QTCREATORBUG-21235 Change-Id: Ie3fad515515b4f28cc6bdef1254f4c05a0557569 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -237,7 +237,7 @@ DeploymentData CMakeBuildConfiguration::deploymentData() const
|
||||
for (const CMakeBuildTarget &ct : m_buildTargets) {
|
||||
if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType) {
|
||||
if (!ct.executable.isEmpty()
|
||||
&& !result.deployableForLocalFile(ct.executable.toString()).isValid()) {
|
||||
&& result.deployableForLocalFile(ct.executable.toString()).localFilePath() != ct.executable) {
|
||||
result.addFile(ct.executable.toString(),
|
||||
deploymentPrefix + buildDir.relativeFilePath(ct.executable.toFileInfo().dir().path()),
|
||||
DeployableFile::TypeExecutable);
|
||||
|
@@ -57,9 +57,15 @@ void DeploymentData::addFile(const QString &localFilePath, const QString &remote
|
||||
|
||||
DeployableFile DeploymentData::deployableForLocalFile(const QString &localFilePath) const
|
||||
{
|
||||
return Utils::findOrDefault(m_files, [&localFilePath](const DeployableFile &d) {
|
||||
const DeployableFile f = Utils::findOrDefault(m_files, [&localFilePath](const DeployableFile &d) {
|
||||
return d.localFilePath().toString() == localFilePath;
|
||||
});
|
||||
if (f.isValid())
|
||||
return f;
|
||||
const QString localFileName = QFileInfo(localFilePath).fileName();
|
||||
return Utils::findOrDefault(m_files, [&localFileName](const DeployableFile &d) {
|
||||
return d.localFilePath().toFileInfo().fileName() == localFileName;
|
||||
});
|
||||
}
|
||||
|
||||
bool DeploymentData::operator==(const DeploymentData &other) const
|
||||
|
@@ -337,6 +337,7 @@ void Target::setDeploymentData(const DeploymentData &deploymentData)
|
||||
if (d->m_deploymentData != deploymentData) {
|
||||
d->m_deploymentData = deploymentData;
|
||||
emit deploymentDataChanged();
|
||||
emit applicationTargetsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user