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);
    }
Esempio n. 2
0
    static void AddPluginToAgenda(UE4Build.BuildAgenda Agenda, string PluginFileName, PluginDescriptor Plugin, string TargetName, TargetRules.TargetType TargetType, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, List<string> ReceiptFileNames, string InAdditionalArgs)
    {
        // Find a list of modules that need to be built for this plugin
        List<string> ModuleNames = new List<string>();
        foreach(ModuleDescriptor Module in Plugin.Modules)
        {
            bool bBuildDeveloperTools = (TargetType == TargetRules.TargetType.Editor || TargetType == TargetRules.TargetType.Program);
            bool bBuildEditor = (TargetType == TargetRules.TargetType.Editor);
            if(Module.IsCompiledInConfiguration(Platform, TargetType, bBuildDeveloperTools, bBuildEditor))
            {
                ModuleNames.Add(Module.Name);
            }
        }

        // Add these modules to the build agenda
        if(ModuleNames.Count > 0)
        {
            string Arguments = String.Format("-plugin {0}", CommandUtils.MakePathSafeToUseWithCommandLine(PluginFileName));
            foreach(string ModuleName in ModuleNames)
            {
                Arguments += String.Format(" -module {0}", ModuleName);
            }

            string ReceiptFileName = BuildReceipt.GetDefaultPath(Path.GetDirectoryName(PluginFileName), TargetName, Platform, Configuration, "");
            Arguments += String.Format(" -receipt {0}", CommandUtils.MakePathSafeToUseWithCommandLine(ReceiptFileName));
            ReceiptFileNames.Add(ReceiptFileName);

            if(!String.IsNullOrEmpty(InAdditionalArgs))
            {
                Arguments += InAdditionalArgs;
            }

            Agenda.AddTarget(TargetName, Platform, Configuration, InAddArgs: Arguments);
        }
    }
	public override void ExecuteBuild()
	{
		UE4Build UE4Build = new UE4Build(this);
		int? ChangelistOverride = ParseParamNullableInt("cl");
		int? CompatibleChangelistOverride = ParseParamNullableInt("compatiblecl");
		string Build = ParseParamValue("Build", null);
		UE4Build.UpdateVersionFiles(ChangelistNumberOverride: ChangelistOverride, CompatibleChangelistNumberOverride: CompatibleChangelistOverride, Build: Build);
	}
Esempio n. 4
0
    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);
        }
    }
    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);
    }
Esempio n. 6
0
    /// <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);
    }
		// 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;
			}
		}
Esempio n. 8
0
	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);
	}
	public override void ExecuteBuild()
	{
		// Get the output directory
		string TargetDir = ParseParamValue("TargetDir");
		if(TargetDir == null)
		{
			throw new AutomationException("Missing -Target argument to CopyUAT");
		}

		// Construct a dummy UE4Build object to get a list of the UAT and UBT build products
		UE4Build Build = new UE4Build(this);
		Build.AddUATFilesToBuildProducts();
		if(ParseParam("WithLauncher"))
		{
			Build.AddUATLauncherFilesToBuildProducts();
		}
		Build.AddUBTFilesToBuildProducts();

		// Get a list of all the input files
		List<string> FileNames = new List<string>(Build.BuildProductFiles);
		foreach(string FileName in Build.BuildProductFiles)
		{
			string SymbolFileName = Path.ChangeExtension(FileName, ".pdb");
			if(File.Exists(SymbolFileName))
			{
				FileNames.Add(SymbolFileName);
			}
		}

		// Copy all the files over
		foreach(string FileName in FileNames)
		{
			string TargetFileName = Utils.MakeRerootedFilePath(FileName, CommandUtils.CmdEnv.LocalRoot, TargetDir);
			Directory.CreateDirectory(Path.GetDirectoryName(TargetFileName));
			File.Copy(FileName, TargetFileName);
		}

		Log("Copied {0} files to {1}", FileNames.Count, TargetDir);
	}
Esempio n. 10
0
		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();
		}
Esempio n. 11
0
 public virtual void PostBuild(GUBP bp, UE4Build UE4Build)
 {
 }
