示例#1
0
        /// <summary>
        /// Finds the icon for the specified build status.
        /// </summary>
        /// <param name="buildStatus">The build status.</param>
        /// <returns></returns>
        public Icon Find(BuildStatus buildStatus)
        {
            Icon icon;

            switch (buildStatus)
            {
                case BuildStatus.Building:
                    icon = Resources.Yellow;
                    break;

                case BuildStatus.Failed:
                    icon = Resources.Red;
                    break;

                case BuildStatus.Passed:
                    icon = Resources.Blue;
                    break;

                default:
                    icon = Resources.Grey;
                    break;
            }

            return icon;
        }
示例#2
0
 public static BuildLocator WithDimensions(BuildTypeLocator buildType = null,
                                           UserLocator user = null,
                                           string agentName = null,
                                           BuildStatus? status = null,
                                           bool? personal = null,
                                           bool? canceled = null,
                                           bool? running = null,
                                           bool? pinned = null,
                                           int? maxResults = null,
                                           int? startIndex = null,
                                           BuildLocator sinceBuild = null,
                                           DateTime? sinceDate = null,
                                           string[] tags = null,
                                           string branch = null
     )
 {
     return new BuildLocator
                {
                    BuildType = buildType,
                    User = user,
                    AgentName = agentName,
                    Status = status,
                    Personal = personal,
                    Canceled = canceled,
                    Running = running,
                    Pinned = pinned,
                    MaxResults = maxResults,
                    StartIndex = startIndex,
                    SinceBuild = sinceBuild,
                    SinceDate = sinceDate,
                    Tags = tags,
                    Branch = branch
                };
 }
示例#3
0
 public void Update(BuildStatus status)
 {
     switch (status)
     {
         case BuildStatus.Unknown:
             _lightController.TurnOff(Light.Red);
             _lightController.TurnOff(Light.Yellow);
             _lightController.TurnOff(Light.Green);
             break;
         case BuildStatus.Successful:
             _lightController.TurnOff(Light.Red);
             _lightController.TurnOff(Light.Yellow);
             _lightController.TurnOn(Light.Green);
             break;
         case BuildStatus.Broken:
             _lightController.TurnOn(Light.Red);
             _lightController.TurnOff(Light.Yellow);
             _lightController.TurnOff(Light.Green);
             break;
         case BuildStatus.TestFailures:
             _lightController.TurnOff(Light.Red);
             _lightController.TurnOn(Light.Yellow);
             _lightController.TurnOff(Light.Green);
             break;
         default:
             throw new ArgumentOutOfRangeException("status");
     }
 }
 public static TeamBuildScreen.Core.Models.BuildStatus Convert(BuildStatus status)
 {
     switch (status)
     {
         case BuildStatus.Failed:
             return TeamBuildScreen.Core.Models.BuildStatus.Failed;
             break;
         case BuildStatus.InProgress:
             return TeamBuildScreen.Core.Models.BuildStatus.InProgress;
             break;
         case BuildStatus.NotStarted:
             return TeamBuildScreen.Core.Models.BuildStatus.NotStarted;
             break;
         case BuildStatus.PartiallySucceeded:
             return TeamBuildScreen.Core.Models.BuildStatus.PartiallySucceeded;
             break;
         case BuildStatus.Stopped:
             return TeamBuildScreen.Core.Models.BuildStatus.Stopped;
             break;
         case BuildStatus.Succeeded:
             return TeamBuildScreen.Core.Models.BuildStatus.Succeeded;
             break;
         default:
             throw new NotSupportedException("Unable to convert unrecognised BuildStatus.");
     }
 }
 public Microsoft.TeamFoundation.Build.Server.BuildStatus ConvertBuildStatus(BuildStatus? status, BuildResult? result)
 {
     if (!status.HasValue)
     {
         return Microsoft.TeamFoundation.Build.Server.BuildStatus.NotStarted;
     }
     BuildStatus value = status.Value;
     switch (value)
     {
         case BuildStatus.None:
             return Microsoft.TeamFoundation.Build.Server.BuildStatus.None;
         case BuildStatus.InProgress:
             return Microsoft.TeamFoundation.Build.Server.BuildStatus.InProgress;
         case BuildStatus.Completed:
             return this.ConvertBuildResult(result);
         case (BuildStatus)3:
         case (BuildStatus)5:
         case (BuildStatus)6:
         case (BuildStatus)7:
             break;
         case BuildStatus.Cancelling:
             return Microsoft.TeamFoundation.Build.Server.BuildStatus.Stopped;
         case BuildStatus.Postponed:
             return Microsoft.TeamFoundation.Build.Server.BuildStatus.NotStarted;
         default:
             if (value == BuildStatus.NotStarted)
             {
                 return Microsoft.TeamFoundation.Build.Server.BuildStatus.NotStarted;
             }
             break;
     }
     return Microsoft.TeamFoundation.Build.Server.BuildStatus.NotStarted;
 }
