internal static void GenerateMakefiles(SolutionItem entry, Solution solution)
        {
            if (solution == null)
            {
                AlertButton generateMakefilesButton = new AlertButton(GettextCatalog.GetString("_Generate Makefiles"));
                if (MessageService.AskQuestion(GettextCatalog.GetString("Generating Makefiles is not supported for single projects. Do you want to generate them for the full solution - '{0}' ?", entry.ParentSolution.Name),
                                               AlertButton.Cancel,
                                               generateMakefilesButton) == generateMakefilesButton)
                {
                    solution = ((SolutionItem)entry).ParentSolution;
                }
                else
                {
                    return;
                }
            }

            DeployContext    ctx     = null;
            IProgressMonitor monitor = null;

            GenerateMakefilesDialog dialog = new GenerateMakefilesDialog(solution);

            try
            {
                if (MessageService.RunCustomDialog(dialog) != (int)Gtk.ResponseType.Ok)
                {
                    return;
                }

                SolutionDeployer deployer = new SolutionDeployer(dialog.GenerateAutotools);
                if (deployer.HasGeneratedFiles(solution))
                {
                    string msg = GettextCatalog.GetString("{0} already exist for this solution.  Would you like to overwrite them?", dialog.GenerateAutotools ? "Autotools files" : "Makefiles");
                    if (MonoDevelop.Ide.MessageService.AskQuestion(msg, AlertButton.Cancel, AlertButton.OverwriteFile) != AlertButton.OverwriteFile)
                    {
                        return;
                    }
                }

                ctx     = new DeployContext(new TarballDeployTarget(dialog.GenerateAutotools), "Linux", null);
                monitor = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor(true);
                deployer.GenerateFiles(ctx, solution, dialog.DefaultConfiguration, monitor);
            }
            finally
            {
                dialog.Destroy();
                if (ctx != null)
                {
                    ctx.Dispose();
                }
                if (monitor != null)
                {
                    monitor.Dispose();
                }
            }
        }
Пример #2
0
		internal static void GenerateMakefiles (SolutionItem entry, Solution solution)
		{
			if (solution == null) {
				AlertButton generateMakefilesButton = new AlertButton (GettextCatalog.GetString ("_Generate Makefiles"));
				if (MessageService.AskQuestion (GettextCatalog.GetString ("Generating Makefiles is not supported for single projects. Do you want to generate them for the full solution - '{0}' ?", entry.ParentSolution.Name),
				                                AlertButton.Cancel,
				                                generateMakefilesButton) == generateMakefilesButton) 
					solution = ((SolutionItem)entry).ParentSolution;
				else
					return;
			}

			DeployContext ctx = null;
			IProgressMonitor monitor = null;

			GenerateMakefilesDialog dialog = new GenerateMakefilesDialog (solution);
			try {
				if (MessageService.RunCustomDialog (dialog) != (int) Gtk.ResponseType.Ok)
					return;

				SolutionDeployer deployer = new SolutionDeployer (dialog.GenerateAutotools);
				if ( deployer.HasGeneratedFiles ( solution ) )
				{
					string msg = GettextCatalog.GetString ( "{0} already exist for this solution.  Would you like to overwrite them?", dialog.GenerateAutotools ? "Autotools files" : "Makefiles" );
					if (MonoDevelop.Ide.MessageService.AskQuestion (msg, AlertButton.Cancel, AlertButton.OverwriteFile) != AlertButton.OverwriteFile)
						return;
				}

				ctx = new DeployContext (new TarballDeployTarget (dialog.GenerateAutotools), "Linux", null);
				monitor = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (true);
				deployer.GenerateFiles (ctx, solution, dialog.DefaultConfiguration, monitor);
			} finally {
				dialog.Destroy ();
				dialog.Dispose ();
				if (ctx != null)
					ctx.Dispose ();
				if (monitor != null)
					monitor.Dispose ();
			}
		}