Esempio n. 12
0
        public override void DoTest(GUBP bp)
        {
            var Build = new UE4Build(bp);
            var Agenda = new UE4Build.BuildAgenda();
            
            Agenda.AddTargets(new string[] { "UnrealHeaderTool" }, HostPlatform, UnrealTargetConfiguration.Development);
            Agenda.AddTargets(
                new string[] { BranchConfig.Branch.BaseEngineProject.Properties.Targets[TargetRules.TargetType.Editor].TargetName },
                HostPlatform, UnrealTargetConfiguration.Development, InAddArgs: "-skipnonhostplatforms -shadowvariableerrors");

            foreach (var Kind in BranchInfo.MonolithicKinds)
            {
                if (BranchConfig.Branch.BaseEngineProject.Properties.Targets.ContainsKey(Kind))
                {
                    var Target = BranchConfig.Branch.BaseEngineProject.Properties.Targets[Kind];
                    Agenda.AddTargets(new string[] { Target.TargetName }, HostPlatform, UnrealTargetConfiguration.Development, InAddArgs: "-shadowvariableerrors");
                }
            }

            Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: false, InForceNonUnity: true, InForceNoXGE: true);

            UE4Build.CheckBuildProducts(Build.BuildProductFiles);
            SaveRecordOfSuccessAndAddToBuildProducts();
        }
Esempio n. 13
0
        public override void DoTest(GUBP bp)
        {
            var Build = new UE4Build(bp);
            var Agenda = new UE4Build.BuildAgenda();

            Agenda.AddTargets(new string[] { BranchConfig.Branch.BaseEngineProject.Properties.Targets[TargetRules.TargetType.Game].TargetName }, UnrealTargetPlatform.IOS, UnrealTargetConfiguration.Development);

            Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: false);

            UE4Build.CheckBuildProducts(Build.BuildProductFiles);
            SaveRecordOfSuccessAndAddToBuildProducts();
        }
 public override void PreBuildAgenda(UE4Build Build, UE4Build.BuildAgenda Agenda)
 {
 }
Esempio n. 15
0
		public virtual void PostBuildTarget(UE4Build Build, string ProjectName, string UProjectPath, string Config)
		{

		}
