Welcome to mirror list, hosted at ThFree Co, Russian Federation.

DeployOperations.cs « MonoDevelop.Deployment.Gui « MonoDevelop.Deployment « Deployment « addins « src « main - github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 74fab9ef936f7bbc5d7af695b63307b52b7377ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

using System.Collections;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Projects;
using System.Threading.Tasks;

namespace MonoDevelop.Deployment.Gui
{
	public static class DeployOperations
	{
		public static void Install (SolutionFolderItem entry, ConfigurationSelector configuration)
		{
			using (ProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ()) {
				InstallDialog dlg = new InstallDialog (entry);
				try {
					if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok)
						DeployService.Install (mon, entry, dlg.Prefix, dlg.AppName, configuration);
				} finally {
					dlg.Destroy ();
				}
			}
		}
		
		public static Task BuildPackages (PackagingProject project)
		{
			return BuildPackages (project.Packages);
		}
		
		static async Task BuildPackages (ICollection packages)
		{
			ProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (true);

			// Run the deploy command in a background thread to avoid
			// deadlocks with the gui thread
			
			using (mon) {
				mon.BeginTask ("Creating packages", packages.Count);
				foreach (Package p in packages) {
					await DeployService.BuildPackage (mon, p);
					mon.Step (1);
				}
				mon.EndTask ();
			}
		}
		
		public static Task BuildPackage (Package package)
		{
			return BuildPackages (new object[] { package });
		}
		
		public static void ShowPackageSettings (Package package)
		{
			EditPackageDialog dlg = new EditPackageDialog (package);
			if (MessageService.ShowCustomDialog (dlg) == (int) Gtk.ResponseType.Ok)
				IdeApp.ProjectOperations.SaveAsync (package.ParentProject);
		}
	}
}