本文整理汇总了C#中Microsoft.Build.Utilities.CommandLineBuilder.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# CommandLineBuilder.ToString方法的具体用法?C# CommandLineBuilder.ToString怎么用?C# CommandLineBuilder.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.Utilities.CommandLineBuilder
的用法示例。
在下文中一共展示了CommandLineBuilder.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands ()
{
var builder = new CommandLineBuilder ();
builder.AppendSwitch("p");
builder.AppendSwitch("-f");
var resdir = Path.Combine (ProjectDir, "res");
var reszip = Path.Combine (ProjectDir, ProjectName + "-res.zip");
if (Directory.Exists (resdir)) {
builder.AppendSwitch("-S");
builder.AppendFileNameIfNotNull (resdir);
}
builder.AppendSwitch("-F");
builder.AppendFileNameIfNotNull (reszip);
builder.AppendSwitch("-J");
builder.AppendFileNameIfNotNull (ProjectDir);
builder.AppendSwitch ("-M");
builder.AppendFileNameIfNotNull (AndroidManifest);
builder.AppendSwitch ("-I");
builder.AppendFileNameIfNotNull (FrameworkApk);
return builder.ToString ();
}
示例2: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands()
{
// Running command: C:\Program Files (x86)\Java\jdk1.6.0_20\bin\javac.exe
// "-J-Dfile.encoding=UTF8"
// "-d" "bin\classes"
// "-classpath" "C:\Users\Jonathan\Documents\Visual Studio 2010\Projects\AndroidMSBuildTest\AndroidMSBuildTest\obj\Debug\android\bin\mono.android.jar"
// "-bootclasspath" "C:\Program Files (x86)\Android\android-sdk-windows\platforms\android-8\android.jar"
// "-encoding" "UTF-8"
// "@C:\Users\Jonathan\AppData\Local\Temp\tmp79c4ac38.tmp"
//var android_dir = MonoDroid.MonoDroidSdk.GetAndroidProfileDirectory (TargetFrameworkDirectory);
var cmd = new CommandLineBuilder ();
cmd.AppendSwitchIfNotNull ("-J-Dfile.encoding=", "UTF8");
cmd.AppendSwitchIfNotNull ("-d ", ClassesOutputDirectory);
cmd.AppendSwitchIfNotNull ("-classpath ", Jars == null || !Jars.Any () ? null : string.Join (Path.PathSeparator.ToString (), Jars.Select (i => i.ItemSpec)));
cmd.AppendSwitchIfNotNull ("-bootclasspath ", JavaPlatformJarPath);
cmd.AppendSwitchIfNotNull ("-encoding ", "UTF-8");
cmd.AppendFileNameIfNotNull (string.Format ("@{0}", TemporarySourceListFile));
cmd.AppendSwitchIfNotNull ("-target ", JavacTargetVersion);
cmd.AppendSwitchIfNotNull ("-source ", JavacSourceVersion);
return cmd.ToString ();
}
示例3: AppendSwitchSimple
public void AppendSwitchSimple()
{
CommandLineBuilder c = new CommandLineBuilder();
c.AppendSwitch("/a");
c.AppendSwitch("-b");
Assert.Equal("/a -b", c.ToString());
}
示例4: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands()
{
CommandLineBuilder clb = new CommandLineBuilder();
clb.AppendSwitch("describe");
return clb.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()
{
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 ();
}
}
示例7: Parse
public string Parse(ITaskItem taskItem, bool fullOutputName, string outputExtension)
{
CommandLineBuilder builder = new CommandLineBuilder();
foreach (string name in taskItem.MetadataNames)
{
string value = taskItem.GetMetadata(name);
if (outputExtension != null && name == "OutputFile")
{
value = Path.ChangeExtension(value, outputExtension);
}
if (fullOutputName && name == "ObjectFileName")
{
if ((File.GetAttributes(value) & FileAttributes.Directory) != 0)
{
value = Path.Combine(value, Path.GetFileName(taskItem.ItemSpec));
value = Path.ChangeExtension(value, ".obj");
}
}
AppendArgumentForProperty(builder, name, value);
}
string result = builder.ToString();
result = result.Replace('\\', '/'); // posix paths
return result;
}
示例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()
{
CommandLineBuilder builder = new CommandLineBuilder();
builder.AppendSwitchIfNotNull("/config:", ConfigFile);
builder.AppendFileNameIfNotNull(ManifestFile);
return builder.ToString();
}
示例9: 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();
}
示例10: 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 commandLine = new CommandLineBuilder();
GenerateCommand(commandLine);
GenerateArguments(commandLine);
return commandLine.ToString();
}
示例11: 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();
}
示例12: 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()
{
CommandLineBuilder builder = new CommandLineBuilder();
builder.AppendSwitchIfNotNull("/d:", ChmDirectory);
builder.AppendSwitchIfNotNull("/l:", LanguageId ?? "1033");
return builder.ToString();
}
示例13: 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("wait-for-device");
return builder.ToString();
}
示例14: 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();
}
示例15: GenerateCommandLineCommands
protected override string GenerateCommandLineCommands()
{
var builder = new CommandLineBuilder();
builder.AppendSwitch(File);
if (Args != null)
builder.AppendSwitch(Args);
return builder.ToString();
}