Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
main.cpp File Reference

(fbb35cdb0b2c302e5963900bf59bc91a7c21765a)

#include <QCoreApplication>
#include <QStringList>
#include <QDir>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
#include <QDebug>
#include <QDataStream>
#include <QXmlStreamReader>
#include <QStandardPaths>
#include <QUuid>
#include <QDirListing>
#include <QElapsedTimer>
#include <QRegularExpression>
#include <QSettings>
#include <QHash>
#include <QSet>
#include <QMap>
#include <depfile_shared.h>
#include <shellquote_shared.h>
#include <algorithm>
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Classes

struct  QtDependency
 
struct  QtInstallDirectoryWithTriple
 
struct  Options
 
struct  GradleBuildConfigs
 

Macros

#define QT_POPEN_READ   "r"
 

Typedefs

typedef QMap< QByteArray, QByteArrayGradleProperties
 

Enumerations

enum  PackageType { AAB , AAR , UnsignedAPK , SignedAPK }
 
enum  ErrorCode {
  Success , SyntaxErrorOrHelpRequested = 1 , CannotReadInputFile = 2 , CannotCopyAndroidTemplate = 3 ,
  CannotReadDependencies = 4 , CannotCopyGnuStl = 5 , CannotCopyQtFiles = 6 , CannotFindApplicationBinary = 7 ,
  CannotCopyAndroidExtraLibs = 10 , CannotCopyAndroidSources = 11 , CannotUpdateAndroidFiles = 12 , CannotCreateAndroidProject = 13 ,
  CannotBuildAndroidProject = 14 , CannotSignPackage = 15 , CannotInstallApk = 16 , CannotCopyAndroidExtraResources = 19 ,
  CannotCopyApk = 20 , CannotCreateRcc = 21
}
 

Functions

auto openProcess (const QString &command)
 
bool goodToCopy (const Options *options, const QString &file, QStringList *unmetDependencies)
 
bool checkCanImportFromRootPaths (const Options *options, const QString &absolutePath, const QString &moduleUrl)
 
bool readDependenciesFromElf (Options *options, const QString &fileName, QSet< QString > *usedDependencies, QSet< QString > *remainingDependencies)
 
QString architectureFromName (const QString &name)
 
static QString execSuffixAppended (QString path)
 
static QString batSuffixAppended (QString path)
 
QString defaultLibexecDir ()
 
static QString llvmReadobjPath (const Options &options)
 
QString fileArchitecture (const Options &options, const QString &path)
 
bool checkArchitecture (const Options &options, const QString &fileName)
 
void deleteMissingFiles (const Options &options, const QDir &srcDir, const QDir &dstDir)
 
Options parseOptions ()
 
void printHelp ()
 
bool quasiLexicographicalReverseLessThan (const QFileInfo &fi1, const QFileInfo &fi2)
 
bool alwaysOverwritableFile (const QString &fileName)
 
bool copyFileIfNewer (const QString &sourceFileName, const QString &destinationFileName, const Options &options, bool forceOverwrite=false)
 
GradleBuildConfigs gradleBuildConfigs (const QString &path)
 
QString cleanPackageName (QString packageName, bool *cleaned=nullptr)
 
QString detectLatestAndroidPlatform (const QString &sdkPath)
 
QString extractPackageName (Options *options)
 
bool parseCmakeBoolean (const QJsonValue &value)
 
bool readInputFileDirectory (Options *options, QJsonObject &jsonObject, const QString keyName)
 
bool readInputFile (Options *options)
 
bool isDeployment (const Options *options, Options::DeploymentMechanism deployment)
 
bool copyFiles (const QDir &sourceDirectory, const QDir &destinationDirectory, const Options &options, bool forceOverwrite=false)
 
void cleanTopFolders (const Options &options, const QDir &srcDir, const QString &dstDir)
 
void cleanAndroidFiles (const Options &options)
 
bool copyAndroidTemplate (const Options &options, const QString &androidTemplate, const QString &outDirPrefix=QString())
 
bool copyGradleTemplate (const Options &options)
 
bool copyAndroidTemplate (const Options &options)
 
bool copyAndroidSources (const Options &options)
 
bool copyAndroidExtraLibs (Options *options)
 
QStringList allFilesInside (const QDir &current, const QDir &rootDir)
 
bool copyAndroidExtraResources (Options *options)
 
bool updateFile (const QString &fileName, const QHash< QString, QString > &replacements)
 
bool updateLibsXml (Options *options)
 
bool updateStringsXml (const Options &options)
 
bool updateAndroidManifest (Options &options)
 
bool updateAndroidFiles (Options &options)
 
static QString absoluteFilePath (const Options *options, const QString &relativeFileName)
 
QList< QtDependencyfindFilesRecursively (const Options &options, const QFileInfo &info, const QString &rootPath)
 
QList< QtDependencyfindFilesRecursively (const Options &options, const QString &fileName)
 
void readDependenciesFromFiles (Options *options, const QList< QtDependency > &files, QSet< QString > &usedDependencies, QSet< QString > &remainingDependencies)
 
