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


C# UE4Build.Build方法代码示例

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


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

示例1: ExecuteInner

    void ExecuteInner()
    {
        var UE4Build = new UE4Build(this);

        var Agenda_Mono = new UE4Build.BuildAgenda();
        var Agenda_NonUnity = new UE4Build.BuildAgenda();
        {
            {
                var Win64DevTargets = new string[]
                {
                    "FortniteEditor",
                    "OrionEditor",
                    "PlatformerGameEditor",
                    "QAGameEditor",
                    "ShooterGameEditor",
                    "StrategyGameEditor",
                    "VehicleGameEditor",
                };
                Agenda_Mono.AddTargets(Win64DevTargets, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development, bForceMonolithic: true);
                Agenda_Mono.AddTargets(Win64DevTargets, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Shipping, bForceMonolithic: true);
                Agenda_Mono.AddTargets(Win64DevTargets, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development, bForceNonUnity: true);
                Agenda_Mono.AddTargets(Win64DevTargets, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Shipping, bForceNonUnity: true);

                var Win32Targets = new string[]
                {
                    "FortniteGame",
                    "FortniteServer",
                    "OrionGame",
                    "PlatformerGame",
                    "QAGame",
                    "ShooterGame",
                    "StrategyGame",
                    "VehicleGame",
                };
                Agenda_Mono.AddTargets(Win32Targets, UnrealTargetPlatform.Win32, UnrealTargetConfiguration.Development, bForceMonolithic: true);
                Agenda_Mono.AddTargets(Win32Targets, UnrealTargetPlatform.Win32, UnrealTargetConfiguration.Development, bForceNonUnity: true);

                var Win32ShipTargets = new string[]
                {
                    "FortniteGame",
                    "FortniteServer",
                };
                Agenda_Mono.AddTargets(Win32ShipTargets, UnrealTargetPlatform.Win32, UnrealTargetConfiguration.Shipping, bForceMonolithic: true);
                Agenda_Mono.AddTargets(Win32ShipTargets, UnrealTargetPlatform.Win32, UnrealTargetConfiguration.Shipping, bForceNonUnity: true);
            }
        }

        UE4Build.Build(Agenda_Mono, InDeleteBuildProducts: true, InUpdateVersionFiles: true);

        UE4Build.Build(Agenda_NonUnity, InDeleteBuildProducts: true, InUpdateVersionFiles: true);
        UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles);
    }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:52,代码来源:VerifyPromotableBuild.Automation.cs

示例2: ExecuteInner

    void ExecuteInner()
    {
        var UE4Build = new UE4Build(this);

        var Agenda = new UE4Build.BuildAgenda();

        {
            var Win32Targets = new string[]
            {
                "FortniteClient",
                "FortniteGame",
                "FortniteServer",
                "OrionServer",
                "OrionClient",
                "OrionGame",
            };
            Agenda.AddTargets(Win32Targets, UnrealTargetPlatform.Win32, UnrealTargetConfiguration.Shipping);
            Agenda.AddTargets(Win32Targets, UnrealTargetPlatform.Win32, UnrealTargetConfiguration.Test);
        }

        Agenda.DoRetries = false;
        Agenda.SpecialTestFlag = true;
        UE4Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: true);

        UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles);
    }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:26,代码来源:PreflightBuild.Automation.cs

