public IEnumerable <MetricsResult> Run(MetricsCommandArguments args) { var buildArgs = new ProjectBuildArguments(args.ProjectName, args.ProjectFile, args.RepositorySourceType, args.BuildOutputFolder); projectBuilder.Build(buildArgs); return(MetricsResult.Empty()); }
public void BuildSolution() { var args = new ProjectBuildArguments("d", "d", RepositorySourceType.CSharp, "cd"); var result = new ProjectBuildResult(); codebaseService.Setup(x => x.BuildSolution(args)).Returns(result); provider.BuildSolution(args); }
private ProjectBuildResult CreateProjectBuildResult(ProjectBuildArguments buildArgs) { return(new ProjectBuildResult { BuildFolder = buildArgs.BuildOutputFolder, Artifacts = fileSystem.FindAllBinaries(buildArgs.BuildOutputFolder) }); }
public void SetUp() { userPreferences = CreateMock <IUserPreferences>(); runPowerShell = CreateMock <IRunPowerShell>(); fileSystem = CreateMock <IFileSystem>(); args = new ProjectBuildArguments("foo", @"c:\project.sln", RepositorySourceType.CSharp, @"c:\buildfolder"); builder = new DotNetProjectBuilder(userPreferences.Object, runPowerShell.Object, fileSystem.Object); }
private void RunBuild(object sender, EventArgs e) { var args = new ProjectBuildArguments(ProjectDetails.ProjectName, ProjectDetails.ProjectFile, RepositorySourceType.CSharp, workSpaceProvider.GetProjectBuildFolder(ProjectDetails.ProjectName)); var buildResult = workSpaceProvider.BuildSolution(args); view.ShowBuildArtifacts(Consolidate(ProjectDetails.FilesToIgnore, buildResult.Artifacts)); }
public void BuildSolution() { var buildArgs = new ProjectBuildArguments(ProjectName, "blah.sln", RepositorySourceType.CSharp, @"C:\project\build\myProject"); var builder = CreateMock <IProjectBuilder>(); projectBuilderFactory.Setup(x => x.BuilderFor(buildArgs.SourceType)).Returns(builder.Object); builder.Setup(x => x.Build(buildArgs)).Returns(new ProjectBuildResult()); var result = codebaseService.BuildSolution(buildArgs); result.Should().NotBeNull(); buildArgs.BuildOutputFolder.Should().Be(Path.Combine(@"C:\project\build", buildArgs.ProjectName)); }
public ProjectBuildResult Build(ProjectBuildArguments buildArgs) { try { Logger.Info($"Cleaning build folder: {buildArgs.BuildOutputFolder}"); fileSystem.CleanFolder(buildArgs.BuildOutputFolder); var buildCommand = GetBuildCommand(buildArgs); Logger.Info($"MSBuild - building with this command: {buildCommand}"); powershell.Invoke(buildCommand); return(CreateProjectBuildResult(buildArgs)); } catch (Exception e) { Logger.Error(e, "Error occurred trying to exeucte an external process"); throw new ApplicationException("Error occurred trying to exeucte an external process", e); } }
public void RunBuild() { var expectedArgs = new ProjectBuildArguments(viewModel.ProjectName, viewModel.ProjectFile, viewModel.RepositorySourceType, @"c:\buildfolder"); var buildResult = new ProjectBuildResult { BuildFolder = @"C:\folder", Artifacts = new[] { new FileDto { Name = "me.exe" }, new FileDto { Name = "ignore.me" } } }; wsProvider.Setup(x => x.GetProjectBuildFolder(expectedArgs.ProjectName)).Returns(@"c:\buildfolder"); wsProvider.Setup(x => x.BuildSolution(expectedArgs)).Returns(buildResult); view.RaiseBuildRequestEvent(); view.ShowBuildArtifactsCalled.Should().BeTrue(); view.ActualArtifacts.Count().Should().Be(2); }
public ProjectBuildResult BuildSolution(ProjectBuildArguments buildArgs) { return(builderFactory.BuilderFor(buildArgs.SourceType).Build(buildArgs)); }
public ProjectBuildResult BuildSolution(ProjectBuildArguments args) { return(codebaseService.BuildSolution(args)); }
private string GetBuildCommand(ProjectBuildArguments buildArgs) { return(MsBuildCommand.FormatWith(userPreferences.MsBuildPath, buildArgs.ProjectFile, buildArgs.BuildOutputFolder)); }