Esempio n. 1
0
        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("list");

            commandLineBuilder.AppendFileNameIfNotNull(SearchTerms);

            commandLineBuilder.AppendSwitchIfAny("-Source ", Source);

            commandLineBuilder.AppendSwitchIfTrue("-AllVersions", AllVersions);

            commandLineBuilder.AppendSwitchIfTrue("-Prerelease", Prerelease);

            commandLineBuilder.AppendSwitchIfTrue("-IncludeDelisted", IncludeDelisted);
        }
Esempio n. 2
0
        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("restore");

            commandLineBuilder.AppendFileNameIfNotNull(File);

            commandLineBuilder.AppendSwitchIfTrue("-RequireConsent", RequireConsent);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-PackagesDirectory ", PackagesDirectory);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-SolutionDirectory ", SolutionDirectory);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-MSBuildVersion ", MsBuildVersion);

            if (IsNuGetVersion4OrGreater())
            {
                commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-MSBuildPath ", MSBuildPath);
            }

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-Project2ProjectTimeOut ", Project2ProjectTimeOut);

            commandLineBuilder.AppendTextUnquoted(AdditionalArguments);

            base.GenerateCommandLineCommands(commandLineBuilder);
        }
Esempio n. 3
0
        /// <summary>
        /// Generates the SvnAdmin arguments.
        /// </summary>
        /// <returns></returns>
        protected virtual void AppendArguments(CommandLineBuilder commandLine)
        {
            commandLine.AppendSwitchIfTrue("--quiet", Quiet);

            // raw arguments
            commandLine.AppendSwitchIfNotNull("", Arguments);
        }
Esempio n. 4
0
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder.AppendSwitchIfNotNull("-o ", OutputFile);
            CommandLineBuilder.AppendSwitchIfTrue("-fv", AddFileVersion);
            CommandLineBuilder.AppendArrayIfNotNull("-ext ", Extensions.ToArray());
            CommandLineBuilder.AppendSwitchIfNotNull("-sice:", SuppressIces);
            CommandLineBuilder.AppendFileNamesIfNotNull(SourceFiles.ToArray(), " ");

            return(CommandLineBuilder.ToString());
        }
Esempio n. 5
0
        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("config");

            commandLineBuilder.AppendFileNameIfNotNull(Key);

            commandLineBuilder.AppendSwitchIfAny("-Set ", Set);

            commandLineBuilder.AppendSwitchIfTrue("-AsPath", AsPath);
        }
Esempio n. 6
0
        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("add");

            commandLineBuilder.AppendFileNameIfNotNull(Package);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-Source ", Source);

            commandLineBuilder.AppendSwitchIfTrue("-Expand", Expand);
        }
Esempio n. 7
0
        /// <summary>
        /// Generates the command line commands for the tool.
        /// </summary>
        /// <returns>The command line commands for the tool.</returns>
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder builder = new CommandLineBuilder();

            builder.AppendSwitch(this.Provider);
            builder.AppendSwitchIfTrue(this.Recursive, "-recursive");
            builder.AppendFileNameIfNotNull(this.Path);

            return(builder.ToString());
        }
Esempio n. 8
0
        /// <summary>
        /// Generates the svn arguments.
        /// </summary>
        /// <returns></returns>
        protected virtual void AppendArguments(CommandLineBuilder commandLine)
        {
            commandLine.AppendSwitchIfNotNull("--username ", Username);
            commandLine.AppendSwitchIfNotNull("--password ", Password);
            commandLine.AppendSwitchIfNotNull("--message ", Message);

            commandLine.AppendSwitchIfTrue("--force", Force);
            commandLine.AppendSwitchIfTrue("--verbose", Verbose);

            commandLine.AppendSwitchIfTrue("--xml", Xml);
            commandLine.AppendSwitchIfTrue("--non-interactive", NonInteractive);
            commandLine.AppendSwitchIfTrue("--no-auth-cache", NoAuthCache);

            // raw arguments
            if (!string.IsNullOrEmpty(Arguments))
            {
                commandLine.AppendSwitch(Arguments);
            }
        }