Esempio n. 16
0
    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",
            "VehicleGame",
            "Shadow",
            "Soul",
        };

        var MacDebugTargets = new List<string>
        {
            "FortniteGame",
            "FortniteEditor",
            "ShooterGameEditor",
            "ShooterGame",
        };

        var PS4DevTargets = new List<string>
        {
            "FortniteGame",
        };

        var XboxOneDevTargets = new List<string>
        {
            "QAGame",
        };

        var IOSDevTargets = new List<string>
        {
            "QAGame",
            "Shadow",
            //"PlatformerGame",
            //"StrategyGame",
            "Soul",
        };

        var LinuxTargets = new List<string>
        {
            "FortniteServer",
        };

        var WinRTDevTargets = new List<string>
        {
            "QAGame",
        };

        var HTML5DevTargets = new List<string>
        {
            "QAGame",
        };

        var AndroidDevTargets = new List<string>
        {
            "UE4Game",
            "Soul",
        };

        //Check to see if we should Exclude any projects.  We would want to do this for branches that do not have all of the projects
        var Excludes = ParseParamValue("Exclude");

        if (!String.IsNullOrEmpty(Excludes))
        {
            List<List<string>> TargetLists = new List<List<string>>
            {
                Win32Targets,
                Win64DevTargets,
                PS4DevTargets,
                XboxOneDevTargets,
                IOSDevTargets,
                LinuxTargets,
                HTML5DevTargets,
                WinRTDevTargets,
                MacDebugTargets,
                AndroidDevTargets
            };

            List<string> Samples = new List<string>
            {
                "PlatformerGame",
                "ShooterGame",
                "StrategyGame",
                "VehicleGame",
                "PlatformerGameEditor",
                "ShooterGameEditor",
                "StrategyGameEditor",
                "VehicleGameEditor",
            };

            List<string> Orion = new List<string>
            {
                "OrionGame",
                "OrionEditor",
            };

            List<string> Fortnite = new List<string>
            {
                "FortniteServer",
                "FortniteGame",
                "FortniteClient",
                "FortniteEditor",
            };

            List<string> Shadow = new List<string>
            {
                "Shadow",
                "ShadowEditor",
            };

            List<string> Soul = new List<string>
            {
                "Soul",
                "SoulEditor",
            };

            List<string> Exclude = new List<string>(Excludes.Split('+'));

            foreach (List<string> List in TargetLists)
            {
                if (Exclude.Contains("Samples"))
                {
                    RemoveTargetsFromList(Samples, List);
                }
                if (Exclude.Contains("Orion"))
                {
                    RemoveTargetsFromList(Orion, List);
                }
                if (Exclude.Contains("Fortnite"))
                {
                    RemoveTargetsFromList(Fortnite, List);
                }
                if (Exclude.Contains("Shadow"))
                {
                    RemoveTargetsFromList(Shadow, List);
                }
                if (Exclude.Contains("Soul"))
                {
                    RemoveTargetsFromList(Soul, List);
                }
            }
        }
        // @todo: make this programmatic by looping over the TargetLists (which maybe should be a map from config to list)
        string[] Win64Dev = Win64DevTargets.ToArray();
        string[] Win32Dev = Win32Targets.ToArray();
        string[] PS4Dev = PS4DevTargets.ToArray();
        string[] XboxOneDev = XboxOneDevTargets.ToArray();
        string[] IOSDev = IOSDevTargets.ToArray();
        string[] LinuxDev = LinuxTargets.ToArray();
        string[] WinRTDev = WinRTDevTargets.ToArray();
        string[] MacDebug = MacDebugTargets.ToArray();
        string[] HTML5Dev = HTML5DevTargets.ToArray();
        string[] AndroidDev = AndroidDevTargets.ToArray();

        switch (Config.ToUpperInvariant())
        {
            case "TOOLS":
                Agenda.AddTargets(ProgramTargets, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development);
                break;
            case "EDITORS":
                Agenda.AddTargets(Win64Dev, UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development);
                break;
            case "WIN32DEV":
                Agenda.AddTargets(Win32Dev, UnrealTargetPlatform.Win32, UnrealTargetConfiguration.Development);
                break;
            case "PS4DEV":
                Agenda.AddTargets(PS4Dev, UnrealTargetPlatform.PS4, UnrealTargetConfiguration.Development);
                break;
            case "XBOXONEDEV":
                Agenda.AddTargets(XboxOneDev, UnrealTargetPlatform.XboxOne, UnrealTargetConfiguration.Development);
                break;
            case "IOSDEV":
                Agenda.AddTargets(IOSDev, UnrealTargetPlatform.IOS, UnrealTargetConfiguration.Development);
                break;
            case "LINUX":
                Agenda.AddTargets(LinuxDev, UnrealTargetPlatform.Linux, UnrealTargetConfiguration.Development);
                break;
            case "WINRT":
                Agenda.AddTargets(WinRTDev, UnrealTargetPlatform.WinRT, UnrealTargetConfiguration.Development);
                break;
            case "MAC":
                Agenda.AddTargets(MacDebug, UnrealTargetPlatform.Mac, UnrealTargetConfiguration.Debug);
                break;
            case "HTML5":
                Agenda.AddTargets(HTML5Dev, UnrealTargetPlatform.HTML5, UnrealTargetConfiguration.Development);
                break;
            case "ANDROID":
                Agenda.AddTargets(AndroidDev, UnrealTargetPlatform.Android, UnrealTargetConfiguration.Development);
                break;
        }
        UE4Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: true);
        UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles);
    }
    public override void PreBuildAgenda(UE4Build Build, UE4Build.BuildAgenda Agenda)
	{
		if (UnrealBuildTool.BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac && !Automation.IsEngineInstalled())
		{
			Agenda.DotNetProjects.Add(@"Engine\Source\Programs\IOS\MobileDeviceInterface\MobileDeviceInterface.csproj");
			Agenda.DotNetProjects.Add(@"Engine\Source\Programs\IOS\iPhonePackager\iPhonePackager.csproj");
			Agenda.DotNetProjects.Add(@"Engine\Source\Programs\IOS\DeploymentServer\DeploymentServer.csproj");
		}
	}
Esempio n. 18
0
		/// <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;
		}
Esempio n. 19
0
    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");
    }
Esempio n. 20
0
 public override void DoBuild(GUBP bp)
 {
     var UE4Build = new UE4Build(bp);
     BuildProducts = UE4Build.UpdateVersionFiles();
 }
Esempio n. 21
0
 public override void PostBuild(GUBP bp, UE4Build UE4Build)
 {
     UE4Build.AddUATFilesToBuildProducts();
     UE4Build.AddUBTFilesToBuildProducts();
 }
