Ejemplo n.º 1
0
 public void OnFileDeployed(ITargetDevice Device, string SourceFile)
 {
     if (WinForm != null && DeviceView != null)
     {
         ThreadHelperClass.UpdateDeviceDeploymentProgress(WinForm, DeviceView, Device);
     }
 }
        public void OnBuildDeployedAborted(ITargetDevice Device, BuildNode Build)
        {
            ThreadHelperClass.SetDeviceDeploymentResult(WinForm, DeviceView, Device, BuildDeploymentResult.Aborted);

            DeployedDeviceCount++;

            if (Devices.Count == DeployedDeviceCount)
            {
                Callback.OnDeploymentDone(this);
            }
        }
        public void OnBuildDeployedError(ITargetDevice Device, BuildNode Build, string ErrorMessage)
        {
            ThreadHelperClass.SetDeviceDeploymentResult(WinForm, DeviceView, Device, BuildDeploymentResult.Failure);

            DeployedDeviceCount++;

            if (Devices.Count == DeployedDeviceCount)
            {
                Callback.OnDeploymentDone(this);
            }
        }
Ejemplo n.º 4
0
 public void OnBuildDeployed(ITargetDevice Device, BuildNode Build)
 {
     if (WinForm != null && DeviceView != null)
     {
         ThreadHelperClass.SetDeviceDeploymentResult(WinForm, DeviceView, Device, BuildDeploymentResult.Success);
     }
     else
     {
         Console.WriteLine(string.Format("Build [{0}] has been successfully deployed on device [{1}]", Build.Number, Device.Name));
     }
     Callback.OnDeploymentDone(this);
 }
Ejemplo n.º 5
0
 public void OnBuildDeployedAborted(ITargetDevice Device, BuildNode Build)
 {
     Build.Progress = 0;
     if (WinForm != null && DeviceView != null)
     {
         ThreadHelperClass.SetDeviceDeploymentResult(WinForm, DeviceView, Device, BuildDeploymentResult.Aborted);
     }
     else
     {
         Console.WriteLine(string.Format("Deployment of build [{0}] to device [{1}] has been aborted !", Build.Number, Device.Name));
     }
     Callback.OnDeploymentDone(this);
 }
Ejemplo n.º 6
0
        public void OnBuildDeployedError(ITargetDevice Device, BuildNode Build, string ErrorMessage)
        {
            if (WinForm != null && DeviceView != null)
            {
                ThreadHelperClass.SetDeviceDeploymentResult(WinForm, DeviceView, Device, BuildDeploymentResult.Failure);
            }
            else
            {
                Console.WriteLine(string.Format("Following error happened while deploying build [{0}] to device [{1}] : {2}", Build.Number, Device.Name, ErrorMessage));
            }

            Callback.OnDeploymentDone(this);
        }
Ejemplo n.º 7
0
        public async Task <bool> Deploy(BuildNode InBuild)
        {
            CancellationTaskTokenSource = new CancellationTokenSource();

            var Build = new BuildNode(InBuild.UseBuild, InBuild.Number, InBuild.Timestamp, InBuild.Path, InBuild.Platform, InBuild.Solution, InBuild.Role, InBuild.AutomatedTestStatus);

            Devices[0].ProjectConfig = WinForm.GetProject(Build);
            Devices[0].Build         = Build;

            ThreadHelperClass.DeployBuild(WinForm, DeviceView, Devices[0]);

            DeploymentTask = Task.Run(() => Devices[0].DeployBuild(Build, this, CancellationTaskTokenSource.Token), CancellationTaskTokenSource.Token);

            await DeploymentTask;

            return(DeploymentTask.Result);
        }
Ejemplo n.º 8
0
        private void Log(Color Color, string Text)
        {
            const int MaxListViewItemTextLength = 258;

            // If the text exceeds the max number of characters for the ListViewItem we need to split it to different rows in the list view.
            var TextParts = Text.SplitInParts(MaxListViewItemTextLength);

            foreach (var TextPart in TextParts)
            {
                string[] row = { DateTime.Now.ToString(), TextPart };

                ListViewItem Item = new ListViewItem(row);

                Item.ForeColor = Color;

                ThreadHelperClass.AddListViewItem(MainForm, View, (ListViewItem)Item.Clone());
            }
        }
        private bool DeployBuild(BuildNode InBuild, IDeploymentSession Callback, CancellationToken Token)
        {
            foreach (var Device in Devices)
            {
                var Build = new BuildNode(InBuild.UseBuild, InBuild.Number, InBuild.Timestamp, InBuild.Path, InBuild.Platform, InBuild.Solution, InBuild.Role, InBuild.AutomatedTestStatus);

                Device.Build = Build;
                Build.Status = "Waiting for Device";

                ThreadHelperClass.DeployBuild(WinForm, DeviceView, Device);
            }

            foreach (var Device in Devices)
            {
                Device.ProjectConfig = WinForm.GetProject(Device.Build);
                Device.DeployBuild(Device.Build, Callback, Token);
            }

            return(true);
        }