nuke-build / nuke

🏗 The AKEless Build System for C#/.NET
https://nuke.build
MIT License
2.9k stars 355 forks source link

Interactive mode converts via ReflectionService #316

Open paul42 opened 4 years ago

paul42 commented 4 years ago

so, not a big deal, but I'm trying to make the build tool as easy to use as possible, if someone doesn't input a variable, the target will prompt them for it, which is great - but if I have a string[] property declared like this:

    [Parameter("List of Lambda Functions to operate on")]
    readonly string[] LambdaFunctions;

and I run this from the command line: nuke --target PackageLambda prompts for a string, but I can't input a space, or comma from my current command line (using powershell or debugging from visual studio) and I get an error like this:

List of Lambda Functions to operate on:
¬  CompleteOnboarding
Value 'CompleteOnboarding' could not be converted to 'String[]'.
   at Nuke.Common.ControlFlow.Fail(String text)
   at Nuke.Common.Execution.ReflectionService.Convert(Object value, Type destinationType)
   at Nuke.Common.Execution.RequirementService.InjectValueInteractive(NukeBuild build, MemberInfo member)
   at Nuke.Common.Execution.RequirementService.IsMemberNull(MemberInfo member, NukeBuild build, ExecutableTarget target)
   at Nuke.Common.Execution.RequirementService.ValidateRequirements(NukeBuild build, IReadOnlyCollection`1 executingTargets)
   at Nuke.Common.Execution.BuildExecutor.Execute(NukeBuild build, IReadOnlyCollection`1 skippedTargets)
   at Nuke.Common.Execution.BuildManager.Execute[T](Expression`1[] defaultTargetExpressions)

but, if I define them ahead of time it works fine (loving the combinewith and code gen :D) nuke --target PackageLambda --lambda-functions CompleteOnboarding, BeginOnboarding works great

paul42 commented 4 years ago

also not certain if it's the same vein because it's interactive mode, but I don't think you can 'require' Custom Enumeration parameters the same way you require strings - might be helpful