Esempio n. 22
0
        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");
            }
        }
Esempio n. 23
0
        public override void DoBuild(GUBP bp)
        {
            BuildProducts = new List<string>();
            var UE4Build = new UE4Build(bp);
            UE4Build.BuildAgenda Agenda = GetAgenda(bp);
            if (Agenda != null)
            {
				bool ReallyDeleteBuildProducts = DeleteBuildProducts() && !BranchConfig.bForceIncrementalCompile;
                Agenda.DoRetries = false; // these would delete build products
				bool UseParallelExecutor = bDependentOnCompileTools && (HostPlatform == UnrealTargetPlatform.Win64);
				UE4Build.Build(Agenda, InDeleteBuildProducts: ReallyDeleteBuildProducts, InUpdateVersionFiles: false, InForceNoXGE: true, InForceUnity: true, InUseParallelExecutor: UseParallelExecutor);
				using(TelemetryStopwatch PostBuildStopwatch = new TelemetryStopwatch("PostBuild"))
				{
					PostBuild(bp, UE4Build);
				}
                UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles);
                foreach (var Product in UE4Build.BuildProductFiles)
                {
                    AddBuildProduct(Product);
                }
                RemoveOveralppingBuildProducts();
                PostBuildProducts(bp);
            }
			if (Agenda == null || (BuildProducts.Count == 0 && BranchConfig.bForceIncrementalCompile))
            {
                SaveRecordOfSuccessAndAddToBuildProducts("Nothing to actually compile");
            }
        }
Esempio n. 24
0
		public override void DoBuild(GUBP bp)
		{
			base.DoBuild(bp);

			if(Precompiled)
			{
				// Get a list of all the build dependencies
				UE4Build.BuildAgenda Agenda = GetAgenda(bp);
				string FileListPath = new UE4Build(bp).GenerateExternalFileList(Agenda);
				UnrealBuildTool.ExternalFileList FileList = UnrealBuildTool.Utils.ReadClass<UnrealBuildTool.ExternalFileList>(FileListPath);

				// Make all the paths relative to the root
				string FilterPrefix = CommandUtils.CombinePaths(PathSeparator.Slash, CommandUtils.CmdEnv.LocalRoot).TrimEnd('/') + "/";
				for(int Idx = 0; Idx < FileList.FileNames.Count; Idx++)
				{
					if(FileList.FileNames[Idx].StartsWith(FilterPrefix, StringComparison.InvariantCultureIgnoreCase))
					{
						FileList.FileNames[Idx] = FileList.FileNames[Idx].Substring(FilterPrefix.Length);
					}
					else
					{
						CommandUtils.LogError("Referenced external file is not under local root: {0}", FileList.FileNames[Idx]);
					}
				}

				// Write the resulting file list out to disk
				string OutputFileListPath = StaticGetBuildDependenciesPath(HostPlatform, GameProj, TargetPlatform);
				UnrealBuildTool.Utils.WriteClass<UnrealBuildTool.ExternalFileList>(FileList, OutputFileListPath, "");
				AddBuildProduct(OutputFileListPath);

				// Archive all the headers
				FileFilter Filter = new FileFilter();
				Filter.Include("/Engine/Intermediate/Build/" + TargetPlatform.ToString() + "/UE4/Inc/...");
				Filter.Include("/Engine/Plugins/.../Intermediate/Build/" + TargetPlatform.ToString() + "/UE4/Inc/...");

				string ZipFileName = StaticGetArchivedHeadersPath(HostPlatform, GameProj, TargetPlatform);
				CommandUtils.ZipFiles(ZipFileName, CommandUtils.CmdEnv.LocalRoot, Filter);
				BuildProducts.Add(ZipFileName);
			}
		}
Esempio n. 25
0
        public override void PostBuild(GUBP bp, UE4Build UE4Build)
        {
			if (HostPlatform == UnrealTargetPlatform.Win64)
            {
            	UE4Build.AddUATFilesToBuildProducts();
            	UE4Build.AddUBTFilesToBuildProducts();
        	}
    	}
Esempio n. 26
0
 public override void DoBuild(GUBP bp)
 {
     var UE4Build = new UE4Build(bp);
     BuildProducts = UE4Build.UpdateVersionFiles(ActuallyUpdateVersionFiles: CommandUtils.P4Enabled && CommandUtils.AllowSubmit);
 }
	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);

			// Open files for add or edit
			UE4Build.AddBuildProductsToChangelist(WorkingCL, UE4Build.BuildProductFiles);
		}

		Log("********** BUILD COMMAND COMPLETED **********");
	}