示例#6
0
 public MockBuildInfo(BuildStatus status, string requestedFor, DateTime startTime, bool buildFinished, DateTime finishTime)
 {
     this.Status = status;
     this.requestedFor = requestedFor;
     this.startTime = startTime;
     this.buildFinished = buildFinished;
     this.finishTime = finishTime;
 }
示例#7
0
文件: Build.cs 项目: Kuzq/gitter
 internal Build(TeamCityServiceContext context, XmlNode node)
     : base(context, node)
 {
     _status		= TeamCityUtility.LoadBuildStatus(node.Attributes[StatusProperty.XmlNodeName]);
     _number		= TeamCityUtility.LoadString(node.Attributes[NumberProperty.XmlNodeName]);
     _startDate	= TeamCityUtility.LoadDateForSure(node.Attributes[StartDateProperty.XmlNodeName]);
     _buildtype	= Context.BuildTypes.Lookup(node.Attributes[BuildTypeProperty.XmlNodeName].InnerText);
 }
        public void CurrentStatus_should_reflect_the_status_of_the_latest_build(string sampleRss, BuildStatus expectedStatus)
        {
            var rssFeedMock = Substitute.For<IJenkinsRssFeed>();
            rssFeedMock.Read().Returns(sampleRss);

            var monitor = new BuildMonitor(rssFeedMock);

            monitor.GetCurrentBuildStatus().Should().Be(expectedStatus);
        }
示例#9
0
 public LogEntry(string branch, uint revision, Guid id, string author, string data, string message, BuildStatus status = BuildStatus.Pending)
 {
     Branch = branch;
     Revision = revision;
     ID = id;
     Author = author;
     Date = data;
     Message = message;
     Status = status;
 }
示例#10
0
		/// <summary>
		/// Initializes a new instance of the <see cref="ClientInformation"/> class.
		/// </summary>
		/// <param name="name">The name.</param>
		/// <param name="session">The session identifier.</param>
		/// <param name="status">The status of the build.</param>
		/// <param name="testResults">The test results collection.</param>
		public ClientInformation(string name, Guid session, BuildStatus status, IReadOnlyCollection<TestResult> testResults)
		{
			RequiresNotNull(name);
			RequiresNotNull(status);
			RequiresNotNull(testResults);
			this.name = name;
			this.status = status;
			this.testResults = testResults;
			this.session = session;
		}
示例#11
0
 public void Reset()
 {
     Translation.ExplicitInputs.Clear();
     Translation.ExplicitOutputs.Clear();
     Translation.ImplicitInputs.Clear();
     Status = BuildStatus.NotStarted;
     Dependencies.Clear();
     Consumers.Clear();
     ImplicitInputsUpToDate = false;
 }
示例#12
0
 public BuildState(string name, BuildStatus status, DateTime finishTime, string uri, string requestedBy, TestStatistics testStatistics)
 {
     Uri = uri;
     Name = name;
     Status = status;
     FinishTime = finishTime;
     Uri = uri;
     RequestedBy = requestedBy;
     TestStatistics = testStatistics;
 }
示例#13
0
 public void OnBuildStatusChanged(Project project, BuildState buildState, BuildStatus buildStatus)
 {
     if (BuildStatusChanged != null)
     {
         BuildStatusChanged(this, new BuildStatusChangedEventArgs
             {
                 Project = project,
                 BuildState = buildState,
                 BuildStatus = buildStatus
             });
     }
 }
示例#14
0
 public void Add(BuildStatus status)
 {
     All ++;
     switch (status)
     {
         case BuildStatus.SUCCESS:
             Success++;
             break;
         case BuildStatus.IGNORED:
             Ignored++;
             break;
         case BuildStatus.FAILURE:
         case BuildStatus.ERROR:
             Failed++;
             break;
     }
 }
示例#15
0
 private void WriteHeader(BuildStatus status)
 {
     string message = Environment.NewLine + Environment.NewLine;
     switch (status)
     {
         case BuildStatus.Failed:
             message += "Build failed.";
             break;
         case BuildStatus.SucceedWithWarning:
             message += "Build succeeded with warning.";
             break;
         case BuildStatus.Succeed:
             message += "Build succeeded.";
             break;
         default:
             break;
     }
     WriteToConsole(message, status);
 }
