• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AutomationTool.CommandEnvironment类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AutomationTool.CommandEnvironment的典型用法代码示例。如果您正苦于以下问题:C# CommandEnvironment类的具体用法?C# CommandEnvironment怎么用?C# CommandEnvironment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CommandEnvironment类属于AutomationTool命名空间,在下文中一共展示了CommandEnvironment类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RunUBT

        /// <summary>
        /// Runs UBT with the specified commandline. Automatically creates a logfile. When 
        /// no LogName is specified, the executable name is used as logfile base name.
        /// </summary>
        /// <param name="Env">Environment to use.</param>
        /// <param name="CommandLine">Commandline to pass on to UBT.</param>
        /// <param name="LogName">Optional logfile name.</param>
        public static void RunUBT(CommandEnvironment Env, string UBTExecutable, string CommandLine, string LogName = null, Dictionary<string, string> EnvVars = null)
        {
            if (!FileExists(UBTExecutable))
            {
                throw new AutomationException("Unable to find UBT executable: " + UBTExecutable);
            }

            if (GlobalCommandLine.Rocket)
            {
                CommandLine += " -rocket";
            }
            if (!IsBuildMachine && UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealBuildTool.UnrealTargetPlatform.Mac)
            {
                CommandLine += " -nocreatestub";
            }
            CommandLine += " -NoHotReloadFromIDE";
            if (bJunkDeleted || GlobalCommandLine.IgnoreJunk)
            {
                // UBT has already deleted junk files, make sure it doesn't do it again
                CommandLine += " -ignorejunk";
            }
            else
            {
                // UBT will delete junk on first run
                bJunkDeleted = true;
            }

            CommandUtils.RunAndLog(Env, UBTExecutable, CommandLine, LogName, EnvVars: EnvVars);
        }
开发者ID:colwalder,项目名称:unrealengine,代码行数:36,代码来源:UBTUtils.cs


