Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
shared.cpp File Reference

(d4ee081589104278a28b711baa2c6e980b18e969)

#include <QCoreApplication>
#include <QString>
#include <QStringList>
#include <QDebug>
#include <iostream>
#include <utility>
#include <QProcess>
#include <QDir>
#include <QSet>
#include <QVariant>
#include <QVariantMap>
#include <QStack>
#include <QDirIterator>
#include <QLibraryInfo>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
#include <QRegularExpression>
#include <QSaveFile>
#include "shared.h"
Include dependency graph for shared.cpp:

Go to the source code of this file.

Functions

bool operator== (const FrameworkInfo &a, const FrameworkInfo &b)
QDebug operator<< (QDebug debug, const FrameworkInfo &info)
QDebug operator<< (QDebug debug, const ApplicationBundleInfo &info)
bool copyFilePrintStatus (const QString &from, const QString &to)
bool linkFilePrintStatus (const QString &file, const QString &link)
void patch_debugInInfoPlist (const QString &infoPlistPath)
OtoolInfo findDependencyInfo (const QString &binaryPath)
FrameworkInfo parseOtoolLibraryLine (const QString &line, const QString &appBundlePath, const QList< QString > &rpaths, bool useDebugLibs)
QString findAppBinary (const QString &appBundlePath)
QStringList findAppFrameworkNames (const QString &appBundlePath)
QStringList findAppFrameworkPaths (const QString &appBundlePath)
QStringList findAppLibraries (const QString &appBundlePath)
QStringList findAppBundleFiles (const QString &appBundlePath, bool absolutePath=false)
QString findEntitlementsFile (const QString &path)
QList< FrameworkInfogetQtFrameworks (const QList< DylibInfo > &dependencies, const QString &appBundlePath, const QList< QString > &rpaths, bool useDebugLibs)
QString resolveDyldPrefix (const QString &path, const QString &loaderPath, const QString &executablePath)
QList< QStringgetBinaryRPaths (const QString &path, bool resolve=true, QString executablePath=QString())
QList< FrameworkInfogetQtFrameworks (const QString &path, const QString &appBundlePath, const QList< QString > &rpaths, bool useDebugLibs)
QList< FrameworkInfogetQtFrameworksForPaths (const QStringList &paths, const QString &appBundlePath, const QList< QString > &rpaths, bool useDebugLibs)
QStringList getBinaryDependencies (const QString executablePath, const QString &path, const QList< QString > &additionalBinariesContainingRpaths)
bool recursiveCopy (const QString &sourcePath, const QString &destinationPath, const QRegularExpression &ignoreRegExp=QRegularExpression())
void recursiveCopyAndDeploy (const QString &appBundlePath, const QList< QString > &rpaths, const QString &sourcePath, const QString &destinationPath)
QString copyDylib (const FrameworkInfo &framework, const QString path)
QString copyFramework (const FrameworkInfo &framework, const QString path)
void runInstallNameTool (QStringList options)
void changeIdentification (const QString &id, const QString &binaryPath)
void changeInstallName (const QString &bundlePath, const FrameworkInfo &framework, const QStringList &binaryPaths, bool useLoaderPath)
void addRPath (const QString &rpath, const QString &binaryPath)
void deployRPaths (const QString &bundlePath, const QList< QString > &rpaths, const QString &binaryPath, bool useLoaderPath)
void deployRPaths (const QString &bundlePath, const QList< QString > &rpaths, const QStringList &binaryPaths, bool useLoaderPath)
void changeInstallName (const QString &oldName, const QString &newName, const QString &binaryPath)
void runStrip (const QString &binaryPath)
void stripAppBinary (const QString &bundlePath)
DeploymentInfo deployQtFrameworks (QList< FrameworkInfo > frameworks, const QString &bundlePath, const QStringList &binaryPaths, bool useDebugLibs, bool useLoaderPath)
DeploymentInfo deployQtFrameworks (const QString &appBundlePath, const QStringList &additionalExecutables, bool useDebugLibs)
QString getLibInfix (const QStringList &deployedFrameworks)
void deployPlugins (const ApplicationBundleInfo &appBundleInfo, const QString &pluginSourcePath, const QString pluginDestinationPath, DeploymentInfo deploymentInfo, bool useDebugLibs)
void createQtConf (const QString &appBundlePath)
void deployPlugins (const QString &appBundlePath, DeploymentInfo deploymentInfo, bool useDebugLibs)
void deployQmlImport (const QString &appBundlePath, const QList< QString > &rpaths, const QString &importSourcePath, const QString &importName)
static bool importLessThan (const QVariant &v1, const QVariant &v2)
bool deployQmlImports (const QString &appBundlePath, DeploymentInfo deploymentInfo, QStringList &qmlDirs, QStringList &qmlImportPaths)
void codesignFile (const QString &identity, const QString &filePath)
QSet< QStringcodesignBundle (const QString &identity, const QString &appBundlePath, QList< QString > additionalBinariesContainingRpaths)
void codesign (const QString &identity, const QString &appBundlePath)
void createDiskImage (const QString &appBundlePath, const QString &filesystemType)
void fixupFramework (const QString &frameworkName)