示例#16
0
 protected static void AppendArgument(StringBuilder sb, string argname, BuildStatus value)
 {
     if(value != BuildStatus.Unknown)
     {
         BeginArgument(sb, argname);
         switch(value)
         {
             case BuildStatus.Error:
                 sb.Append("ERROR");
                 break;
             case BuildStatus.Failure:
                 sb.Append("FAILURE");
                 break;
             case BuildStatus.Success:
                 sb.Append("SUCCESS");
                 break;
             default:
                 throw new ApplicationException();
         }
     }
 }
示例#17
0
        private void ChangeProgress(BuildStatus status)
        {
            var color = Color.FromArgb(255, 47, 201, 31); 
            var buildButtonText = _strings.Build;
            var progressIndicator = string.Empty;
            var staticIndicatorVisible = false;

            if(status == BuildStatus.Error)
            {
                color = Color.FromArgb(255, 241, 37, 47);
                progressIndicator = "\uF071";
                staticIndicatorVisible = true;
            }
            else if (status == BuildStatus.Running)
            {
                color = Color.FromArgb(255, 38, 156, 245); 
                buildButtonText = _strings.Abort;
                progressIndicator = "\uF021";
            }
            else if (status == BuildStatus.Success)
            {
                progressIndicator = "\uF14A";
                staticIndicatorVisible = true;
            }

            Application.Current.Dispatcher.BeginInvoke(
                DispatcherPriority.Background,
                new Action(() =>
                {
                    BuildButtonText = buildButtonText;
                    ProgressColor = new SolidColorBrush(color);
                    ProgressIndicator = progressIndicator;
                    StaticIndicatorVisible = staticIndicatorVisible;
                    DynamicIndicatorVisible = !staticIndicatorVisible;
                }));
        }
示例#18
0
		public BuildState(BuildStatus status, int elapsedTime = 0, int estimatedTime = 0)
		{
			Status = status;
			ElapsedTimeMs = elapsedTime;
			EstimatedDurationMs = estimatedTime;
		}
示例#19
0
        private static void UpdateRetentionPolicy(IBuildDefinition bd, BuildReason reason, int keep, DeleteOptions options, BuildStatus status)
        {
            var rp = bd.RetentionPolicyList.FirstOrDefault(r => r.BuildReason == reason && r.BuildStatus == status);

            if (rp == null)
            {
                bd.AddRetentionPolicy(reason, BuildStatus.Stopped, keep, options);
            }
            else
            {
                rp.NumberToKeep  = keep;
                rp.DeleteOptions = options;
            }
        }
示例#20
0
 public IBuildHavingBuilder Status(BuildStatus buildStatus)
 {
     m_Having.Add("status:" + buildStatus.ToString().ToUpper());
     return this;
 }
        private async Task TestReportJobCompleted(BuildStatus buildStatus, bool returnNullBuild, bool isPassed, int expectedEventCount, TaskResult expectedResult, int expectedRecordCount = 0, string timeLineRecordName = null)
        {
            // given
            Guid        parentId    = Guid.NewGuid();
            Guid        childId     = Guid.NewGuid();
            VstsMessage vstsContext = new TestVstsMessage
            {
                JobId           = parentId,
                VstsHub         = HubType.Build,
                VstsUri         = new Uri("http://vstsUri"),
                VstsPlanUri     = new Uri("http://vstsPlanUri"),
                BuildProperties = new VstsBuildProperties(),
            };
            var mockBuildClient = new MockBuildClient()
            {
                MockBuild = new Build()
                {
                    Status = buildStatus
                },
                ReturnNullBuild = returnNullBuild,
            }; var mockReleaseClient = new MockReleaseClient()

            {
                MockRelease = new Release()
                {
                    Status = ReleaseStatus.Undefined
                },
                ReturnNullRelease = false,
            };

            var timelineRecords = new List <Microsoft.TeamFoundation.DistributedTask.WebApi.TimelineRecord>
            {
                new Microsoft.TeamFoundation.DistributedTask.WebApi.TimelineRecord()
                {
                    Id = parentId
                },
                new Microsoft.TeamFoundation.DistributedTask.WebApi.TimelineRecord()
                {
                    Id       = childId,
                    ParentId = parentId
                },
                new Microsoft.TeamFoundation.DistributedTask.WebApi.TimelineRecord()
                {
                    // Should be ignored
                    Id = Guid.NewGuid()
                }
            };

            if (!string.IsNullOrEmpty(timeLineRecordName))
            {
                timelineRecords.Add(new Microsoft.TeamFoundation.DistributedTask.WebApi.TimelineRecord()
                {
                    Id   = Guid.NewGuid(),
                    Name = timeLineRecordName
                });
            }

            var mockTaskHttpClient = new MockTaskClient()
            {
                GetRecordsReturnCollection = timelineRecords
            };

            var reportingHelper = new TestableJobStatusReportingHelper(vstsContext, new TraceLogger(), mockTaskHttpClient, mockReleaseClient, mockBuildClient, timeLineRecordName);

            // when
            await reportingHelper.ReportJobCompleted(DateTime.UtcNow, "test message", isPassed, default(CancellationToken));

            // then
            Assert.AreEqual(expectedEventCount, mockTaskHttpClient.EventsReceived.Count);
            if (expectedEventCount != 0)
            {
                var taskEvent = mockTaskHttpClient.EventsReceived[0] as JobCompletedEvent;
                Assert.IsNotNull(taskEvent);
                Assert.AreEqual(taskEvent.Result, expectedResult);
            }

            Assert.AreEqual(expectedRecordCount, mockTaskHttpClient.TimelineRecordsUpdated.Count);
            if (expectedRecordCount != 0)
            {
                var records = string.IsNullOrEmpty(timeLineRecordName) ?
                              mockTaskHttpClient.TimelineRecordsUpdated.Where(rec => rec.Id == parentId || rec.Id == childId).ToList() :
                              mockTaskHttpClient.TimelineRecordsUpdated.Where(rec => rec.Name != null && rec.Name.Equals(timeLineRecordName, StringComparison.OrdinalIgnoreCase)).ToList();
                Assert.AreEqual(expectedRecordCount, records.Count);

                foreach (var record in records)
                {
                    Assert.IsNotNull(record);
                    Assert.AreEqual(expectedResult, record.Result);
                }
            }
        }
