public static void UploadComponents(this ICakeContext context, XamarinComponentUploadSettings settings, params string[] xamFileGlobbingPatterns) { foreach (var pattern in xamFileGlobbingPatterns) { var files = context.GetFiles(pattern); if (files == null || !files.Any()) { continue; } foreach (var file in files) { UploadComponent(context, file, settings); } } }
public void Upload(FilePath xamComponentFile, XamarinComponentUploadSettings settings) { var builder = new ProcessArgumentBuilder(); builder.Append("upload"); builder.AppendQuoted(xamComponentFile.MakeAbsolute(_cakeEnvironment).FullPath); if (!string.IsNullOrEmpty(settings.Email)) { builder.Append("--user={0}", settings.Email); } if (!string.IsNullOrEmpty(settings.Password)) { builder.Append("--password={0}", settings.Password); } Run(settings, builder); }
public static void UploadComponent (this ICakeContext context, FilePath xamComponentPackage, XamarinComponentUploadSettings settings = null) { var runner = new XamarinComponentRunner (context.FileSystem, context.Environment, context.ProcessRunner, context.Globber); int attempts = 0; bool success = false; while (attempts < settings.MaxAttempts) { attempts++; try { runner.Upload (xamComponentPackage, settings ?? new XamarinComponentUploadSettings ()); success = true; break; } catch { context.Warning("Component Upload failed attempt #{0} of {1}", attempts, settings.MaxAttempts); } } if (!success) { context.Error("Failed to upload {0}", "component"); throw new Exception("Failed to upload component"); } }
public static void UploadComponents (this ICakeContext context, XamarinComponentUploadSettings settings, params string[] xamFileGlobbingPatterns) { foreach (var pattern in xamFileGlobbingPatterns) { var files = context.GetFiles(pattern); if (files == null || !files.Any()) continue; foreach (var file in files) { UploadComponent(context, file, settings); } } }
public static void UploadComponent(this ICakeContext context, FilePath xamComponentPackage, XamarinComponentUploadSettings settings = null) { var runner = new XamarinComponentRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools); int attempts = 0; bool success = false; while (attempts < settings.MaxAttempts) { attempts++; try { runner.Upload(xamComponentPackage, settings ?? new XamarinComponentUploadSettings()); success = true; break; } catch { context.Warning("Component Upload failed attempt #{0} of {1}", attempts, settings.MaxAttempts); } } if (!success) { context.Error("Failed to upload {0}", "component"); throw new Exception("Failed to upload component"); } }