void Parse()
        {
            const string targetArgument = "--target:";

            var targetsBuilder = StringBuilderCache.Allocate();

            string[] parts = arguments.Split(' ');
            foreach (string part in parts)
            {
                if (part.StartsWith(targetArgument))
                {
                    AppendTargets(targetsBuilder, part.Substring(targetArgument.Length + 1));
                }
                else if (part.StartsWith("/t") || part.StartsWith("-t"))
                {
                    AppendTargets(targetsBuilder, part.Substring(3));
                }
            }

            Targets   = StringBuilderCache.ReturnAndFree(targetsBuilder);
            BuildType = MSBuildTarget.GetBuildType(Targets);
        }
        public MSBuildTargetMonitor(
            Project project,
            string target,
            ConfigurationSelector configuration,
            TargetEvaluationContext context)
        {
            // Ensure log verbosity is set for non-build targets.
            this.context         = context;
            context.LogVerbosity = Runtime.Preferences.MSBuildVerbosity.Value;

            buildTarget = new MSBuildTarget {
                ProjectName     = project.Name,
                ProjectFileName = project.FileName,
                Targets         = target ?? string.Empty,
                BuildType       = MSBuildTarget.GetBuildType(target),
                Dimensions      = project.GetDimensions(configuration)
            };

            buildTarget.Start();

            ProjectSystemService.OnTargetStarted(buildTarget);
        }