Add better diagnostics when failing to find provisioning profiles. (#108)

This commit is contained in:
Rolf Bjarne Kvinge 2022-11-08 18:33:54 +01:00 коммит произвёл GitHub
Родитель b0b5f8b540
Коммит 33502e15ba
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 36 добавлений и 2 удалений

Просмотреть файл

@ -385,6 +385,11 @@ namespace Xamarin.MacDev {
var index = OpenIndex (MobileProvision.ProfileDirectory, IndexFileName);
var latestCreationDate = DateTime.MinValue;
if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
return null;
}
foreach (var profile in index.ProvisioningProfiles) {
if (!profile.FileName.EndsWith (extension, StringComparison.Ordinal)) {
failures?.Add ($"The profile '{profile.Name}' is not applicable because its FileName ({profile.FileName}) does not end with '{extension}'.");
@ -413,6 +418,11 @@ namespace Xamarin.MacDev {
var list = new List<MobileProvision> ();
var now = DateTime.UtcNow;
if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
return list;
}
// iterate over the profiles in reverse order so that we load newer profiles first (optimization for the 'unique' case)
for (int i = index.ProvisioningProfiles.Count - 1; i >= 0; i--) {
var profile = index.ProvisioningProfiles [i];
@ -460,6 +470,11 @@ namespace Xamarin.MacDev {
var list = new List<MobileProvision> ();
var now = DateTime.UtcNow;
if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
return list;
}
// iterate over the profiles in reverse order so that we load newer profiles first (optimization for the 'unique' case)
for (int i = index.ProvisioningProfiles.Count - 1; i >= 0; i--) {
var profile = index.ProvisioningProfiles [i];
@ -516,11 +531,18 @@ namespace Xamarin.MacDev {
if (developerCertificates == null)
throw new ArgumentNullException (nameof (developerCertificates));
if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
return list;
}
foreach (var certificate in developerCertificates)
thumbprints.Add (certificate.Thumbprint);
if (thumbprints.Count == 0)
if (thumbprints.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles because there are no developer certificates.");
return list;
}
// iterate over the profiles in reverse order so that we load newer profiles first (optimization for the 'unique' case)
for (int i = index.ProvisioningProfiles.Count - 1; i >= 0; i--) {
@ -585,6 +607,11 @@ namespace Xamarin.MacDev {
if (bundleIdentifier == null)
throw new ArgumentNullException (nameof (bundleIdentifier));
if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
return list;
}
// iterate over the profiles in reverse order so that we load newer profiles first (optimization for the 'unique' case)
for (int i = index.ProvisioningProfiles.Count - 1; i >= 0; i--) {
var profile = index.ProvisioningProfiles [i];
@ -665,11 +692,18 @@ namespace Xamarin.MacDev {
if (developerCertificates == null)
throw new ArgumentNullException (nameof (developerCertificates));
if (index.ProvisioningProfiles.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles on this machine.");
return list;
}
foreach (var certificate in developerCertificates)
thumbprints.Add (certificate.Thumbprint);
if (thumbprints.Count == 0)
if (thumbprints.Count == 0) {
failures?.Add ($"Could not find any provisioning profiles because there are no developer certificates.");
return list;
}
// iterate over the profiles in reverse order so that we load newer profiles first (optimization for the 'unique' case)
for (int i = index.ProvisioningProfiles.Count - 1; i >= 0; i--) {