public void RaiseBuildTab(MonoBuildTab buildTab) { if (buildTab.GetParent() != buildTabs) { throw new InvalidOperationException("Build tab is not in the tabs list"); } buildTabs.MoveChild(buildTab, 0); _UpdateBuildTabsList(); }
public static bool Build(MonoBuildInfo buildInfo) { if (BuildsInProgress.Contains(buildInfo)) { throw new InvalidOperationException("A build is already in progress"); } BuildsInProgress.Add(buildInfo); try { MonoBuildTab buildTab = GodotSharpEditor.Instance.MonoBottomPanel.GetBuildTabFor(buildInfo); buildTab.OnBuildStart(); // Required in order to update the build tasks list Internal.GodotMainIteration(); try { RemoveOldIssuesFile(buildInfo); } catch (IOException e) { buildTab.OnBuildExecFailed($"Cannot remove issues file: {GetIssuesFilePath(buildInfo)}"); Console.Error.WriteLine(e); } try { int exitCode = BuildSystem.Build(buildInfo); if (exitCode != 0) { PrintVerbose($"MSBuild exited with code: {exitCode}. Log file: {GetLogFilePath(buildInfo)}"); } buildTab.OnBuildExit(exitCode == 0 ? MonoBuildTab.BuildResults.Success : MonoBuildTab.BuildResults.Error); return(exitCode == 0); } catch (Exception e) { buildTab.OnBuildExecFailed($"The build method threw an exception.\n{e.GetType().FullName}: {e.Message}"); Console.Error.WriteLine(e); return(false); } } finally { BuildsInProgress.Remove(buildInfo); } }
public MonoBuildTab GetBuildTabFor(MonoBuildInfo buildInfo) { foreach (var buildTab in new Array <MonoBuildTab>(buildTabs.GetChildren())) { if (buildTab.BuildInfo.Equals(buildInfo)) { return(buildTab); } } var newBuildTab = new MonoBuildTab(buildInfo); AddBuildTab(newBuildTab); return(newBuildTab); }
public void AddBuildTab(MonoBuildTab buildTab) { buildTabs.AddChild(buildTab); RaiseBuildTab(buildTab); }
public static void StopBuild(MonoBuildTab buildTab) => throw new NotImplementedException();