bool readAndroidDependencyXml (Options *options, const QString &moduleName, QSet< QString > *usedDependencies, QSet< QString > *remainingDependencies)
 
QStringList getQtLibsFromElf (const Options &options, const QString &fileName)
 
bool scanImports (Options *options, QSet< QString > *usedDependencies)
 
bool runCommand (const Options &options, const QString &command)
 
bool createRcc (const Options &options)
 
bool readDependencies (Options *options)
 
bool containsApplicationBinary (Options *options)
 
auto runAdb (const Options &options, const QString &arguments) -> decltype(openProcess({}))
 
bool copyQtFiles (Options *options)
 
QStringList getLibraryProjectsInOutputFolder (const Options &options)
 
QString findInPath (const QString &fileName)
 
static GradleProperties readGradleProperties (const QString &path)
 
static bool mergeGradleProperties (const QString &path, GradleProperties properties)
 
bool buildAndroidProject (const Options &options)
 
bool uninstallApk (const Options &options)
 
QString packagePath (const Options &options, PackageType packageType)
 
bool installApk (const Options &options)
 
bool copyPackage (const Options &options)
 
bool copyStdCpp (Options *options)
 
static QString zipalignPath (const Options &options, bool *ok)
 
bool signAAB (const Options &options)
 
bool signPackage (const Options &options)
 
bool writeDependencyFile (const Options &options)
 
int main (int argc, char *argv[])
 [2]
 

Variables

static const bool mustReadOutputAnyway = true
 
static QStringList dependenciesForDepfile
 
static const QHash< QByteArray, QByteArrayelfArchitectures
 

Macro Definition Documentation

◆ QT_POPEN_READ

#define QT_POPEN_READ   "r"

Definition at line 38 of file main.cpp.

Referenced by openProcess().

Typedef Documentation

◆ GradleProperties

Definition at line 2768 of file main.cpp.

Enumeration Type Documentation

◆ ErrorCode

enum ErrorCode
Enumerator
Success 
SyntaxErrorOrHelpRequested 
CannotReadInputFile 
CannotCopyAndroidTemplate 
CannotReadDependencies 
CannotCopyGnuStl 
CannotCopyQtFiles 
CannotFindApplicationBinary 
CannotCopyAndroidExtraLibs 
CannotCopyAndroidSources 
CannotUpdateAndroidFiles 
CannotCreateAndroidProject 
CannotBuildAndroidProject 
CannotSignPackage 
CannotInstallApk 
CannotCopyAndroidExtraResources 
CannotCopyApk 
CannotCreateRcc 

Definition at line 3323 of file main.cpp.

◆ PackageType

Enumerator
AAB 
AAR 
UnsignedAPK 
SignedAPK 

Definition at line 2999 of file main.cpp.

Function Documentation

◆ absoluteFilePath()

static QString absoluteFilePath ( const Options * options,
const QString & relativeFileName )
static

Definition at line 1902 of file main.cpp.

References dir, QFile::exists(), Options::extraLibraryDirs, Options::extraPrefixDirs, QString::mid(), Options::qtDataDirectory, Options::qtInstallDirectory, and Options::qtLibsDirectory.

Referenced by QResourceFileEngine::fileName(), getQtLibsFromElf(), goodToCopy(), QQmlPluginImporter::importDynamicPlugin(), QQmlPluginImporter::importStaticPlugin(), readAndroidDependencyXml(), readDependencies(), readDependenciesFromElf(), and QDeviceDiscoveryStatic::scanConnectedDevices().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ allFilesInside()

QStringList allFilesInside ( const QDir & current,
const QDir & rootDir )

Definition at line 1563 of file main.cpp.

References allFilesInside(), dir, QDir::Dirs, QDir::entryList(), file, QDir::filePath(), QDir::Files, files, QDir::NoDotAndDotDot, and QDir::relativeFilePath().

Referenced by allFilesInside(), and copyAndroidExtraResources().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ alwaysOverwritableFile()

bool alwaysOverwritableFile ( const QString & fileName)

Definition at line 710 of file main.cpp.

References fileName.

Referenced by copyFileIfNewer().

+ Here is the caller graph for this function:

◆ architectureFromName()

QString architectureFromName ( const QString & name)

Definition at line 260 of file main.cpp.

References match(), and QStringLiteral.

Referenced by fileArchitecture().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ batSuffixAppended()

static QString batSuffixAppended ( QString path)
static

Definition at line 277 of file main.cpp.

Referenced by buildAndroidProject(), and signPackage().

+ Here is the caller graph for this function:

◆ buildAndroidProject()

◆ checkArchitecture()

bool checkArchitecture ( const Options & options,
const QString & fileName )

Definition at line 334 of file main.cpp.

References Options::currentArchitecture, fileArchitecture(), and fileName.

Referenced by copyAndroidExtraLibs(), copyAndroidExtraResources(), goodToCopy(), readAndroidDependencyXml(), and scanImports().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkCanImportFromRootPaths()

bool checkCanImportFromRootPaths ( const Options * options,
const QString & absolutePath,
const QString & moduleUrl )

Definition at line 2431 of file main.cpp.

References absolutePath(), and Options::rootPaths.

Referenced by scanImports().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanAndroidFiles()