Variables

bool runStripEnabled = true
bool alwaysOwerwriteEnabled = false
bool runCodesign = true
QStringList librarySearchPath
QString codesignIdentiy = "-"
QString extraEntitlements
bool hardenedRuntime = false
bool secureTimestamp = false
bool appstoreCompliant = false
int logLevel = 1
bool deployFramework = false
const QString bundleFrameworkDirectory = "Contents/Frameworks"

Function Documentation

◆ addRPath()

void addRPath ( const QString & rpath,
const QString & binaryPath )

Definition at line 879 of file shared.cpp.

◆ changeIdentification()

void changeIdentification ( const QString & id,
const QString & binaryPath )

Definition at line 844 of file shared.cpp.

◆ changeInstallName() [1/2]

void changeInstallName ( const QString & bundlePath,
const FrameworkInfo & framework,
const QStringList & binaryPaths,
bool useLoaderPath )

Definition at line 852 of file shared.cpp.

◆ changeInstallName() [2/2]

void changeInstallName ( const QString & oldName,
const QString & newName,
const QString & binaryPath )

Definition at line 927 of file shared.cpp.

◆ codesign()

void codesign ( const QString & identity,
const QString & appBundlePath )

Definition at line 1563 of file shared.cpp.

◆ codesignBundle()

QSet< QString > codesignBundle ( const QString & identity,
const QString & appBundlePath,
QList< QString > additionalBinariesContainingRpaths )

Definition at line 1428 of file shared.cpp.

◆ codesignFile()

void codesignFile ( const QString & identity,
const QString & filePath )

Definition at line 1392 of file shared.cpp.

References hardenedRuntime, runCodesign, and secureTimestamp.

◆ copyDylib()

QString copyDylib ( const FrameworkInfo & framework,
const QString path )

Definition at line 738 of file shared.cpp.

◆ copyFilePrintStatus()

bool copyFilePrintStatus ( const QString & from,
const QString & to )

Definition at line 78 of file shared.cpp.

References alwaysOwerwriteEnabled.

◆ copyFramework()

QString copyFramework ( const FrameworkInfo & framework,
const QString path )

Definition at line 765 of file shared.cpp.

References alwaysOwerwriteEnabled.

◆ createDiskImage()

void createDiskImage ( const QString & appBundlePath,
const QString & filesystemType )

Definition at line 1567 of file shared.cpp.

References alwaysOwerwriteEnabled.

◆ createQtConf()

void createQtConf ( const QString & appBundlePath)

Definition at line 1222 of file shared.cpp.

◆ deployPlugins() [1/2]

void deployPlugins ( const ApplicationBundleInfo & appBundleInfo,
const QString & pluginSourcePath,
const QString pluginDestinationPath,
DeploymentInfo deploymentInfo,
bool useDebugLibs )

Definition at line 1095 of file shared.cpp.

References appstoreCompliant.

◆ deployPlugins() [2/2]

void deployPlugins ( const QString & appBundlePath,
DeploymentInfo deploymentInfo,
bool useDebugLibs )

