Example #1
0
        /// <summary>
        /// Returns a string value containing the command line arguments to pass directly to the executable file.
        /// </summary>
        /// <returns>
        /// A string value containing the command line arguments to pass directly to the executable file.
        /// </returns>
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder builder = new CommandLineBuilder();

            builder.AppendSwitch(PathSeparator + "nologo");
            if (DisableShadowCopy)
            {
                builder.AppendSwitch(PathSeparator + "noshadow");
            }

            if (HideDots)
            {
                builder.AppendSwitch(PathSeparator + "nodots");
            }

            if (ShowLabels)
            {
                builder.AppendSwitch(PathSeparator + "labels");
            }

            if (!TestInNewThread)
            {
                builder.AppendSwitch(PathSeparator + "nothread");
            }

            builder.AppendFileNamesIfNotNull(Assemblies, " ");

            builder.AppendSwitchIfNotNull(PathSeparator + "config=", ProjectConfiguration);

            builder.AppendSwitchIfNotNull(PathSeparator + "run=", WhatToRun);

            builder.AppendSwitchIfNotNull(PathSeparator + "include=", IncludeCategory);

            builder.AppendSwitchIfNotNull(PathSeparator + "exclude=", ExcludeCategory);

            builder.AppendSwitchIfNotNull(PathSeparator + "transform=", XsltTransformFile);

            builder.AppendSwitchIfNotNull(PathSeparator + "xml=", OutputXmlFile);

            builder.AppendSwitchIfNotNull(PathSeparator + "err=", ErrorOutputFile);

            builder.AppendSwitchIfNotNull(PathSeparator + "framework=", FrameworkToUse);

            if (ProcessModelType != ProcessModelType.Default)
            {
                builder.AppendSwitchIfNotNull(PathSeparator + "process=", ProcessModelType.ToString());
            }

            if (AppDomainUsageType != AppDomainUsageType.Default)
            {
                builder.AppendSwitchIfNotNull(PathSeparator + "domain=", AppDomainUsageType.ToString());
            }

            if (TestCaseTimeoutInMilliseconds != 0)
            {
                builder.AppendSwitchIfNotNull(PathSeparator + "timeout=", TestCaseTimeoutInMilliseconds.ToString(CultureInfo.InvariantCulture));
            }

            return(builder.ToString());
        }
Example #2
0
        /// <summary>
        /// Returns a string value containing the command line arguments
        /// to pass directly to the executable file.
        /// </summary>
        /// <returns>
        /// A string value containing the command line arguments to pass
        /// directly to the executable file.
        /// </returns>
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder commandLine = new CommandLineBuilder();

            if (ShowCallStack)
            {
                commandLine.AppendSwitch("/ShowCallStack");
            }
            if (LogFile != null && LogFile.Trim().Length == 0)
            {
                commandLine.AppendSwitch("/LogFile=");
            }
            else
            {
                commandLine.AppendSwitchIfNotNull("/LogFile=", LogFile);
            }

            if (IsUninstall)
            {
                commandLine.AppendSwitch("/uninstall");
            }
            commandLine.AppendFileNamesIfNotNull(AssemblyFiles, " ");
            if (AssemblyNames != null)
            {
                foreach (ITaskItem assemblyName in AssemblyNames)
                {
                    commandLine.AppendSwitch("/AssemblyName");
                    commandLine.AppendFileNameIfNotNull(assemblyName);
                }
            }
            return(commandLine.ToString());
        }
