private void Construction_Completed()
        {
            if (SaveLogToDisk)
            {
                try
                {
                    if (Path.IsPathRooted(_logFile))
                    {
                        var parentDirectory = Path.GetDirectoryName(_logFile);
                        if (!Directory.Exists(parentDirectory))
                        {
                            Directory.CreateDirectory(parentDirectory);
                        }
                    }

                    Serialization.Write(construction.Build, _logFile);
                }
                catch (Exception ex)
                {
                    ErrorReporting.ReportException(ex);
                }
            }
            else
            {
                CurrentBuild = construction.Build;
            }
        }
Ejemplo n.º 2
0
        private void HandleException(Exception ex)
        {
            ErrorReporting.ReportException(ex);

            try
            {
                lock (syncLock)
                {
                    Build.AddChild(new Error()
                    {
                        Text = ex.ToString()
                    });
                }
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 3
0
        public override void Shutdown()
        {
            base.Shutdown();

            if (projectImportsCollector != null)
            {
                var archiveFilePath = projectImportsCollector.ArchiveFilePath;

                projectImportsCollector.Close();
                projectImportsCollector = null;

                if (File.Exists(archiveFilePath))
                {
                    var bytes = File.ReadAllBytes(archiveFilePath);
                    construction.Build.SourceFilesArchive = bytes;
                    File.Delete(archiveFilePath);
                }
            }

            if (SaveLogToDisk)
            {
                try
                {
                    if (Path.IsPathRooted(_logFile))
                    {
                        var parentDirectory = Path.GetDirectoryName(_logFile);
                        if (!Directory.Exists(parentDirectory))
                        {
                            Directory.CreateDirectory(parentDirectory);
                        }
                    }

                    Serialization.Write(construction.Build, _logFile);
                }
                catch (Exception ex)
                {
                    ErrorReporting.ReportException(ex);
                }
            }
            else
            {
                CurrentBuild = construction.Build;
            }
        }