예제 #1
0
 protected virtual IEnumerable <TeamCityParameter> GetGlobalParameters(NukeBuild build)
 {
     return(InjectionUtility.GetParameterMembers(build.GetType(), includeUnlisted: false)
            .Except(build.ExecutableTargets.SelectMany(x => x.Requirements
                                                       .Where(y => !(y is Expression <Func <bool> >))
                                                       .Select(y => y.GetMemberInfo())))
            .Where(x => x.DeclaringType != typeof(NukeBuild) || x.Name == nameof(NukeBuild.Verbosity))
            .Select(x => GetParameter(x, build, required: false)));
 }
예제 #2
0
파일: Program.cs 프로젝트: tunger/nuke
        public static int Main()
        {
            InjectionUtility.InjectValues <Program>();

            if (Debug)
            {
                Warning("Waiting for debugger to attach...");
                SpinWait.SpinUntil(() => Debugger.IsAttached);
            }

            try
            {
                switch (Action)
                {
                case TaskAction.CodeGeneration:
                    CodeGenerator.GenerateCode(Files.Select(x => x.ToString()).ToList());
                    break;

                case TaskAction.ExternalFilesDownload:
                    var results = Files.Select(x => x.ToString()).Select(DownloadExternalFiles).ToList();
                    ControlFlow.Assert(results.All(x => x.Result), "results.All(x => x.Result)");
                    break;

                case TaskAction.GlobalToolPackaging:
                    GetAdditionalPackageFiles().ForEach(x => Console.WriteLine(x));
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(Action));
                }

                return(0);
            }
            catch (Exception ex)
            {
                Error(ex.Message);
                return(-1);
            }
        }