Example #3
0
        protected override string GenerateCommandLineCommands()
        {
            var cmdLine = new CommandLineBuilder();
            var outputs = new List <ITaskItem>();

            ITaskItem bootstrap = null;

            if (BootstrapFile != null)
            {
                if (BootstrapFile.Length > 1)
                {
                    Log.LogError("Multiple bootstrap files is not supported.");
                    return(null);
                }

                bootstrap = BootstrapFile[0];
            }

            cmdLine.AppendSwitchIfNotNull("/b:", bootstrap);
            cmdLine.AppendSwitchIfNotNull("/o:", OutputPath);
            cmdLine.AppendFileNamesIfNotNull(Sources, " ");

            Outputs = outputs.ToArray();
            return(cmdLine.ToString());
        }
        protected override string GenerateCommandLineCommands()
        {
            var argBuilder = new CommandLineBuilder();

            argBuilder.AppendFileNameIfNotNull(string.IsNullOrWhiteSpace(this.ToolLocationOverride)
                ? "codegen"
                : this.ToolLocationOverride);

            foreach (var item in this.ReferencePath)
            {
                argBuilder.AppendSwitch("-r");
                argBuilder.AppendFileNameIfNotNull(item);
            }

            foreach (var item in this.GeneratorAssemblySearchPaths)
            {
                argBuilder.AppendSwitch("--generatorSearchPath");
                argBuilder.AppendFileNameIfNotNull(item);
            }

            argBuilder.AppendSwitch("--out");
            argBuilder.AppendFileNameIfNotNull(this.IntermediateOutputDirectory);

            this.generatedCompileItemsFilePath = Path.Combine(this.IntermediateOutputDirectory, Path.GetRandomFileName());
            argBuilder.AppendSwitch("--generatedFilesList");
            argBuilder.AppendFileNameIfNotNull(this.generatedCompileItemsFilePath);

            argBuilder.AppendSwitch("--");
            argBuilder.AppendFileNamesIfNotNull(this.Compile, " ");

            return(argBuilder.ToString());
        }
Example #5
0
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder commandLine = new CommandLineBuilder();

            if (((OutputAssembly == null) && (Sources != null)) && ((Sources.Length > 0)))
            {
                OutputAssembly = new TaskItem(Path.GetFileNameWithoutExtension(this.Sources[0].ItemSpec));
                if (string.Equals(this.TargetType, "library", StringComparison.OrdinalIgnoreCase))
                {
                    OutputAssembly.ItemSpec += ".dll";
                }
                else if (string.Equals(this.TargetType, "module", StringComparison.OrdinalIgnoreCase))
                {
                    OutputAssembly.ItemSpec += ".netmodule";
                }
                else
                {
                    OutputAssembly.ItemSpec += ".exe";
                }
            }
            commandLine.AppendSwitch("/NOLOGO");

            // TODO: EmitDebugInformation / DebugType
            commandLine.AppendSwitch("/DEBUG");

            if (optimize)
            {
                commandLine.AppendSwitch("/OPTIMIZE");
            }

            commandLine.AppendSwitchIfNotNull("/KEY=@", this.KeyContainer);
            commandLine.AppendSwitchIfNotNull("/KEY=", this.KeyFile);

            if (Resources != null)
            {
                foreach (ITaskItem item in Resources)
                {
                    commandLine.AppendSwitchIfNotNull("/RESOURCE=", item);
                }
            }

            if (FileAlignment > 0)
            {
                AppendIntegerSwitch(commandLine, "/ALIGNMENT=", FileAlignment);
            }

            commandLine.AppendSwitchIfNotNull("/OUTPUT=", this.OutputAssembly);

            if (string.Equals(this.TargetType, "library", StringComparison.OrdinalIgnoreCase))
            {
                commandLine.AppendSwitch("/DLL");
            }
            else if (string.Equals(this.TargetType, "module", StringComparison.OrdinalIgnoreCase))
            {
                commandLine.AppendSwitch("/DLL");
            }

            commandLine.AppendFileNamesIfNotNull(this.Sources, " ");
            return(commandLine.ToString());
        }
