New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Choose/When/Otherwise in Targets #2056
Comments
@rainersigwald @jeffkl @cdmihai is this feasible at all? |
I don't have a strong objection to this, other than the conflict-with-task one. But it's not very high on my priority list, personally. Anybody else feel more strongly about it? |
Implementation wise it will be interesting, since the current design accepts only tasks within targets (properties and items in targets are actually implemented as tasks). But shouldn't be too hard, probably involves implementing a Choose IntrinsicTask . |
Implementing a choose intrinsic task seems to be promising, I got a prototype at If there is interest in taking this as a community contribution I could invest more work into it. |
Took a quick look over it and looks good! Feel free to open it up as a WIP PR to get more feedback. My take on it:
|
Hello there ;-), what's the curent status of this issue? |
<Choose>
/<When>
/<Otherwise>
is a nice feature that allows replacing complex conditions with what is effectively a switch-case-default but can only be used on the project level and not within targets.Can this be changed to work within targets?
This would theoretically conflict with tasks being named
Choose
, are there any ways to deal with this? - like (and I feel bad suggesting this) optional xml namespace for<MSBuild:Choose>
and prefer a task namedChoose
if defined.The text was updated successfully, but these errors were encountered: