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


C# CommandLineBuilder.AppendFileNameIfNotNull方法代码示例

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


在下文中一共展示了CommandLineBuilder.AppendFileNameIfNotNull方法的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 ();
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:28,代码来源:XorptTool.cs

示例2: 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();
        }
开发者ID:jcp-xx,项目名称:dotnetopenid,代码行数:28,代码来源:ReSignDelaySignedAssemblies.cs

示例3: 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("push");
            builder.AppendFileNameIfNotNull(File);
            builder.AppendFileNameIfNotNull(APIKey);
            builder.AppendSwitchIfNotNull("-Source ", Source);
            if (CreateOnly)
                builder.AppendSwitch("-CreateOnly");

            return builder.ToString();
        }
开发者ID:464884492,项目名称:msbuildtasks,代码行数:18,代码来源:NuGetPush.cs

示例4: GenerateCommandLineCommands

        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("delete");

            commandLineBuilder.AppendFileNameIfNotNull(PackageId);

            commandLineBuilder.AppendFileNameIfNotNull(PackageVersion);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-Source", Source);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-ApiKey ", ApiKey);

            commandLineBuilder.AppendSwitchIfTrue("-NoPrompt", NoPrompt);
        }
开发者ID:CommonBuildToolset,项目名称:CBT.Modules,代码行数:14,代码来源:NuGetDelete.cs

示例5: 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("delete");
            builder.AppendFileNameIfNotNull(Package);
            builder.AppendFileNameIfNotNull(Version);
            builder.AppendSwitchIfNotNull("-ApiKey ", ApiKey);
            builder.AppendSwitchIfNotNull("-Source ", Source);
            builder.AppendSwitchIfNotNull("-Verbosity ", Verbosity);
            builder.AppendSwitchIfNotNull("-ConfigFile ", ConfigFile);

            builder.AppendSwitch("-NonInteractive");

            return builder.ToString();
        }
开发者ID:KGuetter,项目名称:msbuildtasks,代码行数:21,代码来源:NuGetDelete.cs

示例6: GenerateCommandLineCommands

        /// <summary>
        /// Construct the command line from the task properties by using the CommandLineBuilder
        /// </summary>
        /// <returns></returns>
        protected override string GenerateCommandLineCommands()
        {
            CommandLineBuilder builder = new CommandLineBuilder();

            foreach(ITaskItem iti in this._sources)
            {
                builder.AppendFileNameIfNotNull(iti);
            }

            if (this._configurationFile != null)
            {
                builder.AppendSwitchIfNotNull("/config:", new string[] {this._configurationFile}, ":");
            }

            if (this._filename != null)
            {
                builder.AppendSwitchIfNotNull("/fileName:", new string[] {this._filename}, ":");
            }

            // Log a High importance message stating the file that we are assembling
            Log.LogMessage(MessageImportance.High, "Assembling {0}", this._sources);

            // We have all of our switches added, return the commandline as a string
            return builder.ToString();
        }
开发者ID:pusp,项目名称:o2platform,代码行数:29,代码来源:LinqToXsdTask.cs

示例7: 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();
        }
开发者ID:SympaOy,项目名称:NuGet.for.MSBuild,代码行数:28,代码来源:Pack.cs

示例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("update");
            builder.AppendFileNameIfNotNull(Package);
            builder.AppendSwitchIfNotNull("-Version ", Version);
            builder.AppendSwitchIfNotNull("-Source ", Source);
            builder.AppendSwitchIfNotNull("-OutputDirectory ", OutputDirectory);
            builder.AppendSwitchIfNotNull("-RepositoryPath ", RepositoryPath);
            builder.AppendSwitchIfNotNull("-OutputDirectory ", OutputDirectory);
            builder.AppendSwitchIfNotNull("-FileConflictAction ", FileConflictAction);
            builder.AppendSwitchIfNotNull("-Verbosity ", Verbosity);
            builder.AppendSwitchIfNotNull("-ConfigFile ", ConfigFile);

            if (Prerelease)
                builder.AppendSwitch("-Prerelease");
            if (Safe)
                builder.AppendSwitch("-Safe");
            if (Self)
                builder.AppendSwitch("-Self");

            builder.AppendSwitch("-NonInteractive");

            return builder.ToString();
        }
开发者ID:KGuetter,项目名称:msbuildtasks,代码行数:31,代码来源:NuGetUpdate.cs

示例9: 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 ();
        }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:27,代码来源:Javac.cs

示例10: 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();
        }
开发者ID:AkechiNEET,项目名称:totalcommander-plugin-donnet,代码行数:25,代码来源:ILDasm.cs

示例11: 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();
 }
开发者ID:464884492,项目名称:msbuildtasks,代码行数:13,代码来源:BuildAssembler.cs

示例12: GenerateCommandLineCommands

        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("setApiKey");

            commandLineBuilder.AppendFileNameIfNotNull(ApiKey);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-Source ", Source);
        }
开发者ID:CommonBuildToolset,项目名称:CBT.Modules,代码行数:8,代码来源:NuGetSetApiKey.cs

示例13: GenerateCommandLineCommands

        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("add");

            commandLineBuilder.AppendFileNameIfNotNull(Package);

            commandLineBuilder.AppendSwitchIfNotNullOrWhiteSpace("-Source ", Source);

            commandLineBuilder.AppendSwitchIfTrue("-Expand", Expand);
        }
开发者ID:CommonBuildToolset,项目名称:CBT.Modules,代码行数:10,代码来源:NuGetAdd.cs

示例14: GenerateCommandLineCommands

		protected override string GenerateCommandLineCommands() {
			var args = new CommandLineBuilder();

			args.AppendSwitch("a");
			args.AppendSwitch("--");

			args.AppendFileNameIfNotNull(this.ZipFileName);

			return args.ToString();
		}
开发者ID:hnlshzx,项目名称:DotNetOpenAuth,代码行数:10,代码来源:AddFilesTo7Zip.cs

示例15: GenerateCommandLineCommands

        protected override void GenerateCommandLineCommands(CommandLineBuilder commandLineBuilder)
        {
            commandLineBuilder.AppendSwitch("config");

            commandLineBuilder.AppendFileNameIfNotNull(Key);

            commandLineBuilder.AppendSwitchIfAny("-Set ", Set);

            commandLineBuilder.AppendSwitchIfTrue("-AsPath", AsPath);
        }
开发者ID:CommonBuildToolset,项目名称:CBT.Modules,代码行数:10,代码来源:NuGetConfig.cs


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