Example #6
0
        /// <summary>
        /// Generate the command line from the properties.
        /// </summary>
        /// <returns>Command line string.</returns>
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder commandLine = new CommandLineBuilder();

            commandLine.AppendSwitchIfNotNull("-b ", this.baseInputPath);
            commandLine.AppendSwitchIfNotNull("-cc ", this.cabinetCache);
            CommandLineHelper.AppendExtensions(commandLine, this.extensions, this.Log);
            commandLine.AppendSwitchIfNotNull("-i ", this.baseUncompressedImagesOutputPath);
            CommandLineHelper.AppendArrayIfNotNull(commandLine, "-loc ", this.LocalizationFiles);
            CommandLineHelper.AppendIfTrue(commandLine, "-nologo", this.noLogo);
            CommandLineHelper.AppendIfTrue(commandLine, "-notidy", this.leaveTemporaryFiles);
            CommandLineHelper.AppendIfTrue(commandLine, "-reusecab", this.reuseCabinetCache);
            commandLine.AppendSwitchIfNotNull("-out ", outputFile.ItemSpec);
            CommandLineHelper.AppendIfTrue(commandLine, "-xo", this.outputAsXml);
            CommandLineHelper.AppendIfTrue(commandLine, "-sadmin", this.suppressDefaultAdminSequenceActions);
            CommandLineHelper.AppendIfTrue(commandLine, "-sadv", this.suppressDefaultAdvSequenceActions);
            CommandLineHelper.AppendIfTrue(commandLine, "-sa", this.suppressAssemblies);
            CommandLineHelper.AppendIfTrue(commandLine, "-sf", this.suppressFiles);
            CommandLineHelper.AppendIfTrue(commandLine, "-sl", this.suppressLayout);
            CommandLineHelper.AppendIfTrue(commandLine, "-ss", this.suppressSchemaValidation);
            CommandLineHelper.AppendIfTrue(commandLine, "-sui", this.suppressDefaultUISequenceActions);
            CommandLineHelper.AppendIfTrue(commandLine, "-sv", this.suppressIntermediateFileVersionMatching);
            CommandLineHelper.AppendIfTrue(commandLine, "-sw", this.suppressAllWarnings);
            CommandLineHelper.AppendIfTrue(commandLine, "-ust", this.useSmallTableDefinitions);
            CommandLineHelper.AppendIfTrue(commandLine, "-wx", this.treatWarningsAsErrors);
            CommandLineHelper.AppendIfSpecified(commandLine, "-w", this.warningLevel);
            CommandLineHelper.AppendIfTrue(commandLine, "-v", this.verboseOutput);
            CommandLineHelper.AppendIfSpecified(commandLine, "-v", this.verboseOutputLevel);
            commandLine.AppendFileNamesIfNotNull(this.objectFiles, " ");

            return(commandLine.ToString());
        }
Example #7
0
        /// <summary>
        /// Returns a string value containing the command line arguments to pass directly to the executable file.
        /// </summary>
        /// <returns>
        /// A string value containing the command line arguments to pass directly to the executable file.
        /// </returns>
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder builder = new CommandLineBuilder();

            builder.AppendSwitch("/nologo");
            if (DisableShadowCopy)
            {
                builder.AppendSwitch("/noshadow");
            }
            if (_testInNewThread.HasValue && !_testInNewThread.Value)
            {
                builder.AppendSwitch("/nothread");
            }
            builder.AppendFileNamesIfNotNull(_assemblies, " ");

            builder.AppendSwitchIfNotNull("/config=", _projectConfiguration);

            builder.AppendSwitchIfNotNull("/fixture=", _fixture);

            builder.AppendSwitchIfNotNull("/include=", _includeCategory);

            builder.AppendSwitchIfNotNull("/exclude=", _excludeCategory);

            builder.AppendSwitchIfNotNull("/transform=", _xsltTransformFile);

            builder.AppendSwitchIfNotNull("/xml=", _outputXmlFile);

            builder.AppendSwitchIfNotNull("/err=", _errorOutputFile);

            builder.AppendSwitchIfNotNull("/framework=", _framework);

            return(builder.ToString());
        }
Example #8
0
        /// <summary>
        /// Generates the response file commands.
        /// </summary>
        protected override string GenerateResponseFileCommands()
        {
            var args = new CommandLineBuilder();

            args.AppendFileNamesIfNotNull(this.Files.Select(GetWorkingDirectoryRelativePath).ToArray(), Environment.NewLine);
            return(args.ToString());
        }
Example #9
0
        protected override string GenerateCommandLineCommands()
        {
            UsageError = false;
            CommandLineBuilder builder = new CommandLineBuilder(false);

            if (!string.IsNullOrEmpty(OutputDir))
            {
                builder.AppendSwitch("--output-dir");
                builder.AppendFileNameIfNotNull(OutputDir);
            }

            if (IncludeDirectories != null)
            {
                foreach (string path in IncludeDirectories)
                {
                    builder.AppendSwitchIfNotNull("-I", path);
                }
            }
            builder.AppendSwitchIfNotNull("-I", Path.Combine(IceHome, "slice"));

            if (AdditionalOptions != null)
            {
                foreach (var option in AdditionalOptions)
                {
                    builder.AppendTextUnquoted(" ");
                    builder.AppendTextUnquoted(option);
                }
            }

            builder.AppendFileNamesIfNotNull(Sources, " ");

            return(builder.ToString());
        }
