Exemple #1
0
        public void LogTargetsHelp(ITaskContextInternal context)
        {
            context.DecreaseDepth();
            context.LogInfo("Targets:");

            // first sort the targets
            var sortedTargets = new SortedList <string, ITargetInternal>();

            foreach (var target in _targets.Values)
            {
                sortedTargets.Add(target.TargetName, target);
            }

            // now display them in sorted order
            foreach (ITargetInternal target in sortedTargets.Values)
            {
                if (target.IsHidden == false)
                {
                    context.LogInfo($"  {target.TargetName} : {target.Description}");
                }
            }

            if (ScriptArgsHelp?.Count > 0)
            {
                context.LogInfo(" ");
                context.LogInfo("Global build script arguments:");
                foreach (var argHelp in ScriptArgsHelp)
                {
                    context.LogInfo($"  {argHelp}");
                }
            }

            context.IncreaseDepth();
        }
        public virtual void LogTargetsHelp(ITaskContextInternal context)
        {
            context.DecreaseDepth();
            context.LogInfo("Targets:");

            // first sort the targets
            var sortedTargets = new SortedList <string, ITargetInternal>();

            foreach (var target in _targets.Values)
            {
                sortedTargets.Add(target.TargetName, target);
            }

            // now display them in sorted order
            foreach (ITargetInternal target in sortedTargets.Values)
            {
                if (target.IsHidden == false)
                {
                    string help = $"  {target.TargetName.Capitalize()}";

                    if (target.Dependencies != null && target.Dependencies.Count != 0)
                    {
                        help = $"{help} ({string.Join(", ", target.Dependencies.GetKeys())})";
                    }

                    help = $"{help} : {target.Description}";

                    if (DefaultTargets.Contains(target))
                    {
#if !NETSTANDARD1_6
                        context.LogInfo(help, Color.DarkOrange);
#else
                        context.LogInfo(help);
#endif
                    }
                    else
                    {
                        context.LogInfo(help);
                    }
                }
            }

            if (ScriptArgsHelp?.Count > 0)
            {
                context.LogInfo(" ");
                context.LogInfo("Global build script arguments:");
                foreach (var argHelp in ScriptArgsHelp)
                {
                    context.LogInfo($"  {argHelp}");
                }
            }

            context.IncreaseDepth();
        }