示例#22
0
 private static void StartBuild(string projectName)
 {
     WriteVerbose("Starting project:  " + projectName);
     if (Projects[projectName].BuildCheckouts.Any())
     {
         foreach (var checkout in Projects[projectName].BuildCheckouts.Keys)
         {
             BuildStatus build = new BuildStatus();
             Directory.CreateDirectory(Path.Combine(MasterConfig.ProjectRoot, projectName, "Archive",
                                                    build.TimeStamp.ToString(DateTimeDirFormat)));
             build.Append("Log for project [" + projectName + "] on reference [" + checkout + "]");
             if (PreBuildActions(projectName, build, checkout) == 0)
                 if (BuildActions(projectName, build, checkout) == 0)
                     if (PostBuildActions(projectName, build, checkout) == 0)
                         build.ChangeResult("Success");
                     else
                         build.ChangeResult("Warning");
                 else
                     build.ChangeResult("Failed");
             else
                 build.ChangeResult("Error");
             Projects[projectName].GetHistory().Append(build);
             WriteVerbose("Project done: " + projectName + " \t Result: " + build.Result);
             string BuildLog = Path.Combine(MasterConfig.ProjectRoot, projectName, "Archive",
                              build.TimeStamp.ToString(DateTimeDirFormat), "run.log");
             File.WriteAllText(BuildLog, build.LogData);
         }
     }
     else
     {
         BuildStatus build = new BuildStatus();
         Directory.CreateDirectory(Path.Combine(MasterConfig.ProjectRoot, projectName, "Archive",
                                                build.TimeStamp.ToString(DateTimeDirFormat)));
         if (PreBuildActions(projectName, build) == 0)
             if (BuildActions(projectName, build) == 0)
                 if (PostBuildActions(projectName, build) == 0)
                     build.ChangeResult("Success");
                 else
                     build.ChangeResult("Warning");
             else
                 build.ChangeResult("Failed");
         else
             build.ChangeResult("Error");
         Projects[projectName].GetHistory().Append(build);
         WriteVerbose("Project done: " + projectName + " \t Result: " + build.Result);
         string BuildLog = Path.Combine(MasterConfig.ProjectRoot, projectName, "Archive",
                          build.TimeStamp.ToString(DateTimeDirFormat), "run.log");
         File.WriteAllText(BuildLog, build.LogData);
     }
 }
 public IBuildHavingBuilder Status(BuildStatus buildStatus)
 {
     m_Having.Add("status:" + buildStatus.ToString().ToUpper());
     return(this);
 }