Example #10
0
        protected override string GenerateCommandLineCommands()
        {
            //   Running command: C:\Program Files\Java\jdk1.6.0_25\bin\java.exe -jar
            //     C:\Program Files (x86)\Android\android-sdk\platform-tools\lib\dx.jar --dex
            //     --output=C:\Users\jeff\Documents\Visual Studio 2010\Projects\<project>\...\android\bin\classes.dex
            //     C:\Users\jeff\Documents\Visual Studio 2010\Projects\<project>\...\android\bin\classes
            //     C:\Users\jeff\Documents\Visual Studio 2010\Projects\<project>\...\android\bin\mono.android.jar

            var cmd = new CommandLineBuilder();

            if (!UseDx)
            {
                // Add the JavaOptions if they are not null
                // These could be any of the additional options
                if (!string.IsNullOrEmpty(JavaOptions))
                {
                    cmd.AppendSwitch(JavaOptions);
                }

                // Add the specific -XmxN to override the default heap size for the JVM
                // N can be in the form of Nm or NGB (e.g 100m or 1GB )
                cmd.AppendSwitchIfNotNull("-Xmx", JavaMaximumHeapSize);

                cmd.AppendSwitchIfNotNull("-jar ", Path.Combine(DxJarPath));
            }

            cmd.AppendSwitch(DxExtraArguments);

            if (MultiDexEnabled)
            {
                cmd.AppendSwitch("--multi-dex");
                cmd.AppendSwitchIfNotNull("--main-dex-list=", MultiDexMainDexListFile);
            }
            cmd.AppendSwitchIfNotNull("--output ", Path.GetDirectoryName(ClassesOutputDirectory));


            // .jar files
            if (AlternativeJarFiles != null && AlternativeJarFiles.Any())
            {
                Log.LogDebugMessage("  processing AlternativeJarFiles...");
                cmd.AppendFileNamesIfNotNull(AlternativeJarFiles, " ");
            }
            else
            {
                Log.LogDebugMessage("  processing ClassesOutputDirectory...");
                var zip = Path.GetFullPath(Path.Combine(ClassesOutputDirectory, "classes.zip"));
                if (!File.Exists(zip))
                {
                    throw new FileNotFoundException($"'{zip}' does not exist. Please rebuild the project.");
                }
                cmd.AppendFileNameIfNotNull(zip);
                foreach (var jar in JavaLibrariesToCompile)
                {
                    cmd.AppendFileNameIfNotNull(jar.ItemSpec);
                }
            }

            return(cmd.ToString());
        }
Example #11
0
        public void TestAppendFileNamesIfNotNull4()
        {
            clb = new CommandLineBuilder();

            clb.AppendFileNamesIfNotNull(items, String.Empty);

            Assert.AreEqual("ab", clb.ToString(), "A1");

            clb.AppendFileNamesIfNotNull((ITaskItem[])null, "sep");

            Assert.AreEqual("ab", clb.ToString(), "A2");

            clb = new CommandLineBuilder();
            clb.AppendFileNamesIfNotNull(new ITaskItem [] { new TaskItem("a"), new TaskItem("b c") }, " ");

            Assert.AreEqual("a \"b c\"", clb.ToString(), "A3");
        }
