public void GetReferencedAssemblies() { IBuildManager buildManager = new DefaultBuildManager(); ICollection assemblies = buildManager.GetReferencedAssemblies(); Assert.NotEmpty(assemblies); }
/// <summary> /// /// </summary> public void Run() { // ReSharper disable once SuggestBaseTypeForParameter Toolset GetToolset(ProjectCollection pc, out string installDirectoryName) { // Aligning the Toolset with the Build Request is kind of a separate step. OnToolsetRequired(out var e); var ts = pc.Toolsets.SingleOrDefault(e.Predicate); Assert.NotNull(ts); installDirectoryName = e.GetInstallDirectoryName(ts); return(ts); } using (var pc = new ProjectCollection()) { var ts = GetToolset(pc, out var installDir); OnConfigureEnvironmentVariables(ts, installDir); OnConfigureBuild(out var e); var parameters = new BuildParameters(pc) { Loggers = e.Loggers.ToArray() }; var requestData = new BuildRequestData(e.ProjectOrSolutionFullPath, e.GlobalProperties , ts.ToolsVersion, e.TargetsToBuild.ToArray(), null); try { var actualResult = DefaultBuildManager.Build(parameters, requestData); OnAfterBuild(actualResult); } catch (InvalidOperationException ioex) { if (!TryOnBuildExceptionOccurred(ioex)) { throw; } } catch (Exception ex) { if (!TryOnBuildExceptionOccurred(ex)) { throw; } } } }
public void CreateCachedFile(string path) { IBuildManager buildManager = new DefaultBuildManager(); Assert.Same(Stream.Null, buildManager.CreateCachedFile(path)); }
public void ReadCachedFile(string path) { IBuildManager buildManager = new DefaultBuildManager(); Assert.Null(buildManager.ReadCachedFile(path)); }
public void GetCompiledType(string path) { IBuildManager buildManager = new DefaultBuildManager(); Assert.Null(buildManager.GetCompiledType(path)); }
public void FileExists(string path) { IBuildManager buildManager = new DefaultBuildManager(); Assert.False(buildManager.FileExists(path)); }