diff options
Diffstat (limited to 'src/tools/androiddeployqt')
-rw-r--r-- | src/tools/androiddeployqt/main.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 4e54c41801..8fc3fa8d05 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -3110,12 +3110,19 @@ bool writeDependencyFile(const Options &options) if (options.verbose) fprintf(stdout, "Writing dependency file.\n"); - QFile depFile(options.depFilePath); - - QString relativeApkPath = QDir(options.buildDirectory).relativeFilePath(options.apkPath); + QString relativeTargetPath; + if (options.copyDependenciesOnly) { + // When androiddeploy Qt is running in copyDependenciesOnly mode we need to use + // the timestamp file as the target to collect dependencies. + QString timestampAbsPath = QFileInfo(options.depFilePath).absolutePath() + QLatin1String("/timestamp"); + relativeTargetPath = QDir(options.buildDirectory).relativeFilePath(timestampAbsPath); + } else { + relativeTargetPath = QDir(options.buildDirectory).relativeFilePath(options.apkPath); + } + QFile depFile(options.depFilePath); if (depFile.open(QIODevice::WriteOnly)) { - depFile.write(escapeAndEncodeDependencyPath(relativeApkPath)); + depFile.write(escapeAndEncodeDependencyPath(relativeTargetPath)); depFile.write(": "); for (const auto &file : dependenciesForDepfile) { @@ -3227,6 +3234,8 @@ int main(int argc, char *argv[]) } if (options.copyDependenciesOnly) { + if (!options.depFilePath.isEmpty()) + writeDependencyFile(options); return 0; } |