public void RaiseBuildTab(BuildTab 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(BuildInfo buildInfo) { if (BuildsInProgress.Contains(buildInfo)) { throw new InvalidOperationException("A build is already in progress"); } BuildsInProgress.Add(buildInfo); try { BuildTab buildTab = GodotSharpEditor.Instance.BottomPanel.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 ? BuildTab.BuildResults.Success : BuildTab.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 BuildTab GetBuildTabFor(BuildInfo buildInfo) { foreach (var buildTab in new Array <BuildTab>(buildTabs.GetChildren())) { if (buildTab.BuildInfo.Equals(buildInfo)) { return(buildTab); } } var newBuildTab = new BuildTab(buildInfo); AddBuildTab(newBuildTab); return(newBuildTab); }
public void AddBuildTab(BuildTab buildTab) { buildTabs.AddChild(buildTab); RaiseBuildTab(buildTab); }
public static void StopBuild(BuildTab buildTab) => throw new NotImplementedException();