diff options
author | Jake Petroules <jake.petroules@qt.io> | 2016-09-14 11:36:45 -0700 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-09-16 05:49:42 +0000 |
commit | f242b91189e3bd0cc96dd1a2695eef0521099aea (patch) | |
tree | c75e88993f31a0c39452cfd34de17ad0a959ed03 /qmake/generators/mac/pbuilder_pbx.cpp | |
parent | 1f01423e86a4ad6f94db06168272d4cf3d47d44b (diff) |
Fix code signing for qmake-generated Xcode projects in Xcode 8
Task-number: QTBUG-55915
Change-Id: I7cbddd7ed8a6e0fa220b423e11e4d550e09297f9
Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
Diffstat (limited to 'qmake/generators/mac/pbuilder_pbx.cpp')
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 75abc4378f..5e37cd65d8 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -38,6 +38,7 @@ #include <qregexp.h> #include <qcryptographichash.h> #include <qdebug.h> +#include <qsettings.h> #include <qstring.h> #include <stdlib.h> #include <time.h> @@ -1405,6 +1406,28 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QString configName = (as_release ? "Release" : "Debug"); QMap<QString, QString> settings; + if (!project->isActiveConfig("no_xcode_development_team")) { + const QSettings xcodeSettings( + QDir::homePath() + QLatin1String("/Library/Preferences/com.apple.dt.Xcode.plist"), + QSettings::NativeFormat); + const QVariantMap teams = xcodeSettings.value(QLatin1String("IDEProvisioningTeams")).toMap(); + if (!teams.isEmpty()) { + for (QVariantMap::const_iterator it = teams.begin(), end = teams.end(); it != end; ++it) { + const QVariantMap team = it.value().toMap(); + const QString teamType = team.value(QLatin1String("teamType")).toString(); + + // Skip Company teams because signing permissions may not be available under all + // circumstances for users who are not the Team Agent + if (teamType != QLatin1String("Company")) { + const QString teamId = team.value(QLatin1String("teamID")).toString(); + settings.insert("DEVELOPMENT_TEAM", teamId); + + // first suitable team we found is the one we'll use by default + break; + } + } + } + } settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO")); // Bitcode is only supported with a deployment target >= iOS 6.0. // Disable it for now, and consider switching it on when later |