public override bool PrepTargetForDeployment(UEBuildTarget InTarget)
        {
            string InAppName = InTarget.AppName;

            Log.TraceInformation("Prepping {0} for deployment to {1}", InAppName, InTarget.Platform.ToString());
            System.DateTime PrepDeployStartTime = DateTime.UtcNow;

            string TargetFilename      = InTarget.RulesAssembly.GetTargetFileName(InAppName).FullName;
            string ProjectSourceFolder = new FileInfo(TargetFilename).DirectoryName + "/";

            string RelativeTargetDirectory;
            string EngineSourceRelativeBinaryPath;

            UWPProjectGenerator.GetTargetUWPPaths(InTarget.RulesAssembly, InAppName, InTarget.Rules, out EngineSourceRelativeBinaryPath, out RelativeTargetDirectory);

            PrepForUATPackageOrDeploy(InAppName, InTarget.ProjectDirectory.FullName, InTarget.OutputPath.FullName, BuildConfiguration.RelativeEnginePath, false, "");

            // TODO - richiem - restore this if we find that it's needed.
            //Log.TraceInformation("...copying the CELL dll...");
            //string CELLPath = "../../../Engine/Source/" + UEBuildConfiguration.UEThirdPartySourceDirectory + "CELL/lib/win64/";
            //string CELLPathRelease = CELLPath + "Release/";
            //string CELLDllRelease = "CommonEventLoggingLibrary.dll";
            //string CELLPathDebug = CELLPath + "Debug/";
            //string CELLDllDebug = "CommonEventLoggingLibraryd.dll";

            //CopyFile(EngineSourceRelativeBinaryPath + CELLPathRelease + CELLDllRelease, EngineSourceRelativeBinaryPath + CELLDllRelease, true);
            //CopyFile(EngineSourceRelativeBinaryPath + CELLPathDebug + CELLDllDebug, EngineSourceRelativeBinaryPath + CELLDllDebug, true);

            //string XSAPIPath            = EngineSourceRelativeBinaryPath + "../../../Engine/Source/ThirdParty/XSAPI/lib/";
            //string XboxServicesConfig   = "xboxservices.config";
            //string DesktopLogin         = "******";

            //Log.TraceInformation("...copying xboxservices.config");
            //CopyFile(XSAPIPath + XboxServicesConfig, EngineSourceRelativeBinaryPath + XboxServicesConfig, true);
            //Log.TraceInformation("...copying DesktopLogin.exe...");
            //CopyFile(XSAPIPath + DesktopLogin, EngineSourceRelativeBinaryPath + DesktopLogin, true);

            // TODO - richiem - restore this if we find that it's needed.
            //if (InTarget.Configuration == UnrealTargetConfiguration.Development)
            //{
            //    Log.TraceInformation("...copying AutoLogin...");
            //    string AutoLoginPath    = EngineSourceRelativeBinaryPath + "../../../Engine/Source/Tools/AutoLogin/";
            //    string AutoLoginDLL     = "AutoLogin.dll";
            //    string AutoLoginBat     = "AutoLogin.bat";
            //    CopyFile(AutoLoginPath + "bin/Debug/" + AutoLoginDLL, EngineSourceRelativeBinaryPath + AutoLoginDLL, true);
            //    CopyFile(AutoLoginPath + AutoLoginBat, EngineSourceRelativeBinaryPath + AutoLoginBat, true);
            //}



            // Log out the time taken to deploy...
            double PrepDeployDuration = (DateTime.UtcNow - PrepDeployStartTime).TotalSeconds;

            Log.TraceInformation("UWP deployment preparation took {0:0.00} seconds", PrepDeployDuration);

            return(true);
        }
