Exemple #1
0
        protected override void Run()
        {
            if (!MonoDroidFramework.EnsureSdksInstalled())
            {
                return;
            }

            // TODO: We may should check the current build profile and
            // show a warning if we are in a debug mode.
            var configSel = IdeApp.Workspace.ActiveConfiguration;
            var proj      = DefaultUploadToDeviceHandler.GetActiveExecutableMonoDroidProject();
            var conf      = proj.GetConfiguration(configSel);

            OperationHandler signOp = delegate {
                using (var monitor = new MonoDevelop.Ide.ProgressMonitoring.MessageDialogProgressMonitor()) {
                    var dlg = new MonoDevelop.MonoDroid.Gui.MonoDroidPublishDialog()
                    {
                        ApkPath       = conf.ApkPath,
                        BaseDirectory = proj.BaseDirectory
                    };

                    if (MessageService.ShowCustomDialog(dlg) == (int)Gtk.ResponseType.Ok)
                    {
                        MonoDroidUtility.PublishPackage(monitor, proj, configSel, dlg.SigningOptions,
                                                        conf.ApkPath, dlg.DestinationApkPath, dlg.CreateNewKey, dlg.DName, dlg.KeyValidity * 365);
                    }
                };
            };

            if (proj.NeedsBuilding(configSel))
            {
                IdeApp.ProjectOperations.Build(proj).Completed += signOp;
            }
            else
            {
                signOp(null);
            }
        }
		protected override void Run ()
		{
			if (!MonoDroidFramework.EnsureSdksInstalled () || !MonoDroidFramework.CheckTrial ())
				return;
			
			var configSel = IdeApp.Workspace.ActiveConfiguration;
			var proj = DefaultUploadToDeviceHandler.GetActiveExecutableMonoDroidProject ();
			var conf = proj.GetConfiguration (configSel);

			OperationHandler signOp = delegate {
				using (var monitor = new MonoDevelop.Ide.ProgressMonitoring.MessageDialogProgressMonitor ()) {
					var dlg = new MonoDevelop.MonoDroid.Gui.MonoDroidPublishDialog () {
						ApkPath = conf.ApkPath,
						BaseDirectory = proj.BaseDirectory
					};

					if (MessageService.ShowCustomDialog (dlg) == (int)Gtk.ResponseType.Ok) {
						MonoDroidUtility.PublishPackage (monitor, proj, configSel, dlg.SigningOptions,
							conf.ApkPath, dlg.DestinationApkPath, dlg.CreateNewKey, dlg.DName, dlg.KeyValidity * 365);
					}
				};
			};

			if (proj.NeedsBuilding (configSel))
				IdeApp.ProjectOperations.Build (proj).Completed += signOp;
			else
				signOp (null);
		}