Esempio n. 9
0
        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("push");

            commandLineBuilder.AppendFileNameIfNotNull(Package);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-Source ", Source);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-ApiKey ", ApiKey);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-Timeout ", PushTimeout);

            commandLineBuilder.AppendSwitchIfTrue("-DisableBuffering", DisableBuffering);
        }
Esempio n. 10
0
        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("delete");

            commandLineBuilder.AppendFileNameIfNotNull(PackageId);

            commandLineBuilder.AppendFileNameIfNotNull(PackageVersion);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-Source", Source);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-ApiKey ", ApiKey);

            commandLineBuilder.AppendSwitchIfTrue("-NoPrompt", NoPrompt);
        }
Esempio n. 11
0
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder commandLineBuilder = new CommandLineBuilder();

            GenerateCommandLineCommands(commandLineBuilder);

            commandLineBuilder.AppendSwitchIfNotNull("-ConfigFile ", ConfigFile);

            if (_commandVerbosity != CommandVerbosity.None)
            {
                commandLineBuilder.AppendSwitchIfNotNull("-Verbosity ", _commandVerbosity.ToString());
            }

            commandLineBuilder.AppendSwitchIfTrue("-NonInteractive", NonInteractive);

            return(commandLineBuilder.ToString());
        }
Esempio n. 12
0
        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("pack");

            commandLineBuilder.AppendFileNameIfNotNull(File);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-OutputDirectory ", OutputDirectory);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-BasePath ", BasePath);

            commandLineBuilder.AppendSwitchIfTrue("-Verbose", Verbose);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-Version ", Version);

            commandLineBuilder.AppendSwitchIfAny("-Exclude ", Exclude);

            commandLineBuilder.AppendSwitchIfTrue("-Symbols", Symbols);

            commandLineBuilder.AppendSwitchIfTrue("-Tool", Tool);

            commandLineBuilder.AppendSwitchIfTrue("-Build", Build);

            commandLineBuilder.AppendSwitchIfTrue("-NoDefaultExcludes", NoDefaultExcludes);

            commandLineBuilder.AppendSwitchIfTrue("-NoPackageAnalysis", NoPackageAnalysis);

            commandLineBuilder.AppendSwitchIfTrue("-ExcludeEmptyDirectories", ExcludeEmptyDirectories);

            commandLineBuilder.AppendSwitchIfTrue("-IncludeReferencedProjects", IncludeReferencedProjects);

            commandLineBuilder.AppendSwitchIfAny("-Properties ", Properties);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-MinClientVersion ", MinClientVersion);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-MSBuildVersion ", MsBuildVersion);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-Suffix ", Suffix);
        }
