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


C# CommandLineBuilderExtension.AppendSwitchUnquotedIfNotNull方法代码示例

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


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

示例1: AddResponseFileCommands

 protected internal override void AddResponseFileCommands(CommandLineBuilderExtension commandLine)
 {
     commandLine.AppendSwitchIfNotNull("/lib:", base.AdditionalLibPaths, ",");
     commandLine.AppendPlusOrMinusSwitch("/unsafe", base.Bag, "AllowUnsafeBlocks");
     commandLine.AppendPlusOrMinusSwitch("/checked", base.Bag, "CheckForOverflowUnderflow");
     commandLine.AppendSwitchWithSplitting("/nowarn:", this.DisabledWarnings, ",", new char[] { ';', ',' });
     commandLine.AppendWhenTrue("/fullpaths", base.Bag, "GenerateFullPaths");
     commandLine.AppendSwitchIfNotNull("/langversion:", this.LangVersion);
     commandLine.AppendSwitchIfNotNull("/moduleassemblyname:", this.ModuleAssemblyName);
     commandLine.AppendSwitchIfNotNull("/pdb:", this.PdbFile);
     commandLine.AppendPlusOrMinusSwitch("/nostdlib", base.Bag, "NoStandardLib");
     commandLine.AppendSwitchIfNotNull("/platform:", this.Platform);
     commandLine.AppendSwitchIfNotNull("/errorreport:", this.ErrorReport);
     commandLine.AppendSwitchWithInteger("/warn:", base.Bag, "WarningLevel");
     commandLine.AppendSwitchIfNotNull("/doc:", this.DocumentationFile);
     commandLine.AppendSwitchIfNotNull("/baseaddress:", this.BaseAddress);
     commandLine.AppendSwitchUnquotedIfNotNull("/define:", this.GetDefineConstantsSwitch(base.DefineConstants));
     commandLine.AppendSwitchIfNotNull("/win32res:", base.Win32Resource);
     commandLine.AppendSwitchIfNotNull("/main:", base.MainEntryPoint);
     commandLine.AppendSwitchIfNotNull("/appconfig:", this.ApplicationConfiguration);
     this.AddReferencesToCommandLine(commandLine);
     base.AddResponseFileCommands(commandLine);
     commandLine.AppendSwitchWithSplitting("/warnaserror+:", this.WarningsAsErrors, ",", new char[] { ';', ',' });
     commandLine.AppendSwitchWithSplitting("/warnaserror-:", this.WarningsNotAsErrors, ",", new char[] { ';', ',' });
     if (base.ResponseFiles != null)
     {
         foreach (ITaskItem item in base.ResponseFiles)
         {
             commandLine.AppendSwitchIfNotNull("@", item.ItemSpec);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:Csc.cs

示例2: 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

示例3: AddResponseFileCommands


//.........这里部分代码省略.........
            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))
                   )
                )
            {
                commandLine.AppendSwitchIfNotNull("/", this.Verbosity);
            }

            commandLine.AppendSwitchIfNotNull("/doc:", this.DocumentationFile);
            commandLine.AppendSwitchUnquotedIfNotNull("/define:", Vbc.GetDefineConstantsSwitch(this.DefineConstants));
            AddReferencesToCommandLine(commandLine);
            commandLine.AppendSwitchIfNotNull("/win32resource:", this.Win32Resource);

            // Special case for "Sub Main"
            if (0 != String.Compare("Sub Main", this.MainEntryPoint, StringComparison.OrdinalIgnoreCase))
            {
                commandLine.AppendSwitchIfNotNull("/main:", this.MainEntryPoint);
            }

            base.AddResponseFileCommands(commandLine);

            // This should come after the "TreatWarningsAsErrors" flag is processed (in managedcompiler.cs).
            // Because if TreatWarningsAsErrors=false, then we'll have a /warnaserror- on the command-line,
            // and then any specific warnings that should be treated as errors should be specified with
            // /warnaserror+:<list> after the /warnaserror- switch.  The order of the switches on the command-line
            // does matter.
            //
            // Note that
            //      /warnaserror+
            // is just shorthand for:
            //      /warnaserror+:<all possible warnings>
            //
            // Similarly,
            //      /warnaserror-
            // is just shorthand for:
            //      /warnaserror-:<all possible warnings>
            commandLine.AppendSwitchWithSplitting("/warnaserror+:", this.WarningsAsErrors, ",", ';', ',');
            commandLine.AppendSwitchWithSplitting("/warnaserror-:", this.WarningsNotAsErrors, ",", ';', ',');

            // If not design time build and the globalSessionGuid property was set then add a -globalsessionguid:<guid>
            bool designTime = false;
            if (this.HostObject != null)
            {
                var vbHost = this.HostObject as IVbcHostObject;
                designTime = vbHost.IsDesignTime();
            }
            if (!designTime)
            {
                if (!string.IsNullOrWhiteSpace(this.VsSessionGuid))
                {
                    commandLine.AppendSwitchIfNotNull("/sqmsessionguid:", this.VsSessionGuid);
                }
            }

            // It's a good idea for the response file to be the very last switch passed, just 
            // from a predictability perspective.
            if (this.ResponseFiles != null)
            {
                foreach (ITaskItem response in this.ResponseFiles)
                {
                    commandLine.AppendSwitchIfNotNull("@", response.ItemSpec);
                }
            }
        }