void cleanAndroidFiles ( const Options & options)

Definition at line 1434 of file main.cpp.

References Options::androidSourceDirectory, cleanTopFolders(), QString::isEmpty(), Options::outputDirectory, Options::qtDataDirectory, and Options::qtInstallDirectory.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanPackageName()

QString cleanPackageName ( QString packageName,
bool * cleaned = nullptr )

Definition at line 805 of file main.cpp.

References ch, cleaned(), QString::indexOf(), QString::insert(), keywords, QString::mid(), next, and QString::size().

Referenced by readInputFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanTopFolders()

void cleanTopFolders ( const Options & options,
const QDir & srcDir,
const QString & dstDir )

Definition at line 1425 of file main.cpp.

References deleteMissingFiles(), dir, QDir::Dirs, and QDir::NoDotAndDotDot.

Referenced by cleanAndroidFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ containsApplicationBinary()

bool containsApplicationBinary ( Options * options)

Definition at line 2578 of file main.cpp.

References Options::applicationBinary, QString::arg(), Options::build, Options::currentArchitecture, QFile::exists(), Options::outputDirectory, qPrintable, and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyAndroidExtraLibs()

bool copyAndroidExtraLibs ( Options * options)

Definition at line 1515 of file main.cpp.

References Options::archExtraLibs, Options::Bundled, checkArchitecture(), copyFileIfNewer(), Options::currentArchitecture, Options::deploymentMechanism, Options::extraLibs, isDeployment(), Options::outputDirectory, qPrintable, Options::Unbundled, and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyAndroidExtraResources()

bool copyAndroidExtraResources ( Options * options)

Definition at line 1578 of file main.cpp.

References allFilesInside(), Options::archExtraPlugins, checkArchitecture(), copyFileIfNewer(), Options::currentArchitecture, Options::extraPlugins, files, isDeployment(), Options::outputDirectory, qPrintable, Options::Unbundled, and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyAndroidSources()

bool copyAndroidSources ( const Options & options)

Definition at line 1498 of file main.cpp.

References Options::androidSourceDirectory, copyFiles(), QString::isEmpty(), Options::outputDirectory, qPrintable, and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyAndroidTemplate() [1/2]

bool copyAndroidTemplate ( const Options & options)

Definition at line 1481 of file main.cpp.

References Options::buildAar, copyAndroidTemplate(), copyGradleTemplate(), and Options::verbose.

+ Here is the call graph for this function:

◆ copyAndroidTemplate() [2/2]

bool copyAndroidTemplate ( const Options & options,
const QString & androidTemplate,
const QString & outDirPrefix = QString() )

Definition at line 1445 of file main.cpp.

References copyFiles(), QDir::current(), Options::outputDirectory, qPrintable, Options::qtDataDirectory, and Options::qtInstallDirectory.

Referenced by copyAndroidTemplate(), and main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyFileIfNewer()

bool copyFileIfNewer ( const QString & sourceFileName,
const QString & destinationFileName,
const Options & options,
bool forceOverwrite = false )

Definition at line 719 of file main.cpp.

References alwaysOverwritableFile(), QFile::copy(), dependenciesForDepfile, QFile::exists(), qPrintable, remove(), and Options::verbose.

Referenced by copyAndroidExtraLibs(), copyAndroidExtraResources(), copyFiles(), copyQtFiles(), and copyStdCpp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyFiles()

bool copyFiles ( const QDir & sourceDirectory,
const QDir & destinationDirectory,
const Options & options,
bool forceOverwrite = false )

Definition at line 1402 of file main.cpp.

References copyFileIfNewer(), copyFiles(), destination, dir, QDir::Dirs, QDir::Files, QDir::NoDotAndDotDot, and qPrintable.

Referenced by copyAndroidSources(), copyAndroidTemplate(), copyFiles(), and copyGradleTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyGradleTemplate()

bool copyGradleTemplate ( const Options & options)

Definition at line 1463 of file main.cpp.

References copyFiles(), QDir::current(), Options::outputDirectory, qPrintable, Options::qtDataDirectory, and Options::qtInstallDirectory.

Referenced by copyAndroidTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyPackage()

bool copyPackage ( const Options & options)

Definition at line 3074 of file main.cpp.

References Options::apkPath, QFile::copy(), QString::isEmpty(), Options::keyStore, packagePath(), QFile::remove(), SignedAPK, and UnsignedAPK.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyQtFiles()

bool copyQtFiles ( Options * options)

Definition at line 2653 of file main.cpp.

References Options::build, Options::Bundled, Options::bundledFiles, copyFileIfNewer(), Options::currentArchitecture, Options::deploymentMechanism, QString::endsWith(), QFile::exists(), QDir::fromNativeSeparators(), goodToCopy(), isDeployment(), QString::mid(), Options::outputDirectory, qPrintable, Options::qtDependencies, QHash< Key, T >::size(), Options::Unbundled, and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyStdCpp()

bool copyStdCpp ( Options * options)

Definition at line 3082 of file main.cpp.

