Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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());
        }
Exemplo n.º 4
0
 public static VSWhereSettings AddRequires(this VSWhereSettings toolSettings, IEnumerable <string> requires)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.RequiresInternal.AddRange(requires);
     return(toolSettings);
 }
Exemplo n.º 5
0
 public static VSWhereSettings AddRequires(this VSWhereSettings toolSettings, params string[] requires)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.RequiresInternal.AddRange(requires);
     return(toolSettings);
 }
Exemplo n.º 6
0
 public static VSWhereSettings SetAll(this VSWhereSettings toolSettings, bool?all)
 {
     toolSettings     = toolSettings.NewInstance();
     toolSettings.All = all;
     return(toolSettings);
 }
Exemplo n.º 7
0
 public static VSWhereSettings SetProperty(this VSWhereSettings toolSettings, string property)
 {
     toolSettings          = toolSettings.NewInstance();
     toolSettings.Property = property;
     return(toolSettings);
 }
Exemplo n.º 8
0
 public static VSWhereSettings DisableAll(this VSWhereSettings toolSettings)
 {
     toolSettings     = toolSettings.NewInstance();
     toolSettings.All = false;
     return(toolSettings);
 }
Exemplo n.º 9
0
 public static VSWhereSettings SetVersion(this VSWhereSettings toolSettings, string version)
 {
     toolSettings         = toolSettings.NewInstance();
     toolSettings.Version = version;
     return(toolSettings);
 }
Exemplo n.º 10
0
 public static VSWhereSettings SetProducts(this VSWhereSettings toolSettings, IEnumerable <string> products)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.ProductsInternal = products.ToList();
     return(toolSettings);
 }
Exemplo n.º 11
0
 public static VSWhereSettings SetRequiresAny(this VSWhereSettings toolSettings, bool?requiresAny)
 {
     toolSettings             = toolSettings.NewInstance();
     toolSettings.RequiresAny = requiresAny;
     return(toolSettings);
 }
Exemplo n.º 12
0
 public static VSWhereSettings TogglePrerelease(this VSWhereSettings toolSettings)
 {
     toolSettings            = toolSettings.NewInstance();
     toolSettings.Prerelease = !toolSettings.Prerelease;
     return(toolSettings);
 }
Exemplo n.º 13
0
 public static VSWhereSettings SetProducts(this VSWhereSettings toolSettings, params string[] products)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.ProductsInternal = products.ToList();
     return(toolSettings);
 }
Exemplo n.º 14
0
 public static VSWhereSettings ResetPrerelease(this VSWhereSettings toolSettings)
 {
     toolSettings            = toolSettings.NewInstance();
     toolSettings.Prerelease = null;
     return(toolSettings);
 }
Exemplo n.º 15
0
 public static VSWhereSettings SetPrerelease(this VSWhereSettings toolSettings, bool?prerelease)
 {
     toolSettings            = toolSettings.NewInstance();
     toolSettings.Prerelease = prerelease;
     return(toolSettings);
 }
Exemplo n.º 16
0
 public static VSWhereSettings ToggleAll(this VSWhereSettings toolSettings)
 {
     toolSettings     = toolSettings.NewInstance();
     toolSettings.All = !toolSettings.All;
     return(toolSettings);
 }
Exemplo n.º 17
0
 public static VSWhereSettings ClearRequires(this VSWhereSettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.RequiresInternal.Clear();
     return(toolSettings);
 }
Exemplo n.º 18
0
 public static VSWhereSettings DisableRequiresAny(this VSWhereSettings toolSettings)
 {
     toolSettings             = toolSettings.NewInstance();
     toolSettings.RequiresAny = false;
     return(toolSettings);
 }
Exemplo n.º 19
0
 public static VSWhereSettings AddProducts(this VSWhereSettings toolSettings, params string[] products)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.ProductsInternal.AddRange(products);
     return(toolSettings);
 }
Exemplo n.º 20
0
 public static VSWhereSettings ResetAll(this VSWhereSettings toolSettings)
 {
     toolSettings     = toolSettings.NewInstance();
     toolSettings.All = null;
     return(toolSettings);
 }
Exemplo n.º 21
0
 public static VSWhereSettings ResetRequiresAny(this VSWhereSettings toolSettings)
 {
     toolSettings             = toolSettings.NewInstance();
     toolSettings.RequiresAny = null;
     return(toolSettings);
 }
Exemplo n.º 22
0
 public static VSWhereSettings AddProducts(this VSWhereSettings toolSettings, IEnumerable <string> products)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.ProductsInternal.AddRange(products);
     return(toolSettings);
 }
Exemplo n.º 23
0
 public static VSWhereSettings ToggleRequiresAny(this VSWhereSettings toolSettings)
 {
     toolSettings             = toolSettings.NewInstance();
     toolSettings.RequiresAny = !toolSettings.RequiresAny;
     return(toolSettings);
 }
Exemplo n.º 24
0
 public static VSWhereSettings ClearProducts(this VSWhereSettings toolSettings)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.ProductsInternal.Clear();
     return(toolSettings);
 }
Exemplo n.º 25
0
 public static VSWhereSettings ResetVersion(this VSWhereSettings toolSettings)
 {
     toolSettings         = toolSettings.NewInstance();
     toolSettings.Version = null;
     return(toolSettings);
 }
Exemplo n.º 26
0
 public static VSWhereSettings SetRequires(this VSWhereSettings toolSettings, params string[] requires)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.RequiresInternal = requires.ToList();
     return(toolSettings);
 }
Exemplo n.º 27
0
 public static VSWhereSettings ResetProperty(this VSWhereSettings toolSettings)
 {
     toolSettings          = toolSettings.NewInstance();
     toolSettings.Property = null;
     return(toolSettings);
 }
Exemplo n.º 28
0
 public static VSWhereSettings SetRequires(this VSWhereSettings toolSettings, IEnumerable <string> requires)
 {
     toolSettings = toolSettings.NewInstance();
     toolSettings.RequiresInternal = requires.ToList();
     return(toolSettings);
 }
Exemplo n.º 29
0
 /// <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);
 }
Exemplo n.º 30
0
 public static VSWhereSettings ToggleLegacy(this VSWhereSettings toolSettings)
 {
     toolSettings        = toolSettings.NewInstance();
     toolSettings.Legacy = !toolSettings.Legacy;
     return(toolSettings);
 }