开发者ID:ChronosWS,项目名称:msbuild,代码行数:101,代码来源:Vbc.cs

示例4: AddResponseFileCommands

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

			if (AdditionalLibPaths != null && AdditionalLibPaths.Length > 0)
				commandLine.AppendSwitchIfNotNull ("/lib:", AdditionalLibPaths, ",");

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

			//baseAddress
			
			if (Bag ["CheckForOverflowUnderflow"] != null)
				if (CheckForOverflowUnderflow)
					commandLine.AppendSwitch ("/checked+");
				else
					commandLine.AppendSwitch ("/checked-");

			if (!String.IsNullOrEmpty (DefineConstants)) {
				string [] defines = DefineConstants.Split (new char [] {';', ' '},
						StringSplitOptions.RemoveEmptyEntries);
				if (defines.Length > 0)
					commandLine.AppendSwitchUnquotedIfNotNull ("/define:",
							String.Join (";", defines));
			}

			commandLine.AppendSwitchIfNotNull ("/nowarn:", DisabledWarnings);

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

			//errorReport

			if (GenerateFullPaths)
				commandLine.AppendSwitch ("/fullpaths");

			commandLine.AppendSwitchIfNotNull ("/langversion:", LangVersion);

			commandLine.AppendSwitchIfNotNull ("/main:", MainEntryPoint);

			//moduleAssemblyName
			
			if (NoStandardLib)
				commandLine.AppendSwitch ("/nostdlib");

			//platform
			//
			if (References != null)
				foreach (ITaskItem item in References)
					commandLine.AppendSwitchIfNotNull ("/reference:", item.ItemSpec);

			if (ResponseFiles != null)
				foreach (ITaskItem item in ResponseFiles) 
					commandLine.AppendSwitchIfNotNull ("@", item.ItemSpec);

			if (Bag ["WarningLevel"] != null)
				commandLine.AppendSwitchIfNotNull ("/warn:", WarningLevel.ToString ());

			commandLine.AppendSwitchIfNotNull ("/warnaserror+:", WarningsAsErrors);

			commandLine.AppendSwitchIfNotNull ("/warnaserror-:", WarningsNotAsErrors);

			if (Win32Resource != null)
				commandLine.AppendSwitchIfNotNull ("/win32res:", Win32Resource);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:67,代码来源:Csc.cs