References Options::architectures, QString::arg(), copyFileIfNewer(), Options::currentArchitecture, QFile::exists(), isDeployment(), Options::outputDirectory, qPrintable, Options::stdCppName, Options::stdCppPath, Options::Unbundled, and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createRcc()

bool createRcc ( const Options & options)

Definition at line 2462 of file main.cpp.

References QDir::currentPath(), execSuffixAppended(), QDir::exists(), QFile::exists(), QString::isEmpty(), Options::isZstdCompressionEnabled, Options::noRccBundleCleanup, Options::outputDirectory, qPrintable, Options::qtLibExecsDirectory, Options::rccBinaryPath, QFile::remove(), QDir::removeRecursively(), QFile::rename(), runCommand(), QDir::setCurrent(), shellQuote(), and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defaultLibexecDir()

QString defaultLibexecDir ( )

Definition at line 285 of file main.cpp.

Referenced by readInputFileDirectory().

+ Here is the caller graph for this function:

◆ deleteMissingFiles()

void deleteMissingFiles ( const Options & options,
const QDir & srcDir,
const QDir & dstDir )

Definition at line 339 of file main.cpp.

References QDir::absolutePath(), deleteMissingFiles(), QDir::Dirs, QDir::Files, QDir::NoDotAndDotDot, qPrintable, QFile::remove(), and Options::verbose.

Referenced by cleanTopFolders(), and deleteMissingFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ detectLatestAndroidPlatform()

QString detectLatestAndroidPlatform ( const QString & sdkPath)

Definition at line 877 of file main.cpp.

References QFileInfo::baseName(), QList< T >::begin(), QList< T >::constFirst(), dir, QDir::Dirs, QList< T >::end(), QList< T >::isEmpty(), QDir::NoDotAndDotDot, qPrintable, and quasiLexicographicalReverseLessThan().

Referenced by readInputFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ execSuffixAppended()

static QString execSuffixAppended ( QString path)
static

Definition at line 269 of file main.cpp.

Referenced by createRcc(), llvmReadobjPath(), scanImports(), signAAB(), and zipalignPath().

+ Here is the caller graph for this function:

◆ extractPackageName()

QString extractPackageName ( Options * options)

Definition at line 897 of file main.cpp.

References Options::androidSourceDirectory, GradleBuildConfigs::appNamespace, gradleBuildConfigs(), QString::isEmpty(), and QIODeviceBase::ReadOnly.

Referenced by readInputFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fileArchitecture()

QString fileArchitecture ( const Options & options,
const QString & path )

Definition at line 302 of file main.cpp.

References architectureFromName(), elfArchitectures, QFile::exists(), QString::fromLatin1(), QByteArray::fromRawData(), it, line, llvmReadobjPath(), QString::mid(), openProcess(), qPrintable, qstrlen(), shellQuote(), QString::startsWith(), and QString::trimmed().

Referenced by checkArchitecture(), and readInputFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findFilesRecursively() [1/2]

QList< QtDependency > findFilesRecursively ( const Options & options,
const QFileInfo & info,
const QString & rootPath )

Definition at line 1943 of file main.cpp.

References dir, QDir::Dirs, QDir::Files, findFilesRecursively(), info, QDir::NoDotAndDotDot, ret, and QString::size().

Referenced by findFilesRecursively(), findFilesRecursively(), readAndroidDependencyXml(), and readDependencies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findFilesRecursively() [2/2]

QList< QtDependency > findFilesRecursively ( const Options & options,
const QString & fileName )

Definition at line 1966 of file main.cpp.

References QFileInfo::absolutePath(), Options::extraPrefixDirs, fileName, findFilesRecursively(), info, and Options::qtInstallDirectory.

+ Here is the call graph for this function:

◆ findInPath()

QString findInPath ( const QString & fileName)

Definition at line 2749 of file main.cpp.

References QFileInfo::exists(), fileName, QString::fromLocal8Bit(), QFileInfo::isExecutable(), QFileInfo::isFile(), and qgetenv().

Referenced by deploy(), findMinGWRuntimePaths(), and signAAB().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLibraryProjectsInOutputFolder()

QStringList getLibraryProjectsInOutputFolder ( const Options & options)

Definition at line 2721 of file main.cpp.

References QFileDevice::atEnd(), file, QString::fromLocal8Bit(), QString::indexOf(), info, QDir::isRelativePath(), line, QString::mid(), QFile::open(), Options::outputDirectory, QIODevice::readLine(), QIODeviceBase::ReadOnly, ret, and QString::startsWith().

+ Here is the call graph for this function:

◆ getQtLibsFromElf()

QStringList getQtLibsFromElf ( const Options & options,
const QString & fileName )

Definition at line 2113 of file main.cpp.

References absoluteFilePath(), Options::currentArchitecture, elfArchitectures, QFile::exists(), fileName, QString::fromLatin1(), QByteArray::fromRawData(), it, line, llvmReadobjPath(), QString::mid(), openProcess(), qPrintable, qstrlen(), ret, shellQuote(), QString::startsWith(), QString::toLatin1(), QString::trimmed(), and Options::verbose.

Referenced by goodToCopy(), and readDependenciesFromElf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ goodToCopy()

bool goodToCopy ( const Options * options,
const QString & file,
QStringList * unmetDependencies )