示例3: ExecuteBuild

    public override void ExecuteBuild()
    {
        // Get the plugin filename
        string PluginFileName = ParseParamValue("Plugin");
        if(PluginFileName == null)
        {
            throw new AutomationException("Plugin file name was not specified via the -plugin argument");
        }

        // Read the plugin
        PluginDescriptor Plugin = PluginDescriptor.FromFile(PluginFileName);

        // Clean the intermediate build directory
        string IntermediateBuildDirectory = Path.Combine(Path.GetDirectoryName(PluginFileName), "Intermediate", "Build");
        if(CommandUtils.DirectoryExists(IntermediateBuildDirectory))
        {
            CommandUtils.DeleteDirectory(IntermediateBuildDirectory);
        }

        // Get any additional arguments from the commandline
        string AdditionalArgs = "";
        if(ParseParam("Rocket"))
        {
            AdditionalArgs += " -Rocket";
        }

        // Build the host platforms
        List<string> ReceiptFileNames = new List<string>();
        UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda();
        UnrealTargetPlatform HostPlatform = BuildHostPlatform.Current.Platform;
        if(!ParseParam("NoHostPlatform"))
        {
            AddPluginToAgenda(Agenda, PluginFileName, Plugin, "UE4Editor", TargetRules.TargetType.Editor, HostPlatform, UnrealTargetConfiguration.Development, ReceiptFileNames, AdditionalArgs);
        }

        // Add the game targets
        List<UnrealTargetPlatform> TargetPlatforms = Rocket.RocketBuild.GetTargetPlatforms(this, HostPlatform);
        foreach(UnrealTargetPlatform TargetPlatform in TargetPlatforms)
        {
            if(Rocket.RocketBuild.IsCodeTargetPlatform(HostPlatform, TargetPlatform))
            {
                AddPluginToAgenda(Agenda, PluginFileName, Plugin, "UE4Game", TargetRules.TargetType.Game, TargetPlatform, UnrealTargetConfiguration.Development, ReceiptFileNames, AdditionalArgs);
                AddPluginToAgenda(Agenda, PluginFileName, Plugin, "UE4Game", TargetRules.TargetType.Game, TargetPlatform, UnrealTargetConfiguration.Shipping, ReceiptFileNames, AdditionalArgs);
            }
        }

        // Build it
        UE4Build Build = new UE4Build(this);
        Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: false);

        // Package the plugin to the output folder
        string PackageDirectory = ParseParamValue("Package");
        if(PackageDirectory != null)
        {
            List<BuildProduct> BuildProducts = GetBuildProductsFromReceipts(ReceiptFileNames);
            PackagePlugin(PluginFileName, BuildProducts, PackageDirectory);
        }
    }
开发者ID:mymei,项目名称:UE4,代码行数:58,代码来源:BuildPluginCommand.Automation.cs

示例4: BuildBuildPatchTool

    /// <summary>
    /// Builds BuildPatchTool for the specified platform.
    /// </summary>
    /// <param name="Command"></param>
    /// <param name="InPlatform"></param>
    public static void BuildBuildPatchTool(BuildCommand Command, UnrealBuildTool.UnrealTargetPlatform InPlatform)
    {
        Log("Building BuildPatchTool");

        var UE4Build = new UE4Build(Command);

        var Agenda = new UE4Build.BuildAgenda();
        Agenda.Targets.Add(new UE4Build.BuildTarget()
        {
            ProjectName = "",
            TargetName = "BuildPatchTool",
            Platform = InPlatform,
            Config = UnrealBuildTool.UnrealTargetConfiguration.Development,
        });

        UE4Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: true);
        UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles);
    }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:23,代码来源:UE4BuildUtils.cs

示例5: BuildProduct

	private static void BuildProduct(BuildCommand Command, UE4Build.BuildTarget Target)
	{
		if (Target == null)
		{
			throw new AutomationException("Target is required when calling UE4BuildUtils.BuildProduct");
		}

		LogConsole("Building {0}", Target.TargetName);

		if (Command == null)
		{
			Command = new UE4BuildUtilDummyBuildCommand();
		}

		var UE4Build = new UE4Build(Command);

		var Agenda = new UE4Build.BuildAgenda();
		Agenda.Targets.Add(Target);

		UE4Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: true);
		UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles);
	}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:22,代码来源:UE4BuildUtils.cs