示例5: AddResponseFileCommandsImpl

        protected void AddResponseFileCommandsImpl(CommandLineBuilderExtension commandLine)
        {
            if (OutputAssembly == null && Sources != null && Sources.Length > 0 && ResponseFiles == null)
            {
                try
                {
                    OutputAssembly = new TaskItem(Path.GetFileNameWithoutExtension(Sources[0].ItemSpec));
                }
                catch (ArgumentException exception)
                {
                    throw new ArgumentException(exception.Message, "Sources", exception);
                }

                var outputAssembly = OutputAssembly;
                switch (TargetType.ToLowerInvariant())
                {
                    case "library":
                        outputAssembly.ItemSpec = outputAssembly.ItemSpec + ".dll";
                        break;

                    case "module":
                        outputAssembly.ItemSpec = outputAssembly.ItemSpec + ".netmodule";
                        break;

                    default:
                        outputAssembly.ItemSpec = outputAssembly.ItemSpec + ".exe";
                        break;
                }
            }

            // Don't call base.AddResponseFileCommands()!
            //base.AddResponseFileCommands(commandLine);

            //System.Diagnostics.Debug.Assert(false);
            if (RunDebugger)
                commandLine.AppendSwitch("\n/debugger");
            if (Optimize)
                commandLine.AppendSwitch("\n/optimize");
            commandLine.AppendPlusOrMinusSwitch("\n/checked", base.Bag, "CheckIntegerOverflow");

            commandLine.AppendSwitch("\n/no-color");
            commandLine.AppendSwitchIfNotNull("\n/lib:", base.AdditionalLibPaths, ",");
            commandLine.AppendSwitchIfNotNull("\n/nowarn:", this.DisabledWarnings, ",");
            commandLine.AppendSwitchIfNotNull("\n/dowarn:", this.EnabledWarnings, ",");
            if (NoStdLib)
                commandLine.AppendSwitch("\n/no-stdlib");
            if (NoStdMacros)
                commandLine.AppendSwitch("\n/no-stdmacros");
            if (!GreedyReferences)
                commandLine.AppendSwitch("\n/greedy-references:-");
            if (WarningLevel != 4)
                commandLine.AppendSwitchIfNotNull("\n/warn:", this.WarningLevel.ToString());
            if (IndentationSyntax)
                commandLine.AppendSwitch("\n/indentation-syntax");
            commandLine.AppendSwitchIfNotNull("\n/doc:", this.DocumentationFile);
            if (!string.IsNullOrEmpty(base.DefineConstants))
            {
                var defines = base.DefineConstants
                    .Split(new char[] { ';', ' ', '\r', '\n', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                commandLine.AppendSwitchUnquotedIfNotNull("\n/define:", String.Join(";", defines));
            }
            commandLine.AppendSwitchIfNotNull("\n/win32res:", base.Win32Resource);
            commandLine.AppendSwitchIfNotNull("\n/platform:", this.Platform);

            // Switchs from base.AddResponseFileCommands()
            commandLine.AppendSwitchIfNotNull("\n/addmodule:", this.AddModules, ",");
            commandLine.AppendPlusOrMinusSwitch("\n/delaysign", base.Bag, "DelaySign");
            commandLine.AppendSwitchIfNotNull("\n/keycontainer:", this.KeyContainer);
            commandLine.AppendSwitchIfNotNull("\n/keyfile:", this.KeyFile);
            commandLine.AppendSwitchIfNotNull("\n/linkresource:", this.LinkResources, new[] { "LogicalName", "Access" });
            if (NoLogo)
                commandLine.AppendSwitch("\n/nologo");
            commandLine.AppendSwitchIfNotNull("\n/resource:", this.Resources, new[] { "LogicalName", "Access" });
            commandLine.AppendSwitchIfNotNull("\n/target:", this.TargetType);
            commandLine.AppendPlusOrMinusSwitch("\n/warnaserror", base.Bag, "TreatWarningsAsErrors");
            commandLine.AppendSwitchIfNotNull("\n/win32icon:", this.Win32Icon);
            commandLine.AppendPlusOrMinusSwitch("\n/debug", base.Bag, "EmitDebugInformation");
            commandLine.AppendSwitchIfNotNull("\n/project-path:", this.ProjectPath);
            commandLine.AppendSwitchIfNotNull("\n/root-namespace:", this.RootNamespace);
            commandLine.AppendSwitchIfNotNull("\n/main:", this.MainEntryPoint);
            if (CompilerStackSize > 0)
                commandLine.AppendSwitchIfNotNull("\n/stack-size:", this.CompilerStackSize.ToString());

            // Not supported options:
            //commandLine.AppendSwitchWithInteger("\n/codepage:", base.Bag, "CodePage");
            //commandLine.AppendSwitchIfNotNull("/debug:", this.DebugType);
            //commandLine.AppendSwitchWithInteger("\n/filealign:", base.Bag, "FileAlignment");
            //commandLine.AppendWhenTrue("\n/utf8output", base.Bag, "Utf8Output");

            // Add sources
            if (this.Sources != null)
            {
                commandLine.Append("\n\n");
                commandLine.AppendFileNamesIfNotNull(this.Sources, "\n");
                commandLine.Append("\n");
            }

            if (null != base.ResponseFiles)
            {
                foreach (var it in base.ResponseFiles)
//.........这里部分代码省略.........
开发者ID:Stitchous,项目名称:nemerle,代码行数:101,代码来源:MSBuildTask.cs

示例6: AddResponseFileCommands

 protected internal override void AddResponseFileCommands(CommandLineBuilderExtension commandLine)
 {
     commandLine.AppendSwitchIfNotNull("/baseaddress:", this.GetBaseAddressInHex());
     commandLine.AppendSwitchIfNotNull("/libpath:", base.AdditionalLibPaths, ",");
     commandLine.AppendSwitchIfNotNull("/imports:", this.Imports, ",");
     commandLine.AppendPlusOrMinusSwitch("/doc", base.Bag, "GenerateDocumentation");
     commandLine.AppendSwitchIfNotNull("/optioncompare:", this.OptionCompare);
     commandLine.AppendPlusOrMinusSwitch("/optionexplicit", base.Bag, "OptionExplicit");
     object obj2 = base.Bag["OptionStrict"];
     if ((obj2 != null) ? ((bool) obj2) : false)
     {
         commandLine.AppendSwitch("/optionstrict+");
     }
     else
     {
         commandLine.AppendSwitch("/optionstrict:custom");
     }
     commandLine.AppendSwitchIfNotNull("/optionstrict:", this.OptionStrictType);
     commandLine.AppendWhenTrue("/nowarn", base.Bag, "NoWarnings");
     commandLine.AppendSwitchWithSplitting("/nowarn:", this.DisabledWarnings, ",", new char[] { ';', ',' });
     commandLine.AppendPlusOrMinusSwitch("/optioninfer", base.Bag, "OptionInfer");
     commandLine.AppendWhenTrue("/nostdlib", base.Bag, "NoStandardLib");
     commandLine.AppendWhenTrue("/novbruntimeref", base.Bag, "NoVBRuntimeReference");
     commandLine.AppendSwitchIfNotNull("/errorreport:", this.ErrorReport);
     commandLine.AppendSwitchIfNotNull("/platform:", this.Platform);
     commandLine.AppendPlusOrMinusSwitch("/removeintchecks", base.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", base.Bag, "TargetCompactFramework");
     if (this.VBRuntime != null)
     {
         string vBRuntime = this.VBRuntime;
         if (string.Compare(vBRuntime, "EMBED", StringComparison.OrdinalIgnoreCase) == 0)
         {
             commandLine.AppendSwitch("/vbruntime*");
         }
         else if (string.Compare(vBRuntime, "NONE", StringComparison.OrdinalIgnoreCase) == 0)
         {
             commandLine.AppendSwitch("/vbruntime-");
         }
         else if (string.Compare(vBRuntime, "DEFAULT", StringComparison.OrdinalIgnoreCase) == 0)
         {
             commandLine.AppendSwitch("/vbruntime+");
         }
         else
         {
             commandLine.AppendSwitchIfNotNull("/vbruntime:", vBRuntime);
         }
     }
     if ((this.Verbosity != null) && ((string.Compare(this.Verbosity, "quiet", StringComparison.OrdinalIgnoreCase) == 0) || (string.Compare(this.Verbosity, "verbose", StringComparison.OrdinalIgnoreCase) == 0)))
     {
         commandLine.AppendSwitchIfNotNull("/", this.Verbosity);
     }
     commandLine.AppendSwitchIfNotNull("/doc:", this.DocumentationFile);
     commandLine.AppendSwitchUnquotedIfNotNull("/define:", GetDefineConstantsSwitch(base.DefineConstants));
     this.AddReferencesToCommandLine(commandLine);
     commandLine.AppendSwitchIfNotNull("/win32resource:", base.Win32Resource);
     if (string.Compare("Sub Main", base.MainEntryPoint, StringComparison.OrdinalIgnoreCase) != 0)
     {
         commandLine.AppendSwitchIfNotNull("/main:", base.MainEntryPoint);
     }
     base.AddResponseFileCommands(commandLine);
     commandLine.AppendSwitchWithSplitting("/warnaserror+:", this.WarningsAsErrors, ",", new char[] { ';', ',' });
     commandLine.AppendSwitchWithSplitting("/warnaserror-:", this.WarningsNotAsErrors, ",", new char[] { ';', ',' });
     if (base.ResponseFiles != null)
     {
         foreach (ITaskItem item in base.ResponseFiles)
         {
             commandLine.AppendSwitchIfNotNull("@", item.ItemSpec);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:74,代码来源:Vbc.cs

示例7: AddResponseFileCommands

        /// <summary>
        /// Fills the provided CommandLineBuilderExtension with those switches and other information that can go into a response file.
        /// </summary>
        override protected internal void AddResponseFileCommands(CommandLineBuilderExtension commandLine)
        {
            commandLine.AppendSwitchIfNotNull("/lib:", this.AdditionalLibPaths, ",");
            commandLine.AppendPlusOrMinusSwitch("/unsafe", this.Bag, "AllowUnsafeBlocks");
            commandLine.AppendPlusOrMinusSwitch("/checked", this.Bag, "CheckForOverflowUnderflow");
            commandLine.AppendSwitchWithSplitting("/nowarn:", this.DisabledWarnings, ",", ';', ',');
            commandLine.AppendWhenTrue("/fullpaths", this.Bag, "GenerateFullPaths");
            commandLine.AppendSwitchIfNotNull("/langversion:", this.LangVersion);
            commandLine.AppendSwitchIfNotNull("/moduleassemblyname:", this.ModuleAssemblyName);
            commandLine.AppendSwitchIfNotNull("/pdb:", this.PdbFile);
            commandLine.AppendPlusOrMinusSwitch("/nostdlib", this.Bag, "NoStandardLib");
            commandLine.AppendSwitchIfNotNull("/platform:", this.PlatformWith32BitPreference);
            commandLine.AppendSwitchIfNotNull("/errorreport:", this.ErrorReport);
            commandLine.AppendSwitchWithInteger("/warn:", this.Bag, "WarningLevel");
            commandLine.AppendSwitchIfNotNull("/doc:", this.DocumentationFile);
            commandLine.AppendSwitchIfNotNull("/baseaddress:", this.BaseAddress);
            commandLine.AppendSwitchUnquotedIfNotNull("/define:", this.GetDefineConstantsSwitch(this.DefineConstants));
            commandLine.AppendSwitchIfNotNull("/win32res:", this.Win32Resource);
            commandLine.AppendSwitchIfNotNull("/main:", this.MainEntryPoint);
            commandLine.AppendSwitchIfNotNull("/appconfig:", this.ApplicationConfiguration);
            commandLine.AppendWhenTrue("/errorendlocation", this.Bag, "ErrorEndLocation");
            commandLine.AppendSwitchIfNotNull("/preferreduilang:", this.PreferredUILang);
            commandLine.AppendPlusOrMinusSwitch("/highentropyva", this.Bag, "HighEntropyVA");

            // If not design time build and the globalSessionGuid property was set then add a -globalsessionguid:<guid>
            bool designTime = false;
            if (this.HostObject != null)
            {
                var csHost = this.HostObject as ICscHostObject;
                designTime = csHost.IsDesignTime();
            }
            if (!designTime)
            {
                if (!string.IsNullOrWhiteSpace(this.VsSessionGuid))
                {
                    commandLine.AppendSwitchIfNotNull("/sqmsessionguid:", this.VsSessionGuid);
                }
            }

            this.AddReferencesToCommandLine(commandLine);

            base.AddResponseFileCommands(commandLine);

            // This should come after the "TreatWarningsAsErrors" flag is processed (in managedcompiler.cs).
            // Because if TreatWarningsAsErrors=false, then we'll have a /warnaserror- on the command-line,
            // and then any specific warnings that should be treated as errors should be specified with
            // /warnaserror+:<list> after the /warnaserror- switch.  The order of the switches on the command-line
            // does matter.
            //
            // Note that
            //      /warnaserror+
            // is just shorthand for:
            //      /warnaserror+:<all possible warnings>
            //
            // Similarly,
            //      /warnaserror-
            // is just shorthand for:
            //      /warnaserror-:<all possible warnings>
            commandLine.AppendSwitchWithSplitting("/warnaserror+:", this.WarningsAsErrors, ",", ';', ',');
            commandLine.AppendSwitchWithSplitting("/warnaserror-:", this.WarningsNotAsErrors, ",", ';', ',');

            // It's a good idea for the response file to be the very last switch passed, just 
            // from a predictability perspective.
            if (this.ResponseFiles != null)
            {
                foreach (ITaskItem response in this.ResponseFiles)
                {
                    commandLine.AppendSwitchIfNotNull("@", response.ItemSpec);
                }
            }
        }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:74,代码来源:Csc.cs

示例8: AddResponseFileCommands

        protected override void AddResponseFileCommands(CommandLineBuilderExtension commandLine)
        {
            if (OutputGeneratedFile != null && !String.IsNullOrEmpty(OutputGeneratedFile.ItemSpec))
                commandLine.AppendSwitchIfNotNull("/outputgeneratedfile:", OutputGeneratedFile);
            commandLine.AppendSwitchUnquotedIfNotNull("/define:", this.GetDefineConstantsSwitch(base.DefineConstants));
            this.AddReferencesToCommandLine(commandLine);
            base.AddResponseFileCommands(commandLine);
            if (ResponseFiles != null)
            {
                foreach (ITaskItem item in ResponseFiles)
                {
                    commandLine.AppendSwitchIfNotNull("@", item.ItemSpec);
                }
            }
            if (ContentFiles != null)
            {
                foreach (var file in ContentFiles)
                {
                    commandLine.AppendSwitchIfNotNull("/contentfile:", file.ItemSpec);
                }
            }
            if (NoneFiles != null)
            {
                foreach (var file in NoneFiles)
                {
                    commandLine.AppendSwitchIfNotNull("/nonefile:", file.ItemSpec);
                }
            }
            if (SkcPlugins != null)
            {
                foreach (var file in SkcPlugins)
                {
                    commandLine.AppendSwitchIfNotNull("/plugin:", file.ItemSpec);
                }
            }
            if (SkcRebuild)
                commandLine.AppendSwitch("/rebuild");
            if (UseBuildService)
            {
                Log.LogMessage("CurrentDirectory is: " + Directory.GetCurrentDirectory());
                commandLine.AppendSwitchIfNotNull("/dir:", Directory.GetCurrentDirectory());
            }

            commandLine.AppendSwitchIfNotNull("/TargetFrameworkVersion:", TargetFrameworkVersion);
        }
开发者ID:benbon,项目名称:SharpKit,代码行数:45,代码来源:Skc.cs


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