public static VSWhereSettings RemoveRequires(this VSWhereSettings toolSettings, IEnumerable <string> requires) { toolSettings = toolSettings.NewInstance(); var hashSet = new HashSet <string>(requires); toolSettings.RequiresInternal.RemoveAll(x => hashSet.Contains(x)); return(toolSettings); }
public static VSWhereSettings RemoveProducts(this VSWhereSettings toolSettings, params string[] products) { toolSettings = toolSettings.NewInstance(); var hashSet = new HashSet <string>(products); toolSettings.ProductsInternal.RemoveAll(x => hashSet.Contains(x)); return(toolSettings); }
private static List <VSWhereResult> GetResult(IProcess process, VSWhereSettings toolSettings) { if (!(toolSettings.UTF8 ?? false) || toolSettings.Format != VSWhereFormat.json || toolSettings.Property != null) { return(null); } var output = process.Output.EnsureOnlyStd().Select(x => x.Text).JoinNewLine(); return(SerializationTasks.JsonDeserialize <VSWhereResult[]>(output).ToList()); }
public static VSWhereSettings AddRequires(this VSWhereSettings toolSettings, IEnumerable <string> requires) { toolSettings = toolSettings.NewInstance(); toolSettings.RequiresInternal.AddRange(requires); return(toolSettings); }
public static VSWhereSettings AddRequires(this VSWhereSettings toolSettings, params string[] requires) { toolSettings = toolSettings.NewInstance(); toolSettings.RequiresInternal.AddRange(requires); return(toolSettings); }
public static VSWhereSettings SetAll(this VSWhereSettings toolSettings, bool?all) { toolSettings = toolSettings.NewInstance(); toolSettings.All = all; return(toolSettings); }
public static VSWhereSettings SetProperty(this VSWhereSettings toolSettings, string property) { toolSettings = toolSettings.NewInstance(); toolSettings.Property = property; return(toolSettings); }
public static VSWhereSettings DisableAll(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.All = false; return(toolSettings); }
public static VSWhereSettings SetVersion(this VSWhereSettings toolSettings, string version) { toolSettings = toolSettings.NewInstance(); toolSettings.Version = version; return(toolSettings); }
public static VSWhereSettings SetProducts(this VSWhereSettings toolSettings, IEnumerable <string> products) { toolSettings = toolSettings.NewInstance(); toolSettings.ProductsInternal = products.ToList(); return(toolSettings); }
public static VSWhereSettings SetRequiresAny(this VSWhereSettings toolSettings, bool?requiresAny) { toolSettings = toolSettings.NewInstance(); toolSettings.RequiresAny = requiresAny; return(toolSettings); }
public static VSWhereSettings TogglePrerelease(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.Prerelease = !toolSettings.Prerelease; return(toolSettings); }
public static VSWhereSettings SetProducts(this VSWhereSettings toolSettings, params string[] products) { toolSettings = toolSettings.NewInstance(); toolSettings.ProductsInternal = products.ToList(); return(toolSettings); }
public static VSWhereSettings ResetPrerelease(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.Prerelease = null; return(toolSettings); }
public static VSWhereSettings SetPrerelease(this VSWhereSettings toolSettings, bool?prerelease) { toolSettings = toolSettings.NewInstance(); toolSettings.Prerelease = prerelease; return(toolSettings); }
public static VSWhereSettings ToggleAll(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.All = !toolSettings.All; return(toolSettings); }
public static VSWhereSettings ClearRequires(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.RequiresInternal.Clear(); return(toolSettings); }
public static VSWhereSettings DisableRequiresAny(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.RequiresAny = false; return(toolSettings); }
public static VSWhereSettings AddProducts(this VSWhereSettings toolSettings, params string[] products) { toolSettings = toolSettings.NewInstance(); toolSettings.ProductsInternal.AddRange(products); return(toolSettings); }
public static VSWhereSettings ResetAll(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.All = null; return(toolSettings); }
public static VSWhereSettings ResetRequiresAny(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.RequiresAny = null; return(toolSettings); }
public static VSWhereSettings AddProducts(this VSWhereSettings toolSettings, IEnumerable <string> products) { toolSettings = toolSettings.NewInstance(); toolSettings.ProductsInternal.AddRange(products); return(toolSettings); }
public static VSWhereSettings ToggleRequiresAny(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.RequiresAny = !toolSettings.RequiresAny; return(toolSettings); }
public static VSWhereSettings ClearProducts(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.ProductsInternal.Clear(); return(toolSettings); }
public static VSWhereSettings ResetVersion(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.Version = null; return(toolSettings); }
public static VSWhereSettings SetRequires(this VSWhereSettings toolSettings, params string[] requires) { toolSettings = toolSettings.NewInstance(); toolSettings.RequiresInternal = requires.ToList(); return(toolSettings); }
public static VSWhereSettings ResetProperty(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.Property = null; return(toolSettings); }
public static VSWhereSettings SetRequires(this VSWhereSettings toolSettings, IEnumerable <string> requires) { toolSettings = toolSettings.NewInstance(); toolSettings.RequiresInternal = requires.ToList(); return(toolSettings); }
/// <summary> /// <p>VSWhere is designed to be a redistributable, single-file executable that can be used in build or deployment scripts to find where Visual Studio - or other products in the Visual Studio family - is located.</p> /// <p>For more details, visit the <a href="https://github.com/Microsoft/vswhere">official website</a>.</p> /// </summary> /// <remarks> /// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p> /// <ul> /// <li><c>-all</c> via <see cref="VSWhereSettings.All"/></li> /// <li><c>-format</c> via <see cref="VSWhereSettings.Format"/></li> /// <li><c>-latest</c> via <see cref="VSWhereSettings.Latest"/></li> /// <li><c>-legacy</c> via <see cref="VSWhereSettings.Legacy"/></li> /// <li><c>-nologo</c> via <see cref="VSWhereSettings.NoLogo"/></li> /// <li><c>-prerelease</c> via <see cref="VSWhereSettings.Prerelease"/></li> /// <li><c>-products</c> via <see cref="VSWhereSettings.Products"/></li> /// <li><c>-property</c> via <see cref="VSWhereSettings.Property"/></li> /// <li><c>-requires</c> via <see cref="VSWhereSettings.Requires"/></li> /// <li><c>-requiresAny</c> via <see cref="VSWhereSettings.RequiresAny"/></li> /// <li><c>-utf8</c> via <see cref="VSWhereSettings.UTF8"/></li> /// <li><c>-version</c> via <see cref="VSWhereSettings.Version"/></li> /// </ul> /// </remarks> public static (List <VSWhereResult> Result, IReadOnlyCollection <Output> Output) VSWhere(VSWhereSettings toolSettings = null) { toolSettings = toolSettings ?? new VSWhereSettings(); using var process = ProcessTasks.StartProcess(toolSettings); process.AssertZeroExitCode(); return(GetResult(process, toolSettings), process.Output); }
public static VSWhereSettings ToggleLegacy(this VSWhereSettings toolSettings) { toolSettings = toolSettings.NewInstance(); toolSettings.Legacy = !toolSettings.Legacy; return(toolSettings); }