示例#24
0
        private IEnumerable <AchievementEnum> CalculateNewAchievementEnums(SirenOfShameSettings settings, BuildStatus build, List <BuildStatus> allActiveBuildDefinitionsOrderedChronoligically)
        {
            int reputation = GetReputation();

            List <BuildStatus> currentBuildDefinitionOrderedChronoligically = allActiveBuildDefinitionsOrderedChronoligically
                                                                              .Where(i => i.BuildDefinitionId == build.BuildDefinitionId)
                                                                              .ToList();

            if (build.FinishedTime != null && build.StartedTime != null)
            {
                TimeSpan?buildDuration = build.FinishedTime.Value - build.StartedTime.Value;
                MyCumulativeBuildTime = MyCumulativeBuildTime == null ? buildDuration : MyCumulativeBuildTime + buildDuration;
            }

            CalculateStats(allActiveBuildDefinitionsOrderedChronoligically);

            List <AchievementBase> possibleAchievements = new List <AchievementBase>
            {
                new Apprentice(this, reputation),
                new Neophyte(this, reputation),
                new Master(this, reputation),
                new GrandMaster(this, reputation),
                new Legend(this, reputation),
                new JonSkeet(this, reputation),
                new TimeWarrior(this),
                new ChronMaster(this),
                new ChronGrandMaster(this),
                new CiNinja(this),
                new Assassin(this),
                new LikeLightning(this, currentBuildDefinitionOrderedChronoligically),
                new ReputationRebound(this, allActiveBuildDefinitionsOrderedChronoligically),
                new ArribaArribaAndaleAndale(this),
                new SpeedDaemon(this),
                new InTheZone(this),
                new Terminator(this),
                new AndGotAwayWithIt(this, currentBuildDefinitionOrderedChronoligically),
                new Critical(this),
                new Perfectionist(this),
                new Macgyver(this, currentBuildDefinitionOrderedChronoligically),
                new Napoleon(this, settings.People),
                new ShamePusher(this, settings)
            };

            return(possibleAchievements
                   .Where(i => i.HasJustAchieved())
                   .Select(i => i.AchievementEnum));
        }
示例#25
0
 public List <Build> AllBuildsOfStatusSinceDate(DateTime date, BuildStatus buildStatus)
 {
     return(ByBuildLocator(BuildLocator.WithDimensions(sinceDate: date, status: buildStatus)));
 }
 public static String GetIconForBuildStatus(BuildStatus status)
 {
     return($"{IconsPath}{IcoPrefix}/{GetIconFilename(status)}");
 }
示例#27
0
        public static string NiceProjectName(this Build b)
        {
            var config = BuildStatus.GetConfig(b.BuildTypeId);

            return(config != null ? config.ProjectName : "Unknown build config");
        }
示例#28
0
文件: AppModel.cs 项目: kain64/kato
        private DataTemplate GetOverlayIcon(BuildStatus newValue)
        {
            var icon = ((DataTemplate)Application.Current.Resources[newValue + "OverlayIcon"]);

            return(icon);
        }
