public void CheckArgs() { _task = new CompileSolutionTask("x.sln", "Release", _flubuEnviroment.Object); _task.WithArguments("aaa"); Assert.Single(_task.GetArguments()); }
public void IfToolsVersionIsNotSpecifiedUseHighestOne() { SetupMsBuildVersions(); SetupRunProgramTask(); _task = new CompileSolutionTask("x.sln", "Release", _flubuEnviroment.Object); _task.ExecuteVoid(Context.Object); }
public void ToolsVersionWasNotFoundButThereIsNewerOne() { SetupMsBuildVersions(include40: false); SetupRunProgramTask(); _task = new CompileSolutionTask("x.sln", "Release", _flubuEnviroment.Object); _task.SetToolsVersion(new Version("4.0")); _task.ExecuteVoid(Context.Object); }
public void ExactToolsVersionWasFound() { SetupMsBuildVersions(); SetupRunProgramTask(); _task = new CompileSolutionTask("x.sln", "Release", _flubuEnviroment.Object); _task.SetToolsVersion(new Version("4.0")); _task.ExecuteVoid(Context.Object); }
public void ToolsVersionWasNotFoundAndThereIsNoNewerOne() { SetupMsBuildVersions(include40: false, include120: false); _task = new CompileSolutionTask("x.sln", "Release", _flubuEnviroment.Object); _task.SetToolsVersion(new Version("4.0")); TaskExecutionException ex = Assert.Throws <TaskExecutionException>(() => _task.ExecuteVoid(Context.Object)); Assert.Equal("Requested MSBuild tools version 4.0 not found and there are no higher versions", ex.Message); }
public void CheckArgsWhenExecuting() { SetupMsBuildVersions(include40: false, include120: false); SetupRunProgramTask(); Tasks.Setup(x => x.RunProgramTask(It.IsAny <string>())).Returns(_runProgramTask.Object); _task = new CompileSolutionTask("x.sln", "Release", _flubuEnviroment.Object); _task.WithArguments("aaa"); _task.Execute(Context.Object); Assert.Equal(4, _task.GetArguments().Count); }
private static void TargetCompile40(ITaskContext context) { CompileSolutionTask task = new CompileSolutionTask( context.Properties.Get <VSSolution>(BuildProps.Solution).SolutionFileName.ToString(), "Release-4.0"); task.MaxCpuCount = context.Properties.Get("CompileMaxCpuCount", 3); task.Target = "Rebuild"; task.Execute(context); }
public static void TargetCompile(ITaskContext context) { VSSolution solution = context.Properties.Get <VSSolution>(BuildProps.Solution); string buildConfiguration = context.Properties.Get <string>(BuildProps.BuildConfiguration); bool useSolutionDirAsMsBuildWorkingDir = context.Properties.Get( BuildProps.UseSolutionDirAsMSBuildWorkingDir, false); CompileSolutionTask task = new CompileSolutionTask( solution.SolutionFileName.ToString(), buildConfiguration); task.UseSolutionDirAsWorkingDir = useSolutionDirAsMsBuildWorkingDir; task.MaxCpuCount = context.Properties.Get(BuildProps.CompileMaxCpuCount, 3); task.Execute(context); }