protected override void Run() { if (!MonoDroidFramework.EnsureSdksInstalled()) { return; } var proj = DefaultUploadToDeviceHandler.GetActiveExecutableMonoDroidProject(); var configSel = IdeApp.Workspace.ActiveConfiguration; OperationHandler createApk = delegate { using (var monitor = new MonoDevelop.Ide.ProgressMonitoring.MessageDialogProgressMonitor()) { MonoDroidUtility.SignAndCopy(monitor, proj, configSel); } }; if (proj.NeedsBuilding(configSel)) { IdeApp.ProjectOperations.Build(proj).Completed += createApk; } else { createApk(null); } }
public static bool CheckTrial() { if (!IsTrial) { return(false); } MonoDroidUtility.InvokeSynch(ShowEvalDialog); return(IsTrial); }
protected override void Run(object dataItem) { if (!MonoDroidFramework.EnsureSdksInstalled()) { return; } var proj = DefaultUploadToDeviceHandler.GetActiveExecutableMonoDroidProject(); var conf = (MonoDroidProjectConfiguration)proj.GetConfiguration(IdeApp.Workspace.ActiveConfiguration); var device = MonoDroidUtility.ChooseDevice(null); if (device != null) { proj.SetDeviceTarget(conf, device.ID); } }
public MonoDroidDeviceLog(IPadWindow container) { Stetic.BinContainer.Attach(this); DockItemToolbar toolbar = container.GetToolbar(PositionType.Top); var chooseDeviceButton = new Button() { Label = GettextCatalog.GetString("Choose Device"), }; deviceLabel = new Label() { Xalign = 0, }; SetDeviceLabel(); var reconnectButton = new Button() { Label = GettextCatalog.GetString("Reconnect"), }; toolbar.Add(deviceLabel); toolbar.Add(chooseDeviceButton); toolbar.Add(reconnectButton); reconnectButton.Clicked += delegate { Disconnect(); if (Device != null) { Connect(); } else { SetDeviceLabel(); } }; chooseDeviceButton.Clicked += delegate { Device = MonoDroidUtility.ChooseDevice(null); }; log = new LogView(); this.Add(log); toolbar.ShowAll(); ShowAll(); }
protected override void Run() { if (!MonoDroidFramework.EnsureSdksInstalled()) { return; } var configSel = IdeApp.Workspace.ActiveConfiguration; var proj = GetActiveExecutableMonoDroidProject(); OperationHandler upload = delegate { using (var monitor = new MonoDevelop.Ide.ProgressMonitoring.MessageDialogProgressMonitor()) { AndroidDevice device = null; var conf = (MonoDroidProjectConfiguration)proj.GetConfiguration(configSel); var deviceId = proj.GetDeviceTarget(conf); if (deviceId != null) { device = MonoDroidFramework.DeviceManager.GetDevice(deviceId); } if (device == null) { proj.SetDeviceTarget(conf, null); } MonoDroidUtility.SignAndUpload(monitor, proj, configSel, true, ref device); } }; if (proj.NeedsBuilding(configSel)) { IdeApp.ProjectOperations.Build(proj).Completed += upload; } else { upload(null); } }
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 OnExecute(IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configSel) { var conf = (MonoDroidProjectConfiguration)GetConfiguration(configSel); IConsole console = null; var opMon = new AggregatedOperationMonitor(monitor); try { var handler = context.ExecutionHandler as MonoDroidExecutionHandler; bool useHandlerDevice = handler != null && handler.DeviceTarget != null; AndroidDevice device = null; if (useHandlerDevice) { device = handler.DeviceTarget; } else { var deviceId = GetDeviceTarget(conf); if (deviceId != null) { device = MonoDroidFramework.DeviceManager.GetDevice(deviceId); } if (device == null) { SetDeviceTarget(conf, null); } } var uploadOp = MonoDroidUtility.SignAndUpload(monitor, this, configSel, false, ref device); //user cancelled device selection if (device == null) { return; } if (!device.IsEmulator && MonoDroidFramework.CheckTrial()) { return; } opMon.AddOperation(uploadOp); uploadOp.WaitForCompleted(); if (!uploadOp.Success || monitor.IsCancelRequested) { return; } //get the activity name after signing produced the final manifest string activity; if (!GetActivityNameFromManifest(monitor, conf, out activity)) { return; } //successful, persist the device choice if (!useHandlerDevice) { SetDeviceTarget(conf, device.ID); } var command = (MonoDroidExecutionCommand)CreateExecutionCommand(configSel, conf); command.Device = device; command.Activity = activity; //FIXME: would be nice to skip this if it's a debug handler, which will set another value later var propOp = MonoDroidFramework.Toolbox.SetProperty(device, "debug.mono.extra", string.Empty); opMon.AddOperation(propOp); propOp.WaitForCompleted(); if (!propOp.Success) { monitor.ReportError(GettextCatalog.GetString("Could not clear debug settings on device"), propOp.Error); return; } console = context.ConsoleFactory.CreateConsole(false); var executeOp = context.ExecutionHandler.Execute(command, console); opMon.AddOperation(executeOp); executeOp.WaitForCompleted(); } finally { opMon.Dispose(); if (console != null) { console.Dispose(); } } }