Esempio n. 28
0
		public override void DoTest(GUBP bp)
		{
			var Build = new UE4Build(bp);
			var Agenda = new UE4Build.BuildAgenda();

			Agenda.AddTargets(new string[] { "UnrealHeaderTool" }, HostPlatform, UnrealTargetConfiguration.Development);
			Agenda.AddTargets(new string[] { ProgramTarget.TargetName }, HostPlatform, UnrealTargetConfiguration.Development, InAddArgs: "-skipnonhostplatforms");			

			Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: false, InForceNonUnity: true, InForceNoXGE: true);

			UE4Build.CheckBuildProducts(Build.BuildProductFiles);
			SaveRecordOfSuccessAndAddToBuildProducts();
		}
	public override void ExecuteBuild()
	{
		// get the project
		var UProjectFileName = ParseParamValue("Project");
		if (UProjectFileName == null)
		{
			throw new AutomationException("Project was not specified via the -project argument.");
		}

		// Get the list of targets
		var TargetList = ParseParamList("Target");
		if (TargetList == null)
		{
			throw new AutomationException("Target was not specified via the -target argument.");
		}

		// get the list of platforms
		var PlatformList = ParseParamList("TargetPlatforms", "Win64");
		List<UnrealTargetPlatform> TargetPlatforms = new List<UnrealTargetPlatform>();
		foreach(string Platform in PlatformList)
		{
			TargetPlatforms.Add((UnrealTargetPlatform)Enum.Parse(typeof(UnrealTargetPlatform), Platform, true));
		}

		// get the list configurations
		var ConfigList = ParseParamList("Config", "Development");
		List<UnrealTargetConfiguration> ConfigsToBuild = new List<UnrealTargetConfiguration>();
		foreach(string Config in ConfigList)
		{
			ConfigsToBuild.Add((UnrealTargetConfiguration)Enum.Parse(typeof(UnrealTargetConfiguration), Config, true));
		}

		// parse any extra parameters
		bool bClean = ParseParam("Clean");
		int WorkingCL = ParseParamInt("P4Change");

        FileReference UProjectFileReference = new FileReference( UProjectFileName);

		// add the targets to the agenda
		// verify the targets and add them to the agenda
		var Properties = ProjectUtils.GetProjectProperties(UProjectFileReference);
		UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda();
		foreach (string Target in TargetList)
		{
			SingleTargetProperties TargetData;
			if (!Properties.Targets.TryGetValue((TargetRules.TargetType)Enum.Parse(typeof(TargetRules.TargetType), Target), out TargetData))
			{
				throw new AutomationException("Project does not support specified target: {0}", Target);
			}

			foreach (UnrealTargetPlatform TargetPlatform in TargetPlatforms)
			{
				if (TargetData.Rules.SupportsPlatform(TargetPlatform))
				{
                    List<UnrealTargetConfiguration> SupportedConfigurations = new List<UnrealTargetConfiguration>();
                    TargetData.Rules.GetSupportedConfigurations(ref SupportedConfigurations, true);

					foreach (UnrealTargetConfiguration TargetConfig in ConfigsToBuild)
					{
						if (SupportedConfigurations.Contains(TargetConfig))
						{
                            Agenda.AddTarget(TargetData.TargetName, TargetPlatform, TargetConfig, UProjectFileReference);
						}
						else
						{
							Log("{0} doesn't support the {1} configuration. It will not be built.", TargetData.TargetName, TargetConfig);
						}
					}
				}
				else
				{
					Log("{0} doesn't support the {1} platform. It will not be built.", TargetData.TargetName, TargetPlatform);
				}
			}
		}


		// build it
		UE4Build Build = new UE4Build(this);
		Build.Build(Agenda, InDeleteBuildProducts: bClean, InUpdateVersionFiles: WorkingCL > 0);

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

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

			// Open files for add or edit
			UE4Build.AddBuildProductsToChangelist(WorkingCL, Build.BuildProductFiles);
		}

	}
Esempio n. 30
0
		public virtual void PreBuildAgenda(UE4Build Build, UE4Build.BuildAgenda Agenda)
		{

		}