示例#29
0
        /// <summary>
        /// Synchronously builds an Android App Bundle at the specified path using the specified Android Player.
        /// </summary>
        /// <returns>True if the build succeeded, false if it failed or was cancelled.</returns>
        public bool CreateBundle(string aabFilePath, string androidPlayerFilePath, AssetPackConfig assetPackConfig)
        {
            if (_buildStatus != BuildStatus.Running)
            {
                throw new Exception("Unexpected call to CreateBundle() with status: " + _buildStatus);
            }

            var moduleDirectoryList = new List <DirectoryInfo>();
            var workingDirectory    = new DirectoryInfo(_workingDirectoryPath);
            var configParams        = new BundletoolHelper.BuildBundleConfigParams
            {
                defaultTcfSuffix = TextureTargetingTools.GetBundleToolTextureCompressionFormatName(
                    assetPackConfig.DefaultTextureCompressionFormat),
                minSdkVersion = _minSdkVersion
            };

            // Create asset pack module directories.
            var assetPackCount = assetPackConfig.AssetPacks.Count;
            var index          = 0;

            foreach (var entry in assetPackConfig.AssetPacks)
            {
                DisplayProgress(
                    string.Format("Processing asset pack {0} of {1}", index + 1, assetPackCount),
                    Mathf.Lerp(0.1f, ProgressCreateBaseModule, (float)index / assetPackCount));
                index++;

                var assetPackName = entry.Key;
                var assetPack     = entry.Value;
                configParams.enableTcfTargeting           |= assetPack.CompressionFormatToAssetBundleFilePath != null;
                configParams.containsInstallTimeAssetPack |=
                    assetPack.DeliveryMode == AssetPackDeliveryMode.InstallTime;

                var assetPackDirectoryInfo = workingDirectory.CreateSubdirectory(assetPackName);
                if (!CreateAssetPackModule(assetPackName, assetPack, assetPackDirectoryInfo))
                {
                    return(false);
                }

                moduleDirectoryList.Add(assetPackDirectoryInfo);
            }

            // Create base module directory.
            var            baseDirectory = workingDirectory.CreateSubdirectory(AndroidAppBundle.BaseModuleName);
            IList <string> bundleMetadata;

            if (!CreateBaseModule(baseDirectory, androidPlayerFilePath, out bundleMetadata))
            {
                return(false);
            }

            moduleDirectoryList.Add(baseDirectory);

            // Create a ZIP file for each module directory.
            var moduleFiles = new List <string>();
            var numModules  = moduleDirectoryList.Count;

            for (var i = 0; i < numModules; i++)
            {
                if (numModules == 1)
                {
                    DisplayProgress("Processing base module", ProgressProcessModules);
                }
                else
                {
                    DisplayProgress(
                        string.Format("Processing module {0} of {1}", i + 1, numModules),
                        Mathf.Lerp(ProgressProcessModules, ProgressRunBundletool, (float)i / numModules));
                }

                var moduleDirectoryInfo      = moduleDirectoryList[i];
                var destinationDirectoryInfo = GetDestinationSubdirectory(moduleDirectoryInfo);

                // Create ZIP file path, for example /path/to/files/base becomes /path/to/files/base/base.zip
                var zipFilePath     = Path.Combine(moduleDirectoryInfo.FullName, moduleDirectoryInfo.Name + ".zip");
                var zipErrorMessage = _zipUtils.CreateZipFile(zipFilePath, destinationDirectoryInfo.FullName, ".");
                if (zipErrorMessage != null)
                {
                    DisplayBuildError("Zip creation", zipErrorMessage);
                    return(false);
                }

                moduleFiles.Add(zipFilePath);
            }

            // If the .aab file exists, EditorUtility.SaveFilePanel() has already prompted for whether to overwrite.
            // Therefore, prevent Bundletool from throwing an IllegalArgumentException that "File already exists."
            File.Delete(aabFilePath);

            DisplayProgress("Running bundletool", ProgressRunBundletool);
            var buildBundleErrorMessage =
                _bundletool.BuildBundle(aabFilePath, moduleFiles, bundleMetadata, configParams);

            if (buildBundleErrorMessage != null)
            {
                DisplayBuildError("bundletool", buildBundleErrorMessage);
                return(false);
            }

            DisplayProgress("Signing bundle", 0.9f);
            var signingErrorMessage = _apkSigner.SignZip(aabFilePath);

            if (signingErrorMessage != null)
            {
                DisplayBuildError("Signing", signingErrorMessage);
                return(false);
            }

            Debug.LogFormat("Finished building app bundle: {0}", aabFilePath);
            _finishedAabFilePath = aabFilePath;
            _buildStatus         = BuildStatus.Succeeding;
            return(true);
        }
示例#30
0
 public BuildState(BuildStatus status, int elapsedTime = 0, int estimatedTime = 0)
 {
     Status              = status;
     ElapsedTimeMs       = elapsedTime;
     EstimatedDurationMs = estimatedTime;
 }
 public ReadBuildStatusCompleteEventArgs(BuildStatus status, string buildConfigurationId, string name)
 {
     Status = status;
     BuildConfigurationId = buildConfigurationId;
     Name = name;
 }
 public ExecutionStage(BuildState buildState, BuildStatus buildStatus, IOutputPlugin outputPlugin)
 {
     BuildState = buildState;
     BuildStatus = buildStatus;
     OutputPlugin = outputPlugin;
 }
示例#33
0
        /// <summary>
        /// Audits the class table for multiple symbol definition.
        /// </summary>
        /// <param name="status">BuildStatus to log the warnings if
        /// multiple symbol found.</param>
        /// /// <param name="guid">Guid of node to which warning corresponds</param>
        public void AuditMultipleDefinition(BuildStatus status, AssociativeGraph.GraphNode graphNode)
        {
            var names = symbolTable.GetAllSymbolNames();
            if (names.Count == symbolTable.GetSymbolCount())
                return;

            foreach (var name in names)
            {
                var symbols = symbolTable.GetAllSymbols(name);
                if (symbols.Count > 1)
                {
                    string message = string.Format(Resources.kMultipleSymbolFound, name, "");
                    foreach (var symbol in symbols)
                    {
                        message += ", " + symbol.FullName;
                    }

                    status.LogWarning(BuildData.WarningID.MultipleSymbolFound, message, graphNode: graphNode);
                }
            }
        }
示例#34
0
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="BuildStatus" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => BuildStatus.CreateFrom(sourceValue);
示例#35
0
 public StatusChangedArgs(BuildStatus oldValue, BuildStatus newValue)
 {
     OldValue = oldValue;
     NewValue = newValue;
 }
示例#36
0
 internal BuildInfo(BuildStatus status, ReadOnlyMemory <byte> binaries)
 {
     Status   = status;
     Binaries = binaries;
 }
        public static bool EqualsToStatus(this string statusString, BuildStatus buildStatus)
        {
            BuildStatus status;

            return(Enum.TryParse(statusString, true, out status) && status == buildStatus);
        }
示例#38
0
 public void InvokeStatusChecked(BuildStatus args)
 {
     ((WatcherFake)CiEntryPointSetting.GetWatcher(Settings)).InvokeStatusChecked(new[] { args });
 }
 public static String GetCachedIconPathForBuildStatus(BuildStatus status)
 {
     return(Path.Combine(IconCacheFolder, GetIconFilename(status)));
 }
示例#40
0
        private static int PreBuildActions(string projectName, BuildStatus status = null, string checkoutRef = null)
        {
            if (projectName == null)
                throw new ArgumentException("ProjectName cannot be null.");
            if (!Projects.ContainsKey(projectName))
                throw new ArgumentException("Project not found: " + projectName);

            WriteVerbose("Start PreBuild: " + projectName);
            if (checkoutRef != null)
            {
                XDictionary<string, string> macros = new XDictionary<string, string>();
                macros["checkout"] = checkoutRef;
                return doActions(projectName, Projects[projectName].BuildCheckouts[checkoutRef].PreCmd, status, macros);
            }
            // else
            return doActions(projectName, Projects[projectName].PreBuild, status);
        }
示例#41
0
 public void FinalizeStatus(BuildStatus status)
 {
     throw new NotImplementedException();
 }
 public static bool EqualsToStatus(this string statusString, BuildStatus buildStatus)
 {
     BuildStatus status;
     return Enum.TryParse(statusString, true, out status) && status == buildStatus;
 }
示例#43
0
 public IEnumerable <AchievementLookup> CalculateNewAchievements(SirenOfShameSettings settings, BuildStatus build, List <BuildStatus> allActiveBuildDefinitionsOrderedChronoligically)
 {
     return(from achievementEnum in CalculateNewAchievementEnums(settings, build, allActiveBuildDefinitionsOrderedChronoligically)
            join achievement in AchievementSetting.AchievementLookups on achievementEnum equals achievement.Id
            select achievement);
 }
示例#44
0
文件: View.cs 项目: rgiot/phactory
        private void SetBuildStatus(BuildStatus status )
        {
            _buildStatus = status;

            if (status == BuildStatus.Running)
            {
                this.statusStrip1.BackColor = System.Drawing.Color.Chocolate;
                this.statusStrip1.ForeColor = System.Drawing.Color.White;
            }
            else if (status == BuildStatus.Success)
            {
                this.statusStrip1.BackColor = System.Drawing.Color.ForestGreen;
                this.statusStrip1.ForeColor = System.Drawing.Color.White;
            }
            else if ( status==BuildStatus.Failure )
            {
                this.statusStrip1.BackColor = System.Drawing.Color.Red;
                this.statusStrip1.ForeColor = System.Drawing.Color.White;
            }
            else
            {
                this.statusStrip1.BackColor = System.Drawing.SystemColors.ControlLightLight;
                this.statusStrip1.ForeColor = defaultForeColor;
            }
        }
 public IRetentionPolicy AddRetentionPolicy(BuildReason reason, BuildStatus status, int numberToKeep, DeleteOptions deleteOptions)
 {
     throw new NotImplementedException();
 }
示例#46
0
 private void UpdateMainWindowItem(string buildDefinitionUri, BuildStatus status, string requestedBy)
 {
     foreach (BuildDetail build in buildContent)
     {
         if (build.BuildDefinitionUri == buildDefinitionUri)
         {
             build.Status = status;
             if (!String.IsNullOrEmpty(requestedBy))
             {
                 build.RequestedFor = requestedBy;
             }
             break;
         }
     }
 }
示例#47
0
 public IBuildDetail CreateManualBuild(string buildNumber, string dropLocation, BuildStatus buildStatus,
                                       IBuildController controller, string requestedFor)
 {
     throw new NotImplementedException();
 }