Esempio n. 13
0
        protected override string GenerateCommandLineCommands()
        {
            // build command line to execute MetaDataProcessor
            CommandLineBuilder commandLinedBuilder = new CommandLineBuilder();

            // going through all possible options for MetaDataProcessor now...

            // -loadHints
            AppendLoadHints(commandLinedBuilder);

            // -load
            commandLinedBuilder.AppendSwitchForEachFile("-load", Load);

            // -loadDatabase
            commandLinedBuilder.AppendSwitchForEachFile("-loadDatabase", LoadDatabase);

            // -loadStrings
            commandLinedBuilder.AppendSwitchForFile("-loadStrings", LoadStrings);

            // -excludeClassByName
            commandLinedBuilder.AppendSwitchForEachFile("-excludeClassByName", ExcludeClassByName);

            // -parse
            commandLinedBuilder.AppendSwitchForFile("-parse", Parse);

            // -minimize
            commandLinedBuilder.AppendSwitchIfTrue("-minimize", Minimize);

            // -resolve
            commandLinedBuilder.AppendSwitchIfTrue("-resolve", Resolve);

            // -dump_exports
            commandLinedBuilder.AppendSwitchForFile("-dump_exports", DumpExports);

            // -dump_all
            commandLinedBuilder.AppendSwitchForFile("-dump_all", DumpAll);

            // -importResource
            commandLinedBuilder.AppendSwitchForEachFile("-importResource", ImportResources);

            // -compile
            commandLinedBuilder.AppendSwitchForFile("-compile", Compile);

            // -savestrings
            commandLinedBuilder.AppendSwitchForFile("-savestrings", SaveStrings);

            // -verbose
            commandLinedBuilder.AppendSwitchIfTrue("-verbose", Verbose);

            // -verboseMinimize
            commandLinedBuilder.AppendSwitchIfTrue("-verboseMinimize", VerboseMinimize);

            // -noByteCode
            commandLinedBuilder.AppendSwitchIfTrue("-noByteCode", NoByteCode);

            // -noAttributes
            commandLinedBuilder.AppendSwitchIfTrue("-noAttributes", NoAttributes);

            // -ignoreAssembly
            commandLinedBuilder.AppendSwitchForEachFile("-ignoreAssembly", IgnoreAssembly);

            // -generateStringsTable
            commandLinedBuilder.AppendSwitchForFile("-generateStringsTable", GenerateStringsTable);

            // -generate_dependency
            commandLinedBuilder.AppendSwitchForFile("-generate_dependency", GenerateDependency);

            // -create_database
            AppendCreateDatabase(commandLinedBuilder);

            // -generate_skeleton
            commandLinedBuilder.AppendSwitchToFileAndExtraSwitches("-generate_skeleton", GenerateSkeletonFile, GenerateSkeletonName, GenerateSkeletonProject, SkeletonWithoutInterop ? "TRUE" : "FALSE");

            // -refresh_assembly
            AppendRefreshAssemblyCommand(commandLinedBuilder);

            // output command line for debug?
            if (OutputCommandLine)
            {
                Log.LogWarning($"NFMDP cmd>> {GenerateFullPathToTool()} {commandLinedBuilder.ToString()} <<");
            }

            return(commandLinedBuilder.ToString());
        }
Esempio n. 14
0
        /// <summary>
        /// Generates the SvnAdmin arguments.
        /// </summary>
        /// <returns></returns>
        protected virtual void AppendArguments(CommandLineBuilder commandLine)
        {
            commandLine.AppendSwitchIfTrue("--quiet", Quiet);

            // raw arguments
            commandLine.AppendSwitchIfNotNull("", Arguments);
        }
