private bool BuildPlugin()

in src/dotnet/RiderPlugin.UnrealLink/PluginInstaller/UnrealPluginInstaller.cs [683:738]


        private bool BuildPlugin(Lifetime lifetime, VirtualFileSystemPath upluginPath,
            VirtualFileSystemPath outputDir, VirtualFileSystemPath engineRoot,
            Action<double> progressPump)
        {
            var runUatName = $"RunUAT.{CmdUtils.GetPlatformCmdExtension()}";
            var pathToUat = engineRoot / "Engine" / "Build" / "BatchFiles" / runUatName;
            if (!pathToUat.ExistsFile)
            {
                myLogger.Warn($"[UnrealLink]: Failed build plugin: {runUatName} is not available");
                myUnrealHost.myModel.RiderLinkInstallMessage(
                    new InstallMessage(Strings.FailedToBuildRiderLinkPluginFor__Text.Format(engineRoot), ContentType.Error));
                myUnrealHost.myModel.RiderLinkInstallMessage(
                    new InstallMessage(Strings.Reason_UatIsNotAvailable_Text.Format(runUatName, pathToUat), ContentType.Error));
                return false;
            }

            try
            {
                var pipeStreams = CreatePipeStreams("[UAT]:", progressPump);
                var startInfo = CmdUtils.GetProcessStartInfo(pipeStreams, pathToUat, null, "BuildPlugin",
                    "-Unversioned", $"-Plugin=\"{upluginPath.FullPath}\"",
                    $"-Package=\"{outputDir.FullPath}\"");

                myLogger.Info($"[UnrealLink]: Building UnrealLink plugin with: {startInfo.Arguments}");
                myLogger.Verbose("[UnrealLink]: Start building UnrealLink");

                var result = CmdUtils.RunCommandWithLock(lifetime, startInfo, myLogger);
                myLogger.Verbose("[UnrealLink]: Stop building UnrealLink");
                lifetime.ToCancellationToken().ThrowIfCancellationRequested();

                if (result != 0)
                {
                    myLogger.Error($"[UnrealLink]: Failed to build plugin for {engineRoot}");
                    myUnrealHost.myModel.RiderLinkInstallMessage(new InstallMessage(Strings.FailedToBuildRiderLinkPluginFor__Text.Format(engineRoot),
                        ContentType.Error));
                    return false;
                }
            }
            catch (OperationCanceledException)
            {
                myLogger.Verbose("[UnrealLink]: Build cancelled");
                throw;
            }
            catch (Exception exception)
            {
                myLogger.Verbose("[UnrealLink]: Stop building UnrealLink");
                myLogger.Error(exception,
                    $"[UnrealLink]: Failed to build plugin for {engineRoot}");

                myUnrealHost.myModel.RiderLinkInstallMessage(
                    new InstallMessage(Strings.FailedToBuildRiderLinkPluginFor__Text.Format(engineRoot), ContentType.Error));
                return false;
            }

            return true;
        }