public BuildCallback(EnvDTE.Project project, EnvDTE.OutputWindowPane outputPane, EnvDTE80.SolutionConfiguration2 solutionConfiguration) { Project = project; OutputPane = outputPane; SolutionConfiguration = solutionConfiguration; }
/// <summary> /// Format configuration from the SolutionConfiguration2 /// </summary> public string SolutionCfgFormat(EnvDTE80.SolutionConfiguration2 cfg) { if (cfg == null) { return(String.Format("{0}|{0}", Environment.PROP_UNAV_STRING)); } return(formatCfg(cfg.Name, cfg.PlatformName)); }
internal SolutionConfiguration([NotNull] Solution solution, [NotNull] EnvDTE80.SolutionConfiguration2 solutionConfiguration) { Contract.Requires(solution != null); Contract.Requires(solutionConfiguration != null); Contract.Assume(solutionConfiguration.SolutionContexts != null); _solution = solution; _solutionConfiguration = solutionConfiguration; _name = _solutionConfiguration.Name; _platformName = _solutionConfiguration.PlatformName; Update(); }
internal SolutionConfiguration([NotNull] Solution solution, [NotNull] EnvDTE80.SolutionConfiguration2 solutionConfiguration) { Contract.Requires(solution != null); Contract.Requires(solutionConfiguration != null); Contract.Assume(solutionConfiguration.SolutionContexts != null); _solution = solution; _solutionConfiguration = solutionConfiguration; // ReSharper disable AssignNullToNotNullAttribute Name = _solutionConfiguration.Name; PlatformName = _solutionConfiguration.PlatformName; // ReSharper restore AssignNullToNotNullAttribute Update(); }
/// <summary> /// Start projects building /// </summary> /// <param name="projects"></param> private void RequestBuildProjects(EnvDTE80.SolutionConfiguration2 config, List <VCProject> projects) { OptionPageGrid page = (OptionPageGrid)package.GetDialogPage(typeof(OptionPageGrid)); GolemBuildService.Configuration options = new GolemBuildService.Configuration() { GolemHubUrl = page.OptionGolemHubUrl, GolemServerPort = page.OptionGolemServerPort }; var task = System.Threading.Tasks.Task.Run(async() => { Stopwatch sw = Stopwatch.StartNew(); if (!GolemBuildService.Instance.Options.Equals(options) || !GolemBuildService.Instance.IsRunning) { GolemBuildService.Instance.Stop(); GolemBuildService.Instance.Options = options; GolemBuildService.Instance.Start(); } GolemBuild.GolemBuild builder = new GolemBuild.GolemBuild(); int projectsSucceeded = 0; int projectsFailed = 0; bool first = true; foreach (VCProject p in projects) { if (first) { first = false; } else { builder.ClearTasks(); } bool succeeded = builder.BuildProject(p.ProjectFile, config.Name, config.PlatformName); if (succeeded) { projectsSucceeded++; } else { projectsFailed++; } } sw.Stop(); Logger.Log("Succeeded: " + projectsSucceeded.ToString() + " Failed: " + projectsFailed.ToString()); Logger.Log("Build took: " + sw.Elapsed.ToString()); string message = string.Format(CultureInfo.CurrentCulture, "Found {0} projects to build", projects.Count); foreach (VCProject p in projects) { message += "\nPROJECT:" + p.ProjectFile; message += builder.GetProjectInformation(p.ProjectFile); } string title = "BuildCommand"; await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken); VsShellUtilities.ShowMessageBox( ServiceProvider, message, title, OLEMSGICON.OLEMSGICON_INFO, OLEMSGBUTTON.OLEMSGBUTTON_OK, OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); }); }