Definition at line 2633 of file main.cpp.

References absoluteFilePath(), checkArchitecture(), QHash< Key, T >::contains(), Options::currentArchitecture, file, getQtLibsFromElf(), Options::qtDependencies, and ret.

Referenced by copyQtFiles(), and readDependencies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gradleBuildConfigs()

GradleBuildConfigs gradleBuildConfigs ( const QString & path)

Definition at line 764 of file main.cpp.

References file, QString::fromUtf8(), line, QFile::open(), QByteArray(), QIODevice::readAll(), QIODeviceBase::ReadOnly, QByteArray::split(), and QString::trimmed().

Referenced by buildAndroidProject(), and extractPackageName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ installApk()

bool installApk ( const Options & options)

Definition at line 3040 of file main.cpp.

References QString::isEmpty(), Options::keyStore, mustReadOutputAnyway, packagePath(), runAdb(), SignedAPK, Options::uninstallApk, uninstallApk(), UnsignedAPK, and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDeployment()

bool isDeployment ( const Options * options,
Options::DeploymentMechanism deployment )

Definition at line 1397 of file main.cpp.

References Options::deploymentMechanism.

Referenced by copyAndroidExtraLibs(), copyAndroidExtraResources(), copyQtFiles(), copyStdCpp(), and updateLibsXml().

+ Here is the caller graph for this function:

◆ llvmReadobjPath()

static QString llvmReadobjPath ( const Options & options)
static

Definition at line 294 of file main.cpp.

References arg, execSuffixAppended(), Options::ndkHost, Options::ndkPath, and Options::toolchainPrefix.

Referenced by fileArchitecture(), and getQtLibsFromElf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

int main ( int argc,
char * argv[] )

[2]

[3]

[2]

[printing a custom type]

[printing a custom type] [storing a custom value]

[storing a custom value]

[retrieving a custom value]

[retrieving a custom value]

[0]

[0] [1]

[1]

[0]

[0]

[1]

[1] [2]

[2]

[0]

[0]

[2]

[2]

[22]

[22]

[3]

[3]

[4]

[4]

[10]

[10]

[qcinfo_stream]

[qcinfo_stream]

[11]

[11]

[12]

[12]

[13]

[13]

[qcinfo_printf]

[qcinfo_printf]

[14]

[14]

[15]

[15]

[16]

[16]

[17]

[17]

[0]

[0]

[1]

[1]

[2]

[2]

[Window class using revision]

[Window class using revision]

[0]

[0]

[0]

[0]

[1]

[1]

[2]

[2]

[0]

[0]

[write output] [start stream]

[start stream]

[write element]

[write element]

[finish stream]

[finish stream] [write output]

[1]

[1]

[0]

[0]

[0]

[0] //! [1]

[1]

[0]

[0] //! [1]

[1]

[0]

[0] //! [1]

[1] //! [2]

[2]

[0]

[0]

[1]

[1]

[Adding a resource]

[Adding a resource]

[Inserting an image with a cursor]

[Inserting an image with a cursor]

[Inserting an image using HTML]

[Inserting an image using HTML]

[0]

[0] //! [1]

[1]

Definition at line 3375 of file main.cpp.

References Options::androidPlatform, Options::apkPath, Options::applicationBinary, Options::architectures, arg, Options::auxMode, Options::build, buildAndroidProject(), CannotBuildAndroidProject, CannotCopyAndroidExtraLibs, CannotCopyAndroidExtraResources, CannotCopyAndroidSources, CannotCopyAndroidTemplate, CannotCopyApk, CannotCopyGnuStl, CannotCopyQtFiles, CannotCreateRcc, CannotFindApplicationBinary, CannotInstallApk, CannotReadDependencies, CannotReadInputFile, CannotSignPackage, CannotUpdateAndroidFiles, cleanAndroidFiles(), QHash< Key, T >::constBegin(), QHash< Key, T >::constEnd(), containsApplicationBinary(), copyAndroidExtraLibs(), copyAndroidExtraResources(), copyAndroidSources(), copyAndroidTemplate(), Options::copyDependenciesOnly, copyPackage(), copyQtFiles(), copyStdCpp(), createRcc(), Options::currentArchitecture, Options::depFilePath, Options::deploymentMechanism, QElapsedTimer::elapsed(), Options::helpRequested, Options::inputFileName, Options::installApk, installApk(), Options::installLocation, QString::isEmpty(), it, Options::keyStore, QElapsedTimer::nsecsElapsed(), Options::outputDirectory, packagePath(), parseOptions(), printHelp(), Q_UNLIKELY, qPrintable, readDependencies(), readInputFile(), QFile::remove(), Options::setCurrentQtArchitecture(), SignedAPK, signPackage(), QElapsedTimer::start(), SyntaxErrorOrHelpRequested, Options::timer, Options::timing, Options::Unbundled, UnsignedAPK, updateAndroidFiles(), and writeDependencyFile().

+ Here is the call graph for this function:

◆ mergeGradleProperties()

static bool mergeGradleProperties ( const QString & path,
GradleProperties properties )
static

Definition at line 2790 of file main.cpp.