Example #12
0
        /// <summary>
        /// Returns a string value containing the command line arguments to pass directly to the executable file.
        /// </summary>
        /// <returns>
        /// A string value containing the command line arguments to pass directly to the executable file.
        /// </returns>
        protected override string GenerateCommandLineCommands()
        {
            var builder = new CommandLineBuilder();

            var c = Environment.OSVersion.Platform == PlatformID.Unix
        ? "-"
        : "--";

            if (EnableShadowCopy)
            {
                builder.AppendSwitch(c + "shadowcopy");
            }
            if (_testInNewThread.HasValue && !_testInNewThread.Value)
            {
                builder.AppendSwitch(c + "nothread");
            }
            if (Force32Bit)
            {
                builder.AppendSwitch(c + "x86");
            }
            if (NoHeader)
            {
                builder.AppendSwitch(c + "noheader");
            }
            if (NoColor)
            {
                builder.AppendSwitch(c + "nocolor");
            }
            if (Verbose)
            {
                builder.AppendSwitch(c + "verbose");
            }
            if (ReportProgressToTeamCity)
            {
                builder.AppendSwitch(c + "teamcity");
            }
            builder.AppendFileNamesIfNotNull(Assemblies, " ");
            builder.AppendSwitchIfNotNull(c + "config=", ProjectConfiguration);
            builder.AppendSwitchIfNotNull(c + "err=", ErrorOutputFile);
            builder.AppendSwitchIfNotNull(c + "out=", TextOutputFile);
            builder.AppendSwitchIfNotNull(c + "framework=", Framework);
            builder.AppendSwitchIfNotNull(c + "process=", Process);
            builder.AppendSwitchIfNotNull(c + "domain=", Domain);
            builder.AppendSwitchIfNotNull(c + "apartment=", Apartment);
            builder.AppendSwitchIfNotNull(c + "where=", Where);
            builder.AppendSwitchIfNotNull(c + "timeout=", TestTimeout);
            builder.AppendSwitchIfNotNull(c + "workers=", Workers);
            builder.AppendSwitchIfNotNull(c + "result=", OutputXmlFile);
            builder.AppendSwitchIfNotNull(c + "work=", WorkingDirectory);
            builder.AppendSwitchIfNotNull(c + "labels=", ShowLabels);
            builder.AppendSwitchIfNotNull(c + "trace=", InternalTrace);
            if (!string.IsNullOrWhiteSpace(AdditionalArguments))
            {
                builder.AppendTextUnquoted(" " + AdditionalArguments);
            }

            return(builder.ToString());
        }
Example #13
0
        public void AppendSourcesArray()
        {
            CommandLineBuilder c = new CommandLineBuilder();

            c.AppendFileNamesIfNotNull(new[] { "Mercury.cs", "Venus.cs", "Earth.cs" }, " ");

            // Managed compilers use this function to append sources files.
            c.ShouldBe(@"Mercury.cs Venus.cs Earth.cs");
        }
Example #14
0
        public void AppendSourcesArrayWithDashesTaskItem()
        {
            CommandLineBuilder c = new CommandLineBuilder();

            c.AppendFileNamesIfNotNull(new[] { new TaskItem("-Mercury.cs"), null, new TaskItem("Venus.cs"), new TaskItem("-Earth.cs") }, " ");

            // Managed compilers use this function to append sources files.
            c.ShouldBe($".{Path.DirectorySeparatorChar}-Mercury.cs  Venus.cs .{Path.DirectorySeparatorChar}-Earth.cs");
        }
Example #15
0
        public void JoinAppendEmpty()
        {
            CommandLineBuilder c = new CommandLineBuilder();

            c.AppendFileNamesIfNotNull(new[] { "" }, " ");

            // Managed compilers use this function to append sources files.
            c.ShouldBe("");
        }
Example #16
0
        public void AppendSourcesArrayWithDashesTaskItem()
        {
            CommandLineBuilder c = new CommandLineBuilder();

            c.AppendFileNamesIfNotNull(new TaskItem[] { new TaskItem("-Mercury.cs"), null, new TaskItem("Venus.cs"), new TaskItem("-Earth.cs") }, " ");

            // Managed compilers use this function to append sources files.
            Assert.Equal("." + Path.DirectorySeparatorChar + "-Mercury.cs  Venus.cs ." + Path.DirectorySeparatorChar + "-Earth.cs", c.ToString());
        }
Example #17
0
        public void JoinAppendNull()
        {
            CommandLineBuilder c = new CommandLineBuilder();

            c.AppendFileNamesIfNotNull((string[])null, " ");

            // Managed compilers use this function to append sources files.
            Assert.Equal(@"", c.ToString());
        }
Example #18
0
        public void AppendSourcesArray()
        {
            CommandLineBuilder c = new CommandLineBuilder();

            c.AppendFileNamesIfNotNull(new string[] { "Mercury.cs", "Venus.cs", "Earth.cs" }, " ");

            // Managed compilers use this function to append sources files.
            Assert.Equal(@"Mercury.cs Venus.cs Earth.cs", c.ToString());
        }
        public void AppendSourcesArrayWithDashes()
        {
            CommandLineBuilder c = new CommandLineBuilder();

            c.AppendFileNamesIfNotNull(new string[] { "-Mercury.cs", "-Venus.cs", "-Earth.cs" }, " ");

            // Managed compilers use this function to append sources files.
            Assert.AreEqual(@".\-Mercury.cs .\-Venus.cs .\-Earth.cs", c.ToString());
        }