Example #2
0
        /**
         *	Helper function for copying a tree files
         */
        //void CopyDirectory(string InSource, string InDest, bool bForce, bool bRecurse)
        //{
        //    if (Directory.Exists(InSource))
        //    {
        //        if (!Directory.Exists(InDest))
        //        {
        //            Directory.CreateDirectory(InDest);
        //        }
        //        // Copy all files
        //        string[] FilesInDir = Directory.GetFiles(InSource);
        //        foreach (string FileSourcePath in FilesInDir)
        //        {
        //            string FileDestPath = Path.Combine(InDest, Path.GetFileName(FileSourcePath));
        //            if (bForce == true)
        //            {
        //                if (File.Exists(FileDestPath) == true)
        //                {
        //                    DeployHelper_DeleteFile(FileDestPath);
        //                }
        //            }
        //            File.Copy(FileSourcePath, FileDestPath, true);
        //        }
        //        // Recurse sub directories
        //        string[] DirsInDir = Directory.GetDirectories(InSource);
        //        foreach (string DirSourcePath in DirsInDir)
        //        {
        //            string DirName = Path.GetFileName(DirSourcePath);
        //            string DirDestPath = Path.Combine(InDest, DirName);
        //            CopyDirectory(DirSourcePath, DirDestPath, bForce, bRecurse);
        //        }
        //    }
        //}
        public bool PrepForUATPackageOrDeploy(string InProjectName, string InProjectDirectory, string InExecutablePath, string InEngineDir, bool bForDistribution, string CookFlavor)
        {
            // Much of the UWPProjectGenerator code assumes that the path will be set to Engine/Source
            string PreviousDirectory = Directory.GetCurrentDirectory();
            string PreviousRelativeEnginePath = BuildConfiguration.RelativeEnginePath;

            Directory.SetCurrentDirectory(Path.Combine(InEngineDir, "Binaries"));
            BuildConfiguration.RelativeEnginePath = "../../Engine";

            string ProjectBinaryFolder = new FileInfo(InExecutablePath).DirectoryName;
            string EngineSourceRelativeBinaryPath = Utils.MakePathRelativeTo(ProjectBinaryFolder, Path.Combine(InEngineDir, "Source"));
            bool bIsUE4Game = new FileInfo(InExecutablePath).Name.StartsWith("UE4Game", StringComparison.InvariantCultureIgnoreCase);

            UWPProjectGenerator ProjectGen = new UWPProjectGenerator();
            ProjectGen.GenerateDeployFiles(InProjectName, ProjectBinaryFolder, bIsUE4Game, EngineSourceRelativeBinaryPath);

            // back to root for UAT
            Directory.SetCurrentDirectory(PreviousDirectory);
            BuildConfiguration.RelativeEnginePath = PreviousRelativeEnginePath;

            return true;
        }
        /// <summary>
        /// Helper function for copying a tree files
        /// </summary>
        //void CopyDirectory(string InSource, string InDest, bool bForce, bool bRecurse)
        //{
        //    if (Directory.Exists(InSource))
        //    {
        //        if (!Directory.Exists(InDest))
        //        {
        //            Directory.CreateDirectory(InDest);
        //        }

        //        // Copy all files
        //        string[] FilesInDir = Directory.GetFiles(InSource);
        //        foreach (string FileSourcePath in FilesInDir)
        //        {
        //            string FileDestPath = Path.Combine(InDest, Path.GetFileName(FileSourcePath));
        //            if (bForce == true)
        //            {
        //                if (File.Exists(FileDestPath) == true)
        //                {
        //                    DeployHelper_DeleteFile(FileDestPath);
        //                }
        //            }
        //            File.Copy(FileSourcePath, FileDestPath, true);
        //        }

        //        // Recurse sub directories
        //        string[] DirsInDir = Directory.GetDirectories(InSource);
        //        foreach (string DirSourcePath in DirsInDir)
        //        {
        //            string DirName = Path.GetFileName(DirSourcePath);
        //            string DirDestPath = Path.Combine(InDest, DirName);
        //            CopyDirectory(DirSourcePath, DirDestPath, bForce, bRecurse);
        //        }
        //    }
        //}


        public bool PrepForUATPackageOrDeploy(string InProjectName, string InProjectDirectory, string InExecutablePath, string InEngineDir, bool bForDistribution, string CookFlavor)
        {
            // Much of the UWPProjectGenerator code assumes that the path will be set to Engine/Source
            string PreviousDirectory          = Directory.GetCurrentDirectory();
            string PreviousRelativeEnginePath = BuildConfiguration.RelativeEnginePath;

            Directory.SetCurrentDirectory(Path.Combine(InEngineDir, "Binaries"));
            BuildConfiguration.RelativeEnginePath = "../../Engine";

            string ProjectBinaryFolder            = new FileInfo(InExecutablePath).DirectoryName;
            string EngineSourceRelativeBinaryPath = Utils.MakePathRelativeTo(ProjectBinaryFolder, Path.Combine(InEngineDir, "Source"));
            bool   bIsUE4Game = new FileInfo(InExecutablePath).Name.StartsWith("UE4Game", StringComparison.InvariantCultureIgnoreCase);

            UWPProjectGenerator ProjectGen = new UWPProjectGenerator();

            ProjectGen.GenerateDeployFiles(InProjectName, ProjectBinaryFolder, bIsUE4Game, EngineSourceRelativeBinaryPath);

            // back to root for UAT
            Directory.SetCurrentDirectory(PreviousDirectory);
            BuildConfiguration.RelativeEnginePath = PreviousRelativeEnginePath;

            return(true);
        }