References QFileDevice::close(), file, QFile::fileName(), it, line, QFile::open(), properties, qPrintable, QIODeviceBase::ReadOnly, QFile::remove(), QFile::rename(), QString::split(), QIODeviceBase::Text, QString::trimmed(), QIODeviceBase::Truncate, QIODevice::write(), and QIODeviceBase::WriteOnly.

Referenced by buildAndroidProject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ openProcess()

auto openProcess ( const QString & command)

Definition at line 47 of file main.cpp.

References QT_POPEN_READ, and void.

Referenced by buildAndroidProject(), fileArchitecture(), getQtLibsFromElf(), runCommand(), scanImports(), signAAB(), and signPackage().

+ Here is the caller graph for this function:

◆ packagePath()

QString packagePath ( const Options & options,
PackageType packageType )

Definition at line 3006 of file main.cpp.

References AAB, AAR, QString::arg(), Options::buildAar, QDir::dirName(), fileName, Options::outputDirectory, Options::releasePackage, SignedAPK, and UnsignedAPK.

Referenced by copyPackage(), installApk(), main(), signAAB(), and signPackage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseCmakeBoolean()

bool parseCmakeBoolean ( const QJsonValue & value)

Definition at line 924 of file main.cpp.

References Qt::CaseInsensitive, QString::compare(), QString::fromUtf8(), and QString::toInt().

Referenced by readInputFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseOptions()

Options parseOptions ( )

Definition at line 369 of file main.cpp.

References Options::androidPlatform, Options::apkPath, QString::arg(), argument, QCoreApplication::arguments(), arguments, QList< T >::at(), Options::auxMode, Options::build, Options::buildAAB, Options::buildAar, Options::buildDirectory, Options::Bundled, QFileInfo::canonicalFilePath(), Qt::CaseInsensitive, QString::clear(), QString::compare(), Options::copyDependenciesOnly, QDir::current(), Options::depFilePath, Options::deploymentMechanism, Options::digestAlg, QString::endsWith(), Options::helpRequested, i, Options::inputFileName, Options::installApk, Options::installLocation, Options::internalSf, QString::isEmpty(), Options::jdkPath, Options::keyPass, Options::keyStore, Options::keyStoreAlias, Options::keyStorePassword, Options::noRccBundleCleanup, Options::outputDirectory, Options::protectedAuthenticationPath, qEnvironmentVariable(), qEnvironmentVariableIsSet(), Options::qmlImportScannerBinaryPath, qPrintable, Options::releasePackage, Options::sectionsOnly, Options::sigAlg, Options::sigFile, QList< T >::size(), Options::storeType, Options::timing, Options::tsaCert, Options::tsaUrl, Options::Unbundled, Options::uninstallApk, and Options::verbose.

Referenced by QQnxIntegration::QQnxIntegration(), main(), and QWindowsIntegrationPrivate::parseOptions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printHelp()

void printHelp ( )

Definition at line 581 of file main.cpp.

Referenced by main().

+ Here is the caller graph for this function:

◆ quasiLexicographicalReverseLessThan()

bool quasiLexicographicalReverseLessThan ( const QFileInfo & fi1,
const QFileInfo & fi2 )

Definition at line 697 of file main.cpp.

References s2.

Referenced by detectLatestAndroidPlatform().

+ Here is the caller graph for this function:

◆ readAndroidDependencyXml()

bool readAndroidDependencyXml ( Options * options,
const QString & moduleName,
QSet< QString > * usedDependencies,
QSet< QString > * remainingDependencies )

Definition at line 2021 of file main.cpp.

References absoluteFilePath(), QtDependency::absolutePath, Options::androidDeployPlugins, checkArchitecture(), QDir::cleanPath(), Options::currentArchitecture, QImageReader::errorString(), Options::features, file, fileName, fileNames, findFilesRecursively(), i, Options::initClasses, QHash< Key, T >::insert(), Options::localLibs, Options::permissions, qPrintable, Options::qtDependencies, readDependenciesFromFiles(), QIODeviceBase::ReadOnly, QHash< Key, T >::size(), and Options::verbose.

Referenced by readDependenciesFromElf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDependencies()

bool readDependencies ( Options * options)

Definition at line 2515 of file main.cpp.

References absoluteFilePath(), Options::androidDeployPlugins, Options::applicationBinary, QHash< Key, T >::begin(), Options::currentArchitecture, QHash< Key, T >::end(), QHash< Key, T >::erase(), fileName, findFilesRecursively(), goodToCopy(), QHash< Key, T >::isEmpty(), it, Options::localLibs, ok, Options::outputDirectory, Options::qmlSkipImportScanning, qPrintable, Options::qrcFiles, Options::qtDependencies, Options::qtInstallDirectory, readDependenciesFromElf(), readDependenciesFromFiles(), Options::rootPaths, scanImports(), and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDependenciesFromElf()

bool readDependenciesFromElf ( Options * options,
const QString & fileName,
QSet< QString > * usedDependencies,
QSet< QString > * remainingDependencies )

Definition at line 2160 of file main.cpp.

