private void BuildAndRun(bool runExecutable) { var citrusDirectory = CalcCitrusDirectory(); Environment.CurrentDirectory = Path.Combine(citrusDirectory, "Orange"); ClearObjFolder(citrusDirectory); OnBuildStatusChange?.Invoke("Building"); if (AreRequirementsMet() && Build(SolutionPath ?? DefaultSolutionPath)) { ClearObjFolder(citrusDirectory); if (runExecutable) { RunExecutable(); } OnBuildSuccess?.Invoke(); } else { if (!areFailedDetailsSet) { SetFailedBuildStatus("Send this text to our developers."); } OnBuildFail?.Invoke(); } }
private void SetFailedBuildStatus(string details = null) { if (string.IsNullOrEmpty(details)) { details = "Send this text to our developers."; } OnBuildStatusChange?.Invoke($"Build failed. {details}"); OnBuildFail?.Invoke(); }
private void BuildAndRun() { Environment.CurrentDirectory = Path.GetDirectoryName(SolutionPath); ClearObjFolder(citrusDirectory); OnBuildStatusChange?.Invoke("Building"); if (AreRequirementsMet() && Build(SolutionPath)) { ClearObjFolder(citrusDirectory); if (NeedRunExecutable) { RunExecutable(); } OnBuildSuccess?.Invoke(); } }
private void ProccessNotifications(object state) { StopTimer(); var buildUpdates = _buildConfigurationService.GetLastBuildPerDefinition(); if (_lastSeenBuilds != null) { // When polling after the first time we are interested in new builds or where the InProgress value has changed var changedBuilds = buildUpdates.Where(b => !_lastSeenBuilds.ContainsKey(b.Url) || _lastSeenBuilds[b.Url].InProgress != b.InProgress); foreach (var changedBuild in changedBuilds) { OnBuildStatusChange?.Invoke(changedBuild); } } _lastSeenBuilds = buildUpdates.ToDictionary(b => b.Url); OnBuildPollComplete?.Invoke(buildUpdates.Any(b => b.GetBuildResult() == BuildResult.Failed)); StartTimer(PollInterval); }
private void ProccessNotifications(object state) { StopTimer(); var buildUpdates = _buildConfigurationService.GetLastBuildPerDefinition(); foreach (var build in buildUpdates) { if ((build.InProgress && build.StartTime > _lastNotificationCheckTime) || (!build.InProgress && build.LastFinished > _lastNotificationCheckTime)) { OnBuildStatusChange?.Invoke(build); } } OnBuildPollComplete?.Invoke(buildUpdates.Any(b => b.Result.ToBuildResult() == BuildResult.Failed)); _lastNotificationCheckTime = DateTime.Now; StartTimer(PollInterval); }
protected void SetFailedBuildStatus(string details) { OnBuildStatusChange?.Invoke($"Build failed. {details}"); areFailedDetailsSet = true; }