示例6: Execute

		/// <summary>
		/// Execute the task.
		/// </summary>
		/// <param name="Job">Information about the current job</param>
		/// <param name="BuildProducts">Set of build products produced by this node.</param>
		/// <param name="TagNameToFileSet">Mapping from tag names to the set of files they include</param>
		/// <returns>True if the task succeeded</returns>
		public override bool Execute(JobContext Job, HashSet<FileReference> BuildProducts, Dictionary<string, HashSet<FileReference>> TagNameToFileSet)
		{
			// Create the agenda
            UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda();
			Agenda.Targets.AddRange(Targets);

			// Build everything
			Dictionary<UE4Build.BuildTarget, BuildManifest> TargetToManifest = new Dictionary<UE4Build.BuildTarget,BuildManifest>();
            UE4Build Builder = new UE4Build(Job.OwnerCommand);
			try
			{
				bool bCanUseParallelExecutor = (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Win64);	// parallel executor is only available on Windows as of 2016-09-22
				Builder.Build(Agenda, InDeleteBuildProducts: null, InUpdateVersionFiles: false, InForceNoXGE: false, InUseParallelExecutor: bCanUseParallelExecutor, InTargetToManifest: TargetToManifest);
			}
			catch (CommandUtils.CommandFailedException)
			{
				return false;
			}
			UE4Build.CheckBuildProducts(Builder.BuildProductFiles);

			// Tag all the outputs
			foreach(KeyValuePair<UE4Build.BuildTarget, string> TargetTagName in TargetToTagName)
			{
				BuildManifest Manifest;
				if(!TargetToManifest.TryGetValue(TargetTagName.Key, out Manifest))
				{
					throw new AutomationException("Missing manifest for target {0} {1} {2}", TargetTagName.Key.TargetName, TargetTagName.Key.Platform, TargetTagName.Key.Config);
				}

				foreach(string TagName in SplitDelimitedList(TargetTagName.Value))
				{
					HashSet<FileReference> FileSet = FindOrAddTagSet(TagNameToFileSet, TagName);
					FileSet.UnionWith(Manifest.BuildProducts.Select(x => new FileReference(x)));
					FileSet.UnionWith(Manifest.LibraryBuildProducts.Select(x => new FileReference(x)));
				}
			}

			// Add everything to the list of build products
			BuildProducts.UnionWith(Builder.BuildProductFiles.Select(x => new FileReference(x)));
			BuildProducts.UnionWith(Builder.LibraryBuildProductFiles.Select(x => new FileReference(x)));
			return true;
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:49,代码来源:CompileTask.cs

示例7: ExecuteBuild

	public override void ExecuteBuild()
	{
		LogConsole("************************* BuildCommonTools");

		// Get the list of platform names
		string[] PlatformNames = ParseParamValue("platforms", BuildHostPlatform.Current.Platform.ToString()).Split('+');

		// Parse the platforms
		List<UnrealBuildTool.UnrealTargetPlatform> Platforms = new List<UnrealTargetPlatform>();
		foreach(string PlatformName in PlatformNames)
		{
			UnrealBuildTool.UnrealTargetPlatform Platform;
			if(!UnrealBuildTool.UnrealTargetPlatform.TryParse(PlatformName, true, out Platform))
			{
				throw new AutomationException("Unknown platform specified on command line - '{0}' - valid platforms are {1}", PlatformName, String.Join("/", Enum.GetNames(typeof(UnrealBuildTool.UnrealTargetPlatform))));
			}
			Platforms.Add(Platform);
		}

		// Add all the platforms if specified
		if(ParseParam("allplatforms"))
		{
			foreach(UnrealTargetPlatform Platform in Enum.GetValues(typeof(UnrealTargetPlatform)))
			{
				if(!Platforms.Contains(Platform))
				{
					Platforms.Add(Platform);
				}
			}
		}

		// Get the agenda
		List<string> ExtraBuildProducts = new List<string>();
		UE4Build.BuildAgenda Agenda = MakeAgenda(Platforms.ToArray(), ExtraBuildProducts);

		// Build everything. We don't want to touch version files for GitHub builds -- these are "programmer builds" and won't have a canonical build version
		UE4Build Builder = new UE4Build(this);
		Builder.Build(Agenda, InDeleteBuildProducts:true, InUpdateVersionFiles: false);

		// Add UAT and UBT to the build products
		Builder.AddUATFilesToBuildProducts();
		Builder.AddUBTFilesToBuildProducts();

		// Add all the extra build products
		foreach(string ExtraBuildProduct in ExtraBuildProducts)
		{
			Builder.AddBuildProduct(ExtraBuildProduct);
		}

		// Make sure all the build products exist
		UE4Build.CheckBuildProducts(Builder.BuildProductFiles);

		// Write the manifest if needed
		string ManifestPath = ParseParamValue("manifest");
		if(ManifestPath != null)
		{
			SortedSet<string> Files = new SortedSet<string>();
			foreach(string BuildProductFile in Builder.BuildProductFiles)
			{
				Files.Add(BuildProductFile);
			}
			File.WriteAllLines(ManifestPath, Files.ToArray());
		}
	}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:64,代码来源:BuildCommonTools.Automation.cs

示例8: ExecuteBuild

    public override void ExecuteBuild()
    {
        var Build = new UE4Build(this);
        var Agenda = new UE4Build.BuildAgenda();
        var Platform = UnrealBuildTool.UnrealTargetPlatform.Win64;
        var Configuration = UnrealBuildTool.UnrealTargetConfiguration.Development;
        var Targets = new List<string>();

        foreach (var ObjParam in Params)
        {
            var Param = (string)ObjParam;
            UnrealBuildTool.UnrealTargetPlatform ParsePlatform;
            if (Enum.TryParse<UnrealBuildTool.UnrealTargetPlatform>(Param, true, out ParsePlatform))
            {
                Platform = ParsePlatform;
                continue;
            }
            UnrealBuildTool.UnrealTargetConfiguration ParseConfiguration;
            if (Enum.TryParse<UnrealBuildTool.UnrealTargetConfiguration>(Param, true, out ParseConfiguration))
            {
                Configuration = ParseConfiguration;
                continue;
            }
            if (String.Compare("NoXGE", Param, true) != 0 && String.Compare("Clean", Param, true) != 0)
            {
                Targets.Add(Param);
            }
        }

        var Clean = ParseParam("Clean");

        Agenda.AddTargets(Targets.ToArray(), Platform, Configuration);

        Log("UBT Buid");
        Log("Targets={0}", String.Join(",", Targets));
        Log("Platform={0}", Platform);
        Log("Configuration={0}", Configuration);
        Log("Clean={0}", Clean);

        Build.Build(Agenda, InUpdateVersionFiles: false);

        Log("UBT Completed");
    }
开发者ID:colwalder,项目名称:unrealengine,代码行数:43,代码来源:Tests.Automation.cs

示例9: DoBuild

        public override void DoBuild(GUBP bp)
        {
            BuildProducts = new List<string>();
            var UE4Build = new UE4Build(bp);
            UE4Build.BuildAgenda Agenda = GetAgenda(bp);
            if (Agenda != null)
            {
                Agenda.DoRetries = false; // these would delete build products
                UE4Build.Build(Agenda, InDeleteBuildProducts: DeleteBuildProducts(), InUpdateVersionFiles: false, InForceUnity: true);
                PostBuild(bp, UE4Build);

                UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles);
                foreach (var Product in UE4Build.BuildProductFiles)
                {
                    AddBuildProduct(Product);
                }

                RemoveOveralppingBuildProducts();
                if (bp.bSignBuildProducts)
                {
                    // Sign everything we built
                    CodeSign.SignMultipleIfEXEOrDLL(bp, BuildProducts);
                }
            }
            else
            {
                SaveRecordOfSuccessAndAddToBuildProducts("Nothing to actually compile");
            }
        }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:29,代码来源:GUBP.Automation.cs