示例2: InitEnvironment

		protected virtual void InitEnvironment(P4Connection Connection, CommandEnvironment CmdEnv)
		{
			//
			// P4 Environment
			//

			P4Port = CommandUtils.GetEnvVar(EnvVarNames.P4Port);
			ClientRoot = CommandUtils.GetEnvVar(EnvVarNames.ClientRoot);
			User = CommandUtils.GetEnvVar(EnvVarNames.User);
			ChangelistStringInternal = CommandUtils.GetEnvVar(EnvVarNames.Changelist, null);
			Client = CommandUtils.GetEnvVar(EnvVarNames.Client);
			BuildRootP4 = CommandUtils.GetEnvVar(EnvVarNames.BuildRootP4);
			if (BuildRootP4.EndsWith("/", StringComparison.InvariantCultureIgnoreCase) || BuildRootP4.EndsWith("\\", StringComparison.InvariantCultureIgnoreCase))
			{
				// We expect the build root to not end with a path separator
				BuildRootP4 = BuildRootP4.Substring(0, BuildRootP4.Length - 1);
				CommandUtils.SetEnvVar(EnvVarNames.BuildRootP4, BuildRootP4);
			}
			BuildRootEscaped = CommandUtils.GetEnvVar(EnvVarNames.BuildRootEscaped);
			LabelToSync = CommandUtils.GetEnvVar(EnvVarNames.LabelToSync);

			string CodeChangelistString = CommandUtils.GetEnvVar(EnvVarNames.CodeChangelist);
			if(!String.IsNullOrEmpty(CodeChangelistString))
			{
				CodeChangelist = Int32.Parse(CodeChangelistString);
			}

			if (((CommandUtils.P4Enabled || CommandUtils.IsBuildMachine) && (ClientRoot == String.Empty || User == String.Empty ||
				(String.IsNullOrEmpty(ChangelistStringInternal) && CommandUtils.IsBuildMachine) || Client == String.Empty || BuildRootP4 == String.Empty)))
			{
                Log.TraceInformation("P4Enabled={0}", CommandUtils.P4Enabled);
                Log.TraceInformation("ClientRoot={0}",ClientRoot );
                Log.TraceInformation("User={0}", User);
                Log.TraceInformation("ChangelistString={0}", ChangelistStringInternal);
                Log.TraceInformation("Client={0}", Client);
                Log.TraceInformation("BuildRootP4={0}", BuildRootP4);

				throw new AutomationException("BUILD FAILED Perforce Environment is not set up correctly. Please check your environment variables.");
			}

			LabelPrefix = BuildRootP4 + "/";

			if (CommandUtils.P4Enabled)
			{
				if (CommandUtils.IsBuildMachine || ChangelistStringInternal != null)
				{
					// We may not always need the changelist number if we're not a build machine.
					// In local runs, changelist initialization can be really slow!
					VerifyChangelistStringAndSetChangelistNumber();
				}
			}

			LogSettings();
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:54,代码来源:P4Environment.cs


示例3: RunUBT

        /// <summary>
        /// Runs UBT with the specified commandline. Automatically creates a logfile. When 
        /// no LogName is specified, the executable name is used as logfile base name.
        /// </summary>
        /// <param name="Env">Environment to use.</param>
        /// <param name="CommandLine">Commandline to pass on to UBT.</param>
        /// <param name="LogName">Optional logfile name.</param>
        public static void RunUBT(CommandEnvironment Env, string UBTExecutable, string CommandLine, string LogName = null)
        {
            if (!FileExists(UBTExecutable))
            {
                throw new AutomationException("Unable to find UBT executable: " + UBTExecutable);
            }

            if (GlobalCommandLine.Rocket)
            {
                CommandLine += " -rocket";
            }
            CommandUtils.RunAndLog(Env, UBTExecutable, CommandLine, LogName);
        }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:20,代码来源:UBTUtils.cs


示例4: BuildSolution

		/// <summary>
		/// Builds a Visual Studio solution with MsDevEnv. Automatically creates a logfile. When 
		/// no LogName is specified, the executable name is used as logfile base name.
		/// </summary>
		/// <param name="Env">BuildEnvironment to use.</param>
		/// <param name="SolutionFile">Path to the solution file</param>
		/// <param name="BuildConfig">Configuration to build.</param>
		/// <param name="LogName">Optional logfile name.</param>
		public static void BuildSolution(CommandEnvironment Env, string SolutionFile, string BuildConfig = "Development", string LogName = null)
		{
			if (!FileExists(SolutionFile))
			{
				throw new AutomationException(String.Format("Unabled to build Solution {0}. Solution file not found.", SolutionFile));
			}
			if (String.IsNullOrEmpty(Env.MsDevExe))
			{
				throw new AutomationException(String.Format("Unabled to build Solution {0}. devenv.com not found.", SolutionFile));
			}
			string CmdLine = String.Format("\"{0}\" /build \"{1}\"", SolutionFile, BuildConfig);
			RunAndLog(Env, Env.MsDevExe, CmdLine, LogName);
		}
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:21,代码来源:BuildUtils.cs


示例5: BuildCSharpProject

		/// <summary>
		/// Builds a CSharp project with msbuild.exe. Automatically creates a logfile. When 
		/// no LogName is specified, the executable name is used as logfile base name.
		/// </summary>
		/// <param name="Env">BuildEnvironment to use.</param>
		/// <param name="ProjectFile">Path to the project file. Must be a .csproj file.</param>
		/// <param name="BuildConfig">Configuration to build.</param>
		/// <param name="LogName">Optional logfile name.</param>
		public static void BuildCSharpProject(CommandEnvironment Env, string ProjectFile, string BuildConfig = "Development", string LogName = null)
		{
			if (!ProjectFile.EndsWith(".csproj"))
			{
				throw new AutomationException(String.Format("Unabled to build Project {0}. Not a valid .csproj file.", ProjectFile));
			}
			if (!FileExists(ProjectFile))
			{
				throw new AutomationException(String.Format("Unabled to build Project {0}. Project file not found.", ProjectFile));
			}

			string CmdLine = String.Format(@"/verbosity:normal /target:Rebuild /property:Configuration={0} /property:Platform=AnyCPU", BuildConfig);
			MsBuild(Env, ProjectFile, CmdLine, LogName);
		}
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:22,代码来源:BuildUtils.cs


示例6: BuildSolution

 /// <summary>
 /// Builds a Visual Studio solution with MsDevEnv. Automatically creates a logfile. When 
 /// no LogName is specified, the executable name is used as logfile base name.
 /// </summary>
 /// <param name="Env">BuildEnvironment to use.</param>
 /// <param name="SolutionFile">Path to the solution file</param>
 /// <param name="BuildConfig">Configuration to build.</param>
 /// <param name="LogName">Optional logfile name.</param>
 public static void BuildSolution(CommandEnvironment Env, string SolutionFile, string BuildConfig = "Development", string LogName = null)
 {
     if (!FileExists(SolutionFile))
     {
         throw new AutomationException(String.Format("Unabled to build Solution {0}. Solution file not found.", SolutionFile));
     }
     if (String.IsNullOrEmpty(Env.MsDevExe))
     {
         throw new AutomationException(String.Format("Unabled to build Solution {0}. devenv.com not found.", SolutionFile));
     }
     string CmdLine = String.Format("\"{0}\" /build \"{1}\"", SolutionFile, BuildConfig);
     using(TelemetryStopwatch CompileStopwatch = new TelemetryStopwatch("Compile.{0}.{1}.{2}", Path.GetFileName(SolutionFile), "WinC#", BuildConfig))
     {
         RunAndLog(Env, Env.MsDevExe, CmdLine, LogName);
     }
 }
开发者ID:colwalder,项目名称:unrealengine,代码行数:24,代码来源:BuildUtils.cs


示例7: BuildSolution

		/// <summary>
		/// Builds a Visual Studio solution with MsBuild (using msbuild.exe rather than devenv.com can help circumvent issues with expired Visual Studio licenses).
		/// Automatically creates a logfile. When no LogName is specified, the executable name is used as logfile base name.
		/// </summary>
		/// <param name="Env">BuildEnvironment to use.</param>
		/// <param name="SolutionFile">Path to the solution file</param>
		/// <param name="BuildConfig">Configuration to build.</param>
		/// <param name="BuildPlatform">Platform to build.</param>
		/// <param name="LogName">Optional logfile name.</param>
		public static void BuildSolution(CommandEnvironment Env, string SolutionFile, string BuildConfig, string BuildPlatform, string LogName = null)
		{
			if (!FileExists(SolutionFile))
			{
				throw new AutomationException(String.Format("Unabled to build Solution {0}. Solution file not found.", SolutionFile));
			}
			if (String.IsNullOrEmpty(Env.MsBuildExe))
			{
				throw new AutomationException("Unable to find msbuild.exe at: \"{0}\"", Env.MsBuildExe);
			}
			string CmdLine = String.Format("\"{0}\" /m /t:Build /p:Configuration=\"{1}\" /p:Platform=\"{2}\" /verbosity:minimal /nologo", SolutionFile, BuildConfig, BuildPlatform);
			using (TelemetryStopwatch CompileStopwatch = new TelemetryStopwatch("Compile.{0}.{1}.{2}", Path.GetFileName(SolutionFile), "WinC#", BuildConfig))
			{
				RunAndLog(Env, Env.MsBuildExe, CmdLine, LogName);
			}
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:25,代码来源:BuildUtils.cs


示例8: BuildSolution

		/// <summary>
		/// Builds a Visual Studio solution with MsDevEnv. Automatically creates a logfile. When 
		/// no LogName is specified, the executable name is used as logfile base name.
		/// </summary>
		/// <param name="Env">BuildEnvironment to use.</param>
		/// <param name="SolutionFile">Path to the solution file</param>
		/// <param name="BuildConfig">Configuration to build.</param>
		/// <param name="LogName">Optional logfile name.</param>
		public static void BuildSolution(CommandEnvironment Env, string SolutionFile, string BuildConfig = "Development", string LogName = null)
		{
			if (!FileExists(SolutionFile))
			{
				throw new AutomationException(String.Format("Unabled to build Solution {0}. Solution file not found.", SolutionFile));
			}
			if (String.IsNullOrEmpty(Env.MsDevExe))
			{
				throw new AutomationException(String.Format("Unabled to build Solution {0}. devenv.com not found.", SolutionFile));
			}
			string CmdLine = String.Format("\"{0}\" /build \"{1}\"", SolutionFile, BuildConfig);
            var StartBuildSolution = DateTime.Now.ToString();
			RunAndLog(Env, Env.MsDevExe, CmdLine, LogName);
            var FinishBuildSolution = DateTime.Now.ToString();
            PrintCSVFile(String.Format("UAT,Compile,{0},{1}", StartBuildSolution, FinishBuildSolution));
		}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:24,代码来源:BuildUtils.cs


示例9: RunUBT

        /// <summary>
        /// Runs UBT with the specified commandline. Automatically creates a logfile. When 
        /// no LogName is specified, the executable name is used as logfile base name.
        /// </summary>
        /// <param name="Env">Environment to use.</param>
        /// <param name="CommandLine">Commandline to pass on to UBT.</param>
        /// <param name="LogName">Optional logfile name.</param>
        public static void RunUBT(CommandEnvironment Env, string UBTExecutable, string CommandLine, string LogName = null)
        {
            if (!FileExists(UBTExecutable))
            {
                throw new AutomationException("Unable to find UBT executable: " + UBTExecutable);
            }

            if (GlobalCommandLine.Rocket)
            {
                CommandLine += " -rocket";
            }
            if (!IsBuildMachine && UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealBuildTool.UnrealTargetPlatform.Mac)
            {
                CommandLine += " -nocreatestub";
            }
            CommandUtils.RunAndLog(Env, UBTExecutable, CommandLine, LogName);
        }
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:24,代码来源:UBTUtils.cs


示例10: MsBuild

		/// <summary>
		/// Runs msbuild.exe with the specified arguments. Automatically creates a logfile. When 
		/// no LogName is specified, the executable name is used as logfile base name.
		/// </summary>
		/// <param name="Env">BuildEnvironment to use.</param>
		/// <param name="Project">Path to the project to build.</param>
		/// <param name="Arguments">Arguments to pass to msbuild.exe.</param>
		/// <param name="LogName">Optional logfile name.</param>
		public static void MsBuild(CommandEnvironment Env, string Project, string Arguments, string LogName)
		{
			if (String.IsNullOrEmpty(Env.MsBuildExe))
			{
				throw new AutomationException("Unable to find msbuild.exe at: \"{0}\"", Env.MsBuildExe);
			}
			if (!FileExists(Project))
			{
				throw new AutomationException("Project {0} does not exist!", Project);
			}
			var RunArguments = MakePathSafeToUseWithCommandLine(Project);
			if (!String.IsNullOrEmpty(Arguments))
			{
				RunArguments += " " + Arguments;
			}
			RunAndLog(Env, Env.MsBuildExe, RunArguments, LogName);
		}
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:25,代码来源:BuildUtils.cs


示例11: DeleteLocalTempStorageManifests

 public static void DeleteLocalTempStorageManifests(CommandEnvironment Env)
 {
     DeleteDirectory(true, LocalTempStorageManifestDirectory(Env));
 }
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:4,代码来源:TempStorage.cs


示例12: SaveSharedTempStorageManifest

 public static TempStorageManifest SaveSharedTempStorageManifest(CommandEnvironment Env, string StorageBlockName, string GameFolder, List<string> Files)
 {
     return SaveTempStorageManifest(SharedTempStorageDirectory(StorageBlockName, GameFolder), SharedTempStorageManifestFilename(Env, StorageBlockName, GameFolder), Files);
 }
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:4,代码来源:TempStorage.cs


示例13: SharedTempStorageManifestFilename

 public static string SharedTempStorageManifestFilename(CommandEnvironment Env, string StorageBlockName, string GameFolder)
 {
     return CombinePaths(SharedTempStorageDirectory(StorageBlockName, GameFolder), StorageBlockName + ".TempManifest");
 }
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:4,代码来源:TempStorage.cs


示例14: SaveLocalTempStorageManifest

 public static TempStorageManifest SaveLocalTempStorageManifest(CommandEnvironment Env, string BaseFolder, string StorageBlockName, List<string> Files)
 {
     return SaveTempStorageManifest(BaseFolder, LocalTempStorageManifestFilename(Env, StorageBlockName), Files);
 }
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:4,代码来源:TempStorage.cs


示例15: LocalTempStorageManifestFilename

 public static string LocalTempStorageManifestFilename(CommandEnvironment Env, string StorageBlockName)
 {
     return CombinePaths(LocalTempStorageManifestDirectory(Env), StorageBlockName + ".TempManifest");
 }
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:4,代码来源:TempStorage.cs


示例16: LocalTempStorageManifestDirectory

 public static string LocalTempStorageManifestDirectory(CommandEnvironment Env)
 {
     return CombinePaths(Env.LocalRoot, "Engine", "Saved", "GUBP");
 }
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:4,代码来源:TempStorage.cs


示例17: RetrieveFromPermanentStorage

		public static void RetrieveFromPermanentStorage(CommandEnvironment Env, string NetworkRoot, string Build, string Platform)
		{
			var LocalManifest = LocalTempStorageManifestFilename(Env, Build);
			if (!FileExists_NoExceptions(LocalManifest))
			{
				string BaseFolder = CombinePaths(Env.LocalRoot, "Rocket", "TempInst", Platform);
				string Root = RootSharedTempStorageDirectory();
				string SrcFolder = CombinePaths(Root, NetworkRoot, Build, Platform);
				var SourceFiles = FindFiles_NoExceptions("*", true, SrcFolder);
				foreach (var File in SourceFiles)
				{
					var DestFile = File.Replace(SrcFolder, "");
					DestFile = CombinePaths(BaseFolder, DestFile);
					CopyFile_NoExceptions(File, DestFile);
				}
				if(!DirectoryExists(Path.GetDirectoryName(LocalManifest)))
				{
					CreateDirectory(Path.GetDirectoryName(LocalManifest));
				}
				XmlDocument Local = new XmlDocument();
				XmlElement RootElement = Local.CreateElement("permstorage");
				Local.AppendChild(RootElement);
				Local.Save(LocalManifest);
			}
		}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:25,代码来源:TempStorage.cs


示例18: TempStorageExists

 public static bool TempStorageExists(CommandEnvironment Env, string StorageBlockName, string GameFolder = "", bool bLocalOnly = false, bool bQuiet = false)
 {
     return LocalTempStorageExists(Env, StorageBlockName, bQuiet) || (!bLocalOnly && SharedTempStorageExists(Env, StorageBlockName, GameFolder, bQuiet));
 }
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:4,代码来源:TempStorage.cs


示例19: DeleteLocalTempStorage

 public static void DeleteLocalTempStorage(CommandEnvironment Env, string StorageBlockName, bool bQuiet = false)
 {
     var LocalManifest = LocalTempStorageManifestFilename(Env, StorageBlockName);
     DeleteFile(bQuiet, LocalManifest);
 }
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:5,代码来源:TempStorage.cs


示例20: DeleteSharedTempStorageManifests

 public static void DeleteSharedTempStorageManifests(CommandEnvironment Env, string StorageBlockName, string GameFolder = "")
 {
     DeleteDirectory(true, SharedTempStorageDirectory(StorageBlockName, GameFolder));
 }
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:4,代码来源:TempStorage.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AutomationTool.ProjectParams类代码示例发布时间:2022-05-24
下一篇:
C# WebApi.AutofacWebApiDependencyResolver类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap