本文整理汇总了C#中Microsoft.Build.Utilities.CommandLineBuilder.AppendSwitch方法的典型用法代码示例。如果您正苦于以下问题:C# CommandLineBuilder.AppendSwitch方法的具体用法?C# CommandLineBuilder.AppendSwitch怎么用?C# CommandLineBuilder.AppendSwitch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.Utilities.CommandLineBuilder
的用法示例。
在下文中一共展示了CommandLineBuilder.AppendSwitch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands()
{
Log.LogDebugMessage ("MDoc");
Log.LogDebugMessage (" RunExport: {0}", RunExport);
Log.LogDebugMessage (" TargetAssembly: {0}", TargetAssembly);
Log.LogDebugMessage (" References");
if (References != null)
foreach (var reference in References)
Log.LogDebugMessage (" {0}", reference);
Log.LogDebugMessage (" OutputDocDirectory: {0}", OutputDocDirectory);
if (RunExport) {
var cmd = new CommandLineBuilder ();
cmd.AppendSwitch ("--debug");
cmd.AppendSwitch ("export-msxdoc");
cmd.AppendSwitchIfNotNull ("-o", Path.ChangeExtension (TargetAssembly, ".xml"));
cmd.AppendSwitch (OutputDocDirectory);
return cmd.ToString ();
} else {
var refPaths = References.Select (Path.GetDirectoryName).Distinct ();
var cmd = new CommandLineBuilder ();
cmd.AppendSwitch ("--debug");
cmd.AppendSwitch ("update");
cmd.AppendSwitch ("--delete");
cmd.AppendSwitchIfNotNull ("-L", Path.GetDirectoryName (TargetAssembly));
foreach (var rp in refPaths)
cmd.AppendSwitchIfNotNull ("-L", rp);
cmd.AppendSwitchIfNotNull ("-o", OutputDocDirectory);
cmd.AppendSwitch (Path.GetFullPath (TargetAssembly));
return cmd.ToString ();
}
}
示例2: GenerateCommandLineCommands
protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
{
if (Source != null)
{
foreach (var item in Source)
{
commandLineBuilder.AppendSwitchIfNotNull("-Source ", item.ItemSpec);
}
}
if (FallbackSource != null)
{
foreach (var item in FallbackSource)
{
commandLineBuilder.AppendSwitchIfNotNull("-FallbackSource ", item.ItemSpec);
}
}
if (NoCache)
{
commandLineBuilder.AppendSwitch("-NoCache");
}
if (DisableParallelProcessing)
{
commandLineBuilder.AppendSwitch("-DisableParallelProcessing");
}
commandLineBuilder.AppendSwitchIfNotNull("-PackageSaveMode ", PackageSaveMode);
}
示例3: GenerateCommandLineCommands
/// <summary>
/// Generates the command line commands.
/// </summary>
protected override string GenerateCommandLineCommands()
{
////if (this.Assemblies.Length != 1) {
//// throw new NotSupportedException("Exactly 1 assembly for signing is supported.");
////}
CommandLineBuilder args = new CommandLineBuilder();
args.AppendSwitch("-q");
if (this.KeyFile != null) {
args.AppendSwitch("-R");
} else if (this.KeyContainer != null) {
args.AppendSwitch("-Rc");
} else {
throw new InvalidOperationException("Either KeyFile or KeyContainer must be set.");
}
args.AppendFileNameIfNotNull(this.Assemblies[0]);
if (this.KeyFile != null) {
args.AppendFileNameIfNotNull(this.KeyFile);
} else {
args.AppendFileNameIfNotNull(this.KeyContainer);
}
return args.ToString();
}
示例4: AppendSwitchSimple
public void AppendSwitchSimple()
{
CommandLineBuilder c = new CommandLineBuilder();
c.AppendSwitch("/a");
c.AppendSwitch("-b");
Assert.Equal("/a -b", c.ToString());
}
示例5: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands()
{
CommandLineBuilder builder = new CommandLineBuilder();
builder.AppendSwitch("pack");
if (!File.Exists(this.Target))
{
throw new FileNotFoundException(string.Format("The file '{0}' could not be found.", this.Target), this.Target);
}
builder.AppendFileNameIfNotNull(this.Target);
builder.AppendSwitchIfTrue("-Symbols", this.Symbols);
builder.AppendSwitchIfTrue("-NoDefaultExcludes", this.NoDefaultExcludes);
builder.AppendSwitchIfTrue("-NoPackageAnalysis", this.NoPackageAnalysis);
builder.AppendSwitchIfTrue("-ExcludeEmptyDirectories", this.ExcludeEmptyDirectories);
builder.AppendSwitchIfTrue("-IncludeReferencedProjects", this.IncludeReferencedProjects);
builder.AppendSwitchIfNotNull("-Version ", this.Version);
builder.AppendSwitchIfNotNull("-Properties ", this.Properties, ";");
builder.AppendSwitchIfNotNull("-Exclude ", this.Excluded, ";");
builder.AppendSwitchIfNotNull("-MinClientVersion ", this.MinClientVersion);
builder.AppendSwitchIfNotNull("-BasePath ", this.BasePath);
builder.AppendSwitchIfNotNull("-OutputDirectory ", this.OutputDirectory);
builder.AppendSwitchIfNotNull("-Verbosity ", this.Verbosity);
builder.AppendSwitch("-NonInteractive ");
builder.AppendTextUnquotedIfNotNullOrEmpty(this.CustomSwitches);
return builder.ToString();
}
示例6: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands()
{
var builder = new CommandLineBuilder();
builder.AppendFileNameIfNotNull(Source);
if (Source != null)
{
OutputRes = Path.ChangeExtension(OutputIL, ".res");
}
builder.AppendSwitch("/nobar");
builder.AppendSwitchIfNotNull("/output=", OutputIL);
if (Encoding == null || Encoding.StartsWith("uni", StringComparison.InvariantCultureIgnoreCase))
{
builder.AppendSwitch("/unicode");
}
if (Encoding != null && Encoding.StartsWith("utf", StringComparison.InvariantCultureIgnoreCase))
{
builder.AppendSwitch("/utf8");
}
builder.AppendSwitchIfNotNull("/item:", Item);
Log.LogMessage(MessageImportance.High, "Disassembling {0}...", Source);
return builder.ToString();
}
示例7: GenerateArguments
/// <summary>
/// Generates the arguments.
/// </summary>
/// <param name="builder">The builder.</param>
protected override void GenerateArguments(CommandLineBuilder builder)
{
builder.AppendSwitch("--count");
base.GenerateArguments(builder);
builder.AppendSwitch(Revision);
}
示例8: GenerateCommandLineCommands
/// <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();
builder.AppendSwitch("uninstall");
builder.AppendSwitch(PackageName);
return builder.ToString();
}
示例9: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands() {
var args = new CommandLineBuilder();
args.AppendSwitch("a");
args.AppendSwitch("--");
args.AppendFileNameIfNotNull(this.ZipFileName);
return args.ToString();
}
示例10: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands()
{
var builder = new CommandLineBuilder();
builder.AppendSwitch(File);
if (Args != null)
builder.AppendSwitch(Args);
return builder.ToString();
}
示例11: GenerateArguments
/// <summary>
/// Generates the arguments.
/// </summary>
/// <param name="builder">The builder.</param>
protected override void GenerateArguments(CommandLineBuilder builder)
{
builder.AppendSwitch("--verify");
if (Short)
builder.AppendSwitch("--short");
base.GenerateArguments(builder);
builder.AppendSwitch(Revision);
}
示例12: GenerateCommandLineCommands
/// <summary>
/// Generates the command line commands.
/// </summary>
protected override string GenerateCommandLineCommands() {
CommandLineBuilder builder = new CommandLineBuilder();
builder.AppendSwitch("-q");
if (this.SkipVerification) {
builder.AppendSwitch("-Vr");
} else {
builder.AppendSwitch("-Vu");
}
builder.AppendFileNameIfNotNull(this.AssemblyName + "," + this.PublicKeyToken);
return builder.ToString();
}
示例13: GenerateCommandLineCommands
/// <summary>See <see cref="ToolTask.GenerateCommandLineCommands"/>.</summary>
protected override string GenerateCommandLineCommands()
{
CommandLineBuilder commandLineBuilder = new CommandLineBuilder();
commandLineBuilder.AppendSwitchIfNotNull(this.Uninstall ? "uninstall " : "install ", this.AssemblyName);
if (this.NoDependencies)
{
commandLineBuilder.AppendSwitch("/NoDependencies");
}
commandLineBuilder.AppendSwitch("/nologo");
commandLineBuilder.AppendSwitch("/verbose");
return commandLineBuilder.ToString();
}
示例14: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands()
{
CommandLineBuilder cb = new CommandLineBuilder();
//cb.AppendSwitch("-q");
cb.AppendSwitch("-nologo");
cb.AppendSwitch("--");
cb.AppendFileNamesIfNotNull(Sources, " ");
return cb.ToString();
}
示例15: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands()
{
CommandLineBuilder builder = new CommandLineBuilder();
builder.AppendSwitch("spec");
builder.AppendSwitchIfNotNull("-AssemblyPath ", this.AssemblyPath);
builder.AppendSwitchIfNotNull("-Verbosity ", this.Verbosity);
builder.AppendSwitchIfTrue("-Force", this.Force);
builder.AppendSwitch("-NonInteractive");
return builder.ToString();
}