示例10: BuildNecessaryTargets

		// Broken down steps used to run the process.
		#region RebuildLightMaps Process Steps

		private void BuildNecessaryTargets()
		{
			Log("Running Step:- RebuildLightMaps::BuildNecessaryTargets");
			UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda();
            Agenda.AddTarget("UnrealHeaderTool", UnrealBuildTool.UnrealTargetPlatform.Win64, UnrealBuildTool.UnrealTargetConfiguration.Development);
			Agenda.AddTarget("ShaderCompileWorker", UnrealBuildTool.UnrealTargetPlatform.Win64, UnrealBuildTool.UnrealTargetConfiguration.Development);
			Agenda.AddTarget("UnrealLightmass", UnrealBuildTool.UnrealTargetPlatform.Win64, UnrealBuildTool.UnrealTargetConfiguration.Development);
			Agenda.AddTarget(CommandletTargetName, UnrealBuildTool.UnrealTargetPlatform.Win64, UnrealBuildTool.UnrealTargetConfiguration.Development);

			try
			{
				UE4Build Builder = new UE4Build(this);
				Builder.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: true, InForceNoXGE: false, InChangelistNumberOverride: GetLatestCodeChange());
				UE4Build.CheckBuildProducts(Builder.BuildProductFiles);
			}
			catch (AutomationException Ex)
			{
				LogError("Rebuild Light Maps has failed.");
				throw Ex;
			}
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:24,代码来源:RebuildLightMapsCommand.Automation.cs