References absoluteFilePath(), Options::currentArchitecture, fileName, getQtLibsFromElf(), QString::left(), QString::mid(), qPrintable, Options::qtDependencies, readAndroidDependencyXml(), readDependenciesFromElf(), and Options::verbose.

Referenced by readDependencies(), readDependenciesFromElf(), readDependenciesFromFiles(), and scanImports().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDependenciesFromFiles()

void readDependenciesFromFiles ( Options * options,
const QList< QtDependency > & files,
QSet< QString > & usedDependencies,
QSet< QString > & remainingDependencies )

Definition at line 1995 of file main.cpp.

References Options::currentArchitecture, fileName, files, qPrintable, Options::qtDependencies, readDependenciesFromElf(), and Options::verbose.

Referenced by readAndroidDependencyXml(), and readDependencies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readGradleProperties()

static GradleProperties readGradleProperties ( const QString & path)
static

Definition at line 2770 of file main.cpp.

References QFileDevice::close(), file, QString::indexOf(), QString::left(), line, QString::mid(), QFile::open(), properties, QIODevice::readAll(), QIODeviceBase::ReadOnly, QByteArray::split(), QString::startsWith(), and QString::trimmed().

Referenced by buildAndroidProject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readInputFile()

bool readInputFile ( Options * options)

Definition at line 994 of file main.cpp.

References QFileInfo::absolutePath(), absolutePath(), Options::androidDeployPlugins, Options::androidPlatform, Options::androidSourceDirectory, Options::applicationArguments, Options::applicationBinary, Options::architectures, QString::arg(), Options::build, Options::Bundled, cleaned(), cleanPackageName(), QHash< Key, T >::constBegin(), QSet< T >::constBegin(), QHash< Key, T >::constEnd(), QSet< T >::constEnd(), QHash< Key, T >::contains(), dependenciesForDepfile, Options::deploymentMechanism, detectLatestAndroidPlatform(), directory, QStringView::endsWith(), QDir::exists(), QFile::exists(), extractPackageName(), Options::extraLibraryDirs, Options::extraLibs, Options::extraPlugins, Options::extraPrefixDirs, file, fileArchitecture(), QJsonDocument::fromJson(), QDir::fromNativeSeparators(), QSettings::IniFormat, Options::inputFileName, QHash< Key, T >::insert(), QString::isEmpty(), QJsonValue::isObject(), QJsonValue::isString(), QJsonValue::isUndefined(), Options::isZstdCompressionEnabled, it, QHash< Key, T >::keys(), Options::minSdkVersion, Options::ndkHost, Options::ndkPath, Options::ndkVersion, QFile::open(), Options::outputDirectory, Options::packageName, parseCmakeBoolean(), Options::qmlImportPaths, Options::qmlImportScannerBinaryPath, Options::qmlSkipImportScanning, qPrintable, Options::qrcFiles, QStringLiteral, Options::qtDependencies, Options::qtHostDirectory, Options::qtInstallDirectory, Options::rccBinaryPath, QIODevice::readAll(), readInputFileDirectory(), QIODeviceBase::ReadOnly, Options::rootPaths, Options::sdkBuildToolsVersion, Options::sdkPath, settings, QString::size(), Qt::SkipEmptyParts, QString::split(), QStringView::split(), Options::stdCppPath, subPath(), Options::systemLibsPath, Options::targetSdkVersion, QJsonValue::toBool(), QJsonValue::toObject(), Options::toolchainPrefix, QVariant::toString(), QJsonValue::toString(), QStringView::toString(), QString::toUtf8(), Options::Unbundled, QJsonObject::value(), QSettings::value(), Options::verbose, Options::versionCode, and Options::versionName.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readInputFileDirectory()

bool readInputFileDirectory ( Options * options,
QJsonObject & jsonObject,
const QString keyName )

Definition at line 934 of file main.cpp.

References Options::architectures, QHash< Key, T >::constBegin(), QHash< Key, T >::constEnd(), QSet< T >::constEnd(), QHash< Key, T >::contains(), defaultLibexecDir(), directory, Options::inputFileName, it, keyName(), QHash< Key, T >::keys(), and qPrintable.

Referenced by readInputFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ runAdb()

auto runAdb ( const Options & options,
const QString & arguments ) -> decltype(openProcess({}))

Definition at line 2607 of file main.cpp.

Referenced by installApk(), and uninstallApk().

+ Here is the caller graph for this function:

◆ runCommand()

bool runCommand ( const Options & options,
const QString & command )

Definition at line 2441 of file main.cpp.

References openProcess(), qPrintable, runCommand(), and Options::verbose.

Referenced by createRcc(), and runCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scanImports()

◆ signAAB()

bool signAAB ( const Options & options)

Definition at line 3121 of file main.cpp.

References AAB, QString::arg(), Options::buildAAB, Options::digestAlg, execSuffixAppended(), QFile::exists(), file, findInPath(), QString::fromLocal8Bit(), Options::internalSf, QString::isEmpty(), Options::jdkPath, Options::keyPass, Options::keyStore, Options::keyStoreAlias, Options::keyStorePassword, openProcess(), packagePath(), Options::protectedAuthenticationPath, qgetenv(), qPrintable, Options::sectionsOnly, shellQuote(), Options::sigAlg, Options::sigFile, Options::signedJar, Options::storeType, Options::tsaCert, Options::tsaUrl, and Options::verbose.

