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))); }
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); } }