Example #20
0
        public void JoinAppendNull()
        {
            CommandLineBuilder c = new CommandLineBuilder();

            c.AppendFileNamesIfNotNull((string[])null, " ");

            // Managed compilers use this function to append sources files.
            c.ShouldBe("");
        }
        protected override String GenerateCommandLineCommands()
        {
            UsageError = false;
            CommandLineBuilder builder = new CommandLineBuilder(false);

            if (Depend)
            {
                builder.AppendSwitch("--depend-xml");
                builder.AppendSwitch("--depend-file");
                builder.AppendFileNameIfNotNull(Path.Combine(OutputDir, DependFile));
            }

            if (!String.IsNullOrEmpty(OutputDir))
            {
                builder.AppendSwitch("--output-dir");
                builder.AppendFileNameIfNotNull(OutputDir);
            }

            if (AllowIcePrefix)
            {
                builder.AppendSwitch("--ice");
            }

            if (Underscore)
            {
                builder.AppendSwitch("--underscore");
            }

            if (Stream)
            {
                builder.AppendSwitch("--stream");
            }

            if (Checksum)
            {
                builder.AppendSwitch("--checksum");
            }

            if (IncludeDirectories != null)
            {
                foreach (String path in IncludeDirectories)
                {
                    builder.AppendSwitchIfNotNull("-I", path);
                }
            }

            if (!String.IsNullOrEmpty(AdditionalOptions))
            {
                builder.AppendTextUnquoted(" ");
                builder.AppendTextUnquoted(AdditionalOptions);
            }

            builder.AppendFileNamesIfNotNull(Sources, " ");

            return(builder.ToString());
        }
Example #22
0
 protected override string GenerateCommandLineCommands()
 {
     CommandLineBuilder.AppendSwitchIfNotNull("-out ", OutputPath);
     // No trailing space, preprocessor definitions are passed as -d<Variable>=<Value>
     CommandLineBuilder.AppendArrayIfNotNull("-d", PreprocessorDefinitions.ToArray());
     CommandLineBuilder.AppendArrayIfNotNull("-ext ", Extensions.ToArray());
     CommandLineBuilder.AppendSwitchIfNotNull("-arch ", Arch);
     CommandLineBuilder.AppendFileNamesIfNotNull(SourceFiles.ToArray(), " ");
     return(CommandLineBuilder.ToString());
 }
Example #23
0
        public void AppendTwoStringsEnsureNoSpace()
        {
            CommandLineBuilder c = new CommandLineBuilder();

            c.AppendFileNamesIfNotNull(new string[] { "Form1.resx", FileUtilities.FixFilePath("built\\Form1.resources") }, ",");

            // There shouldn't be a space before or after the comma
            // Tools like resgen require comma-delimited lists to be bumped up next to each other.
            Assert.Equal(FileUtilities.FixFilePath(@"Form1.resx,built\Form1.resources"), c.ToString());
        }
Example #24
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());
        }
Example #25
0
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder cb = new CommandLineBuilder();

            //cb.AppendSwitch("-q");
            cb.AppendSwitch("-nologo");
            cb.AppendSwitch("--");

            cb.AppendFileNamesIfNotNull(Sources, " ");

            return(cb.ToString());
        }
Example #26
0
 private void AppendTaskItemsToSwitch(CommandLineBuilder aCommandLineBuilder, ITaskItem[] aTaskItems, CompilerCommandAttribute aCommand)
 {
     if (aCommand.QuotedValue)
     {
         if (!aCommand.UseSingleItem)
         {
             if (String.IsNullOrEmpty(aCommand.Switch))
             {
                 aCommandLineBuilder.AppendFileNamesIfNotNull(aTaskItems, aCommand.Delimiter);
             }
             else // delphi 7 does not support -Switch"Path Name";"Path Name" so use GetItems method instead
             {
                 aCommandLineBuilder.AppendSwitchIfNotNull(aCommand.Switch, GetItems(aTaskItems, aCommand.Delimiter));
             }
         }
         else
         {
             if (String.IsNullOrEmpty(aCommand.Switch))
             {
                 aCommandLineBuilder.AppendFileNameIfNotNull(aTaskItems[0]);
             }
             else
             {
                 aCommandLineBuilder.AppendSwitchIfNotNull(aCommand.Switch, aTaskItems[0]);
             }
         }
     }
     else
     {
         if (!aCommand.UseSingleItem)
         {
             if (String.IsNullOrEmpty(aCommand.Switch))
             {
                 aCommandLineBuilder.AppendSwitchUnquotedIfNotNull("", aTaskItems, aCommand.Delimiter);
             }
             else
             {
                 aCommandLineBuilder.AppendSwitchUnquotedIfNotNull(aCommand.Switch, aTaskItems, aCommand.Delimiter);
             }
         }
         else
         {
             if (String.IsNullOrEmpty(aCommand.Switch))
             {
                 aCommandLineBuilder.AppendSwitchUnquotedIfNotNull("", aTaskItems[0]);
             }
             else
             {
                 aCommandLineBuilder.AppendSwitchUnquotedIfNotNull(aCommand.Switch, aTaskItems[0]);
             }
         }
     }
 }