Referenced by signPackage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ signPackage()

bool signPackage ( const Options & options)

Definition at line 3208 of file main.cpp.

References QString::arg(), batSuffixAppended(), Options::buildAAB, QFile::copy(), QFile::exists(), QString::isEmpty(), Options::keyPass, Options::keyStore, Options::keyStoreAlias, Options::keyStorePassword, ok, openProcess(), packagePath(), QFile::remove(), Options::sdkBuildToolsVersion, Options::sdkPath, shellQuote(), signAAB(), SignedAPK, UnsignedAPK, Options::verbose, and zipalignPath().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uninstallApk()

bool uninstallApk ( const Options & options)

Definition at line 2971 of file main.cpp.

References mustReadOutputAnyway, Options::packageName, qPrintable, runAdb(), shellQuote(), and Options::verbose.

Referenced by installApk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateAndroidFiles()

bool updateAndroidFiles ( Options & options)

Definition at line 1888 of file main.cpp.

References updateAndroidManifest(), updateLibsXml(), and Options::verbose.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateAndroidManifest()

bool updateAndroidManifest ( Options & options)

Definition at line 1806 of file main.cpp.

References Options::applicationArguments, Options::applicationBinary, QString::arg(), QImageReader::errorString(), Options::features, Options::outputDirectory, Options::packageName, Options::permissions, qPrintable, QStringLiteral, QIODeviceBase::ReadOnly, QString::trimmed(), updateFile(), updateStringsXml(), Options::usesOpenGL, Options::verbose, Options::versionCode, and Options::versionName.

Referenced by updateAndroidFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateFile()

bool updateFile ( const QString & fileName,
const QHash< QString, QString > & replacements )

Definition at line 1620 of file main.cpp.

References QFileDevice::close(), QSet< T >::constBegin(), QSet< T >::constEnd(), contents, fileName, forever, it, QFile::open(), qPrintable, QIODevice::readAll(), QIODeviceBase::ReadOnly, QSet< T >::size(), QIODevice::write(), and QIODeviceBase::WriteOnly.

Referenced by FileInfoThread::FileInfoThread(), deploy(), deployWebEngineCore(), deployWebProcess(), updateAndroidManifest(), updateLibrary(), updateLibsXml(), and updateStringsXml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLibsXml()

bool updateLibsXml ( Options * options)

Definition at line 1664 of file main.cpp.

References Options::archExtraLibs, Options::architectures, QString::arg(), QString::asprintf(), Options::bundledFiles, QString::chop(), QHash< Key, T >::constBegin(), QHash< Key, T >::constEnd(), QFile::exists(), fileName, Options::initClasses, isDeployment(), QHash< Key, T >::isEmpty(), it, Options::localLibs, QString::mid(), Options::outputDirectory, qPrintable, QStringLiteral, Options::qtDependencies, Options::stdCppName, Options::systemLibsPath, QString::trimmed(), Options::Unbundled, updateFile(), Options::usesOpenGL, and Options::verbose.

Referenced by updateAndroidFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStringsXml()

bool updateStringsXml ( const Options & options)

Definition at line 1777 of file main.cpp.

References append(), Options::applicationBinary, QFile::exists(), file, fileName, QFile::open(), Options::outputDirectory, QByteArray(), qPrintable, QStringLiteral, QString::toLatin1(), updateFile(), Options::verbose, QIODevice::write(), and QIODeviceBase::WriteOnly.

Referenced by updateAndroidManifest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeDependencyFile()

bool writeDependencyFile ( const Options & options)

Definition at line 3345 of file main.cpp.

References QFileInfo::absolutePath(), Options::apkPath, Options::buildDirectory, Options::copyDependenciesOnly, dependenciesForDepfile, Options::depFilePath, escapeAndEncodeDependencyPath(), file, QDir::relativeFilePath(), Options::verbose, and QIODeviceBase::WriteOnly.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ zipalignPath()

static QString zipalignPath ( const Options & options,
bool * ok )
static

Definition at line 3105 of file main.cpp.

References execSuffixAppended(), QFile::exists(), ok, qPrintable, Options::sdkBuildToolsVersion, and Options::sdkPath.

Referenced by signPackage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ dependenciesForDepfile

QStringList dependenciesForDepfile
static

Definition at line 45 of file main.cpp.

Referenced by copyFileIfNewer(), readInputFile(), and writeDependencyFile().

◆ elfArchitectures

const QHash<QByteArray, QByteArray> elfArchitectures
static
Initial value:
= {
{"aarch64", "arm64-v8a"},
{"arm", "armeabi-v7a"},
{"i386", "x86"},
{"x86_64", "x86_64"}
}

Definition at line 247 of file main.cpp.

Referenced by fileArchitecture(), and getQtLibsFromElf().

◆ mustReadOutputAnyway

const bool mustReadOutputAnyway = true
static

Definition at line 43 of file main.cpp.

Referenced by installApk(), and uninstallApk().