コード例 #1
0
ファイル: UE4Build.cs プロジェクト: kidaa/UnrealEngineVR
        XGEItem XGEPrepareBuildWithUBT(string ProjectName, string TargetName, UnrealBuildTool.UnrealTargetPlatform Platform, string Config, string UprojectPath, bool ForceMonolithic = false, bool ForceNonUnity = false, bool ForceDebugInfo = false, string InAddArgs = "", bool ForceUnity = false, Dictionary<string, string> EnvVars = null)
        {
            string AddArgs = "";
            if (string.IsNullOrEmpty(UprojectPath) == false)
            {
                AddArgs += " " + CommandUtils.MakePathSafeToUseWithCommandLine(UprojectPath);
            }
            AddArgs += " " + InAddArgs;
            if (ForceMonolithic)
            {
                AddArgs += " -monolithic";
            }
            if (ForceNonUnity)
            {
                AddArgs += " -disableunity";
            }
            if (ForceUnity)
            {
                AddArgs += " -forceunity";
            }
            if (ForceDebugInfo)
            {
                AddArgs += " -forcedebuginfo";
            }
            if(AddArgs.Contains("PostedRocket"))
            {
                if (UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealBuildTool.UnrealTargetPlatform.Win64)
                {
                    BaseUBTDirectory = @"Rocket/TempInst/Windows";
                }
                if (UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealBuildTool.UnrealTargetPlatform.Mac)
                {
                    BaseUBTDirectory = @"Rocket/TempInst/Mac";
                }
            }
            PrepareUBT();

            string UBTManifest = GetUBTManifest(UprojectPath, AddArgs);

            DeleteFile(UBTManifest);
            XGEItem Result = new XGEItem();

            ClearExportedXGEXML();

            RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: Platform.ToString(), Config: Config, AdditionalArgs: "-generatemanifest -nobuilduht -xgeexport" + AddArgs, EnvVars: EnvVars);

            PrepareManifest(UBTManifest);

            Result.Platform = Platform;
            Result.Config = Config;
            Result.ProjectName = string.IsNullOrEmpty(ProjectName) ? TargetName : ProjectName; // use the target as the project if no project is set
            Result.UProjectPath = UprojectPath;
            Result.Manifest = ReadManifest(UBTManifest);
            Result.OutputCaption = String.Format("{0}-{1}-{2}", Path.GetFileNameWithoutExtension(Result.ProjectName), Platform.ToString(), Config.ToString());
            DeleteFile(UBTManifest);

            Result.CommandLine = UBTExecutable + " " + UBTCommandline(Project: ProjectName, Target: TargetName, Platform: Platform.ToString(), Config: Config, AdditionalArgs: "-noxge -nobuilduht" + AddArgs);

            Result.XgeXmlFiles = new List<string>();
            foreach (var XGEFile in FindXGEFiles())
            {
                if (!FileExists_NoExceptions(XGEFile))
                {
                    throw new AutomationException("BUILD FAILED: Couldn't find file: {0}", XGEFile);
                }
                int FileNum = 0;
                string OutFile;
                while (true)
                {
                    OutFile = CombinePaths(CmdEnv.LogFolder, String.Format("UBTExport.{0}.xge.xml", FileNum));
                    FileInfo ItemInfo = new FileInfo(OutFile);
                    if (!ItemInfo.Exists)
                    {
                        break;
                    }
                    FileNum++;
                }
                CopyFile(XGEFile, OutFile);
                Result.XgeXmlFiles.Add(OutFile);
            }
            ClearExportedXGEXML();
            return Result;
        }
コード例 #2
0
ファイル: UE4Build.cs プロジェクト: kidaa/UnrealEngineVR
        void BuildWithUBT(string ProjectName, string TargetName, UnrealBuildTool.UnrealTargetPlatform TargetPlatform, string Config, string UprojectPath, bool ForceMonolithic = false, bool ForceNonUnity = false, bool ForceDebugInfo = false, bool ForceFlushMac = false, bool DisableXGE = false, string InAddArgs = "", bool ForceUnity = false, Dictionary<string, string> EnvVars = null)
        {
            string AddArgs = "";
            if (string.IsNullOrEmpty(UprojectPath) == false)
            {
                AddArgs += " " + CommandUtils.MakePathSafeToUseWithCommandLine(UprojectPath);
            }
            AddArgs += " " + InAddArgs;
            if (ForceMonolithic)
            {
                AddArgs += " -monolithic";
            }
            if (ForceNonUnity)
            {
                AddArgs += " -disableunity";
            }
            if (ForceUnity)
            {
                AddArgs += " -forceunity";
            }
            if (ForceDebugInfo)
            {
                AddArgs += " -forcedebuginfo";
            }
            if (ForceFlushMac)
            {
                AddArgs += " -flushmac";
            }
            if (DisableXGE)
            {
                AddArgs += " -noxge";
            }
            if(AddArgs.Contains("PostedRocket"))
            {
                if (UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealBuildTool.UnrealTargetPlatform.Win64)
                {
                    BaseUBTDirectory = @"Rocket/TempInst/Windows";
                }
                if (UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealBuildTool.UnrealTargetPlatform.Mac)
                {
                    BaseUBTDirectory = @"Rocket/TempInst/Mac";
                }
            }

            PrepareUBT();

            // let the platform determine when to use the manifest
            bool UseManifest = Platform.Platforms[TargetPlatform].ShouldUseManifestForUBTBuilds(AddArgs);

            if (UseManifest)
            {
                string UBTManifest = GetUBTManifest(UprojectPath, AddArgs);

                DeleteFile(UBTManifest);

                RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: TargetPlatform.ToString(), Config: Config, AdditionalArgs: "-generatemanifest" + AddArgs, EnvVars: EnvVars);

                PrepareManifest(UBTManifest);
            }

            RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: TargetPlatform.ToString(), Config: Config, AdditionalArgs: AddArgs, EnvVars: EnvVars);

            // allow the platform to perform any actions after building a target (seems almost like this should be done in UBT)
            Platform.Platforms[TargetPlatform].PostBuildTarget(this, string.IsNullOrEmpty(ProjectName) ? TargetName : ProjectName, UprojectPath, Config);

            if (UseManifest)
            {
                string UBTManifest = GetUBTManifest(UprojectPath, AddArgs);

                AddBuildProductsFromManifest(UBTManifest);

                DeleteFile(UBTManifest);
            }
        }