Example #27
0
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder builder = new CommandLineBuilder();

            builder.AppendFileNamesIfNotNull(this.Assemblies, " ");
            if (this.Use32Bit)
            {
                builder.AppendSwitch("--x86");
            }
            if (this.TeamCity)
            {
                builder.AppendSwitch("--teamcity");
            }
            if (!this.NoShadow)
            {
                builder.AppendSwitch("--shadowcopy");
            }
            if (this.DisposeRunners)
            {
                builder.AppendSwitch("--dispose-runners");
            }
            if (this.WorkerThreads > 0)
            {
                builder.AppendSwitch("--workers=" + this.WorkerThreads);
            }
            if (this.TestTimeout > 0)
            {
                builder.AppendSwitch("--timeout=" + this.TestTimeout);
            }
            if (this.Agents > 0)
            {
                builder.AppendSwitch("--agents=" + this.Agents);
            }
            builder.AppendSwitchIfNotNull("--labels=", this.Labels);
            builder.AppendSwitchIfNotNull("--test=", this.Test);
            builder.AppendSwitchIfNotNull("--config=", this.Configuration);
            builder.AppendSwitchIfNotNull("--where=", this.Where);
            builder.AppendSwitchIfNotNull("--process=", this.Process);
            builder.AppendSwitchIfNotNull("--domain=", this.Domain);
            builder.AppendSwitchIfNotNull("--framework=", this.Framework);
            if (this.OutputXmlFile != null)
            {
                builder.AppendSwitch("--result=" + this.OutputXmlFile + ";format=nunit2");
            }
            else
            {
                builder.AppendSwitch("--result=TestResult.xml;format=nunit2");
            }
            builder.AppendSwitchIfNotNull("--err=", this.ErrorOutputFile);
            builder.AppendSwitchIfNotNull("--out=", this.OutputFile);
            return(builder.ToString());
        }
Example #28
0
    protected string GenerateCommandLineCommands()
    {
        CommandLineBuilder builder = new CommandLineBuilder(false);

        builder.AppendSwitch("sign");
        if (AdditionalOptions != null)
        {
            builder.AppendTextUnquoted(" ");
            builder.AppendTextUnquoted(AdditionalOptions);
        }
        builder.AppendFileNamesIfNotNull(Files, " ");
        return(builder.ToString());
    }
Example #29
0
        public void TestAppendFileNamesIfNotNull2()
        {
            clb = new CommandLineBuilder();

            clb.AppendFileNamesIfNotNull(array, String.Empty);

            Assert.AreEqual("abc", clb.ToString(), "A1");

            clb = new CommandLineBuilder();

            clb.AppendFileNamesIfNotNull(array, "\t");

            Assert.AreEqual("a\tb\tc", clb.ToString(), "A2");

            clb.AppendFileNamesIfNotNull((string[])null, "sep");

            Assert.AreEqual("a\tb\tc", clb.ToString(), "A3");

            clb = new CommandLineBuilder();
            clb.AppendFileNamesIfNotNull(new string [] { "a", "b c" }, " ");

            Assert.AreEqual("a \"b c\"", clb.ToString(), "A4");
        }
Example #30
0
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder builder = new CommandLineBuilder();

            builder.AppendFileNameIfNotNull(this.Source);
            builder.AppendFileNameIfNotNull(this.Destination);
            builder.AppendFileNamesIfNotNull(this.Files, " ");
            if (!string.IsNullOrEmpty(this.Options))
            {
                builder.AppendSwitch(this.Options);
            }

            return(builder.ToString());
        }