示例11: DoTest

		public override void DoTest(GUBP bp)
		{
			var Build = new UE4Build(bp);
			var Agenda = new UE4Build.BuildAgenda();

			string AddArgs = "-nobuilduht";

			Agenda.AddTargets(
				new string[] { BranchConfig.Branch.BaseEngineProject.Properties.Targets[TargetRules.TargetType.Editor].TargetName },
				HostPlatform, UnrealTargetConfiguration.Development, InAddArgs: AddArgs);
			foreach (var ProgramTarget in BranchConfig.Branch.BaseEngineProject.Properties.Programs)
			{
				if (ProgramTarget.Rules.GUBP_AlwaysBuildWithBaseEditor() && ProgramTarget.Rules.SupportsPlatform(HostPlatform))
				{
					Agenda.AddTargets(new string[] { ProgramTarget.TargetName }, HostPlatform, UnrealTargetConfiguration.Development, InAddArgs: AddArgs);
				}
			}
			Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: false);

			UE4Build.CheckBuildProducts(Build.BuildProductFiles);
			SaveRecordOfSuccessAndAddToBuildProducts();
		}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:22,代码来源:LegacyNodes.cs

示例12: Build

	public static void Build(BuildCommand Command, ProjectParams Params, int WorkingCL = -1)
	{

		Params.ValidateAndLog();

		if (!Params.Build)
		{
			return;
		}

		Log("********** BUILD COMMAND STARTED **********");

		var UE4Build = new UE4Build(Command);
		var Agenda = new UE4Build.BuildAgenda();
		var CrashReportPlatforms = new HashSet<UnrealTargetPlatform>();

		// Setup editor targets
		if (Params.HasEditorTargets && !Params.Rocket)
		{
			// @todo Mac: proper platform detection
			UnrealTargetPlatform EditorPlatform = HostPlatform.Current.HostEditorPlatform;
			const UnrealTargetConfiguration EditorConfiguration = UnrealTargetConfiguration.Development;

			CrashReportPlatforms.Add(EditorPlatform);
			Agenda.AddTargets(Params.EditorTargets.ToArray(), EditorPlatform, EditorConfiguration, Params.CodeBasedUprojectPath);
			if (Params.EditorTargets.Contains("UnrealHeaderTool") == false)
			{
				Agenda.AddTargets(new string[] { "UnrealHeaderTool" }, EditorPlatform, EditorConfiguration);
			}
			if (Params.EditorTargets.Contains("ShaderCompileWorker") == false)
			{
				Agenda.AddTargets(new string[] { "ShaderCompileWorker" }, EditorPlatform, EditorConfiguration);
			}
			if (Params.Pak && Params.EditorTargets.Contains("UnrealPak") == false)
			{
				Agenda.AddTargets(new string[] { "UnrealPak" }, EditorPlatform, EditorConfiguration);
			}
			if (Params.FileServer && Params.EditorTargets.Contains("UnrealFileServer") == false)
			{
				Agenda.AddTargets(new string[] { "UnrealFileServer" }, EditorPlatform, EditorConfiguration);
			}
		}

		// Setup cooked targets
		if (Params.HasClientCookedTargets)
		{
			foreach (var BuildConfig in Params.ClientConfigsToBuild)
			{
				foreach (var ClientPlatform in Params.ClientTargetPlatforms)
				{
					CrashReportPlatforms.Add(ClientPlatform);
					Agenda.AddTargets(Params.ClientCookedTargets.ToArray(), ClientPlatform, BuildConfig, Params.CodeBasedUprojectPath, InAddArgs: " -remoteini=\""+Path.GetDirectoryName(Params.RawProjectPath)+"\"");
				}
			}
		}
		if (Params.HasServerCookedTargets)
		{
			foreach (var BuildConfig in Params.ServerConfigsToBuild)
			{
				foreach (var ServerPlatform in Params.ServerTargetPlatforms)
				{
					CrashReportPlatforms.Add(ServerPlatform);
					Agenda.AddTargets(Params.ServerCookedTargets.ToArray(), ServerPlatform, BuildConfig, Params.CodeBasedUprojectPath, InAddArgs: " -remoteini=\""+Path.GetDirectoryName(Params.RawProjectPath)+"\"");
				}
			}
		}
		if (Params.CrashReporter && !Params.Rocket)
		{
			var CrashReportClientTarget = new[] { "CrashReportClient" };
			foreach (var CrashReportPlatform in CrashReportPlatforms)
			{
				if (UnrealBuildTool.UnrealBuildTool.PlatformSupportsCrashReporter(CrashReportPlatform))
				{
					Agenda.AddTargets(CrashReportClientTarget, CrashReportPlatform, UnrealTargetConfiguration.Development);
				}
			}
		}
		if (Params.HasProgramTargets && !Params.Rocket)
		{
			foreach (var BuildConfig in Params.ClientConfigsToBuild)
			{
				foreach (var ClientPlatform in Params.ClientTargetPlatforms)
				{
					Agenda.AddTargets(Params.ProgramTargets.ToArray(), ClientPlatform, BuildConfig, Params.CodeBasedUprojectPath);
				}
			}
		}
		UE4Build.Build(Agenda, InDeleteBuildProducts: Params.Clean, InUpdateVersionFiles: WorkingCL > 0);

		if (WorkingCL > 0) // only move UAT files if we intend to check in some build products
		{
			UE4Build.AddUATFilesToBuildProducts();
		}
		UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles);

		if (WorkingCL > 0)
		{
			// Sign everything we built
			CodeSign.SignMultipleIfEXEOrDLL(Command, UE4Build.BuildProductFiles);

//.........这里部分代码省略.........
开发者ID:ErwinT6,项目名称:T6Engine,代码行数:101,代码来源:BuildProjectCommand.Automation.cs

示例13: ExecuteInner

    void ExecuteInner()
    {
        var UE4Build = new UE4Build(this);
        bool IsRunningOnMono = (Type.GetType("Mono.Runtime") != null);
        var Agenda = new UE4Build.BuildAgenda();

        var Config = ParseParamValue("Config");
        if (String.IsNullOrEmpty(Config))
        {
            Config = "tools";
        }

        if (Config.ToLower() == "tools")
        {
            Agenda.DotNetSolutions.AddRange(
                    new string[]
                {
                    @"Engine\Source\Programs\UnrealDocTool\UnrealDocTool\UnrealDocTool.sln",
                    @"Engine\Source\Programs\NetworkProfiler\NetworkProfiler.sln",
                }
                    );

            Agenda.SwarmProject = @"Engine\Source\Programs\UnrealSwarm\UnrealSwarm.sln";

            Agenda.DotNetProjects.AddRange(
                    new string[]
                {
                    @"Engine\Source\Programs\DotNETCommon\DotNETUtilities\DotNETUtilities.csproj",
                    @"Engine\Source\Programs\NoRedist\CrashReportServer\CrashReportCommon\CrashReportCommon.csproj",
                    @"Engine\Source\Programs\NoRedist\CrashReportServer\CrashReportReceiver\CrashReportReceiver.csproj",
                    @"Engine\Source\Programs\NoRedist\CrashReportServer\CrashReportProcess\CrashReportProcess.csproj",
                    @"Engine\Source\Programs\CrashReporter\RegisterPII\RegisterPII.csproj",
                    @"Engine\Source\Programs\Distill\Distill.csproj",
                    @"Engine\Source\Programs\RPCUtility\RPCUtility.csproj",
                    @"Engine\Source\Programs\UnrealControls\UnrealControls.csproj",
                }
                    );

            Agenda.IOSDotNetProjects.AddRange(
                    new string[]
                {
                    @"Engine\Source\Programs\IOS\iPhonePackager\iPhonePackager.csproj",
                    @"Engine\Source\Programs\IOS\MobileDeviceInterface\MobileDeviceInterface.csproj",
                    @"Engine\Source\Programs\IOS\DeploymentInterface\DeploymentInterface.csproj",
                }
                    );

            Agenda.ExtraDotNetFiles.AddRange(
                    new string[]
                {
                    "Interop.IWshRuntimeLibrary",
                    "UnrealMarkdown",
                    "CommonUnrealMarkdown",
                }
                    );
        }
        //This needs to be a separate target for distributed building because it is required to build anything else.
        if (!IsRunningOnMono)
        {
            var UHTTarget = new string[]
            {
                "UnrealHeaderTool",
            };

            Agenda.AddTargets(UHTTarget, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development);
        }

        var ProgramTargets = new string[]
        {
            "UnrealFileServer",
            "ShaderCompileWorker",
            "MinidumpDiagnostics",
            "SymbolDebugger",
            "UnrealFrontend",
            "UnrealLightmass",
            "UnrealPak",
        };

        var Win64DevTargets = new List<string>
        {
            "FortniteEditor",
            "OrionEditor",
            "PlatformerGameEditor",
            "QAGameEditor",
            "ShooterGameEditor",
            "StrategyGameEditor",
            "VehicleGameEditor",
            "ShadowEditor",
            "SoulEditor",
        };

        var Win32Targets = new List<string>
        {
            "FortniteGame",
            "FortniteServer",
            "FortniteClient",
            "OrionGame",
            "PlatformerGame",
            "ShooterGame",
            "StrategyGame",
//.........这里部分代码省略.........
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:101,代码来源:CIS.Automation.cs

示例14: ExecuteBuild

		public override void ExecuteBuild()
		{
			// Parse the target list
			string[] Targets = ParseParamValues("Target");
			if(Targets.Length == 0)
			{
				throw new AutomationException("No targets specified (eg. -Target=\"UE4Editor Win64 Development\")");
			}

			// Parse the archive path
			string ArchivePath = ParseParamValue("Archive");
			if(ArchivePath != null && (!ArchivePath.StartsWith("//") || ArchivePath.Sum(x => (x == '/')? 1 : 0) < 4))
			{
				throw new AutomationException("Archive path is not a valid depot filename");
			}

			// Prepare the build agenda
			UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda();
			foreach(string Target in Targets)
			{
				string[] Tokens = Target.Split(new char[]{ ' ' }, StringSplitOptions.RemoveEmptyEntries);

				UnrealTargetPlatform Platform;
				UnrealTargetConfiguration Configuration;
				if(Tokens.Length < 3 || !Enum.TryParse(Tokens[1], true, out Platform) || !Enum.TryParse(Tokens[2], true, out Configuration))
				{
					throw new AutomationException("Invalid target '{0}' - expected <TargetName> <Platform> <Configuration>");
				}

				Agenda.AddTarget(Tokens[0], Platform, Configuration, InAddArgs: String.Join(" ", Tokens.Skip(3)));
			}

			// Build everything
			UE4Build Builder = new UE4Build(this);
			Builder.Build(Agenda, InUpdateVersionFiles: ArchivePath != null);

			// Include the build products for UAT and UBT if required
			if(ParseParam("WithUAT"))
			{
				Builder.AddUATFilesToBuildProducts();
			}
			if(ParseParam("WithUBT"))
			{
				Builder.AddUBTFilesToBuildProducts();
			}

			// Archive the build products
			if(ArchivePath != null)
			{
				// Create an output folder
				string OutputFolder = Path.Combine(CommandUtils.CmdEnv.LocalRoot, "ArchiveForUGS");
				Directory.CreateDirectory(OutputFolder);

				// Create a temp folder for storing stripped PDB files
				string SymbolsFolder = Path.Combine(OutputFolder, "Symbols");
				Directory.CreateDirectory(SymbolsFolder);

				// Get the Windows toolchain
				UEToolChain WindowsToolChain = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.Win64).CreateContext(null).CreateToolChain(CPPTargetPlatform.Win64);

				// Figure out all the files for the archive
				Ionic.Zip.ZipFile Zip = new Ionic.Zip.ZipFile();
				Zip.UseZip64WhenSaving = Ionic.Zip.Zip64Option.Always;
				foreach(string BuildProduct in Builder.BuildProductFiles)
				{
					if(!File.Exists(BuildProduct))
					{
						throw new AutomationException("Missing build product: {0}", BuildProduct);
					}
					if(BuildProduct.EndsWith(".pdb", StringComparison.InvariantCultureIgnoreCase))
					{
						string StrippedFileName = CommandUtils.MakeRerootedFilePath(BuildProduct, CommandUtils.CmdEnv.LocalRoot, SymbolsFolder);
						Directory.CreateDirectory(Path.GetDirectoryName(StrippedFileName));
						WindowsToolChain.StripSymbols(BuildProduct, StrippedFileName);
						Zip.AddFile(StrippedFileName, Path.GetDirectoryName(CommandUtils.StripBaseDirectory(StrippedFileName, SymbolsFolder)));
					}
					else
					{
						Zip.AddFile(BuildProduct, Path.GetDirectoryName(CommandUtils.StripBaseDirectory(BuildProduct, CommandUtils.CmdEnv.LocalRoot)));
					}
				}
				// Create the zip file
				string ZipFileName = Path.Combine(OutputFolder, "Archive.zip");
				Console.WriteLine("Writing {0}...", ZipFileName);
				Zip.Save(ZipFileName);

				// Submit it to Perforce if required
				if(CommandUtils.AllowSubmit)
				{
					// Delete any existing clientspec for submitting
					string ClientName = Environment.MachineName + "_BuildForUGS";

					// Create a brand new one
					P4ClientInfo Client = new P4ClientInfo();
					Client.Owner = CommandUtils.P4Env.User;
					Client.Host = Environment.MachineName;
					Client.Stream = ArchivePath.Substring(0, ArchivePath.IndexOf('/', ArchivePath.IndexOf('/', 2) + 1));
					Client.RootPath = Path.Combine(OutputFolder, "Perforce");
					Client.Name = ClientName;
					Client.Options = P4ClientOption.NoAllWrite | P4ClientOption.NoClobber | P4ClientOption.NoCompress | P4ClientOption.Unlocked | P4ClientOption.NoModTime | P4ClientOption.RmDir;
//.........这里部分代码省略.........
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:101,代码来源:BuildForUGS.Automation.cs

示例15: ExecuteBuild

	public override void ExecuteBuild()
	{
		int WorkingCL = -1;
		if (P4Enabled && AllowSubmit)
		{
			string CmdLine = "";
			foreach (var Arg in Params)
			{
				CmdLine += Arg.ToString() + " ";
			}
			WorkingCL = P4.CreateChange(P4Env.Client, String.Format("MegaXGE build from changelist {0} - Params: {1}", P4Env.Changelist, CmdLine));
		}

		LogConsole("************************* MegaXGE");

		bool Clean = ParseParam("Clean");
		string CleanToolLocation = CombinePaths(CmdEnv.LocalRoot, "Engine", "Build", "Batchfiles", "Clean.bat");

		bool ShowProgress = ParseParam("Progress");

		var UE4Build = new UE4Build(this);

		var Agenda = new UE4Build.BuildAgenda();

		// we need to always build UHT when we use mega XGE
		var ProgramTargets = new string[] 
		{
			"UnrealHeaderTool",
		};
		Agenda.AddTargets(ProgramTargets, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development);
		if (Clean)
		{
			LogSetProgress(ShowProgress, "Cleaning previous builds...");
			foreach (var CurTarget in ProgramTargets)
			{
				string Args = String.Format("{0} {1} {2}", CurTarget, UnrealTargetPlatform.Win64.ToString(), UnrealTargetConfiguration.Development.ToString());
				RunAndLog(CmdEnv, CleanToolLocation, Args);
			}
		}

		LogConsole("*************************");
		for (int Arg = 1; Arg < 100; Arg++)
		{
			string Parm = String.Format("Target{0}", Arg);
			string Target = ParseParamValue(Parm, "");
			if (String.IsNullOrEmpty(Target))
			{
				break;
			}
			var Parts = Target.Split(' ');

			string JustTarget = Parts[0];
			if (String.IsNullOrEmpty(JustTarget))
			{
				throw new AutomationException("BUILD FAILED target option '{0}' not parsed.", Target);
			}
			var Targets = JustTarget.Split('|');
			if (Targets.Length < 1)
			{
				throw new AutomationException("BUILD FAILED target option '{0}' not parsed.", Target);
			}

			var Platforms = new List<UnrealTargetPlatform>();
			var Configurations = new List<UnrealTargetConfiguration>();

			for (int Part = 1; Part < Parts.Length; Part++)
			{
				if (!String.IsNullOrEmpty(Parts[Part]))
				{
					var SubParts = Parts[Part].Split('|');

					foreach (var SubPart in SubParts)
					{
						if (UEBuildPlatform.ConvertStringToPlatform(SubPart) != UnrealTargetPlatform.Unknown)
						{
							Platforms.Add(UEBuildPlatform.ConvertStringToPlatform(SubPart));
						}
						else
						{
							switch (SubPart.ToUpperInvariant())
							{
								case "DEBUG":
									Configurations.Add(UnrealTargetConfiguration.Debug);
									break;
								case "DEBUGGAME":
									Configurations.Add(UnrealTargetConfiguration.DebugGame);
									break;
								case "DEVELOPMENT":
									Configurations.Add(UnrealTargetConfiguration.Development);
									break;
								case "SHIPPING":
									Configurations.Add(UnrealTargetConfiguration.Shipping);
									break;
								case "TEST":
									Configurations.Add(UnrealTargetConfiguration.Test);
									break;
								default:
									throw new AutomationException("BUILD FAILED target option {0} not recognized.", SubPart);
							}
						}
//.........这里部分代码省略.........
开发者ID:frobro98,项目名称:UnrealSource,代码行数:101,代码来源:MegaXGE.Automation.cs


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