async System.Threading.Tasks.Task CallMenuItemBallbackAsync() { try { await MenuItemCallbackAsync(); } catch (Exception exception) { _errorListService.WriteError(exception.ToString()); } }
public async Task IntegrateAsync(VCProject vcProject) { var projectDirectory = vcProject.ProjectDirectory; var conanfileDirectory = await ConanPathHelper.GetNearestConanfilePathAsync(projectDirectory); if (conanfileDirectory == null) { _errorListService.WriteError("unable to locate conanfile directory!"); return; } if (_settingsService.GetConanInstallOnlyActiveConfiguration()) { IntegrateIntoConfiguration(vcProject.ActiveConfiguration); } else { foreach (VCConfiguration configuration in vcProject.Configurations) { IntegrateIntoConfiguration(configuration); } } }
protected internal override async Task MenuItemCallbackAsync() { _errorListService.Clear(); var vcProject = _vcProjectService.GetActiveProject(); if (vcProject == null) { _errorListService.WriteError("A C++ project with a conan file must be selected."); return; } await _conanService.InstallAsync(vcProject); await _conanService.IntegrateAsync(vcProject); }
public string getProfile(ConanConfiguration configuration, Core.IErrorListService errorListService) { if (!File.Exists(ConfigFile)) { return(null); } try { JObject jObject = JObject.Parse(File.ReadAllText(ConfigFile)); var configs = jObject["configurations"].ToObject <Dictionary <string, string> >(); configs.TryGetValue(configuration.VSName, out string conanProfile); if (conanProfile == null) { errorListService.WriteWarning($"File for Conan configuration found at '{ConfigFile}'," + $" but no profile declared for VS configuration '{configuration.VSName}'"); } return(conanProfile); } catch (Exception) { errorListService.WriteError($"Error parsing Conan configuration from file '{ConfigFile}'"); return(null); } }