コード例 #3
0
ファイル: UE4Build.cs プロジェクト: kidaa/UnrealEngineVR
        void CleanWithUBT(string ProjectName, string TargetName, UnrealBuildTool.UnrealTargetPlatform Platform, string Config, string UprojectPath, bool ForceMonolithic = false, bool ForceNonUnity = false, bool ForceDebugInfo = false, string InAddArgs = "", bool ForceUnity = false, Dictionary<string, string> EnvVars = null)
        {
            string AddArgs = "";
            if (string.IsNullOrEmpty(UprojectPath) == false)
            {
                AddArgs += " " + CommandUtils.MakePathSafeToUseWithCommandLine(UprojectPath);
            }
            AddArgs += " " + InAddArgs;
            if (ForceMonolithic)
            {
                AddArgs += " -monolithic";
            }
            if (ForceNonUnity)
            {
                AddArgs += " -disableunity";
            }
            if (ForceUnity)
            {
                AddArgs += " -forceunity";
            }
            if (ForceDebugInfo)
            {
                AddArgs += " -forcedebuginfo";
            }
            if (!TargetName.Equals("UnrealHeaderTool", StringComparison.InvariantCultureIgnoreCase))
            {
                AddArgs += " -nobuilduht";
            }

            PrepareUBT();

            RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: Platform.ToString(), Config: Config, AdditionalArgs: "-clean" + AddArgs, EnvVars: EnvVars);
        }
コード例 #4
0
		void BuildWithUBT(string ProjectName, string TargetName, UnrealBuildTool.UnrealTargetPlatform TargetPlatform, string Config, string UprojectPath, bool ForceMonolithic = false, bool ForceNonUnity = false, bool ForceDebugInfo = false, bool ForceFlushMac = false, bool DisableXGE = false, string InAddArgs = "", bool ForceUnity = false, Dictionary<string, string> EnvVars = null)
		{
			string AddArgs = "";
			if (string.IsNullOrEmpty(UprojectPath) == false)
			{
				AddArgs += " " + CommandUtils.MakePathSafeToUseWithCommandLine(UprojectPath);
			}
			AddArgs += " " + InAddArgs;
			if (ForceMonolithic)
			{
				AddArgs += " -monolithic";
			}
			if (ForceNonUnity)
			{
				AddArgs += " -disableunity";
			}
			if (ForceUnity)
			{
				AddArgs += " -forceunity";
			}
			if (ForceDebugInfo)
			{
				AddArgs += " -forcedebuginfo";
			}
			if (ForceFlushMac)
			{
				AddArgs += " -flushmac";
			}
			if (DisableXGE)
			{
				AddArgs += " -noxge";
			}

			PrepareUBT();

			// let the platform determine when to use the manifest
            bool UseManifest = Platform.Platforms[TargetPlatform].ShouldUseManifestForUBTBuilds(AddArgs);

			if (UseManifest)
			{
                string UBTManifest = GetUBTManifest(UprojectPath, AddArgs);

				DeleteFile(UBTManifest);
				using(TelemetryStopwatch PrepareManifestStopwatch = new TelemetryStopwatch("PrepareUBTManifest.{0}.{1}.{2}", TargetName, TargetPlatform.ToString(), Config))
				{
					RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: TargetPlatform.ToString(), Config: Config, AdditionalArgs: AddArgs + " -generatemanifest", EnvVars: EnvVars);
				}
                PrepareManifest(UBTManifest, false);
			}

			using(TelemetryStopwatch CompileStopwatch = new TelemetryStopwatch("Compile.{0}.{1}.{2}", TargetName, TargetPlatform.ToString(), Config))
			{
				RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: TargetPlatform.ToString(), Config: Config, AdditionalArgs: AddArgs, EnvVars: EnvVars);
			}
            // allow the platform to perform any actions after building a target (seems almost like this should be done in UBT)
			Platform.Platforms[TargetPlatform].PostBuildTarget(this, string.IsNullOrEmpty(ProjectName) ? TargetName : ProjectName, UprojectPath, Config);

			if (UseManifest)
			{
                string UBTManifest = GetUBTManifest(UprojectPath, AddArgs);

				AddBuildProductsFromManifest(UBTManifest);

				DeleteFile(UBTManifest);
			}
		}