Definition at line 1252 of file shared.cpp.

◆ deployQmlImport()

void deployQmlImport ( const QString & appBundlePath,
const QList< QString > & rpaths,
const QString & importSourcePath,
const QString & importName )

Definition at line 1262 of file shared.cpp.

◆ deployQmlImports()

bool deployQmlImports ( const QString & appBundlePath,
DeploymentInfo deploymentInfo,
QStringList & qmlDirs,
QStringList & qmlImportPaths )

Definition at line 1284 of file shared.cpp.

◆ deployQtFrameworks() [1/2]

DeploymentInfo deployQtFrameworks ( const QString & appBundlePath,
const QStringList & additionalExecutables,
bool useDebugLibs )

Definition at line 1053 of file shared.cpp.

References alwaysOwerwriteEnabled.

◆ deployQtFrameworks() [2/2]

DeploymentInfo deployQtFrameworks ( QList< FrameworkInfo > frameworks,
const QString & bundlePath,
const QStringList & binaryPaths,
bool useDebugLibs,
bool useLoaderPath )

Definition at line 977 of file shared.cpp.

References DeploymentInfo::isDebug, FrameworkInfo::isDebugLibrary(), DeploymentInfo::isFramework, and DeploymentInfo::useLoaderPath.

Here is the call graph for this function:

◆ deployRPaths() [1/2]

void deployRPaths ( const QString & bundlePath,
const QList< QString > & rpaths,
const QString & binaryPath,
bool useLoaderPath )

Definition at line 884 of file shared.cpp.

◆ deployRPaths() [2/2]

void deployRPaths ( const QString & bundlePath,
const QList< QString > & rpaths,
const QStringList & binaryPaths,
bool useLoaderPath )

Definition at line 920 of file shared.cpp.

◆ findAppBinary()

QString findAppBinary ( const QString & appBundlePath)

Definition at line 377 of file shared.cpp.

◆ findAppBundleFiles()

QStringList findAppBundleFiles ( const QString & appBundlePath,
bool absolutePath = false )

Definition at line 457 of file shared.cpp.

◆ findAppFrameworkNames()

QStringList findAppFrameworkNames ( const QString & appBundlePath)

Definition at line 413 of file shared.cpp.

◆ findAppFrameworkPaths()

QStringList findAppFrameworkPaths ( const QString & appBundlePath)

Definition at line 430 of file shared.cpp.

◆ findAppLibraries()

QStringList findAppLibraries ( const QString & appBundlePath)

Definition at line 444 of file shared.cpp.

◆ findDependencyInfo()

OtoolInfo findDependencyInfo ( const QString & binaryPath)

Definition at line 156 of file shared.cpp.

◆ findEntitlementsFile()

QString findEntitlementsFile ( const QString & path)

Definition at line 474 of file shared.cpp.

◆ fixupFramework()

void fixupFramework ( const QString & frameworkName)

Definition at line 1603 of file shared.cpp.

◆ getBinaryDependencies()

QStringList getBinaryDependencies ( const QString executablePath,
const QString & path,
const QList< QString > & additionalBinariesContainingRpaths )

Definition at line 593 of file shared.cpp.

◆ getBinaryRPaths()

QList< QString > getBinaryRPaths ( const QString & path,
bool resolve = true,
QString executablePath = QString() )

Definition at line 531 of file shared.cpp.

◆ getLibInfix()

QString getLibInfix ( const QStringList & deployedFrameworks)

Definition at line 1078 of file shared.cpp.

◆ getQtFrameworks() [1/2]

QList< FrameworkInfo > getQtFrameworks ( const QList< DylibInfo > & dependencies,
const QString & appBundlePath,
const QList< QString > & rpaths,
bool useDebugLibs )

Definition at line 491 of file shared.cpp.

◆ getQtFrameworks() [2/2]

QList< FrameworkInfo > getQtFrameworks ( const QString & path,
const QString & appBundlePath,
const QList< QString > & rpaths,
bool useDebugLibs )

Definition at line 570 of file shared.cpp.

◆ getQtFrameworksForPaths()

