public async Task <IActionResult> GenerateAndSaveSourceProject(string specificationId, SourceCodeType sourceCodeType) { Guard.IsNullOrWhiteSpace(specificationId, nameof(specificationId)); BuildProject buildProject = await GetBuildProjectForSpecificationId(specificationId); IEnumerable <Models.Calcs.Calculation> calculations = await _calculationsRepository.GetCalculationsBySpecificationId(specificationId); CompilerOptions compilerOptions = await _calculationsRepository.GetCompilerOptions(specificationId); if (compilerOptions == null) { throw new InvalidOperationException("Compiler options returned were null"); } if (sourceCodeType == SourceCodeType.Diagnostics) { compilerOptions.UseDiagnosticsMode = true; } IEnumerable <SourceFile> sourceFiles = _sourceCodeService.GenerateSourceFiles(buildProject, calculations, compilerOptions); await _sourceCodeService.SaveSourceFiles(sourceFiles, specificationId, sourceCodeType); return(new NoContentResult()); }
public void CalculateProviderResult_WhenCalculationsAreNull_ShouldReturnResultWithEmptyCalculations() { // Arrange IAllocationModel mockAllocationModel = Substitute.For <IAllocationModel>(); mockAllocationModel .Execute( Arg.Any <Dictionary <string, ProviderSourceDataset> >(), Arg.Any <ProviderSummary>(), Arg.Any <IEnumerable <CalculationAggregation> >()) .Returns(new CalculationResultContainer { FundingLineResults = new List <FundingLineResult>() }); CalculationEngine calculationEngine = CreateCalculationEngine(); ProviderSummary providerSummary = CreateDummyProviderSummary(); BuildProject buildProject = CreateBuildProject(); // Act ProviderResult result = calculationEngine.CalculateProviderResults( mockAllocationModel, buildProject.SpecificationId, null, providerSummary, new Dictionary <string, ProviderSourceDataset>()); // Assert result.CalculationResults.Should().BeNull(); result.Provider.Should().Be(providerSummary); result.SpecificationId.Should().BeEquivalentTo(buildProject.SpecificationId); result.Id.Should().BeEquivalentTo(GenerateId(providerSummary.Id, buildProject.SpecificationId)); }
void SetsProjectName() { const string NAME = "Trunk unit tests"; var buildProject = new BuildProject(NAME); Assert.Equal(NAME, buildProject.Name); }
public override void Done(BuildProject currentObject) { if (currentObject == null) { throw new ArgumentNullException("currentObject"); } List <string> filePathList = new List <string>(); //Make sure we have some checked files before continuing foreach (FileListItem cItem in FileList.Items) { if (cItem.Checked) { filePathList.Add(cItem.FilePath); } } if ((this.FilePath.Text.Trim().Length == 0) || (filePathList.Count == 0)) { ShowErrorBubble(new WizardErrorMessage(FilePath, "Project Files Required", "You must choose files for this project to continue")); return; } //Create the template for this project currentObject.CreateTemplate(filePathList.ToArray()); //Done base.Done(currentObject); }
public async Task SaveAssembly_GivenAssemblyAndSabeSuccessful_LogsSuccess() { //Arrange BuildProject buildProject = new BuildProject { SpecificationId = specificationId, Build = new Build { Assembly = new byte[100] } }; ISourceFileRepository sourceFileRepository = CreateSourceFileRepository(); ILogger logger = CreateLogger(); SourceCodeService sourceFileService = CreateSourceCodeService(sourceFileRepository, logger); //Act await sourceFileService.SaveAssembly(buildProject); //Assert logger .Received(1) .Information($"Saved assembly for specification id: '{buildProject.SpecificationId}'"); }
public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, System.DateTime buildTime, ref BuildOptions options, string configKey, string buildPath) { StringBuilder defines = new StringBuilder(BuildProject.GenerateDefaultDefines(releaseType, platform, architecture, distribution)); if (!string.IsNullOrEmpty(removeDefines)) { string resolvedRemove = BuildProject.ResolvePath(removeDefines, releaseType, platform, architecture, distribution, buildTime); string[] splitRemove = resolvedRemove.Split(';'); for (int i = 0; i < splitRemove.Length; i++) { defines.Replace(splitRemove[i] + ";", ""); defines.Replace(splitRemove[i], ""); } } if (!string.IsNullOrEmpty(addDefines)) { string resolvedAdd = BuildProject.ResolvePath(addDefines, releaseType, platform, architecture, distribution, buildTime); if (defines.Length > 0) { defines.Append(";" + resolvedAdd); } else { defines.Append(resolvedAdd); } } PlayerSettings.SetScriptingDefineSymbolsForGroup(platform.targetGroup, defines.ToString()); }
public void Setup() { var data = new StringBuilder(); data.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); data.AppendLine("<project name=\"IglooCoder Commons\" default=\"basic\">"); data.AppendLine(" <property name=\"nant.settings.currentframework\" value=\"net-3.5\" />"); data.AppendLine(" <property name=\"variable1\" value=\"hahaha\" />"); data.AppendLine(" <echo value=\"something that is not a property or target\"/>"); data.AppendLine(" <target name=\"test.run\">"); data.AppendLine(" <exec basedir=\"${dir.base}\" workingdir=\"${dir.base}\" program=\"${tools.nunit.console}\" commandline=\"${dir.compile}\\${name.commons.tests} /xml:${dir.results.unittests}\\${output.results.unittests.name}\"/>"); data.AppendLine(" </target>"); data.AppendLine(" <target name=\"compile\">"); data.AppendLine(" <exec basedir=\"${dir.base}\" workingdir=\"${dir.base}\" program=\"${tools.nunit.console}\" commandline=\"${dir.compile}\\${name.commons.tests} /xml:${dir.results.unittests}\\${output.results.unittests.name}\"/>"); data.AppendLine(" </target>"); data.AppendLine("</project>"); XDocument doc = XDocument.Parse(data.ToString()); _subject = new NantBuildFileParser(); _buildProject = _subject.ParseDocument(doc); }
public bool UpdateProjectBuildStatus(int id) { BuildProject build = db.BuildProjects.Where(x => x.BuildId == id).Include(x => x.Project).FirstOrDefault(); if (build != null) { if (build.BuildId % 2 == 0 || build.Status.Equals("failure")) { build.Status = "success"; build.DownloadURL = build.DownloadURL + "\\" + build.Project.ProjectName + "_" + build.Mejor_Version + "." + build.Minor_Version + "." + build.Build_Version + ".zip"; string ReadmeText = "Hello!\n\nThis is a " + build.Project.ProjectName + " README..."; using (ZipFile zip = new ZipFile()) { zip.AddEntry("Redme.txt", ReadmeText); zip.Save(build.DownloadURL); } } else { build.Status = "failure"; } db.Entry(build).State = EntityState.Modified; bool status = false; if (db.SaveChanges() > 0) { status = true; } return(status); } return(true); }
public void Parse(XElement data, BuildProject buildProject) { OutputTo = data.Attribute("output").Value; foreach (XElement element in data.Element("attributes").Elements()) { switch (element.Attribute("type").Value) { case "ComVisibleAttribute": ComVisible = Convert.ToBoolean(element.Attribute("value").Value); break; case "CLSCompliantAttribute": ClsCompliant = Convert.ToBoolean(element.Attribute("value").Value); break; case "AssemblyVersionAttribute": Version = element.Attribute("value").Value; break; case "AssemblyTitleAttribute": Title = element.Attribute("value").Value; break; case "AssemblyDescriptionAttribute": Description = element.Attribute("value").Value; break; case "AssemblyCopyrightAttribute": Copyright = element.Attribute("value").Value; break; } } }
public bool InsertServerBuild(int BuildId, int ServerId, int UserId) { bool status = false; ServerBuild serverBuild = new ServerBuild(); try { BuildProject build = db.BuildProjects.Where(x => x.BuildId == BuildId).FirstOrDefault(); serverBuild.BuildId = BuildId; serverBuild.Build_Version = build.Build_Version; serverBuild.Mejor_Version = build.Mejor_Version; serverBuild.Minor_Version = build.Minor_Version; serverBuild.PublishedBy = UserId; serverBuild.ServerId = ServerId; serverBuild.PublishDate = DateTime.Now; serverBuild.Status = "queued"; db.ServerBuilds.Add(serverBuild); if (db.SaveChanges() > 0) { status = true; } } catch (Exception e) { Console.WriteLine(e.Message); return(false); } return(status); }
public void ReactivateCascadeRuns() { BuildProject project = Instance.Create.BuildProject("My Project", "Project"); IList <AssetID> ids = new List <AssetID>(); ids.Add(project.ID); ids.Add(project.CreateBuildRun("Run 1", new DateTime(2008, 1, 1)).ID); ids.Add(project.CreateBuildRun("Run 2", new DateTime(2008, 1, 2)).ID); ids.Add(project.CreateBuildRun("Run 3", new DateTime(2008, 1, 3)).ID); project.Close(); foreach (AssetID id in ids) { Assert.IsTrue(Instance.Get.BaseAssetByID(id).IsClosed); } project.Reactivate(); foreach (AssetID id in ids) { Assert.IsTrue(Instance.Get.BaseAssetByID(id).IsActive); } }
public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, System.DateTime buildTime, ref BuildOptions options, string configKey, string buildPath) { string resolvedScriptPath = BuildProject.ResolvePath(scriptPath, releaseType, platform, architecture, distribution, buildTime); string resolvedScriptArgs = BuildProject.ResolvePath(scriptArguments, releaseType, platform, architecture, distribution, buildTime); RunScript(resolvedScriptPath, resolvedScriptArgs); }
public void SaveAssembly_GivenBuildProjectDoesntNotContainAssembly_ThrowsArgumentException() { //Arrange BuildProject buildProject = new BuildProject { SpecificationId = specificationId, Build = new Build() }; ISourceFileRepository sourceFileRepository = CreateSourceFileRepository(); ILogger logger = CreateLogger(); SourceCodeService sourceFileService = CreateSourceCodeService(sourceFileRepository, logger); //Act Func <Task> test = async() => await sourceFileService.SaveAssembly(buildProject); //Assert test .Should() .ThrowExactly <ArgumentException>() .Which .Message .Should() .Be($"Assembly not present on build project for specification id: '{buildProject.SpecificationId}'"); }
public void Create() { BuildProject project = Instance.Create.BuildProject("My Project", "Project"); Assert.AreEqual("My Project", project.Name); Assert.AreEqual("Project", project.Reference); }
public async Task RunTests_GivenNoTestScenarios_LogsAndreturnsEmptyResults() { //Arrange IEnumerable <ProviderResult> providerResults = new[] { new ProviderResult() }; IEnumerable <TestScenario> scenarios = new TestScenario[0]; IEnumerable <ProviderSourceDataset> providerSourceDatasets = new ProviderSourceDataset[0]; IEnumerable <TestScenarioResult> testScenarioResults = new TestScenarioResult[0]; SpecificationSummary specificationSummary = new SpecificationSummary(); BuildProject buildProject = new BuildProject(); ILogger logger = CreateLogger(); TestEngine testEngine = CreateTestEngine(logger: logger); //Act IEnumerable <TestScenarioResult> results = await testEngine.RunTests(scenarios, providerResults, providerSourceDatasets, testScenarioResults, specificationSummary, buildProject); results .Count() .Should() .Be(0); logger .Received(1) .Warning(Arg.Is("No test scenarios were supplied to execute tests")); }
public async Task RunTests_GivenNoTestResults_LogsAndreturnsEmptyResults() { //Arrange IEnumerable <ProviderResult> providerResults = new[] { new ProviderResult { Provider = new ProviderSummary { Id = ProviderId }, SpecificationId = SpecificationId } }; IEnumerable <TestScenario> scenarios = new[] { new TestScenario() }; IEnumerable <ProviderSourceDataset> providerSourceDatasets = new ProviderSourceDataset[0]; IEnumerable <TestScenarioResult> testScenarioResults = new TestScenarioResult[0]; SpecificationSummary specificationSummary = new SpecificationSummary(); BuildProject buildProject = new BuildProject(); ILogger logger = CreateLogger(); TestEngine testEngine = CreateTestEngine(logger: logger); //Act IEnumerable <TestScenarioResult> results = await testEngine.RunTests(scenarios, providerResults, providerSourceDatasets, testScenarioResults, specificationSummary, buildProject); results .Count() .Should() .Be(0); logger .Received(1) .Warning(Arg.Is($"No test results generated for provider: {ProviderId} on specification: {SpecificationId}")); }
/// <summary> /// Provide UI to add a JAR reference. /// </summary> private void AddJarReference() { // Get the current project var project = (IVsHierarchy)GetCurrentProject(); using (var dialog = new AddJarReferenceDialog()) { if (dialog.ShowDialog() == DialogResult.OK) { var jarPath = dialog.JarPath; var libName = dialog.LibraryName; var importCode = dialog.ImportCode; var item = BuildProject.AddItem("JarReference", jarPath).Single(); if (!string.IsNullOrEmpty(libName)) { item.SetMetadataValue("LibraryName", libName); } if (importCode) { item.SetMetadataValue("ImportCode", "yes"); } // Save project BuildProject.Save(); // Unload the project - also saves the modifications ErrorHandler.ThrowOnFailure(solution.CloseSolutionElement((uint)__VSSLNCLOSEOPTIONS.SLNCLOSEOPT_UnloadProject, project, 0)); // Reload project dte.ExecuteCommand("Project.ReloadProject", ""); } } }
public async Task BuildCodeContextForSpecificationCompilesCalculationsForSuppliedSpecificationIdAndGetsTheirTypeInformation() { string specificationId = NewRandomString(); BuildProject expectedBuildProject = NewBuildProject(); Calculation[] calculations = new[] { NewCalculation(), NewCalculation() }; TypeInformation[] expectedTypeInformation = new[] { NewTypeInformation(), NewTypeInformation() }; Build expectedBuild = NewBuild(); GivenTheBuildProject(specificationId, expectedBuildProject); AndTheCalculations(specificationId, calculations); AndTheBuild(expectedBuildProject, calculations, expectedBuild); AndTheCodeContext(expectedBuildProject, expectedBuild, expectedTypeInformation); IEnumerable <TypeInformation> actualCodeContext = await WhenTheCodeContextIsBuilt(specificationId); actualCodeContext .Should() .BeEquivalentTo <TypeInformation>(expectedTypeInformation); }
private void AndTheCodeContext(BuildProject buildProject, Build expectedBuild, TypeInformation[] codeContext) => _compiler.Setup(_ => _.GetTypeInformation(It.Is <BuildProject>(bp => ReferenceEquals(bp, buildProject) && ReferenceEquals(bp.Build, expectedBuild)))) .ReturnsAsync(codeContext);
public bool BuildProject(BuildProject project) { bool status = false; BuildProject buildProject = new BuildProject(); try { BuildProject build = db.BuildProjects.Where(x => x.ProjectId == project.ProjectId && x.BranchId == project.BranchId).OrderByDescending(x => x.BuildDate).FirstOrDefault(); Branch branch = db.Branches.Where(x => x.BranchId == project.BranchId).FirstOrDefault(); buildProject.BuildBy = project.BuildBy; buildProject.BuildDate = DateTime.Now; buildProject.ProjectId = project.ProjectId; buildProject.Build_Version = build == null ? branch.Build_Version + 1 : build.Build_Version + 1; buildProject.Mejor_Version = build == null ? branch.Mejor_Version : build.Mejor_Version; buildProject.Minor_Version = build == null ? branch.Minor_Version : build.Minor_Version; buildProject.DownloadURL = project.DownloadURL; buildProject.Status = project.Status; buildProject.BranchId = project.BranchId; db.BuildProjects.Add(buildProject); if (db.SaveChanges() > 0) { status = true; } } catch (Exception e) { Console.WriteLine(e.Message); return(false); } return(status); }
public void SaveAssembly_GivenAssemblyButFailsToSave_ThrowsException() { //Arrange BuildProject buildProject = new BuildProject { SpecificationId = specificationId, Build = new Build { Assembly = new byte[100] } }; ISourceFileRepository sourceFileRepository = CreateSourceFileRepository(); sourceFileRepository.When(x => x.SaveAssembly(Arg.Is(buildProject.Build.Assembly), Arg.Is(buildProject.SpecificationId))) .Do(x => { throw new Exception(); }); ILogger logger = CreateLogger(); SourceCodeService sourceFileService = CreateSourceCodeService(sourceFileRepository, logger); //Act Func <Task> test = async() => await sourceFileService.SaveAssembly(buildProject); //Assert test .Should() .ThrowExactly <Exception>(); logger .Received(1) .Error(Arg.Any <Exception>(), Arg.Is($"Failed to save assembly for specification id '{buildProject.SpecificationId}'")); }
public void Setup() { _project = new BuildProject(); _dirBaseProperty = new Property("dirBase", "c:\\temp"); _project.AddProperty(_dirBaseProperty); _subject = new OutputGenerator(_project); }
public async Task <IActionResult> CompileAndSaveAssembly(string specificationId) { Guard.IsNullOrWhiteSpace(specificationId, nameof(specificationId)); BuildProject buildProject = await GetBuildProjectForSpecificationId(specificationId); IEnumerable <Models.Calcs.Calculation> calculations = await _calculationsRepository.GetCalculationsBySpecificationId(specificationId); CompilerOptions compilerOptions = await _calculationsRepository.GetCompilerOptions(specificationId); (compilerOptions ?? (compilerOptions = new CompilerOptions())).ConfigureForReleaseBuild(); buildProject.Build = _sourceCodeService.Compile(buildProject, calculations ?? Enumerable.Empty <Models.Calcs.Calculation>(), compilerOptions); if (buildProject.Build.Success) { if (!_featureToggle.IsDynamicBuildProjectEnabled()) { await _buildProjectsRepositoryPolicy.ExecuteAsync(() => _buildProjectsRepository.UpdateBuildProject(buildProject)); } await _sourceCodeService.SaveAssembly(buildProject); return(new NoContentResult()); } ModelStateDictionary keyValuePairs = new ModelStateDictionary(); for (int i = 0; i < buildProject.Build.CompilerMessages.Count(); i++) { keyValuePairs.AddModelError(i.ToString(), buildProject.Build.CompilerMessages[i].Message); } return(new BadRequestObjectResult(keyValuePairs)); }
public void GetBuildRuns() { BuildProject project = Instance.Create.BuildProject("My Project", "Project"); BuildRun run1 = project.CreateBuildRun("Run 1", new DateTime(2008, 1, 1)); BuildRun run2 = project.CreateBuildRun("Run 2", new DateTime(2008, 1, 2)); BuildRun run3 = project.CreateBuildRun("Run 3", new DateTime(2008, 1, 3)); run1.Reference = "A"; run2.Reference = "A"; run3.Reference = "B"; run1.Status.CurrentValue = "Passed"; run2.Status.CurrentValue = "Passed"; run3.Status.CurrentValue = "Failed"; run1.Save(); run2.Save(); run3.Save(); BuildRunFilter filter = new BuildRunFilter(); filter.References.Add("A"); filter.Status.Add("Passed"); ICollection <BuildRun> runs = project.GetBuildRuns(filter); CollectionAssert.AreEquivalent(new string[] { "Run 1", "Run 2" }, DeriveListOfNamesFromAssets(runs)); }
public void GetAssembly_GivenNullStreamReturned_ThrowsException() { //Arrange BuildProject buildProject = new BuildProject { SpecificationId = specificationId, }; ISourceFileRepository sourceFileRepository = CreateSourceFileRepository(); sourceFileRepository .DoesAssemblyExist(Arg.Is(specificationId)) .Returns(true); sourceFileRepository .GetAssembly(Arg.Is(specificationId)) .Returns((Stream)null); ILogger logger = CreateLogger(); SourceCodeService sourceCodeService = CreateSourceCodeService(sourceFileRepository, logger); //Act Func <Task> test = async() => await sourceCodeService.GetAssembly(buildProject); //Assert test .Should() .ThrowExactly <Exception>() .Which .Message .Should() .Be($"Failed to get assembly for specification id: '{specificationId}'"); }
public void SortedDependencies() { var mockXmlLoader = new Mock <IXmlLoader>(); mockXmlLoader.Setup(x => x.LoadFromFile("test")).Returns( @"<project name=""DummyProject"" default=""all"">" + @"<property name=""dependencies"" value=""Project1Output.txt,Project2Output.txt,Project3Output.txt,DependenciesOutput.txt,InstallsOutput.txt""/>" + @"<property name=""finalOutputArtifact"" value=""DummyProjectOutput.txt""/>" + @"</project>"); BuildProject testProject = new BuildProject("TestProject", mockXmlLoader.Object); testProject.Load("test"); List <ProjectTitle> dependenciesInCorrectOrder = new List <ProjectTitle>() { new ProjectTitle("Dependencies"), new ProjectTitle("Installs"), new ProjectTitle("Project1"), new ProjectTitle("Project2"), new ProjectTitle("Project3") }; CollectionAssert.AreEquivalent(testProject.Dependencies, dependenciesInCorrectOrder); }
/// <summary> /// Create a file node based on absolute file name. /// </summary> public override FileNode CreateFileNode(string absFileName) { // Avoid adding files to the project multiple times. Ultimately // we should not use project items and instead should have virtual items. string path = absFileName; if (absFileName.Length > ProjectDir.Length && String.Compare(ProjectDir, 0, absFileName, 0, ProjectDir.Length, StringComparison.OrdinalIgnoreCase) == 0) { path = absFileName.Substring(ProjectDir.Length); if (path.StartsWith("\\")) { path = path.Substring(1); } } var prjItem = GetExistingItem(absFileName); if (prjItem == null) { if (IsCodeFile(absFileName)) { prjItem = BuildProject.AddItem("Compile", path)[0]; } else { prjItem = BuildProject.AddItem("Content", path)[0]; } } ProjectElement prjElem = new ProjectElement(this, prjItem, false); return(CreateFileNode(prjElem)); }
async public Task <IEnumerable <ProviderResult> > GenerateAllocations(BuildProject buildProject, IEnumerable <ProviderSummary> providers, Func <string, string, Task <IEnumerable <ProviderSourceDataset> > > getProviderSourceDatasets) { var assembly = Assembly.Load(buildProject.Build.Assembly); var allocationModel = _allocationFactory.CreateAllocationModel(assembly); ConcurrentBag <ProviderResult> providerResults = new ConcurrentBag <ProviderResult>(); IEnumerable <CalculationSummaryModel> calculations = await _calculationsRepository.GetCalculationSummariesForSpecification(buildProject.SpecificationId); Parallel.ForEach(providers, new ParallelOptions { MaxDegreeOfParallelism = 5 }, provider => { var stopwatch = new Stopwatch(); stopwatch.Start(); IEnumerable <ProviderSourceDataset> providerSourceDatasets = getProviderSourceDatasets(provider.Id, buildProject.SpecificationId).Result; if (providerSourceDatasets == null) { providerSourceDatasets = Enumerable.Empty <ProviderSourceDataset>(); } var result = CalculateProviderResults(allocationModel, buildProject, calculations, provider, providerSourceDatasets.ToList()); providerResults.Add(result); stopwatch.Stop(); _logger.Debug($"Generated result for {provider.Name} in {stopwatch.ElapsedMilliseconds}ms"); }); return(providerResults); }
public Target Parse(XElement element, BuildProject buildProject) { var target = new Target(); target.Name = GetNameOfTarget(element.Attribute("name").Value); target.Body = element.ToString(); if (element.Attribute("depends") != null) { foreach (var name in Regex.Split(element.Attribute("depends").Value, "[ ,]")) { if (name.Trim().Length > 0 && name != ",") { target.DependsOn.Add(_targetRepository.Resolve(name)); } } } foreach (var childNode in element.Elements()) { var parser = _resolver.Resolve(childNode.Name.ToString()); parser.Parse(childNode, buildProject); target.Tasks.Add(parser); } _targetRepository.Register(target); return(target); }
public async Task <IActionResult> UpdateBuildProjectRelationships(string specificationId, DatasetRelationshipSummary relationship) { if (string.IsNullOrWhiteSpace(specificationId)) { _logger.Error("No specification Id was provided to UpdateBuildProjectRelationships"); return(new BadRequestObjectResult("Null or empty specification Id provided")); } if (relationship == null) { _logger.Error("A null relationship message was provided to UpdateBuildProjectRelationships"); return(new BadRequestObjectResult("Null relationship provided")); } BuildProject buildProject = await GetBuildProjectForSpecificationId(specificationId); IEnumerable <Models.Calcs.Calculation> calculations = await _calculationsRepository.GetCalculationsBySpecificationId(specificationId); buildProject.Build = _sourceCodeService.Compile(buildProject, calculations ?? Enumerable.Empty <Models.Calcs.Calculation>()); if (!_featureToggle.IsDynamicBuildProjectEnabled()) { await _buildProjectsRepositoryPolicy.ExecuteAsync(() => _buildProjectsRepository.UpdateBuildProject(buildProject)); } await _sourceCodeService.SaveAssembly(buildProject); return(new OkObjectResult(buildProject)); }
internal string CreateRssUrl(BuildProject buildProject) { if (buildProject == null) return string.Empty; if (string.IsNullOrEmpty(buildProject.Url)) return string.Empty; string relativeRssUrl = buildProject.Url.Replace("ViewProjectReport.aspx", "RssFeed.aspx"); string serviceUrl = ServiceDetails.DataAddress.Replace("/ViewFarmReport.aspx", string.Empty); return string.Concat(serviceUrl, relativeRssUrl); }