示例#48
0
 public List<Build> AllBuildsOfStatusSinceDate(DateTime date, BuildStatus buildStatus)
 {
     return ByBuildLocator(BuildLocator.WithDimensions(sinceDate: date, status: buildStatus));
 }
 public BuildLocator Status(BuildStatus buildStatus)
 {
     _locators.Add(new ApiLocator("status", buildStatus.ToString().ToUpper()));
     return(this);
 }
 public IBuildDetail CreateManualBuild(string buildNumber, string dropLocation, BuildStatus buildStatus, IBuildController controller, string requestedFor)
 {
     throw new NotImplementedException();
 }
示例#51
0
 /// <summary>
 /// Update the status of a request
 /// </summary>
 /// <param name="projectName"></param>
 /// <param name="requestId"></param>
 /// <param name="newStatus"></param>
 /// <returns></returns>
 public async Task <string> UpdateBuildRequest(string projectName, int requestId, BuildStatus newStatus)
 {
     return(await PatchResponse(string.Format("requests/{0}", requestId), new { status = newStatus.ToString() }, projectName, MediaType.JSON_MEDIA_TYPE));
 }
示例#52
0
        public IEnumerable <AchievementLookup> CalculateNewAchievements(SirenOfShameSettings settings, BuildStatus build)
        {
            List <BuildStatus> allActiveBuildDefinitionsOrderedChronoligically = _sosDb
                                                                                 .ReadAll(settings.GetAllActiveBuildDefinitions())
                                                                                 .OrderBy(i => i.StartedTime)
                                                                                 .ToList();

            return(CalculateNewAchievements(settings, build, allActiveBuildDefinitionsOrderedChronoligically));
        }
示例#53
0
 public IRetentionPolicy AddRetentionPolicy(BuildReason reason, BuildStatus status, int numberToKeep,
                                            DeleteOptions deleteOptions)
 {
     throw new NotImplementedException();
 }
示例#54
0
 private void SetStatus(bool failed, bool building, bool successful)
 {
     if (failed)
     {
         Status = BuildStatus.Failed;
     }
     else if(building)
     {
         Status = BuildStatus.Building;
     }
     else if(successful)
     {
         Status = BuildStatus.Successful;
     }
     else
     {
         Status = BuildStatus.Unknown;
     }
 }
示例#55
0
        private void DoUpdateNotifier()
        {
            BuildStatusEnum?worstBuildStatus            = null;
            var             buildInProgress             = false;
            var             buildIsStuck                = false;
            var             errorProjects               = new HashedSet <Project>();
            var             regressingProjects          = new HashedSet <Project>();
            var             progressingAndErrorProjects = new HashedSet <Project>();
            var             interestingProjects         = new HashedSet <Project>();
            var             totalProjectCount           = 0;

            foreach (var server in ConfigurationService.Servers)
            {
                foreach (var project in server.Projects)
                {
                    totalProjectCount++;

                    var status = GetProjectStatus(project);
                    if (worstBuildStatus == null || status.Value > worstBuildStatus)
                    {
                        worstBuildStatus = status.Value;
                    }
                    if (status.Value >= BuildStatusEnum.Failed)
                    {
                        errorProjects.Add(project);
                    }
                    if (status.Value > BuildStatusEnum.Successful)
                    {
                        progressingAndErrorProjects.Add(project);
                    }
                    if (status.IsInProgress)
                    {
                        buildInProgress = true;
                        progressingAndErrorProjects.Add(project);
                    }
                    if (status.IsStuck)
                    {
                        buildIsStuck = true;
                    }
                    if (IsRegressing(project))
                    {
                        regressingProjects.Add(project);
                    }
                    lastProjectsBuildDetails[project] = project.AllBuildDetails;

                    if (project.Activity.HasBuildActivity)
                    {
                        interestingProjects.Add(project);
                    }
                }
            }

            if (worstBuildStatus == null)
            {
                worstBuildStatus = BuildStatusEnum.Unknown;
            }

#if false // tests
            lastBuildStatus++;
            if (lastBuildStatus > BuildStatus.Failed_BuildInProgress)
            {
                lastBuildStatus = 0;
            }
            worstBuildStatus = lastBuildStatus;
            Console.WriteLine("tray:" + lastBuildStatus);
#endif

            var buildStatus = new BuildStatus(worstBuildStatus.Value, buildInProgress, buildIsStuck);

            UpdateIcon(buildStatus);
            UpdateTrayTooltip(progressingAndErrorProjects, totalProjectCount);
            if (ConfigurationService.NotificationSettings.BalloonNotifications)
            {
                UpdateBalloonTip(errorProjects, regressingProjects);
                ShowBallowTip(interestingProjects);
            }

            lastBuildStatus = buildStatus;
        }