Fix code signing for qmake-generated Xcode projects in Xcode 8 (again)
This version now prefers non-free provisioning teams, since the latter seem to be problematic in more cases. Task-number: QTBUG-55915 Change-Id: Ie40ddae5e333acdd5327ed46992fb4fb300dee25 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This commit is contained in:
parent
f242b91189
commit
a45566eec7
@ -496,6 +496,32 @@ static QString xcodeFiletypeForFilename(const QString &filename)
|
||||
return QString();
|
||||
}
|
||||
|
||||
static bool compareProvisioningTeams(const QVariantMap &a, const QVariantMap &b)
|
||||
{
|
||||
int aFree = a.value(QLatin1String("isFreeProvisioningTeam")).toBool() ? 1 : 0;
|
||||
int bFree = b.value(QLatin1String("isFreeProvisioningTeam")).toBool() ? 1 : 0;
|
||||
return aFree < bFree;
|
||||
}
|
||||
|
||||
static QList<QVariantMap> provisioningTeams()
|
||||
{
|
||||
const QSettings xcodeSettings(
|
||||
QDir::homePath() + QLatin1String("/Library/Preferences/com.apple.dt.Xcode.plist"),
|
||||
QSettings::NativeFormat);
|
||||
const QVariantMap teamMap = xcodeSettings.value(QLatin1String("IDEProvisioningTeams")).toMap();
|
||||
QList<QVariantMap> flatTeams;
|
||||
for (QVariantMap::const_iterator it = teamMap.begin(), end = teamMap.end(); it != end; ++it) {
|
||||
const QString emailAddress = it.key();
|
||||
QVariantMap team = it.value().toMap();
|
||||
team[QLatin1String("emailAddress")] = emailAddress;
|
||||
flatTeams.append(team);
|
||||
}
|
||||
|
||||
// Sort teams so that Free Provisioning teams come last
|
||||
std::sort(flatTeams.begin(), flatTeams.end(), ::compareProvisioningTeams);
|
||||
return flatTeams;
|
||||
}
|
||||
|
||||
bool
|
||||
ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
{
|
||||
@ -1407,25 +1433,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
|
||||
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();
|
||||
const QList<QVariantMap> teams = provisioningTeams();
|
||||
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;
|
||||
}
|
||||
}
|
||||
// first suitable team we find is the one we'll use by default
|
||||
settings.insert("DEVELOPMENT_TEAM",
|
||||
teams.first().value(QLatin1String("teamID")).toString());
|
||||
}
|
||||
}
|
||||
settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user