/// <summary> /// Returns true if FreeStyleProject instances are equal /// </summary> /// <param name="other">Instance of FreeStyleProject to be compared</param> /// <returns>Boolean</returns> public bool Equals(FreeStyleProject other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Class == other.Class || Class != null && Class.Equals(other.Class) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( Url == other.Url || Url != null && Url.Equals(other.Url) ) && ( Color == other.Color || Color != null && Color.Equals(other.Color) ) && ( Actions == other.Actions || Actions != null && Actions.SequenceEqual(other.Actions) ) && ( Description == other.Description || Description != null && Description.Equals(other.Description) ) && ( DisplayName == other.DisplayName || DisplayName != null && DisplayName.Equals(other.DisplayName) ) && ( DisplayNameOrNull == other.DisplayNameOrNull || DisplayNameOrNull != null && DisplayNameOrNull.Equals(other.DisplayNameOrNull) ) && ( FullDisplayName == other.FullDisplayName || FullDisplayName != null && FullDisplayName.Equals(other.FullDisplayName) ) && ( FullName == other.FullName || FullName != null && FullName.Equals(other.FullName) ) && ( Buildable == other.Buildable || Buildable != null && Buildable.Equals(other.Buildable) ) && ( Builds == other.Builds || Builds != null && Builds.SequenceEqual(other.Builds) ) && ( FirstBuild == other.FirstBuild || FirstBuild != null && FirstBuild.Equals(other.FirstBuild) ) && ( HealthReport == other.HealthReport || HealthReport != null && HealthReport.SequenceEqual(other.HealthReport) ) && ( InQueue == other.InQueue || InQueue != null && InQueue.Equals(other.InQueue) ) && ( KeepDependencies == other.KeepDependencies || KeepDependencies != null && KeepDependencies.Equals(other.KeepDependencies) ) && ( LastBuild == other.LastBuild || LastBuild != null && LastBuild.Equals(other.LastBuild) ) && ( LastCompletedBuild == other.LastCompletedBuild || LastCompletedBuild != null && LastCompletedBuild.Equals(other.LastCompletedBuild) ) && ( LastFailedBuild == other.LastFailedBuild || LastFailedBuild != null && LastFailedBuild.Equals(other.LastFailedBuild) ) && ( LastStableBuild == other.LastStableBuild || LastStableBuild != null && LastStableBuild.Equals(other.LastStableBuild) ) && ( LastSuccessfulBuild == other.LastSuccessfulBuild || LastSuccessfulBuild != null && LastSuccessfulBuild.Equals(other.LastSuccessfulBuild) ) && ( LastUnstableBuild == other.LastUnstableBuild || LastUnstableBuild != null && LastUnstableBuild.Equals(other.LastUnstableBuild) ) && ( LastUnsuccessfulBuild == other.LastUnsuccessfulBuild || LastUnsuccessfulBuild != null && LastUnsuccessfulBuild.Equals(other.LastUnsuccessfulBuild) ) && ( NextBuildNumber == other.NextBuildNumber || NextBuildNumber != null && NextBuildNumber.Equals(other.NextBuildNumber) ) && ( QueueItem == other.QueueItem || QueueItem != null && QueueItem.Equals(other.QueueItem) ) && ( ConcurrentBuild == other.ConcurrentBuild || ConcurrentBuild != null && ConcurrentBuild.Equals(other.ConcurrentBuild) ) && ( Scm == other.Scm || Scm != null && Scm.Equals(other.Scm) )); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Class != null) { hashCode = hashCode * 59 + Class.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (Url != null) { hashCode = hashCode * 59 + Url.GetHashCode(); } if (Color != null) { hashCode = hashCode * 59 + Color.GetHashCode(); } if (Actions != null) { hashCode = hashCode * 59 + Actions.GetHashCode(); } if (Description != null) { hashCode = hashCode * 59 + Description.GetHashCode(); } if (DisplayName != null) { hashCode = hashCode * 59 + DisplayName.GetHashCode(); } if (DisplayNameOrNull != null) { hashCode = hashCode * 59 + DisplayNameOrNull.GetHashCode(); } if (FullDisplayName != null) { hashCode = hashCode * 59 + FullDisplayName.GetHashCode(); } if (FullName != null) { hashCode = hashCode * 59 + FullName.GetHashCode(); } if (Buildable != null) { hashCode = hashCode * 59 + Buildable.GetHashCode(); } if (Builds != null) { hashCode = hashCode * 59 + Builds.GetHashCode(); } if (FirstBuild != null) { hashCode = hashCode * 59 + FirstBuild.GetHashCode(); } if (HealthReport != null) { hashCode = hashCode * 59 + HealthReport.GetHashCode(); } if (InQueue != null) { hashCode = hashCode * 59 + InQueue.GetHashCode(); } if (KeepDependencies != null) { hashCode = hashCode * 59 + KeepDependencies.GetHashCode(); } if (LastBuild != null) { hashCode = hashCode * 59 + LastBuild.GetHashCode(); } if (LastCompletedBuild != null) { hashCode = hashCode * 59 + LastCompletedBuild.GetHashCode(); } if (LastFailedBuild != null) { hashCode = hashCode * 59 + LastFailedBuild.GetHashCode(); } if (LastStableBuild != null) { hashCode = hashCode * 59 + LastStableBuild.GetHashCode(); } if (LastSuccessfulBuild != null) { hashCode = hashCode * 59 + LastSuccessfulBuild.GetHashCode(); } if (LastUnstableBuild != null) { hashCode = hashCode * 59 + LastUnstableBuild.GetHashCode(); } if (LastUnsuccessfulBuild != null) { hashCode = hashCode * 59 + LastUnsuccessfulBuild.GetHashCode(); } if (NextBuildNumber != null) { hashCode = hashCode * 59 + NextBuildNumber.GetHashCode(); } if (QueueItem != null) { hashCode = hashCode * 59 + QueueItem.GetHashCode(); } if (ConcurrentBuild != null) { hashCode = hashCode * 59 + ConcurrentBuild.GetHashCode(); } if (Scm != null) { hashCode = hashCode * 59 + Scm.GetHashCode(); } return(hashCode); } }
public async Task <bool> Run( string dropboxGeneratedAccessToken, string automationLogDirectory, string automationLogFilename, string automationConfigDirectory, string automationConfigFilename) { DropboxClientKey = dropboxGeneratedAccessToken; AutomationLogFilename = automationLogFilename; AutomationLogDirectory = automationLogDirectory; LogPath = System.IO.Path.Combine(AutomationLogDirectory, AutomationLogFilename); CheckLogPathExists(); LogBeforeBuildStarted(); LogMessage(string.Format(" Configuration Directory: {0}", automationConfigDirectory)); LogMessage(string.Format(" Configuration File Name: {0}", automationConfigFilename)); string CIConfigJsonFilePath = Path.Combine(automationConfigDirectory, automationConfigFilename); LogMessage(string.Format(" Configuration File Path: {0}", CIConfigJsonFilePath)); string configjson = File.ReadAllText(CIConfigJsonFilePath); LogMessage(string.Format(" Configuration JSON: {0}", configjson)); _config = JsonConvert.DeserializeObject <PostBuildConfigSettingsModel>(configjson); ProjectName = _config.ProjectName; NextBuildNumber = _config.NextBuildNumber; IPASourceFileName = _config.IPASourceFileName; IPASourceDirectory = _config.IPASourceDirectory; IPATargetFileName = _config.IPATargetFileName; IPATargetDirectory = _config.IPATargetDirectory; string sourceFile = System.IO.Path.Combine(IPASourceDirectory, IPASourceFileName); LogMessage(string.Format(" CONFIG FILE JSON RESULTS", ProjectName)); LogMessage(string.Format(" : Project Name {0}", ProjectName)); LogMessage(string.Format(" : Next Build Number {0}", NextBuildNumber)); LogMessage(string.Format(" : IPA Source Filename {0}", IPASourceFileName)); LogMessage(string.Format(" : IPA Source Directory {0}", IPASourceDirectory)); LogMessage(string.Format(" : IPA Target Filename {0}", IPATargetFileName)); LogMessage(string.Format(" : IPA Target Directory {0}", IPATargetDirectory)); LogMessage(string.Format(" IPA Source Path {0}", sourceFile)); string destFile = string.Empty; if (IPATargetFileName.Contains("{0}")) { IPATargetFileName = string.Format(IPATargetFileName, NextBuildNumber.Trim()); destFile = System.IO.Path.Combine(IPATargetDirectory, IPATargetFileName); } else { destFile = System.IO.Path.Combine(IPATargetDirectory, IPATargetFileName); } LogMessage(string.Format(" IPA Target Filename {0}", IPATargetFileName)); LogMessage(string.Format(" IPA Target Directory {0}", IPATargetDirectory)); LogMessage(string.Format(" IPA Target Path {0}", destFile)); if (!System.IO.Directory.Exists(IPATargetDirectory)) { System.IO.Directory.CreateDirectory(IPATargetDirectory); } if (File.Exists(sourceFile)) { System.IO.File.Copy(sourceFile, destFile, true); } else { LogMessage(string.Format(" ERROR File Path Does not exist {0}", sourceFile)); } LogMessage(string.Format(" Copied {0} to IPAArchives Directory", IPATargetFileName)); await UploadToDropBox("/test", IPATargetFileName, destFile); LogAfterBuildFinished(); return(true); }