当前位置: 首页>>代码示例>>C#>>正文


C# CommandLineBuilderExtension.AppendSwitchIfNotNull方法代码示例

本文整理汇总了C#中Microsoft.Build.Tasks.CommandLineBuilderExtension.AppendSwitchIfNotNull方法的典型用法代码示例。如果您正苦于以下问题:C# CommandLineBuilderExtension.AppendSwitchIfNotNull方法的具体用法?C# CommandLineBuilderExtension.AppendSwitchIfNotNull怎么用?C# CommandLineBuilderExtension.AppendSwitchIfNotNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Build.Tasks.CommandLineBuilderExtension的用法示例。


在下文中一共展示了CommandLineBuilderExtension.AppendSwitchIfNotNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddCommandLineCommands

		protected internal override void AddCommandLineCommands (
						CommandLineBuilderExtension commandLine)
		{
			if (Sources.Length == 0)
				return;

			foreach (ITaskItem item in Sources)
				commandLine.AppendSwitchIfNotNull ("--complist=", item.ItemSpec);

			commandLine.AppendSwitchIfNotNull ("--target=", LicenseTarget);

			if (ReferencedAssemblies != null)
				foreach (ITaskItem reference in ReferencedAssemblies)
					commandLine.AppendSwitchIfNotNull ("--load=", reference.ItemSpec);

			string outdir;
			if (Bag ["OutputDirectory"] != null)
				outdir = OutputDirectory;
			else
				outdir = ".";

			commandLine.AppendSwitchIfNotNull ("--outdir=", outdir);

			if (Bag ["NoLogo"] != null && NoLogo)
				commandLine.AppendSwitch ("--nologo");

			OutputLicense = new TaskItem (Path.Combine (OutputDirectory, LicenseTarget.ItemSpec + ".licenses"));
		}
开发者ID:Profit0004,项目名称:mono,代码行数:28,代码来源:LC.cs

