diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-11-15 18:54:42 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-12-02 14:28:09 +0100 |
commit | 87db26bdfe56e9445c03623eb962f569b2570b92 (patch) | |
tree | b2b644a13112105b9143f14acde4a8ff187d7785 /src/tools | |
parent | 0062f5a2089f9654c8880087ac6fb0b46a90bef2 (diff) |
Change the external projects approach for multi-abi builds
Instead of generating external projects that build the project tree
for each target, this creates a single project for each ABI that have
the common for all targets configure steps. Each executable target
then adds additional build step to each ABI-specific external project,
that builds and copies dependencies to the "main" project build tree.
To resolve dependencies from the build tree, when building multi-abi
apk instead of scanning the build directories of external projects for
dependencies, it makes sense to run androiddeployqt for each
ABI-specific external project to copy all necessary libraries. This
is done by adding --copy-dependencies-only flag to androiddeployqt
that only copies the apk dependencies, but avoids creating apk and all
the essential steps. The ABI-specific external project now handles the
deploying of the build artifacts to the end-point apk deployment
directory and the "main" project assembles the apk using collected
artifacts. The ABI-specific external project uses the
qt_internal_${target}_copy_apk_dependencies target to run androiddeployqt
with the introduced --copy-dependencies-only flag.
TODO: Build steps that build and copy the ABI-specific apk
dependencies are non-skipable and will run each time top-level build
is triggered. This behavior should be fixed by adding dependencies to
the generated by androiddeployqt DEPFILES for each ABI in the
top-level build.
Task-number: QTBUG-88841
Tash-number: QTBUG-94714
Change-Id: Id442a9fbd589f58b70f4204c5215645056b379a2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/androiddeployqt/main.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 766af0ec31..4e54c41801 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -135,6 +135,7 @@ struct Options bool build; bool auxMode; bool noRccBundleCleanup = false; + bool copyDependenciesOnly = false; QElapsedTimer timer; // External tools @@ -563,6 +564,9 @@ Options parseOptions() } else if (argument.compare(QLatin1String("--no-rcc-bundle-cleanup"), Qt::CaseInsensitive) == 0) { options.noRccBundleCleanup = true; + } else if (argument.compare(QLatin1String("--copy-dependencies-only"), + Qt::CaseInsensitive) == 0) { + options.copyDependenciesOnly = true; } } @@ -687,6 +691,10 @@ void printHelp() " the resource bundle content, but it should not be used when deploying\n" " a project, since it litters the 'assets' directory.\n" "\n" + " --copy-dependencies-only: resolve application dependencies and stop\n" + " deploying process after all libraries and resources that the\n" + " application depends on have been copied.\n" + "\n" " --help: Displays this information.\n", qPrintable(QCoreApplication::arguments().at(0)) ); @@ -2347,7 +2355,7 @@ bool copyQtFiles(Options *options) if (options->verbose) { switch (options->deploymentMechanism) { case Options::Bundled: - fprintf(stdout, "Copying %zd dependencies from Qt into package.\n", size_t(options->qtDependencies.size())); + fprintf(stdout, "Copying %zd dependencies from Qt into package.\n", size_t(options->qtDependencies[options->currentArchitecture].size())); break; }; } @@ -3163,7 +3171,7 @@ int main(int argc, char *argv[]) options.setCurrentQtArchitecture(it.key(), it.value().qtInstallDirectory); // All architectures have a copy of the gradle files but only one set needs to be copied. - if (!androidTemplatetCopied && options.build && !options.auxMode) { + if (!androidTemplatetCopied && options.build && !options.auxMode && !options.copyDependenciesOnly) { cleanAndroidFiles(options); if (Q_UNLIKELY(options.timing)) fprintf(stdout, "[TIMING] %lld ns: Cleaned Android file\n", options.timer.nsecsElapsed()); @@ -3218,6 +3226,10 @@ int main(int argc, char *argv[]) fprintf(stdout, "[TIMING] %lld ns: Bundled Qt libs\n", options.timer.nsecsElapsed()); } + if (options.copyDependenciesOnly) { + return 0; + } + if (!createRcc(options)) return CannotCreateRcc; |