private static void WriteBeginChildBuildMessage(string componentName)
 {
     CommandLineInterfaceApplication.WriteLine(
         string.Format(
             CultureInfo.CurrentCulture,
             "   " + LocalizedStrings.BuildComponentTool_ChildBuildStartMessage,
             componentName,
             CommandLineHelpers.GetFullDateTimeString()));
 }
        private static void WriteChildBuildFinishedMessage(string componentName)
        {
            string message = string.Format(
                CultureInfo.CurrentCulture,
                "   " + LocalizedStrings.BuildComponentTool_ChildBuildSuccess,
                componentName,
                CommandLineHelpers.GetFullDateTimeString());

            CommandLineInterfaceApplication.WriteLine(message);
        }
示例#3
0
        private static void WriteSuccessMessage(string componentName, string outputDirectory)
        {
            string message = string.Format(
                CultureInfo.CurrentCulture,
                LocalizedStrings.BuildComponentTool_RootBuildSuccess,
                componentName,
                outputDirectory,
                CommandLineHelpers.GetFullDateTimeString());

            CommandLineInterfaceApplication.WriteLine(message);
        }
        private void CancelBuild()
        {
            if (_rootJob == null)
            {
                return;
            }
            _rootJob.Cancel();
            string cancelMessage = string.Format(
                CultureInfo.CurrentCulture,
                LocalizedStrings.BuildComponentTool_BuildCanceledMessage,
                _rootJob.AssociatedEnvoy.Name.Last,
                CommandLineHelpers.GetFullDateTimeString());

            CommandLineInterfaceApplication.WriteLine(cancelMessage);
        }
        private static void BuildJobPropertyChanged(object sender, PropertyChangedEventArgs eventArgs, bool isChildBuild)
        {
            string spacingString = isChildBuild ? "   " : string.Empty;
            var    job           = (IBuildQueueJob)sender;

            if (!IsStatusChangedEvent(eventArgs))
            {
                return;
            }

            bool buildFinished = false;

            if (job.State == JobState.Error || job.State == JobState.Failed)
            {
                WriteErrorsFromJob(job);
                buildFinished = true;
            }
            else if (job.State == JobState.Success)
            {
                if (isChildBuild)
                {
                    WriteChildBuildFinishedMessage(job.AssociatedEnvoy.Name.Last);
                }
                buildFinished = true;
            }

            if (buildFinished)
            {
                if (isChildBuild)
                {
                    job.PropertyChanged -= OnChildBuildJobPropertyChanged;
                }
                else
                {
                    job.PropertyChanged -= OnRootBuildJobPropertyChanged;
                }
                return;
            }

            // We've already printed an update for the first build step (starting the build), so we don't want to print it again here.
            if (job.CurrentStepIndex != 0)
            {
                CommandLineInterfaceApplication.WriteLine($"{spacingString}{job.AssociatedEnvoy.Name.Last} -- {job.CurrentActionDisplayName}. -- {CommandLineHelpers.GetFullDateTimeString()}");
            }
        }