forked from qt-creator/qt-creator
QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h. Move ExitCodeInterpreter into processenums.h. Remove superfluous Utils:: prefix. Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -100,7 +100,7 @@ const char profileTeamIdTag[] = "TeamIdentifier";
|
||||
static const QString xcodePlistPath = QDir::homePath() + "/Library/Preferences/com.apple.dt.Xcode.plist";
|
||||
static const QString provisioningProfileDirPath = QDir::homePath() + "/Library/MobileDevice/Provisioning Profiles";
|
||||
|
||||
static Utils::Id deviceId(const QString &sdkName)
|
||||
static Id deviceId(const QString &sdkName)
|
||||
{
|
||||
if (sdkName.startsWith("iphoneos", Qt::CaseInsensitive))
|
||||
return Constants::IOS_DEVICE_TYPE;
|
||||
@@ -109,7 +109,7 @@ static Utils::Id deviceId(const QString &sdkName)
|
||||
return {};
|
||||
}
|
||||
|
||||
static bool isSimulatorDeviceId(const Utils::Id &id)
|
||||
static bool isSimulatorDeviceId(const Id &id)
|
||||
{
|
||||
return id == Constants::IOS_SIMULATOR_TYPE;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ static QList<ClangToolChain *> clangToolChains(const Toolchains &toolChains)
|
||||
static QList<ClangToolChain *> autoDetectedIosToolChains()
|
||||
{
|
||||
const QList<ClangToolChain *> toolChains = clangToolChains(ToolChainManager::toolchains());
|
||||
return Utils::filtered(toolChains, [](ClangToolChain *toolChain) {
|
||||
return filtered(toolChains, [](ClangToolChain *toolChain) {
|
||||
return toolChain->isAutoDetected()
|
||||
&& (toolChain->displayName().startsWith("iphone")
|
||||
|| toolChain->displayName().startsWith("Apple Clang")); // TODO tool chains should be marked directly
|
||||
@@ -138,15 +138,15 @@ static ToolChainPair findToolChainForPlatform(const XcodePlatform &platform,
|
||||
const QList<ClangToolChain *> &toolChains)
|
||||
{
|
||||
ToolChainPair platformToolChains;
|
||||
auto toolchainMatch = [](ClangToolChain *toolChain, const Utils::FilePath &compilerPath, const QStringList &flags) {
|
||||
auto toolchainMatch = [](ClangToolChain *toolChain, const FilePath &compilerPath, const QStringList &flags) {
|
||||
return compilerPath == toolChain->compilerCommand()
|
||||
&& flags == toolChain->platformCodeGenFlags()
|
||||
&& flags == toolChain->platformLinkerFlags();
|
||||
};
|
||||
platformToolChains.first = Utils::findOrDefault(toolChains, std::bind(toolchainMatch, std::placeholders::_1,
|
||||
platformToolChains.first = findOrDefault(toolChains, std::bind(toolchainMatch, std::placeholders::_1,
|
||||
platform.cCompilerPath,
|
||||
target.backendFlags));
|
||||
platformToolChains.second = Utils::findOrDefault(toolChains, std::bind(toolchainMatch, std::placeholders::_1,
|
||||
platformToolChains.second = findOrDefault(toolChains, std::bind(toolchainMatch, std::placeholders::_1,
|
||||
platform.cxxCompilerPath,
|
||||
target.backendFlags));
|
||||
return platformToolChains;
|
||||
@@ -169,8 +169,8 @@ static QHash<XcodePlatform::ToolchainTarget, ToolChainPair> findToolChains(const
|
||||
|
||||
static QSet<Kit *> existingAutoDetectedIosKits()
|
||||
{
|
||||
return Utils::toSet(Utils::filtered(KitManager::kits(), [](Kit *kit) -> bool {
|
||||
Utils::Id deviceKind = DeviceTypeKitAspect::deviceTypeId(kit);
|
||||
return toSet(filtered(KitManager::kits(), [](Kit *kit) -> bool {
|
||||
Id deviceKind = DeviceTypeKitAspect::deviceTypeId(kit);
|
||||
return kit->isAutoDetected() && (deviceKind == Constants::IOS_DEVICE_TYPE
|
||||
|| deviceKind == Constants::IOS_SIMULATOR_TYPE);
|
||||
}));
|
||||
@@ -182,8 +182,8 @@ static void printKits(const QSet<Kit *> &kits)
|
||||
qCDebug(kitSetupLog) << " -" << kit->displayName();
|
||||
}
|
||||
|
||||
static void setupKit(Kit *kit, Utils::Id pDeviceType, const ToolChainPair& toolChains,
|
||||
const QVariant &debuggerId, const Utils::FilePath &sdkPath, QtVersion *qtVersion)
|
||||
static void setupKit(Kit *kit, Id pDeviceType, const ToolChainPair& toolChains,
|
||||
const QVariant &debuggerId, const FilePath &sdkPath, QtVersion *qtVersion)
|
||||
{
|
||||
DeviceTypeKitAspect::setDeviceTypeId(kit, pDeviceType);
|
||||
if (toolChains.first)
|
||||
@@ -214,7 +214,7 @@ static void setupKit(Kit *kit, Utils::Id pDeviceType, const ToolChainPair& toolC
|
||||
SysRootKitAspect::setSysRoot(kit, sdkPath);
|
||||
}
|
||||
|
||||
static QVersionNumber findXcodeVersion(const Utils::FilePath &developerPath)
|
||||
static QVersionNumber findXcodeVersion(const FilePath &developerPath)
|
||||
{
|
||||
const FilePath xcodeInfo = developerPath.parentDir().pathAppended("Info.plist");
|
||||
if (xcodeInfo.exists()) {
|
||||
@@ -231,12 +231,12 @@ static QByteArray decodeProvisioningProfile(const QString &path)
|
||||
{
|
||||
QTC_ASSERT(!path.isEmpty(), return QByteArray());
|
||||
|
||||
Utils::QtcProcess p;
|
||||
QtcProcess p;
|
||||
p.setTimeoutS(3);
|
||||
// path is assumed to be valid file path to .mobileprovision
|
||||
p.setCommand({"openssl", {"smime", "-inform", "der", "-verify", "-in", path}});
|
||||
p.runBlocking();
|
||||
if (p.result() != Utils::QtcProcess::FinishedWithSuccess)
|
||||
if (p.result() != ProcessResult::FinishedWithSuccess)
|
||||
qCDebug(iosCommonLog) << "Reading signed provisioning file failed" << path;
|
||||
return p.stdOut().toLatin1();
|
||||
}
|
||||
@@ -251,7 +251,7 @@ void IosConfigurations::updateAutomaticKitList()
|
||||
// target -> tool chain
|
||||
const auto targetToolChainHash = findToolChains(platforms);
|
||||
|
||||
const auto qtVersions = Utils::toSet(QtVersionManager::versions([](const QtVersion *v) {
|
||||
const auto qtVersions = toSet(QtVersionManager::versions([](const QtVersion *v) {
|
||||
return v->isValid() && v->type() == Constants::IOSQT;
|
||||
}));
|
||||
|
||||
@@ -264,8 +264,8 @@ void IosConfigurations::updateAutomaticKitList()
|
||||
QSet<Kit *> resultingKits;
|
||||
for (const XcodePlatform &platform : platforms) {
|
||||
for (const auto &sdk : platform.sdks) {
|
||||
const auto targets = Utils::filtered(platform.targets,
|
||||
[&sdk](const XcodePlatform::ToolchainTarget &target) {
|
||||
const auto targets = filtered(platform.targets,
|
||||
[&sdk](const XcodePlatform::ToolchainTarget &target) {
|
||||
return sdk.architectures.first() == target.architecture;
|
||||
});
|
||||
if (targets.empty())
|
||||
@@ -278,7 +278,7 @@ void IosConfigurations::updateAutomaticKitList()
|
||||
qCDebug(kitSetupLog) << " - No tool chain found";
|
||||
continue;
|
||||
}
|
||||
Utils::Id pDeviceType = deviceId(sdk.directoryName);
|
||||
Id pDeviceType = deviceId(sdk.directoryName);
|
||||
if (!pDeviceType.isValid()) {
|
||||
qCDebug(kitSetupLog) << "Unsupported/Invalid device type" << sdk.directoryName;
|
||||
continue;
|
||||
@@ -286,7 +286,7 @@ void IosConfigurations::updateAutomaticKitList()
|
||||
|
||||
for (QtVersion *qtVersion : qtVersions) {
|
||||
qCDebug(kitSetupLog) << " - Qt version:" << qtVersion->displayName();
|
||||
Kit *kit = Utils::findOrDefault(existingKits, [&pDeviceType, &platformToolchains, &qtVersion](const Kit *kit) {
|
||||
Kit *kit = findOrDefault(existingKits, [&pDeviceType, &platformToolchains, &qtVersion](const Kit *kit) {
|
||||
// we do not compare the sdk (thus automatically upgrading it in place if a
|
||||
// new Xcode is used). Change?
|
||||
return DeviceTypeKitAspect::deviceTypeId(kit) == pDeviceType
|
||||
@@ -418,7 +418,7 @@ void IosConfigurations::updateSimulators()
|
||||
{
|
||||
// currently we have just one simulator
|
||||
DeviceManager *devManager = DeviceManager::instance();
|
||||
Utils::Id devId = Constants::IOS_SIMULATOR_DEVICE_ID;
|
||||
Id devId = Constants::IOS_SIMULATOR_DEVICE_ID;
|
||||
IDevice::ConstPtr dev = devManager->find(devId);
|
||||
if (dev.isNull()) {
|
||||
dev = IDevice::ConstPtr(new IosSimulator(devId));
|
||||
@@ -492,7 +492,7 @@ void IosConfigurations::loadProvisioningData(bool notify)
|
||||
}
|
||||
|
||||
// Sort team id's to move the free provisioning teams at last of the list.
|
||||
Utils::sort(teams, [](const QVariantMap &teamInfo1, const QVariantMap &teamInfo2) {
|
||||
sort(teams, [](const QVariantMap &teamInfo1, const QVariantMap &teamInfo2) {
|
||||
return teamInfo1.value(freeTeamTag).toInt() < teamInfo2.value(freeTeamTag).toInt();
|
||||
});
|
||||
|
||||
@@ -564,7 +564,7 @@ DevelopmentTeamPtr IosConfigurations::developmentTeam(const QString &teamID)
|
||||
QTC_CHECK(m_instance);
|
||||
m_instance->initializeProvisioningData();
|
||||
return findOrDefault(m_instance->m_developerTeams,
|
||||
Utils::equal(&DevelopmentTeam::identifier, teamID));
|
||||
equal(&DevelopmentTeam::identifier, teamID));
|
||||
}
|
||||
|
||||
const ProvisioningProfiles &IosConfigurations::provisioningProfiles()
|
||||
@@ -578,8 +578,8 @@ ProvisioningProfilePtr IosConfigurations::provisioningProfile(const QString &pro
|
||||
{
|
||||
QTC_CHECK(m_instance);
|
||||
m_instance->initializeProvisioningData();
|
||||
return Utils::findOrDefault(m_instance->m_provisioningProfiles,
|
||||
Utils::equal(&ProvisioningProfile::identifier, profileID));
|
||||
return findOrDefault(m_instance->m_provisioningProfiles,
|
||||
equal(&ProvisioningProfile::identifier, profileID));
|
||||
}
|
||||
|
||||
IosToolChainFactory::IosToolChainFactory()
|
||||
@@ -598,7 +598,7 @@ Toolchains IosToolChainFactory::autoDetect(const ToolchainDetector &detector) co
|
||||
for (const XcodePlatform::ToolchainTarget &target : platform.targets) {
|
||||
ToolChainPair platformToolchains = findToolChainForPlatform(platform, target,
|
||||
existingClangToolChains);
|
||||
auto createOrAdd = [&](ClangToolChain *toolChain, Utils::Id l) {
|
||||
auto createOrAdd = [&](ClangToolChain *toolChain, Id l) {
|
||||
if (!toolChain) {
|
||||
toolChain = new ClangToolChain;
|
||||
toolChain->setDetection(ToolChain::AutoDetection);
|
||||
|
||||
@@ -68,7 +68,7 @@ void XcodeProbe::detectDeveloperPaths()
|
||||
selectedXcode.setTimeoutS(5);
|
||||
selectedXcode.setCommand({"/usr/bin/xcode-select", {"--print-path"}});
|
||||
selectedXcode.runBlocking();
|
||||
if (selectedXcode.result() != QtcProcess::FinishedWithSuccess)
|
||||
if (selectedXcode.result() != ProcessResult::FinishedWithSuccess)
|
||||
qCWarning(probeLog)
|
||||
<< QString::fromLatin1("Could not detect selected Xcode using xcode-select");
|
||||
else
|
||||
|
||||
@@ -88,7 +88,7 @@ static bool runCommand(const CommandLine &command, QString *stdOutput, QString *
|
||||
*stdOutput = p.stdOut();
|
||||
if (allOutput)
|
||||
*allOutput = p.allOutput();
|
||||
return p.result() == QtcProcess::FinishedWithSuccess;
|
||||
return p.result() == ProcessResult::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
static bool runSimCtlCommand(QStringList args, QString *output, QString *allOutput = nullptr)
|
||||
|
||||
Reference in New Issue
Block a user