public override async Task <string> OnGetEvaluatedPropertyValueAsync(string propertyName, string evaluatedPropertyValue, IProjectProperties defaultProperties) { ActiveConfiguredObjects <ConfiguredProject>?configuredProjects = await _projectProvider.GetActiveConfiguredProjectsAsync(); if (configuredProjects == null) { return(""); } var builder = PooledArray <string> .GetInstance(capacity : configuredProjects.Objects.Length); foreach (ConfiguredProject configuredProject in configuredProjects.Objects) { ProjectProperties projectProperties = configuredProject.Services.ExportProvider.GetExportedValue <ProjectProperties>(); ConfigurationGeneral configuration = await projectProperties.GetConfigurationGeneralPropertiesAsync(); string?currentPlatformMoniker = (string?)await configuration.TargetPlatformIdentifier.GetValueAsync(); string?currentPlatformVersion = (string?)await configuration.TargetPlatformVersion.GetValueAsync(); Assumes.NotNull(currentPlatformMoniker); builder.Add($"{ currentPlatformMoniker }, Version={ currentPlatformVersion }"); } return(string.Join(";", builder.ToArrayAndFree())); }
public override async Task <string> OnGetEvaluatedPropertyValueAsync(string evaluatedPropertyValue, IProjectProperties defaultProperties) { ActiveConfiguredObjects <ConfiguredProject> configuredProjects = await _projectProvider.GetActiveConfiguredProjectsAsync(); ImmutableArray <string> .Builder builder = ImmutableArray.CreateBuilder <string>(); foreach (ConfiguredProject configuredProject in configuredProjects.Objects) { ProjectProperties projectProperties = configuredProject.Services.ExportProvider.GetExportedValue <ProjectProperties>(); ConfigurationGeneral configuration = await projectProperties.GetConfigurationGeneralPropertiesAsync(); string currentTargetFrameworkMoniker = (string)await configuration.TargetFrameworkMoniker.GetValueAsync(); builder.Add(currentTargetFrameworkMoniker); } return(string.Join(";", builder.ToArray())); }
public override async Task <string> OnGetEvaluatedPropertyValueAsync(string evaluatedPropertyValue, IProjectProperties defaultProperties) { ActiveConfiguredObjects <ConfiguredProject>?configuredProjects = await _projectProvider.GetActiveConfiguredProjectsAsync(); if (configuredProjects == null) { return(""); } var builder = PooledArray <string> .GetInstance(); foreach (ConfiguredProject configuredProject in configuredProjects.Objects) { ProjectProperties projectProperties = configuredProject.Services.ExportProvider.GetExportedValue <ProjectProperties>(); ConfigurationGeneral configuration = await projectProperties.GetConfigurationGeneralPropertiesAsync(); string currentTargetFrameworkMoniker = (string)await configuration.TargetFrameworkMoniker.GetValueAsync(); builder.Add(currentTargetFrameworkMoniker); } return(string.Join(";", builder.ToArrayAndFree())); }
public IActiveConfiguredProjectsProviderFactory ImplementGetProjectFrameworksAsync(ActiveConfiguredObjects <ProjectConfiguration> projectConfigurations) { _mock.Setup(x => x.GetActiveProjectConfigurationsAsync()) .Returns(Task.FromResult(projectConfigurations)); return(this); }
public IActiveConfiguredProjectsProviderFactory ImplementGetActiveConfiguredProjectsAsync(ActiveConfiguredObjects <ConfiguredProject> configuredProjects) { _mock.Setup(x => x.GetActiveConfiguredProjectsAsync()) .Returns(Task.FromResult(configuredProjects)); return(this); }