Esempio n. 15
0
        /// <summary>
        /// Generates the svn arguments.
        /// </summary>
        /// <returns></returns>
        protected virtual void AppendArguments(CommandLineBuilder commandLine)
        {
            commandLine.AppendSwitchIfNotNull("--username ", Username);
            commandLine.AppendSwitchIfNotNull("--password ", Password);
            commandLine.AppendSwitchIfNotNull("--message ", Message);

            commandLine.AppendSwitchIfTrue("--force", Force);
            commandLine.AppendSwitchIfTrue("--verbose", Verbose);

            commandLine.AppendSwitchIfTrue("--xml", Xml);
            commandLine.AppendSwitchIfTrue("--non-interactive", NonInteractive);
            commandLine.AppendSwitchIfTrue("--no-auth-cache", NoAuthCache);

            // raw arguments
            if (!string.IsNullOrEmpty(Arguments))
                commandLine.AppendSwitch(Arguments);
        }
        /// <summary>
        /// Gets the MSBuild command-line based on the current properties of this object.
        /// </summary>
        /// <param name="useShortSwitchNames"><code>true</code> to use short command-line argument switches like '/nr' instead of '/NodeReuse', otherwise <code>false</code>.</param>
        /// <returns></returns>
        public string ToString(bool useShortSwitchNames)
        {
            CommandLineBuilder commandLineBuilder = new CommandLineBuilder();

            commandLineBuilder.AppendSwitchIfNotNull($"/{(useShortSwitchNames ? "t" : "Target")}:", Targets);

            commandLineBuilder.AppendSwitchIfNotNull($"/{(useShortSwitchNames ? "p" : "Property")}:", Properties);

            commandLineBuilder.AppendSwitchIfNotNull($"/{(useShortSwitchNames ? "m" : "MaxCpuCount")}:", MaxCpuCount, minValue: 1);

            commandLineBuilder.AppendSwitchIfNotNull($"/{(useShortSwitchNames ? "tv" : "ToolsVersion")}:", ToolsVersion);

            commandLineBuilder.AppendSwitchIfNotNull($"/{(useShortSwitchNames ? "v" : "Verbosity")}:", Verbosity);

            commandLineBuilder.AppendSwitchIfNotNullOrEmpty($"/{(useShortSwitchNames ? "val" : "Validate")}:", Validate);

            commandLineBuilder.AppendSwitchIfNotNull($"/{(useShortSwitchNames ? "ignore" : "IgnoreProjectExtensions")}:", IgnoreProjectExtensions);

            if (ConsoleLoggerParameters != null)
            {
                commandLineBuilder.AppendSwitchIfNotNull($"/{(useShortSwitchNames ? "clp" : "ConsoleLoggerParameters")}:", ConsoleLoggerParameters.ToString(useShortSwitchNames));
            }

            commandLineBuilder.AppendSwitchIfTrue($"/{(useShortSwitchNames ? "dfl" : "DistributedFileLogger")}", DistributedFileLogger);

            foreach (MSBuildLoggerParameters logger in Loggers)
            {
                commandLineBuilder.AppendSwitch($"\"/{(useShortSwitchNames ? "l" : "Logger")}:{logger}\"");
            }

            commandLineBuilder.AppendSwitchIfNotNull($"/{(useShortSwitchNames ? "nr" : "NodeReuse")}:", NodeReuse);

            commandLineBuilder.AppendSwitchIfTrue($"/{(useShortSwitchNames ? "noconlog" : "NoConsoleLogger")}", NoConsoleLogger);

            for (int i = 0; i < FileLoggers.Count; i++)
            {
                string index = FileLoggers.Count > 1 ? i.ToString() : String.Empty;

                commandLineBuilder.AppendSwitch($"/{(useShortSwitchNames ? "fl" : "FileLogger")}{index}");

                commandLineBuilder.AppendSwitchIfNotNull($"/{(useShortSwitchNames ? "flp" : "FileLoggerParameters")}{index}:", FileLoggers[i].ToString(useShortSwitchNames));
            }

            foreach (MSBuildDistributedLoggerParameters distributedLogger in DistributedLoggers)
            {
                commandLineBuilder.AppendSwitch($"\"/{(useShortSwitchNames ? "dl" : "DistributedLogger")}:{distributedLogger}\"");
            }

            if (BinaryLogger != null)
            {
                commandLineBuilder.AppendSwitch($"/{(useShortSwitchNames ? "bl" : "BinaryLogger")}{BinaryLogger}");
            }

            commandLineBuilder.AppendSwitchIfNotNullOrEmpty($"/{(useShortSwitchNames ? "pp" : "PreProcess")}:", PreProcess);

            commandLineBuilder.AppendSwitchIfTrue($"/{(useShortSwitchNames ? "ds" : "DetailedSummary")}", DetailedSummary);

            commandLineBuilder.AppendSwitchIfTrue($"/{(useShortSwitchNames ? "noautorsp" : "NoAutoResponse")}", NoAutoResponse);

            commandLineBuilder.AppendSwitchIfTrue("/NoLogo", NoLogo);

            commandLineBuilder.AppendSwitchIfTrue($"/{(useShortSwitchNames ? "ver" : "Version")}", Version);

            foreach (string responseFile in ResponseFiles.Where(i => !String.IsNullOrWhiteSpace(i)))
            {
                commandLineBuilder.AppendSwitch("@");
                commandLineBuilder.AppendTextUnquoted($"\"{responseFile}\"");
            }

            commandLineBuilder.AppendFileNameIfNotNull(Project);

            return(commandLineBuilder.ToString());
        }