/// <summary> /// Public Constructor. /// </summary> /// <param name="workspaceProperties">Subscribers may furnish their own set of Workspace /// Properties for use throughout the build cycle.</param> /// <param name="configuration">A caller provided Configuration. /// The default is <see cref="CompilationManager.Release"/>.</param> public MSBuildCompilationManager(IWorkspacePropertiesDictionary workspaceProperties , string configuration = Debug) : base(configuration) { // ReSharper disable once RedundantEmptyObjectOrCollectionInitializer _workspaceProperties = workspaceProperties ?? new WorkspacePropertiesDictionary { }; LazyWorkspace = new Lazy <MSBuildWorkspace>(() => MSBuildWorkspace.Create(WorkspaceProperties)); //// TODO: TBD: perhaps add test projects and member assets as embedded resources that we extrapolate and evaluate ... //// TODO: TBD: which can open solution, open projects, etc... //new MSBuildWorkspace() //new MSBuildWorkspace().OpenSolutionAsync("") // TODO: TBD: then what to do about "sources", never mind "solution", "projects", etc... }
/// <summary> /// Override in order to add different <see cref="WorkspaceProperties"/> as needed. /// Adds the <see cref="CompilationManager.Configuration"/> property in the specified /// value by default. /// </summary> /// <param name="workspaceProperties"></param> /// <returns></returns> protected virtual IWorkspacePropertiesDictionary PrepareWorkspaceProperties(IWorkspacePropertiesDictionary workspaceProperties) { workspaceProperties[nameof(Configuration)] = Configuration; return(workspaceProperties); }