Exemple #1
0
        private bool RegenerateProjectUsingUVS(FileSystemPath uprojectFilePath, FileSystemPath engineRoot)
        {
            if (PlatformUtil.RuntimePlatform != PlatformUtil.Platform.Windows)
            {
                return(false);
            }

            var pathToUnrealVersionSelector =
                engineRoot / "Engine" / "Binaries" / "Win64" / "UnrealVersionSelector.exe";

            if (!pathToUnrealVersionSelector.ExistsFile)
            {
                myLogger.Info($"[UnrealLink]: {pathToUnrealVersionSelector} is not available");
                return(false);
            }

            var commandLine =
                GetPlatformCommandLine(pathToUnrealVersionSelector, "/projectFiles", $"\"{uprojectFilePath}\"");

            try
            {
                lock (HACK_getMutexForUBT())
                {
                    myLogger.Info($"[UnrealLink]: Regenerating project files: {commandLine}");
                    ErrorLevelException.ThrowIfNonZero(InvokeChildProcess.InvokeChildProcessIntoLogger(
                                                           BatchUtils.GetPathToCmd(),
                                                           commandLine,
                                                           LoggingLevel.INFO,
                                                           TimeSpan.FromMinutes(1),
                                                           InvokeChildProcess.TreatStderr.AsOutput,
                                                           pathToUnrealVersionSelector.Directory
                                                           ));
                }
            }
            catch (ErrorLevelException errorLevelException)
            {
                myLogger.Error(errorLevelException,
                               $"[UnrealLink]: Failed refresh project files: calling {pathToUnrealVersionSelector} {commandLine}");
                return(false);
            }

            return(true);
        }
Exemple #2
0
 private FileSystemPath GetPlatformCommand(FileSystemPath command)
 {
     return(PlatformUtil.RuntimePlatform == PlatformUtil.Platform.Windows ? BatchUtils.GetPathToCmd() : command);
 }