示例2: AddReferencesToCommandLine

 private void AddReferencesToCommandLine(CommandLineBuilderExtension commandLine)
 {
     if ((base.References != null) && (base.References.Length != 0))
     {
         List<ITaskItem> list = new List<ITaskItem>(base.References.Length);
         List<ITaskItem> list2 = new List<ITaskItem>(base.References.Length);
         foreach (ITaskItem item in base.References)
         {
             if (MetadataConversionUtilities.TryConvertItemMetadataToBool(item, "EmbedInteropTypes"))
             {
                 list2.Add(item);
             }
             else
             {
                 list.Add(item);
             }
         }
         if (list2.Count > 0)
         {
             commandLine.AppendSwitchIfNotNull("/link:", list2.ToArray(), ",");
         }
         if (list.Count > 0)
         {
             commandLine.AppendSwitchIfNotNull("/reference:", list.ToArray(), ",");
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:Vbc.cs

示例3: AddResponseFileCommands

 protected internal override void AddResponseFileCommands(CommandLineBuilderExtension commandLine)
 {
     if (((this.OutputAssembly == null) && (this.Sources != null)) && ((this.Sources.Length > 0) && (this.ResponseFiles == null)))
     {
         try
         {
             this.OutputAssembly = new TaskItem(Path.GetFileNameWithoutExtension(this.Sources[0].ItemSpec));
         }
         catch (ArgumentException exception)
         {
             throw new ArgumentException(exception.Message, "Sources");
         }
         if (string.Compare(this.TargetType, "library", StringComparison.OrdinalIgnoreCase) == 0)
         {
             ITaskItem outputAssembly = this.OutputAssembly;
             outputAssembly.ItemSpec = outputAssembly.ItemSpec + ".dll";
         }
         else if (string.Compare(this.TargetType, "module", StringComparison.OrdinalIgnoreCase) == 0)
         {
             ITaskItem item2 = this.OutputAssembly;
             item2.ItemSpec = item2.ItemSpec + ".netmodule";
         }
         else
         {
             ITaskItem item3 = this.OutputAssembly;
             item3.ItemSpec = item3.ItemSpec + ".exe";
         }
     }
     commandLine.AppendSwitchIfNotNull("/addmodule:", this.AddModules, ",");
     commandLine.AppendSwitchWithInteger("/codepage:", base.Bag, "CodePage");
     this.ConfigureDebugProperties();
     commandLine.AppendPlusOrMinusSwitch("/debug", base.Bag, "EmitDebugInformation");
     commandLine.AppendSwitchIfNotNull("/debug:", this.DebugType);
     commandLine.AppendPlusOrMinusSwitch("/delaysign", base.Bag, "DelaySign");
     commandLine.AppendSwitchWithInteger("/filealign:", base.Bag, "FileAlignment");
     commandLine.AppendSwitchIfNotNull("/keycontainer:", this.KeyContainer);
     commandLine.AppendSwitchIfNotNull("/keyfile:", this.KeyFile);
     commandLine.AppendSwitchIfNotNull("/linkresource:", this.LinkResources, new string[] { "LogicalName", "Access" });
     commandLine.AppendWhenTrue("/nologo", base.Bag, "NoLogo");
     commandLine.AppendWhenTrue("/nowin32manifest", base.Bag, "NoWin32Manifest");
     commandLine.AppendPlusOrMinusSwitch("/optimize", base.Bag, "Optimize");
     commandLine.AppendSwitchIfNotNull("/out:", this.OutputAssembly);
     commandLine.AppendSwitchIfNotNull("/resource:", this.Resources, new string[] { "LogicalName", "Access" });
     commandLine.AppendSwitchIfNotNull("/target:", this.TargetType);
     commandLine.AppendPlusOrMinusSwitch("/warnaserror", base.Bag, "TreatWarningsAsErrors");
     commandLine.AppendWhenTrue("/utf8output", base.Bag, "Utf8Output");
     commandLine.AppendSwitchIfNotNull("/win32icon:", this.Win32Icon);
     commandLine.AppendSwitchIfNotNull("/win32manifest:", this.Win32Manifest);
     commandLine.AppendFileNamesIfNotNull(this.Sources, " ");
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:50,代码来源:ManagedCompiler.cs

示例4: AddReferencesToCommandLine

 private void AddReferencesToCommandLine(CommandLineBuilderExtension commandLine)
 {
     if ((base.References != null) && (base.References.Length != 0))
     {
         foreach (ITaskItem item in base.References)
         {
             string metadata = item.GetMetadata("Aliases");
             string switchName = "/reference:";
             if (MetadataConversionUtilities.TryConvertItemMetadataToBool(item, "EmbedInteropTypes"))
             {
                 switchName = "/link:";
             }
             if ((metadata == null) || (metadata.Length == 0))
             {
                 commandLine.AppendSwitchIfNotNull(switchName, item.ItemSpec);
             }
             else
             {
                 foreach (string str3 in metadata.Split(new char[] { ',' }))
                 {
                     string str4 = str3.Trim();
                     if (str3.Length != 0)
                     {
                         if (str4.IndexOfAny(new char[] { ',', ' ', ';', '"' }) != -1)
                         {
                             Microsoft.Build.Shared.ErrorUtilities.VerifyThrowArgument(false, "Csc.AssemblyAliasContainsIllegalCharacters", item.ItemSpec, str4);
                         }
                         if (string.Compare("global", str4, StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             commandLine.AppendSwitchIfNotNull(switchName, item.ItemSpec);
                         }
                         else
                         {
                             commandLine.AppendSwitchAliased(switchName, str4, item.ItemSpec);
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:41,代码来源:Csc.cs

示例5: AppendItemWithInvalidBooleanAttribute

        public void AppendItemWithInvalidBooleanAttribute()
        {
            Assert.Throws<ArgumentException>(() =>
            {
                // Construct the task item.
                TaskItem i = new TaskItem();
                i.ItemSpec = "MyResource.bmp";
                i.SetMetadata("Name", "Kenny");
                i.SetMetadata("Private", "Yes");       // This is our flag.

                CommandLineBuilderExtension c = new CommandLineBuilderExtension();

                // Validate that a legitimate bool works first.
                try
                {
                    c.AppendSwitchIfNotNull
                    (
                        "/myswitch:",
                        new ITaskItem[] { i },
                        new string[] { "Name", "Private" },
                        new bool[] { false, true }
                    );
                    Assert.Equal(@"/myswitch:MyResource.bmp,Kenny,Private", c.ToString());
                }
                catch (ArgumentException e)
                {
                    Assert.True(false, "Got an unexpected exception:" + e.Message);
                }

                // Now try a bogus boolean.
                i.SetMetadata("Private", "Maybe");       // This is our flag.
                c.AppendSwitchIfNotNull
                (
                    "/myswitch:",
                    new ITaskItem[] { i },
                    new string[] { "Name", "Private" },
                    new bool[] { false, true }
                );  // <-- Expect an ArgumentException here.
            }
           );
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:41,代码来源:CommandLineBuilderExtension_Tests.cs

示例6: AddCommandLineCommands

 protected internal override void AddCommandLineCommands(CommandLineBuilderExtension commandLine)
 {
     commandLine.AppendSwitchIfNotNull("/target:", this.LicenseTarget.ItemSpec);
     foreach (ITaskItem item in this.Sources)
     {
         commandLine.AppendSwitchIfNotNull("/complist:", item.ItemSpec);
     }
     commandLine.AppendSwitchIfNotNull("/outdir:", this.OutputDirectory);
     if (this.ReferencedAssemblies != null)
     {
         foreach (ITaskItem item2 in this.ReferencedAssemblies)
         {
             commandLine.AppendSwitchIfNotNull("/i:", item2.ItemSpec);
         }
     }
     commandLine.AppendWhenTrue("/nologo", base.Bag, "NoLogo");
     string str = this.LicenseTarget.ItemSpec + ".licenses";
     if (this.OutputDirectory != null)
     {
         str = Path.Combine(this.OutputDirectory, str);
     }
     this.OutputLicense = new TaskItem(str);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:23,代码来源:LC.cs

示例7: AddCommandLineCommands

 protected internal override void AddCommandLineCommands(CommandLineBuilderExtension commandLine)
 {
     commandLine.AppendSwitchIfNotNull("-m ", this.MetabasePath);
     commandLine.AppendSwitchIfNotNull("-v ", this.VirtualPath);
     commandLine.AppendSwitchIfNotNull("-p ", this.PhysicalPath);
     if (this.Updateable)
     {
         commandLine.AppendSwitch("-u");
     }
     if (this.Force)
     {
         commandLine.AppendSwitch("-f");
     }
     if (this.Clean)
     {
         commandLine.AppendSwitch("-c");
     }
     if (this.Debug)
     {
         commandLine.AppendSwitch("-d");
     }
     if (this.FixedNames)
     {
         commandLine.AppendSwitch("-fixednames");
     }
     commandLine.AppendSwitchIfNotNull("", this.TargetPath);
     if (this.AllowPartiallyTrustedCallers)
     {
         commandLine.AppendSwitch("-aptca");
     }
     if (this.DelaySign)
     {
         commandLine.AppendSwitch("-delaysign");
     }
     commandLine.AppendSwitchIfNotNull("-keyfile ", this.KeyFile);
     commandLine.AppendSwitchIfNotNull("-keycontainer ", this.KeyContainer);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:37,代码来源:AspNetCompiler.cs

示例8: AddCommandLineCommands

 protected internal override void AddCommandLineCommands(CommandLineBuilderExtension commandLine)
 {
     commandLine.AppendFileNameIfNotNull(this.TypeLibName);
     commandLine.AppendSwitchIfNotNull("/asmversion:", (this.AssemblyVersion != null) ? this.AssemblyVersion.ToString() : null);
     commandLine.AppendSwitchIfNotNull("/namespace:", this.AssemblyNamespace);
     commandLine.AppendSwitchIfNotNull("/machine:", this.Machine);
     commandLine.AppendWhenTrue("/noclassmembers", base.Bag, "PreventClassMembers");
     commandLine.AppendWhenTrue("/nologo", base.Bag, "NoLogo");
     commandLine.AppendSwitchIfNotNull("/out:", this.OutputAssembly);
     commandLine.AppendWhenTrue("/silent", base.Bag, "Silent");
     commandLine.AppendWhenTrue("/sysarray", base.Bag, "SafeArrayAsSystemArray");
     commandLine.AppendSwitchIfNotNull("/transform:", this.ConvertTransformFlagsToCommandLineCommand(this.Transform));
     commandLine.AppendWhenTrue("/verbose", base.Bag, "Verbose");
     if (this.ReferenceFiles != null)
     {
         foreach (string str in this.ReferenceFiles)
         {
             commandLine.AppendSwitchIfNotNull("/reference:", str);
         }
     }
     base.AddCommandLineCommands(commandLine);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:ResolveComReference.cs

示例9: AddStrongNameOptions

 private void AddStrongNameOptions(CommandLineBuilderExtension commandLine)
 {
     commandLine.AppendWhenTrue("/delaysign", base.Bag, "DelaySign");
     commandLine.AppendSwitchIfNotNull("/keyfile:", this.KeyFile);
     commandLine.AppendSwitchIfNotNull("/keycontainer:", this.KeyContainer);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:6,代码来源:AxTlbBaseTask.cs

示例10: AddResponseFileCommands

		protected internal override void AddResponseFileCommands (
						 CommandLineBuilderExtension commandLine)
		{
			commandLine.AppendSwitchIfNotNull ("/algid:", AlgorithmId);
			commandLine.AppendSwitchIfNotNull ("/baseaddress:", BaseAddress);
			commandLine.AppendSwitchIfNotNull ("/company:", CompanyName);
			commandLine.AppendSwitchIfNotNull ("/configuration:", Configuration);
			commandLine.AppendSwitchIfNotNull ("/culture:", Culture);
			commandLine.AppendSwitchIfNotNull ("/copyright:", Copyright);
			if (Bag ["DelaySign"] != null)
				if (DelaySign)
					commandLine.AppendSwitch ("/delaysign+");
				else
					commandLine.AppendSwitch ("/delaysign-");
			commandLine.AppendSwitchIfNotNull ("/description:", Description);
			if (EmbedResources != null)
				foreach (ITaskItem item in EmbedResources)
					commandLine.AppendSwitchIfNotNull ("/embed:", item.ItemSpec);
			commandLine.AppendSwitchIfNotNull ("/evidence:", EvidenceFile);
			commandLine.AppendSwitchIfNotNull ("/fileversion:", FileVersion);
			commandLine.AppendSwitchIfNotNull ("/flags:", Flags);
			if (GenerateFullPaths)
				commandLine.AppendSwitch ("/fullpaths");
			commandLine.AppendSwitchIfNotNull ("/keyname:", KeyContainer);
			commandLine.AppendSwitchIfNotNull ("/keyfile:", KeyFile);
			if (LinkResources != null)
				foreach (ITaskItem item in LinkResources)
					commandLine.AppendSwitchIfNotNull ("/link:", item.ItemSpec);
			commandLine.AppendSwitchIfNotNull ("/main:", MainEntryPoint);
			if (OutputAssembly != null)
				commandLine.AppendSwitchIfNotNull ("/out:", OutputAssembly.ItemSpec);
			//platform
			commandLine.AppendSwitchIfNotNull ("/product:", ProductName);
			commandLine.AppendSwitchIfNotNull ("/productversion:", ProductVersion);
			if (ResponseFiles != null)
				foreach (string s in ResponseFiles)
					commandLine.AppendFileNameIfNotNull (String.Format ("@{0}", s));
			if (SourceModules != null)
				foreach (ITaskItem item in SourceModules)
					commandLine.AppendFileNameIfNotNull (item.ItemSpec);
			commandLine.AppendSwitchIfNotNull ("/target:", TargetType);
			commandLine.AppendSwitchIfNotNull ("/template:", TemplateFile);
			commandLine.AppendSwitchIfNotNull ("/title:", Title);
			commandLine.AppendSwitchIfNotNull ("/trademark:", Trademark);
			commandLine.AppendSwitchIfNotNull ("/version:", Version);
			commandLine.AppendSwitchIfNotNull ("/win32icon:", Win32Icon);
			commandLine.AppendSwitchIfNotNull ("/win32res:", Win32Resource);
		}
开发者ID:koush,项目名称:mono,代码行数:48,代码来源:AL.cs

示例11: AddResponseFileCommands

        /// <summary>
        /// Looks at all the parameters that have been set, and builds up the string
        /// containing all the command-line switches.
        /// </summary>
        /// <param name="commandLine"></param>
        protected internal override void AddResponseFileCommands(CommandLineBuilderExtension commandLine)
        {
            commandLine.AppendSwitchIfNotNull("/baseaddress:", this.GetBaseAddressInHex());
            commandLine.AppendSwitchIfNotNull("/libpath:", this.AdditionalLibPaths, ",");
            commandLine.AppendSwitchIfNotNull("/imports:", this.Imports, ",");
            // Make sure this /doc+ switch comes *before* the /doc:<file> switch (which is handled in the
            // ManagedCompiler.cs base class).  /doc+ is really just an alias for /doc:<assemblyname>.xml,
            // and the last /doc switch on the command-line wins.  If the user provided a specific doc filename,
            // we want that one to win.
            commandLine.AppendPlusOrMinusSwitch("/doc", this.Bag, "GenerateDocumentation");
            commandLine.AppendSwitchIfNotNull("/optioncompare:", this.OptionCompare);
            commandLine.AppendPlusOrMinusSwitch("/optionexplicit", this.Bag, "OptionExplicit");
            // Make sure this /optionstrict+ switch appears *before* the /optionstrict:xxxx switch below

            /* In Orcas a change was made that set Option Strict-, whenever this.DisabledWarnings was
             * empty.  That was clearly the wrong thing to do and we found it when we had a project with all the warning configuration 
             * entries set to WARNING.  Because this.DisabledWarnings was empty in that case we would end up sending /OptionStrict- 
             * effectively silencing all the warnings that had been selected.
             * 
             * Now what we do is:
             *  If option strict+ is specified, that trumps everything and we just set option strict+ 
             *  Otherwise, just set option strict:custom.
             *  You may wonder why we don't try to set Option Strict-  The reason is that Option Strict- just implies a certain
             *  set of warnings that should be disabled (there's ten of them today)  You get the same effect by sending 
             *  option strict:custom on along with the correct list of disabled warnings.
             *  Rather than make this code know the current set of disabled warnings that comprise Option strict-, we just send
             *  option strict:custom on with the understanding that we'll get the same behavior as option strict- since we are passing
             *  the /nowarn line on that contains all the warnings OptionStrict- would disable anyway. The IDE knows what they are
             *  and puts them in the project file so we are good.  And by not making this code aware of which warnings comprise
             *  Option Strict-, we have one less place we have to keep up to date in terms of what comprises option strict-
             */

            // Decide whether we are Option Strict+ or Option Strict:custom
            object optionStrictSetting = this.Bag["OptionStrict"];
            bool optionStrict = optionStrictSetting != null ? (bool)optionStrictSetting : false;
            if (optionStrict)
            {
                commandLine.AppendSwitch("/optionstrict+");
            }
            else // OptionStrict+ wasn't specified so use :custom.
            {
                commandLine.AppendSwitch("/optionstrict:custom");
            }

            commandLine.AppendSwitchIfNotNull("/optionstrict:", this.OptionStrictType);
            commandLine.AppendWhenTrue("/nowarn", this.Bag, "NoWarnings");
            commandLine.AppendSwitchWithSplitting("/nowarn:", this.DisabledWarnings, ",", ';', ',');
            commandLine.AppendPlusOrMinusSwitch("/optioninfer", this.Bag, "OptionInfer");
            commandLine.AppendWhenTrue("/nostdlib", this.Bag, "NoStandardLib");
            commandLine.AppendWhenTrue("/novbruntimeref", this.Bag, "NoVBRuntimeReference");
            commandLine.AppendSwitchIfNotNull("/errorreport:", this.ErrorReport);
            commandLine.AppendSwitchIfNotNull("/platform:", this.PlatformWith32BitPreference);
            commandLine.AppendPlusOrMinusSwitch("/removeintchecks", this.Bag, "RemoveIntegerChecks");
            commandLine.AppendSwitchIfNotNull("/rootnamespace:", this.RootNamespace);
            commandLine.AppendSwitchIfNotNull("/sdkpath:", this.SdkPath);
            commandLine.AppendSwitchIfNotNull("/langversion:", this.LangVersion);
            commandLine.AppendSwitchIfNotNull("/moduleassemblyname:", this.ModuleAssemblyName);
            commandLine.AppendWhenTrue("/netcf", this.Bag, "TargetCompactFramework");
            commandLine.AppendSwitchIfNotNull("/preferreduilang:", this.PreferredUILang);
            commandLine.AppendPlusOrMinusSwitch("/highentropyva", this.Bag, "HighEntropyVA");

            if (0 == String.Compare(this.VBRuntimePath, this.VBRuntime, StringComparison.OrdinalIgnoreCase))
            {
                commandLine.AppendSwitchIfNotNull("/vbruntime:", this.VBRuntimePath);
            }
            else if (this.VBRuntime != null)
            {
                string vbRuntimeSwitch = this.VBRuntime;
                if (0 == String.Compare(vbRuntimeSwitch, "EMBED", StringComparison.OrdinalIgnoreCase))
                {
                    commandLine.AppendSwitch("/vbruntime*");
                }
                else if (0 == String.Compare(vbRuntimeSwitch, "NONE", StringComparison.OrdinalIgnoreCase))
                {
                    commandLine.AppendSwitch("/vbruntime-");
                }
                else if (0 == String.Compare(vbRuntimeSwitch, "DEFAULT", StringComparison.OrdinalIgnoreCase))
                {
                    commandLine.AppendSwitch("/vbruntime+");
                }
                else
                {
                    commandLine.AppendSwitchIfNotNull("/vbruntime:", vbRuntimeSwitch);
                }
            }


            // Verbosity
            if (
                   (this.Verbosity != null) &&

                   (
                      (0 == String.Compare(this.Verbosity, "quiet", StringComparison.OrdinalIgnoreCase)) ||
                      (0 == String.Compare(this.Verbosity, "verbose", StringComparison.OrdinalIgnoreCase))
                   )
//.........这里部分代码省略.........
开发者ID:ChronosWS,项目名称:msbuild,代码行数:101,代码来源:Vbc.cs

示例12: AddResponseFileCommands

		protected internal override void AddResponseFileCommands (
				CommandLineBuilderExtension commandLine )
		{
			base.AddResponseFileCommands (commandLine);

			commandLine.AppendSwitchIfNotNull ("/libpath:", AdditionalLibPaths, ",");

			commandLine.AppendSwitchIfNotNull ("/baseaddress:", BaseAddress);

			if (DefineConstants != null)
				commandLine.AppendSwitchUnquotedIfNotNull ("/define:",
						String.Format ("\"{0}\"", EscapeDoubleQuotes (DefineConstants)));

			// DisabledWarnings

			commandLine.AppendSwitchIfNotNull ("/doc:", DocumentationFile);

			// ErrorReport
			
			// GenerateDocumentation
			
			if (Imports != null)
				foreach (ITaskItem item in Imports)
					commandLine.AppendSwitchIfNotNull ("/imports:", item.ItemSpec);
			
			commandLine.AppendSwitchIfNotNull ("/main:", MainEntryPoint);

			// NoStandardLib
			if (Bag ["NoStandardLib"] != null && NoStandardLib)
				commandLine.AppendSwitch ("/nostdlib");
			
			if (NoWarnings)
				commandLine.AppendSwitch ("/nowarn");

			commandLine.AppendSwitchIfNotNull ("/optioncompare:", OptionCompare);

			if (Bag ["OptionExplicit"] != null)
				if (OptionExplicit)
					commandLine.AppendSwitch ("/optionexplicit+");
				else
					commandLine.AppendSwitch ("/optionexplicit-");

			if (Bag ["OptionStrict"] != null)
				if (OptionStrict)
					commandLine.AppendSwitch ("/optionstrict+");
				else
					commandLine.AppendSwitch ("/optionstrict-");

			if (Bag ["OptionInfer"] != null)
				if (OptionInfer)
					commandLine.AppendSwitch ("/optioninfer+");
				else
					commandLine.AppendSwitch ("/optioninfer-");

			// OptionStrictType
			
			// Platform
			
			if (References != null)
				foreach (ITaskItem item in References)
					commandLine.AppendSwitchIfNotNull ("/reference:", item.ItemSpec);
	
			if (Bag ["RemoveIntegerChecks"] != null)
				if (RemoveIntegerChecks)
					commandLine.AppendSwitch ("/removeintchecks+");
				else
					commandLine.AppendSwitch ("/removeintchecks-");

			if (ResponseFiles != null)
				foreach (ITaskItem item in ResponseFiles)
					commandLine.AppendFileNameIfNotNull (String.Format ("@{0}", item.ItemSpec));

			commandLine.AppendSwitchIfNotNull ("/rootnamespace:", RootNamespace);

			commandLine.AppendSwitchIfNotNull ("/sdkpath:", SdkPath);

			// TargetCompactFramework

			if (String.Compare (VBRuntime, "Embed", StringComparison.OrdinalIgnoreCase) == 0) 
				commandLine.AppendSwitch ("/vbruntime*");
			
			// Verbosity

			// WarningsAsErrors

			// WarningsNotAsErrors

		}
开发者ID:Profit0004,项目名称:mono,代码行数:88,代码来源:Vbc.cs

示例13: AddAnalyzersToCommandLine

        /// <summary>
        /// Adds a "/analyzer:" switch to the command line for each provided analyzer.
        /// </summary>
        private void AddAnalyzersToCommandLine(CommandLineBuilderExtension commandLine)
        {
            // If there were no analyzers passed in, don't add any /analyzer: switches
            // on the command-line.
            if ((this.Analyzers == null) || (this.Analyzers.Length == 0))
            {
                return;
            }

            foreach (ITaskItem analyzer in this.Analyzers)
            {
                commandLine.AppendSwitchIfNotNull("/analyzer:", analyzer.ItemSpec);
            }
        }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:17,代码来源:ManagedCompiler.cs

示例14: AddResponseFileCommands

        /// <summary>
        /// Generates response file with arguments for lc.exe
        /// </summary>
        /// <param name="commandLine">command line builder class to add arguments to the response file</param>
        protected internal override void AddResponseFileCommands(CommandLineBuilderExtension commandLine)
        {
            commandLine.AppendSwitchIfNotNull("/target:", LicenseTarget.ItemSpec);

            foreach (ITaskItem item in Sources)
            {
                commandLine.AppendSwitchIfNotNull("/complist:", item.ItemSpec);
            }

            commandLine.AppendSwitchIfNotNull("/outdir:", OutputDirectory);

            if (ReferencedAssemblies != null)
            {
                foreach (ITaskItem item in ReferencedAssemblies)
                {
                    commandLine.AppendSwitchIfNotNull("/i:", item.ItemSpec);
                }
            }

            commandLine.AppendWhenTrue("/nologo", Bag, "NoLogo");

            // generate the output file name
            string outputPath = LicenseTarget.ItemSpec + ".licenses";

            if (OutputDirectory != null)
                outputPath = Path.Combine(OutputDirectory, outputPath);

            OutputLicense = new TaskItem(outputPath);
        }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:33,代码来源:LC.cs

示例15: AddAliasesReference

		static void AddAliasesReference (CommandLineBuilderExtension commandLine, string aliases, string reference)
		{
			foreach (var alias in aliases.Split (',')) {
				var a = alias.Trim ();
				if (a.Length == null)
					continue;

				var r = "/reference:";
				if (!string.Equals (a, "global", StringComparison.OrdinalIgnoreCase))
					r += a + "=";

				commandLine.AppendSwitchIfNotNull (r, reference);
			}
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:14,代码来源:Csc.cs


注:本文中的Microsoft.Build.Tasks.CommandLineBuilderExtension.AppendSwitchIfNotNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。