QList< FrameworkInfo > getQtFrameworksForPaths ( const QStringList & paths,
const QString & appBundlePath,
const QList< QString > & rpaths,
bool useDebugLibs )

Definition at line 578 of file shared.cpp.

◆ importLessThan()

bool importLessThan ( const QVariant & v1,
const QVariant & v2 )
static

Definition at line 1274 of file shared.cpp.

◆ linkFilePrintStatus()

bool linkFilePrintStatus ( const QString & file,
const QString & link )

Definition at line 115 of file shared.cpp.

◆ operator<<() [1/2]

QDebug operator<< ( QDebug debug,
const ApplicationBundleInfo & info )
inline

Definition at line 70 of file shared.cpp.

◆ operator<<() [2/2]

QDebug operator<< ( QDebug debug,
const FrameworkInfo & info )

Definition at line 50 of file shared.cpp.

◆ operator==()

bool operator== ( const FrameworkInfo & a,
const FrameworkInfo & b )

Definition at line 45 of file shared.cpp.

◆ parseOtoolLibraryLine()

FrameworkInfo parseOtoolLibraryLine ( const QString & line,
const QString & appBundlePath,
const QList< QString > & rpaths,
bool useDebugLibs )

Definition at line 220 of file shared.cpp.

References FrameworkInfo::isDylib.

◆ patch_debugInInfoPlist()

void patch_debugInInfoPlist ( const QString & infoPlistPath)

Definition at line 134 of file shared.cpp.

◆ recursiveCopy()

bool recursiveCopy ( const QString & sourcePath,
const QString & destinationPath,
const QRegularExpression & ignoreRegExp = QRegularExpression() )

Definition at line 644 of file shared.cpp.

◆ recursiveCopyAndDeploy()

void recursiveCopyAndDeploy ( const QString & appBundlePath,
const QList< QString > & rpaths,
const QString & sourcePath,
const QString & destinationPath )

Definition at line 671 of file shared.cpp.

◆ resolveDyldPrefix()

QString resolveDyldPrefix ( const QString & path,
const QString & loaderPath,
const QString & executablePath )

Definition at line 505 of file shared.cpp.

◆ runInstallNameTool()

void runInstallNameTool ( QStringList options)

Definition at line 833 of file shared.cpp.

◆ runStrip()

void runStrip ( const QString & binaryPath)

Definition at line 936 of file shared.cpp.

References runStripEnabled.

◆ stripAppBinary()

void stripAppBinary ( const QString & bundlePath)

Definition at line 952 of file shared.cpp.

Variable Documentation

◆ alwaysOwerwriteEnabled

bool alwaysOwerwriteEnabled = false

◆ appstoreCompliant

bool appstoreCompliant = false

Definition at line 37 of file shared.cpp.

Referenced by deployPlugins(), and main().

◆ bundleFrameworkDirectory

const QString bundleFrameworkDirectory = "Contents/Frameworks"

Definition at line 68 of file shared.cpp.

◆ codesignIdentiy

QString codesignIdentiy = "-"

Definition at line 33 of file shared.cpp.

Referenced by main().

◆ deployFramework

bool deployFramework = false

Definition at line 39 of file shared.cpp.

Referenced by main().

◆ extraEntitlements

QString extraEntitlements

Definition at line 34 of file shared.cpp.

◆ hardenedRuntime

bool hardenedRuntime = false

Definition at line 35 of file shared.cpp.

Referenced by codesignFile(), and main().

◆ librarySearchPath

QStringList librarySearchPath

Definition at line 32 of file shared.cpp.

Referenced by main().

◆ logLevel

int logLevel = 1

Definition at line 38 of file shared.cpp.

Referenced by main().

◆ runCodesign

bool runCodesign = true

Definition at line 31 of file shared.cpp.

Referenced by codesignFile(), and main().

◆ runStripEnabled

bool runStripEnabled = true

Definition at line 29 of file shared.cpp.

Referenced by main(), and runStrip().

◆ secureTimestamp

bool secureTimestamp = false

Definition at line 36 of file shared.cpp.

Referenced by codesignFile(), and main().